Download

Disable Max Loop Limit?

When initializing my world (especially since adding dedicated servers to my game), it’s a constant battle to keep below the 1,000,000 iteration limit. Some of the save games have huge bases built all over the map with 10’s of thousands of individual building pieces. I using a lot of logic and hacks to prevent hitting this limit.

@Nathaniel3W mentioned that it was possible to disable this limit for certain functions. I would love to be able to remove this limit just for my main load function (which runs when the world is initializing). I can’t find anything in the config files so far.

Anyone know how to do this?

Hey there, sorry about not watching the forum closer. I’m usually here every day.

The maximum recursion limit is, I’m sorry to say, in the C++ source code. Open up UnCorSc.cpp. On lines 68 and 72 you’ll see RUNAWAY_LIMIT and RECURSE_LIMIT. I have set mine to



#define RUNAWAY_LIMIT 10000000


I have RECURSE_LIMIT set to only 250. I don’t know why I didn’t change that, but it doesn’t seem to be giving me any trouble.

Note that this is the game engine’s recursion limit. You can set these as high as you want, but your game will still crash if it hits the operating system’s maximum call stack size.

Thanks @Nathaniel3W I see that in the code now. Yet another reason for me to make the switch (at some point i will).

For now I’ve modified my load-game logic to process the deserialization over many ticks, which seems to be working fine.

Thanks for the info.