Make stack_size writeable

Things that we aren't going to implement
Post Reply
napu
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Nov 17, 2017 8:16 pm
Contact:

Make stack_size writeable

Post by napu »

Would it be possible to make the stack_size property on item_prototype a writeable property?
I could really use this in a mod I'm currently working on.
Casual modder

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

Re: Make stack_size writeable

Post by Rseding91 »

That's not likely to happen. If any property can be changed runtime it has to be saved in the save file regardless of it being used.
If you want to get ahold of me I'm almost always on Discord.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Make stack_size writeable

Post by DaveMcW »

Could you save only the differences compared to the data stage? That would only increase the size of saves that modify the property.

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

Re: Make stack_size writeable

Post by Rseding91 »

DaveMcW wrote:Could you save only the differences compared to the data stage? That would only increase the size of saves that modify the property.
When loading the game it has to know what to load from the input stream and the only way to do that is to always have something there. That means you can't conditionally save something unless something else signals it being conditionally saved.
If you want to get ahold of me I'm almost always on Discord.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Make stack_size writeable

Post by DaveMcW »

So include an array of stack_size_diferences in every save. It can be empty.

napu
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Nov 17, 2017 8:16 pm
Contact:

Re: Make stack_size writeable

Post by napu »

Rseding91 wrote:That's not likely to happen. If any property can be changed runtime it has to be saved in the save file regardless of it being used.
So you're currently not saving any data of the prototypes in the savegame files as is? Because a single property shouldn't change savegame filesize by much.


DaveMcW wrote:So include an array of stack_size_diferences in every save. It can be empty.
I think this would be a possibility.
Casual modder

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Make stack_size writeable

Post by Nexela »

I can't be bothered to look up the max size of an item stack so we will assume 32bit...

4 bytes * 1,000,00 items = 4 megabytes of storage.
Add in peoples obsession with warehouses and
768 slots * 200 ore each slot = 1.5 additional megabytes PER angels warehouse.

That is a lot of data for something that can be stored in the item prototype at just 4 bytes per item TYPE. And changing the stack size of any item type can be done on an existing map with a mod it just requires a game reload to take effect.

napu
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Nov 17, 2017 8:16 pm
Contact:

Re: Make stack_size writeable

Post by napu »

But what if one wants to make a research to increase stack sizes?

It wouldn't matter, if you just want a static stack size, there are loads of mods out there that change the stack size, but it would be cool if it was possible to change it runtime.
Casual modder

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Make stack_size writeable

Post by Nexela »

A technology modifier for stack size might be feasible , It would have drawbacks that it would affect the stack size of everything though.

napu
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Nov 17, 2017 8:16 pm
Contact:

Re: Make stack_size writeable

Post by napu »

I would go for DaveMcW's method instead and use an array.

That way it would be possible to create researches for just some items or even single items.
Casual modder

Post Reply

Return to “Won't implement”