Topic: Production Time
stonerl![]() Topic Opener |
Posted at:
2018-08-09, 20:28 UTC+2.0
I think I found another bug in the barbarians big_inn. Shouldn't it be one sleep on one animate statement instead of 2 sleep. Also the times for rations are weird:
Like this:
![]() ![]() |
hessenfarmer![]() |
Posted at:
2018-08-09, 21:10 UTC+2.0
animate working does not work if no animation is designed ![]() ![]() |
stonerl![]() Topic Opener |
Posted at:
2018-08-09, 21:32 UTC+2.0
What are the working_xx.png and working_xx_pc.png in the big_inn folder? Aren't these the files for the animation?
Edited:
2018-08-09, 21:33 UTC+2.0
![]() ![]() |
WorldSavior![]() |
Posted at:
2018-08-09, 21:34 UTC+2.0
Why are they weird? By the way, the big inn is about to be changed a little bit, it will look like this: https://bazaar.launchpad.net/~widelands-dev/widelands/mines-worldsavior/view/head:/data/tribes/buildings/productionsites/barbarians/big_inn/init.lua Wanted to save the world, then I got widetracked ![]() ![]() |
kaputtnik![]() |
Posted at:
2018-08-09, 21:57 UTC+2.0
The *pc.png are used to display the player color on top of the other image with the same name. ![]() ![]() |
stonerl![]() Topic Opener |
Posted at:
2018-08-09, 22:18 UTC+2.0
I'm pretty sure this is a bug. At the top of the init.lua for the big_inn there ar the following lines:
In the big_inn folder the working_??.png are present. So there are animations. That's why I meant the times are weird. If the second sleep where the animation, then the actual animation would be very short compared to a normal inn(18s) or tavern(19s). ![]() ![]() |
stonerl![]() Topic Opener |
Posted at:
2018-08-09, 23:28 UTC+2.0
@WorldSaviour This is how it should look like: Tested it and send a merge request to your branch. ![]() ![]() |
stonerl![]() Topic Opener |
Posted at:
2018-08-10, 02:43 UTC+2.0
I do have a suspicion why the Reed Yard, farm and many other production sites where the worker has to leave the building have an additional 10 seconds added. I use the Reed Yard for my explanation. After the gardener enters the Redd Yard, the production program starts:
Since he starts harvesting only after the third reed has been planted the timings are as follows:
These are the times between entering and leaving the building. 18s is the sleep time for the plant action and 5 seconds the sleep tome for harvest. So second and third plant are:
After the second time these 10 seconds get added to every plant action. I found the following in this file: In this very line 10 seconds are added, when a program gets skipped? I guess? Can't really explain this. But to my, limited, understanding this seems to be related. Any Ideas? ![]() ![]() |
stonerl![]() Topic Opener |
Posted at:
2018-08-10, 22:41 UTC+2.0
Okay I now know whats going on here. IMHO this is a severe bug. The line I mentioned in my last post adds 10 seconds when the production is skipped.
So as an example I choose the gold ore mine in the mining routine this is defined:
The mining program is skipped and the above mentioned adds 10 seconds before it starts the mining routine again. this is okay because here we have the condition "unless economy needs gold_ore" The problem is this:
The last return=skipped has no condition so even if the mining was successful. The 10 seconds penalty is added every time. Even if it was successful. I grepped through the data folder and these are the files where this need to be removed or a condition added:
If these 10 seconds are intentional then they should be added directly to the buildings lua file. Edit: with the worldsaviours branch there are even more sites affected.
Edited:
2018-08-11, 00:51 UTC+2.0
![]() ![]() |
hessenfarmer![]() |
Posted at:
2018-08-10, 23:50 UTC+2.0
Sounds like a real problem, cause we need this unconditional skips to not screw up statistics. However I do not exactly know what is going on in the code you mentioned. For example I don't understand all if conditions there and neither do I understand the check and setting of tdelta which is the real variable triggering the scheduler. Hopefully one of our c++ experts could have a look into this piece of code. ![]() ![]() |