LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Issue with RANDOMIZE not working

Root / Programming Questions / [.]

ahavasandwichCreated:
I've been working on making UAG Drumpf a two player game, and it works fine until one of the players dies. Until someone dies both players are using the same random numbers. However, once someone gets ganked both players are using different random numbers. the level resets after death. Do I have to declare RANDOMIZE again if I use a subroutine, or could it be something else. Any insight or suggestion will be appreciated. Knowns: I only used RND(seed,max value). All seed values are set to 1. I used RANDOMIZE 1,1 just outside the main loop. It's annoying to get killed by a robot only your buddy can see. Edit: Also enemies initially spawn in the same locations on both consoles, but after they're killed things get out of sync.

Can we see the code?

Maybe only use the host system to return RNG values?

You'll have to use randomize again whenever the level resets

You'll have to use randomize again whenever the level resets
I tried placing RANDOMIZE in the main loop...that didn't work. Next I tried placing it at the begining of every reset subroutine, but that just made it where the enemies only respawned at only one location that never changed. The plus side to the latter is that both systems were synced.
Maybe only use the host system to return RNG values?
There is probably a way to do that. I'll have to take another look at the documentation.

What if you did RANDOMIZE 1,N N=N+1 in the reset code

What if you did RANDOMIZE 1,N N=N+1 in the reset code
Hmm. I overlooked that. It's been a while since I experimented with that command. I'll add something like that. Thanks.