Increase recipes for crafting category past 256

Things that already exist in the current mod API
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Increase recipes for crafting category past 256

Post by Honktown »

Playing a mod with recycling, and noticed certain recipes were available in the technology screen as unlockables, but weren't actually available as recipes in the machine (the machine has an automatic feature - it can switch automatically if the recipe is available, or be manually set).

A crafting machine can only have 256 recipes for a category (I thought about it and counted how many were available in the selection menu). A way around may be to count how many are introduced, and add a new category when the limit's reached, but it will always be a surprise to someone not expecting it.

I'm going to have to test if more than 256 recipes can exist for a machine at all (if it's a hard limit of the sum of all categories the machine supports, or only per-category).

Edit: going by something else, it might be only 256 recipes unlocked when I researched a technology. There's definitely more than 256 in another category, so I'm not sure what's going on.
I have mods! I guess!
Link

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Increase recipes for crafting category past 256

Post by Rseding91 »

There is no game limit for number of recipes in a crafting category that I know of. The code as I see it supports up to 2 ^ 64 per category which you'll never hit before running out of RAM.
If you want to get ahold of me I'm almost always on Discord.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Increase recipes for crafting category past 256

Post by Honktown »

Found the issue. There were exactly 256 recipes, but the ones that were missing were "random". For some reason the mod author only skipped applying a recipe conversion(recycling) if there were difficulties in the prototype, and only to the first difficulty encountered (check for normal and hide it, if not, look for expensive and hide that instead). They don't seem to remember why they did that.
I have mods! I guess!
Link

Post Reply

Return to “Already exists”