The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

103 betyg
Isaac.Spawn() Crash Fix
2
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Tags: Lua
Filstorlek
Lades upp
3.041 KB
22 jun, 2024 @ 3:40
1 ändringsnotis ( visa )

Abonnera för att ladda ner
Isaac.Spawn() Crash Fix

Beskrivning
What?

Most mods use a function named Isaac.Spawn() to spawn just about everything in the game (visual effects, familiars, pickups, etc.). However, this function has a very small chance (1 in 4294967296) to Crash the game if the randomly generated seed happens to be 0.

Since it's unlikely that every mod that uses Isaac.Spawn() will update their code to account for this possibility, I created this mod to patch the problem directly.

Which Versions Are Affected?

The issue affects all versions of the game, including REPENTOGON, although it is likely that the issue will be fixed in their next update. While Repentance may eventually receive a patch, this issue also affects Afterbirth+, which is unlikely to receive one. Therefore, this mod will remain available to protect Afterbirth+ users.

Regarding Performance Concerns

While it is true that the necessary checks to avoid this edge case add some overhead, in practice this "slowdown" is irrelevant. The most time-consuming part of the function is not the checks, but the actual spawning of the entity, and the difference is significant. Even when the function is called frequently enough to potentially skip frames (around 1000 spawns in a single frame), the added delay cannot be noticed in terms of milliseconds.
16 kommentarer
kanye south 24 apr @ 9:44 
this sounds overpowerd for weak pcs
10/10
Guantol  [skapare] 23 nov, 2024 @ 15:35 
@Roak Yes, it's still present.
Roak 23 nov, 2024 @ 15:08 
does this issue still occur in rep+?
Guantol  [skapare] 15 sep, 2024 @ 18:03 
@Hamburger:
Fun fact: this can also happen in non modded isaac. Specifically everytime an ember effect is spawned whilst in burning basement there is a chance it crashes the game.
Hamburger 15 sep, 2024 @ 15:37 
im not gonna install this, because I wanna have fun knowing that there's a 0.00000000023283064365386962890625% chance that the game randomly decides to kill itself after an item is spawned through a mod.
DILEREK115 30 jun, 2024 @ 16:44 
kto pubi boberki :steamsalty:
Guantol  [skapare] 29 jun, 2024 @ 3:20 
@Fred RNGesus wasn't on your side.
Former President, George W. Bush 28 jun, 2024 @ 19:48 
dude I uninstalled this and my next run this exact crash happens
Guantol  [skapare] 26 jun, 2024 @ 14:06 
@ZilusLules
No, that's not what I meant.

In the modding API there is a function named Isaac.Spawn() which is what allows any mod to spawn an entity
In this game most things are entities: Players, Familiars, Pickups (Coins, Collectibles, Chests, Keys, Bombs, etc.), Enemies, Bosses, Visual Effects, etc.

Whenever a mod tries to spawn one of these in the game they most likely will use the Isaac.Spawn() function (As it was the recommended function in the Documentation, until I discovered the crash).

However this function has a very rare chance of setting the entity's RNG seed to 0, which crashes the game.

So actually this helps if you are using any mod that spawns anything in the game (which will most likely be most mods).
ZilusLules 26 jun, 2024 @ 13:49 
So you're saying that this helps in this type of situation:

Plays with mods and paused, leaves to continue the run on the later, goes back and the game crashes when i press "continue"