Engine instability at high table numbers?

7 posts / 0 new
Last post
Engine instability at high table numbers?

So I spent the night making a new item and getting familiar with the code when I came across an interesting issue.

When I first started I wondered why just use the next number for new table entries, obviously other modders are going to be using them and they're just arbitrary and inconvenient numbers to remember to boot right? Itemtypes 417, itemprops 84, treasuretable 583, recipes 84, ingredients 97, etc. So I figured I'd pick an easier to remember high number to work with (1313), so now I would only have to remember one number for most new entries when I start making new items.

Well the game didn't like that. Loaded up fine and everything works normally, until you tried to do any crafting, then suddenly the game would start throwing all kinds of fits. Available crafting items wouldn't show up half of the time, couldn't finish crafting items (no Confirm button), busy hourglass icon that didn't want to go away, the game getting stuck in a loop ending your turn over and over without being able to stop it, etc, all kinds of interesting and game breaking bugs.

I then fixed the issue by reverting my new table entries and things pointing to them to the next number in sequence, itemtypes 417, itemprops 84, treasuretable 583, recipes 84, ingredients 97, and such, instead of all those entries being at 1313. This fixed the issue completely and my new item and recipe worked flawlessly this time.

So I guess the bug is that the game either doesn't like you skipping table number entries, or crafting becomes unstable with a large amount (1313) of entries in most tables.

Figured it was worth bringing to Dan's attention, even though he said he's for the most part not going to be doing bugfixes with regards to modding.

just a guess but, maybe the itemtype group IDs work in sequence, maybe it can't recognise 1313 because its not a number directly after the last highest number for GroupIDs?


Sorry, I should clarify. I made a new type of spear, itemtypes nGroupID was 31 just like the other spears, nSubgroupID I made 3, the next number in sequence of what the last spear had (2). The itemtypes entry I made 1313 was ID, the one right above nGroupID and nSubgroupID.

Which eventually I changed to 417.

yeah it's a pity lol, would save some time merging.


"So I guess the bug is that the game either doesn't like you skipping table number entries"

This, most likely. It happened to me when I skipped only 1 ID number.

Pew pew pew!

I think it was the skipped ID, too. I'm not sure if itemtypes cares, but there are definitely some other data types that do. E.g. the data is just stored in a list, so skipped IDs throw the index off.

Making mods easier to merge is still something I'd like to explore, as I'm sure the modders would appreciate not having to re-index everything with new builds (or other merged mods).

Dan Fedor - Founder, Blue Bottle Games

For now, just create an arbitrary number (50-500) of dummy entries, up to the ID you want to use. Hopefully, nobody else will use that exact same ID. This will allow for merging later.