-
Notifications
You must be signed in to change notification settings - Fork 102
Make deterministic spawn bugfix toggleable #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
|
The random function being changed effects the podium ceremony. Please clarify what the intentions are. The best way to prevent random spawn order is likely to alter the random function in spawn_players.c |
|
I btw observed something weird: In Only speculation but did the original MK64 devs want to have better randomness but ran out of time? |
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
This reverts commit 6762257 as talked up on Discord.
| } | ||
|
|
||
| void balloons_and_fireworks_init(void) { | ||
| sRandomSeed16 = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be placed in?
void init_segment_ending_sequences(void) {
#ifdef TARGET_N64
bzero((void*) SEG_ENDING, SEG_ENDING_SIZE);
osWritebackDCacheAll();
dma_copy((u8*) SEG_ENDING, (u8*) SEG_ENDING_ROM_START, SEG_ENDING_ROM_SIZE);
osInvalICache((void*) SEG_ENDING, SEG_ENDING_SIZE);
osInvalDCache((void*) SEG_ENDING, SEG_ENDING_SIZE);
#endif
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see it's static. Yea this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's not around a CVar?
|
|
||
| f32 random_float_between_0_and_1(void) { | ||
| return random_u16_credits() / 65536.0f; | ||
| return random_u16_credits() / (f32) UINT16_MAX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not identical behaviour
|
|
||
| u16 random_u16_credits(void) { | ||
| u16 temp1, temp2; | ||
| if (CVarGetInteger("gBugfixRNGReset", true) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand this change.
The idea is to remove the duplicate function and use the original one. But now the random seed won't have been reset because we're now using gRandomSeed instead of sRandomSeed.
I would recommend one of two options
- Just delete random_u16_credits, and modify the game to act how expected using just the one random function
- This is simpler, makes more sense, etc.
- Not call the original
random_u16()and just use random_u16_credits()
- Otherwise it's more likely to get mixed up and confused.
| AddSidebarEntry("Enhancements", "Bugfixes", 3); | ||
| AddWidget(path, "Don't reset random seed", WIDGET_CVAR_CHECKBOX) | ||
| .CVar("gBugfixRNGReset") | ||
| .Options(CheckboxOptions().Tooltip("The section handling of MK8 zeroes the random seed before races. Enable this to never zero the seed.").DefaultValue(true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Racer spawns are not randomized at the start of Grand Prix. Enable this to fix random seeding.
or
Fix random seeding allowing randomized racer spawns at the start of a Grand Prix and randomized firework spawns during the podium ceremony.
(I think I like this one the best so far of everything I've come up with)
|
|
||
| path = { "Enhancements", "Bugfixes", SECTION_COLUMN_1 }; | ||
| AddSidebarEntry("Enhancements", "Bugfixes", 3); | ||
| AddWidget(path, "Don't reset random seed", WIDGET_CVAR_CHECKBOX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix random seeding ? Maybe Prevent random seeding from being reset
Or perhaps
Randomize racer spawns and then have the explanation in the tooltip?
|
Regarding the enhancement button. Try to reword it in a way that explains to users what the button does. Users won't understand the technical jargon like "The game resets gRandomSeed to zero for the racing code segment at the start of the race resulting in spawn locations not being reset" is more info then necessary because they don't know what a code segment or gRandomSeed is. But the end result of "fireworks and racers not being randomized" is moreso something they would understand. Or perhaps another way of wording it "Racer and firework spawn locations do not get randomized due to the random seed being reset just before the race begins" |


No description provided.