flycast icon indicating copy to clipboard operation
flycast copied to clipboard

Randomized features in SOULCALIBUR aren't random on boot

Open sologuitarplaying opened this issue 2 months ago • 11 comments

Platform / OS / Hardware: Windows 10 PC

Flycast version: v2.5-157-gbf2bd7efe

Hardware: Nvidia GTX 1080

Description of the Issue

RNG is always the same on boot (not from a save state) when it shouldn't be. Random stage select always picks the Colosseum stage first, and with the opening direction set to random, the game always shows the same fighters in the same order when the game starts. Successive stage random selects or replays of the opening are randomized properly.

Debugging Steps Tested

Saving in-game has no effect.

Logs Gathered


Screenshots

sologuitarplaying avatar Oct 25 '25 00:10 sologuitarplaying

I can't reproduce this issue. I tried all battle modes and selected random stage when possible, and I got Colosseum just once, which seems normal. Do you have a precise scenario I can follow?

flyinghead avatar Oct 25 '25 07:10 flyinghead

Start the game, go into practice mode, pick any characters, then random stage. Close the game, repeat the process, see if you always get the same stage. I get Colosseum every time.

sologuitarplaying avatar Oct 25 '25 09:10 sologuitarplaying

I did exactly this on all editions I have and I didn't get Colosseum even once. I tested 2 US/NTSC dumps, the EU/PAL and JP/NTSC editions and even a CDI (US). I got a different stage at each boot.

Which game media and edition are you using?

flyinghead avatar Oct 25 '25 09:10 flyinghead

US version, GDI. Completed save.

sologuitarplaying avatar Oct 25 '25 10:10 sologuitarplaying

I'm able to reproduce the issue on all regional versions of the game. On a fresh save I get Emperor's Garden every time. Are there any settings that would affect how the game behaves on boot or on close?

Edit: Narrowed down the conditions for reproducing. Pressing start immediately when the Namco logo appears in the opening sequence causes random stage select to always pick the same stage first. Waiting a few seconds for the scene to transition THEN pressing start causes the stage to be random as expected.

sologuitarplaying avatar Oct 25 '25 20:10 sologuitarplaying

The game selects Rock consistently as the first opponent in arcade mode if the opening scene is skipped immediately.

sologuitarplaying avatar Oct 26 '25 23:10 sologuitarplaying

I was able to reproduce the issue by pressing start immediately at boot.

However it looks like a game issue. I decompiled the game code and the random number generator is initialized at boot with a constant (0). This means that the RNG always generates the exact same sequence. When skipping the opening sequence (which uses some random numbers), the RNG is always in exactly the same state when you reach the menu, hence the lack of randomness.

I haven't tested on original hardware but I don't think it's an emulation issue (random number generation is 100% game code). You have to wonder why they didn't use the real-time clock to set a different seed instead of 0...

flyinghead avatar Oct 27 '25 09:10 flyinghead

Interestingly, when selecting Museum > Art Gallery > Recollections: Slideshow, the RNG is initialized with a different value each time.

flyinghead avatar Oct 27 '25 09:10 flyinghead

If this is a bug in the game on hardware I'm surprised it's not documented. Is it possible some quirk on real hardware saves it?

What I find fascinating is that it affects stage select and the opening, but NOT character select. It works as expected regardless, as if there's multiple RNG arrays.

sologuitarplaying avatar Oct 27 '25 10:10 sologuitarplaying

Is it possible some quirk on real hardware saves it?

I can't think of anything but it could be the case. Ideally if someone could test this on real hardware, we'd know for sure.

What I find fascinating is that it affects stage select and the opening, but NOT character select.

It looks like the random stage is one of the first thing the game selects (before you even choose the stage). As soon as the character selection screen appears, the game generates random numbers, which are probably used for random character selection, but the random stage has already been selected behind the scene. As a consequence, if you quit the character selection screen and go back to the title screen, the RNG will then be in a non-predictable state.

flyinghead avatar Oct 27 '25 10:10 flyinghead

https://www.youtube.com/watch?v=ZifoqnHF-ec Doesn't appear to happen on hardware.

sologuitarplaying avatar Oct 28 '25 03:10 sologuitarplaying