production times are 10s longer when return=skipped
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The logic for production sites contains a function that starts the programs. See here:
Interesting is this part:
SkippedProgram
if (i != skipped_
uint32_t const gametime = game.get_
uint32_t const earliest_
if (gametime + tdelta < earliest_
tdelta = earliest_
}
This is used for cases like this:
This means 10 seconds are added before the action gets executed again.
The problem is that unconditional "return=skipped" are used to avoid wrong productivity statistics. This is because the skipped case does not calculate stats as seen in the program end function.
But 10 seconds are added to the production time every time an unconditional "return=skipped is called.
Possible solutions would be to add a 4th case that doesn't trigger the above mentioned "SkippedPrograms:" function.
Another solution would be, to remove the above mentioned "SkippedPrograms:" function and add a
sleep=10000
before every conditional return=skipped where a sleep missing and remove these 10s from other sleep times in the production. Doing this would keep the production times length the same but also have the 10s that are added before production continues if a ware wasn't needed.
Some production sites already have a sleep before a conditional return=skipped. Have these extra 10s been taken into consideration when adding these? Here for example the Barbarians bakery:
programs = {
work = {
-- TRANSLATORS: Completed/
descname = pgettext(
actions = {
}
},
If no bread is needed the sleep before the return is called is 20s + 10s because these 10 seconds have been added since bread wasn't needed.
This was discovered in the forum. Starting from this post: https:/
Related branches
- hessenfarmer: Approve
-
Diff: 12 lines (+1/-1)1 file modifiedsrc/logic/map_objects/tribes/productionsite.cc (+1/-1)
- hessenfarmer: Pending requested
-
Diff: 743 lines (+65/-56)54 files modifieddata/campaigns/emp04.wmf/scripting/tribes/farm1.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/armorsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/blackroot_farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/crystalmine/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/mill/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/smelting_works/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/smokery/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/toolsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/weaponsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/weaving_mill/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/ax_workshop/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/big_inn/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/helmsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/inn/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/metal_workshop/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/reed_yard/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/smelting_works/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/warmill/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/armorsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/inn/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/marblemine/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/smelting_works/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/toolsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/vineyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/weaponsmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/aqua_farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/armor_smithy_large/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/armor_smithy_small/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/blacksmithy/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/drinking_hall/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/furnace/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/honey_bread_bakery/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/mead_brewery/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/recycling_center/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/reed_farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/reindeer_farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/smokery/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/tailors_shop/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/tavern/init.lua (+1/-1)
src/logic/map_objects/tribes/production_program.cc (+3/-1)
src/logic/map_objects/tribes/production_program.h (+10/-4)
src/logic/map_objects/tribes/productionsite.cc (+1/-0)
Changed in widelands: | |
status: | New → In Progress |
assignee: | nobody → Toni Förster (stonerl) |
milestone: | none → build20-rc1 |
Changed in widelands: | |
status: | In Progress → Fix Committed |
Changed in widelands: | |
assignee: | Toni Förster (stonerl) → nobody |
I am against a manual invocation of sleep - it makes things to complicated for tribe development. It would be better to amend the C++ code to add no time when there was no condition in the program.