snes9xgit / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
2.67k stars 462 forks source link

[Feature Request] Memory randomization #299

Open ghost opened 6 years ago

ghost commented 6 years ago

Hello. If you let the demo mode play (don't touch joypad), snes9x always shows the same exact race every time at clean bootup. Real hardware is pretty random which course and how the race plays out (bonus items, when ai uses nitros, who wins, etc.). Bsnes gets this right and looks tied to ram being randomized on 1st boot. Thanks for looking at this bug. Hopefully can be fixed in this emu too!

ghost commented 6 years ago

hmmm just tested on snes 9x 1.55 and on real hardware, Snes9x is doing the attract mode proper and not how you describe.

maybe you have a bad dump? or older version of snes9x??

ghost commented 6 years ago

Compared Super Off Road (USA) and matches latest no-intro. Using official release snes9x-1.55-win32. Always get sidewinder as 1st demo track.

With bsnes, everytime I start game fresh (no soft reset), I can get different 1st demo tracks: fandango, sidewinder, big dukes, huevos grande. Haven't checked real hardware in awhile but I remember something similar to bsnes when I power it on (random track as demo).

Maybe there's a config option I'm missing? Or my memory isn't spot on. Thanks for trying to help out!

ghost commented 6 years ago

Tried a clean dump again (my own dump) and snes9x and bsnes both cycle through same tracks in attract mode. Real hardware same behavior. I honestly think its your rom.

ghost commented 6 years ago

Okay. That's enough proof snes9x is okay. My rom dump md5 is: 0C1CC5369A31C988858A087598BAB9C3. http://datomatic.no-intro.org/?page=show_record&s=49&n=2799

Does this match yours? I'm almost ready to close this as non-issue after verification. Thanks for checking this out everywhere

Cibomatto2002 commented 6 years ago

Have you tried the latest test build?

bearoso commented 6 years ago

This is probably a legitimate issue, but adding random memory means more nondeterminism, which I wouldn’t want to add until all our unintentional nondeterminism is completely eliminated.

byuu had to scale back the completely random memory to a pattern, and it’s done selectively, because fully randomized memory isn’t accurate, either.

qwertymodo commented 6 years ago

If we do add random initialization, it should probably be a config file option (not sure I'd even suggest putting it in the GUI), and disabled by default. Randomized is a better approximation than zeroed, the pseudo-random patterns just happen to be an even better approximation than that. I think higan offers all 3 options.

ghost commented 6 years ago

I will check when i get home.

Also was just thinking i tested snes9x 64 bit

ghost commented 6 years ago

Has anybody else actually tested. I was truly unable to replicate the issue

ghost commented 6 years ago

Going to close this then unless someone finds another legit reason to open this ticket for this particular game. Thanks!

ghost commented 6 years ago

your md5 is good so i tested again with both 32 and 64 bit. problem still doesnt happen. maybe try a fresh copy of snes9x

ghost commented 6 years ago

Tried versions of snes9x 1.54-1.43. Emucr builds of snes9x. Always get sidewinder as 1st demo / attract track. Money bag always shows up in same spot also. That's alright - I must be doing something wrong somehow.

bsnes-mercury 0.94 always gives me huevos grande (1st demo track). bsnes-plus-0.73 is pretty random on 1st demo track (power off, power on).

Found some hack that changes the rng everytime a race is started and the ai uses nitros a lot more now in-game than before so I'm okay with this. Before I could finish some races and cpu would use nitro only once or twice. Now they do lot more often so game is more fair and less easy. Why I'm only one to have stupid (demo, enemy) behavior is beyond me. Thanks again! Appreciated!

ghost commented 6 years ago

try using 1.55 or newer. i only tested 1.55 and newer and problem is not there.

you reported a bug on an obsolete build.

ghost commented 6 years ago

Same behavior (for me) on 1.55 and recent github builds from www.s9x-w32.de/dl/testbuilds/.

I'm going to keep this closed and ignore it since no else can replicate this problem on snes9x. Not really important. Funny enough, the snes mini emulator has the stupid ai problem also but someone fixed it over there at rhdn.

ghost commented 6 years ago

very odd.

i load snes 9x, i load the rom, i press nothing and it goes to demo mode and every time a new track

ghost commented 6 years ago

ok im wrong i misunderstood the complaint there is an issue

ghost commented 6 years ago

reopen im an idiot i misunderstood the complaint and was trying again and now i understand.

bearoso commented 6 years ago

As I said earlier, I’m not comfortable adding nondeterminism at this point, given it can exacerbate snes9x’s inherent timing discrepancies. If you can find the address being used as a seed, we could probably add a hidden flag that randomizes that particular region.

bearoso commented 6 years ago

bsnes-mercury and other forks used for TASs probably removed the randomization as it totally breaks videos and netplay.

ghost commented 6 years ago

considering the game fully plays proper and the issue is not so noticable ie even running it on real hardware took a few looks to realize I dont think it would be worth possibly hurting other compatibility over it.

The current Snes9x is real nice.

ghost commented 6 years ago

I can't imagine how many games would break adding any type of (ram, aram, sram) memory randomization (heard there's enough, $55 works very well). Only know of this one game so far.

Thanks to both for bringing this back up again. Such an amazingly tiny issue; really not important other than for documenting purposes.

Making a game specific hack just for Super Off Road (JUE) would work, in case I find other games later on to pile on the list.

ghost commented 6 years ago

This seems fixed. They either implemented randomization or game specific fix. Not sure what but it is working correct both on this and latest higan

bearoso commented 6 years ago

No, nothing implemented.

ghost commented 6 years ago

There is an ips patch for this. Can info from the IPS patch be used to generate a game specific hack in snes9x? This would boot the list of compatible titles. I know it's not necessary anyone that really wants can just get the IPS but it would make snes9x more "compatible"

ghost commented 6 years ago

no that I know this it bugs me, I know an IPS patch exists cause I can find talks about it but cant find the actual patch. Anyone know where to obtain the fix? Im assuming it wont be added to snes9x so I figure I can just drop the ips in the correct folder for the time being.

ghost commented 6 years ago

think I have it https://drive.google.com/drive/folders/1qgLQjYypSVpMWClJ-OtHqDz7DKkkeMPG?usp=sharing

ghost commented 5 years ago

Can a game specific hack be added to snes9x for this? it would just bring it closer to being more compatible.

qwertymodo commented 5 years ago

Awhile back, I looked into implementing higan's randomization algorithms. If I remember correctly, it didn't look that hard. If there are no objections, I'll take another shot at it. There were either 2 or 3 different algorithms with different amounts of entropy, so there would need to be a config file option for it, which would then also allow it to be completely disabled (which I think should be the default).

ghost commented 5 years ago

Have you tried the randomization? Just curious

ghost commented 5 years ago

is this coming to the windows port?