Page 1 of 1

Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 3:26 pm
by vinipsmaker
  1. Start Mario Kart DS
  2. Select Single Player
  3. Select VS
  4. Default options for everything but Course
  5. Select Rnadom for option Course
  6. Wario Stadium is "randomly" selected
  7. Close the emulator and repeat the process
Besides random, wario stadium is drawn every time.

Not sure if this is a bug on the emulator or on the game, but I'd love to see an reply from the devs.

For games like Castlevania, where luck is too important, this is a critical bug that my prevent players from unlocking all secrets.

Re: Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 4:23 pm
by Lordus
It's a different course for me every time.
If you're loading from a savestate, you shouldn't.

Re: Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 4:25 pm
by vinipsmaker
Lordus wrote:It's a different course for me every time.
If you're loading from a savestate, you shouldn't.
I'm not loading from a savestate. I'm doing exactly what I described.

PS.:
I'm using the latest Pandora version (2.2.1.0p).

Re: Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 5:00 pm
by Exophase
There's no random number generator in DS, so nowhere to put an srand. Games may use the RTC as a random seed. RTC is pulled from system time, so it should work the same as the system time does. Can you check with this Watch.nds if the time is set right when you start it?

Re: Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 5:10 pm
by vinipsmaker
Exophase wrote:There's no random number generator in DS, so nowhere to put an srand. Games may use the RTC as a random seed. RTC is pulled from system time, so it should work the same as the system time does.
Thanks for the info.

No I'm not too scared by "wasting luck" on other games, but I still wonder why Mario Kart DS cannot get it right.
Exophase wrote:Can you check with this Watch.nds if the time is set right when you start it?
It's displaying the correct time (the red arrow is the hour-pointer, right?).

Re: Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 5:25 pm
by Exophase
It's possible that your sequence of inputs are being repeated really deterministically, although it'd be weird if the game had such coarse resolution for this. Could you try waiting very different amounts of time between button presses and see if you still get the same stage? Also, can you confirm that it happens between exiting and entering the emulator and not just resetting the game?

Re: Missing srand call at DraStic startup?

Posted: Thu Jul 31, 2014 5:35 pm
by vinipsmaker
Exophase wrote:It's possible that your sequence of inputs are being repeated really deterministically, although it'd be weird if the game had such coarse resolution for this. Could you try waiting very different amounts of time between button presses and see if you still get the same stage? Also, can you confirm that it happens between exiting and entering the emulator and not just resetting the game?
I tried different intervals between the presses and different sequences to choose the same previous options, but I still do get the same course, "Wario Stadium".

I found out that if I select "reset game" instead closing the emulator, a different course is chosen (but still predictable), the figure-8 circuit. Selecting to load new game and choosing the same game has the same effect from reset.

I wonder where this "entropy" comes from.