Topic: Fixing "Calculation Needed"
JJG Topic Opener |
Posted at: 2019-11-21, 04:15
Continued from Forums » Player Forums » Technical Help » Appveyor broken my post from Nov 2019 hessenfarmer: " ...building yourself is only necessary to test own changes to the code." Yes, thanks, that was my intent; to understand the code, with these ideas in mind; I'm trying to understand the source code for some grandiose ideas: I'd appreciate any pointers to any wiki, forum, README, etc that discusses how to understand the code. My simplest idea is to fix "Calculation needed" help texts.I tracked down "Calculation needed" as output of return no_performance_text_yet() in various productionsite/*/*/helptext.lua It looks like the actual times are in the init.lua (see below) It looks like the time is a comment 57 + 3.6, based on sleep+animate+sleep times in milliseconds. Where does the +3.6 come from?I know enough perl to scrape out all the production times and update the helptexts with the production times. Maybe even to make a general purpose perl script to do the updating for new files as well. The problem that the real info is in the init.lua file, but the helptext can't access it, so it is just copied/hardcoded into the helptext.lua . The helptext CAN access the inputs, outputs, buildingcost, dismantle, enhancement, but not the production time. So this type of auto-update script would be just a band-aid.
Top Quote |
WorldSavior |
Posted at: 2019-11-21, 06:49
It seems like a worker needs 3.6 seconds to go to the flag, drop the ware there and go back into the building (on flat terrain). I'm not sure if it's the exact value, it might be also something like 3.75 seconds. And if the terrain is not flat, the duration might be even longer, but just slightly. Wanted to save the world, then I got widetracked Top Quote |
hessenfarmer |
Posted at: 2019-11-21, 07:54
I believe the terrain is always flat as I think to remember that this flattness is prerequisite for showing the build Icon on the map. Top Quote |
Nordfriese |
Posted at: 2019-11-21, 09:41
The worker´s speed is exactly 1800 ms per field. Faster/slower on slopes. I believe the terrain before a building doesn´t have to be completely flat but a small slope (~2 units) is tolerated. Top Quote |
WorldSavior |
Posted at: 2019-11-21, 16:19
Okay. Fun fact: It seems like any object in Widelands moves exactly that fast (on even terrain). But I think that this is no problem.
That's highly possible. For mines, an even higher slope might be tolerated. Wanted to save the world, then I got widetracked Top Quote |
Nordfriese |
Posted at: 2019-11-21, 16:33
Correct
Mines have the same slope restrictions as small buildings. Small buildings allow steeper slopes around them than medium and big buildings.
You could add a lot of
I´m afraid there isn´t really one (or if there is, it´s likely outdated)
Unfortunately one can write really complex productionsite programs, with additional sleep times depending on whether certain additional wares are present/missing, and (silly but allowed) skip commands depending on economy demand or worker experience… Edited: 2019-11-21, 16:36
Top Quote |
JJG Topic Opener |
Posted at: 2019-11-22, 06:42
Thanks for all the comments. In Settlers, I believe, you could build warehouses with an entrance slope of yellow instead of green, or the entrance speed was same as last road speed, so a yellow incoming road would have slower entrance as well. I don't seem to be able to test this for Widelands warehouse because entrance is always green, and only connecting roads are green and yellow, (no red). Maybe mines would work better. Has anyone seen this slowdown of entrance walk? From the top post, I'm guessing that sleep and animate take arguments in mS.
I found that the barbarian bakery init.lua uses 3 wheat + 3 water, and makes the first loaf in 40s and second loaf in 20s, for an average of 30s/loaf. Thanks for pointer to syntax and location for logging. Top Quote |
stonerl |
Posted at: 2019-11-22, 07:34
Have a look in the . Simply speaking, it is the distance between two nodes (flags, if you will). Edited: 2019-11-22, 07:37
Top Quote |
hessenfarmer |
Posted at: 2019-11-22, 09:54
Not quite exactly one field is the distance between 2 nodes. Flags however are separated at least 2 nodes. Top Quote |
hessenfarmer |
Posted at: 2019-11-22, 10:04
yes but in different order. as the the buildings can't store any produced wares they need to be carried out to the building flag, which is only one node away, to be stored on the flag until it gets transported. I believe if theres is a slope from building to flag the effects of slowing down uphill and accelerate downhil should average so it should be 3.6s all the time.
sound plays in parallel to the other commands as long as the sound file takes (duration of sound recorded). 192 is only a priority of the sound in relation to other sounds to be played in the same field of view on the map.
no skipping takes 10 seconds I believe but you need to look into the c++ code to confirm this.
thats where the stuff is done.
yes skipping is always done conditional either for economy reason (the ware is not needed) or production reason the inputs to produce the ware are not available. This reasons are normally defined in the lua code. Personally I believe we could and should only calculate performance in the good case (all inputs available and wares are needed). As this is where performance matters. Top Quote |