Topic: Improvement of lua-code for productionsites
Posted at: 2021-07-06, 18:40
I am currently working on the following problem. I have a smithy that can produce around 20 different products.
Now I've switched to a different system. All weapons will continue to be produced, regardless of whether they are needed or not, so that the smithy continues to have a productivity of more than 0%. I only check the consumed input.
This leads to a new problem that weapons are produced very unevenly. The consequences for the trainingsites are that certain weapons are in abundance and others are lacking.
Now, before each work program, I have set a series of skip commands that skip production if another weapon is missing. However, this has now in turn led to a deadlock in the smithy If more than 1 weapon is required, the skip prevents production for weapon 1 because weapon 2 is missing and for weapon 2 production is prevented because weapon 1 is missing..
Example - old code:
I would therefore suggest implementing a code in the game that basically states that the production of a ware in a productionsite is only started when it is needed by the economy or when all ware that can be produced by the building are not needed by the economy.
new proposal (only analogously, not literally)
Edited: 2021-07-06, 19:46
My widelands project: https://github.com/widelands/wl_addons_server/tree/master/addons/europeans_tribe.wadTop Quote
Posted at: 2021-07-06, 21:29
1. from a game mechanics point of view producing things that are not needed is a waste of inputs, if the inputs could be used for something more useful. Therefore the economy settings exist for all wares that use wares that can be used for different purposes.
Edited: 2021-07-06, 21:30