The Spice Rack - Decaying goods


The Spice Rack is intended to spice up the vanilla game by changing some well chosen details. Most changes can be disabled individually. Buffering gets even worse. Basic goods are decaying and emitting pollution, if they are buffered in chests. The more a chest is filled, the bigger percentage of the content is decaying... CAUTION: Not tested in multiplayer! Interested in feedback

Tweaks
2 years ago
1.1
86
Owner:
Jodokus31
Source:
https://github.com/jodokus31/factorio
Homepage:
https://forums.factorio.com/viewtopic...
License:
MIT
Created:
2 years ago
Latest Version:
0.0.1 (2 years ago)
Factorio version:
1.1
Downloaded by:
86 users

The Spice Rack

The Spice Rack is intended to spice up the vanilla game by changing some well chosen details. Most changes can be disabled individually.

The Spice Rack - Decaying goods

Buffering gets even worse. Basic goods are decaying and emitting pollution, if they are buffered in chests. The more a chest is filled, the bigger percentage of the content is decaying. This should encourage to don't excessively buffer basic items, but create production lines, which uses the material on the fly. Some buffering is always necessary, f.e. for train stations, but it's a consideration, how small this buffer can be.

Summary

Basic goods like ores, plates, wood, fish, plastic, batteries, uranium are decaying with invidual rate per hour. This can be configured in the settings.
For each decayed item, it is removed from the chest and/or pollution is emitted, which is also configurable

The only way to see what's happening currently is to call:
/spice_rack_item_statistics (does not deactivate achievements tracking)

Commands

There are some command line commands:

  • /spice_rack_item_statistics - displays a statistics about items and how much already decayed
  • /spice_rack_active_containers - displays all containers (chests)
  • /spice_rack_rebuild_containers - rebuild the containers structure, if necessary

Options:

  • Emitted pollution per decayed item - How much pollution is emitted per decayed item (0 is none)
  • Destroy decayed items from chest - Whether decayed items are actually destroyed
  • Decay % <item> - Max. decay rate percent per hour (less than 48 stacks in chest means lower decay rate)

  • Expert: Slot count for containers - Expert: More slots are useful for large amount of containers to increase performance. Must be a prime

  • Expert: Interval in ticks - Expert: Bigger intervals enlarge the turnaround time (slots * interval). Can be increased to improve performance.
  • Debug mode for decaying goods - 0=off, 1=errors only, 2=errors and warning, 3=additional infos, 4=additional debug logs

Technical background

The mods keeps track over all placed containers and investigates the content. For the amount of each decayable item, an integer decay is calculated and the items get removed from container and/or pollution is emitted. Since decay is sometimes very slow, the decayed fraction per item is carried along to the next calculation of that item.

To ensure performance, the containers are handled not all at once, but they are distributed over a timespan of ~ 2 min. . When a container is added, it's assign to an alternating slot. One slot is handled each interval of 10 ticks (configurable). The amount of slots is a prime value: 719 (configurable). 7190 ticks ~ 2 min.