Latest Posts

Topic: Production times

palino
Avatar
Topic Opener
Joined: 2022-12-19, 07:06
Posts: 13
OS: Windows 10
Version: 1.1
Ranking
Pry about Widelands
Posted at: 2023-01-04, 17:01

Hello

I was comparing production times for barbarian mines in help and in lua scripts, for deep iron mine there seems to be typo.
In tribal encyclopedia (data/tribes/initialization/barbarians/units.lua):

"If the food supply is steady, this mine can produce iron ore in 39.5 seconds on average."

But according to data/tribes/buildings/productionsites/barbarians/coalmine_deep/init.lua
The time should be 40/4+9.5 = 19.5 sec

Is my calculation correct? Because I've noticed in another files, like here: data/tribes/buildings/productionsites/atlanteans/coalmine/init.lua:

            -- after having the food the miners are working 7 times
            -- each cycle lasts 10 seconds for mining and producing coal
            -- and 3.6 seconds to deliver the coal to the flag

There is mentioned 3.6 delay for each produced ware. Is this delay generic for all production buildings, where worker is going from indoor? So formula for barbarian deep iron mine would be: 40/4+9.5+3.6 = 23.1 sec

Is there possibly any other delay for indoor workers, when input queues are satisfied?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2023-01-05, 01:03

you are rigtht.

the correct value would be 23.1 sec for the reasons you figured out.

thanks for reporting.


Top Quote
palino
Avatar
Topic Opener
Joined: 2022-12-19, 07:06
Posts: 13
OS: Windows 10
Version: 1.1
Ranking
Pry about Widelands
Posted at: 2023-01-11, 00:22

I've checked the exact times when ware was delivered to flag, using in-game clock. It seems 23.1 sec is not correct value but approximately 26 sec.
e.g.: 6:19:16 6:19:30 6:19:43 6:19:56 - 6:21:00 6:21:13 ...

For the non-mine buildings, basic iron mine and basic gold mine, the production times are matching lua scripts - I checked Wood Hardener, Lime Kiln, Bakery, Brewery.

These mines have longer times, it seems like cycle is delayed with additional 12 seconds:

Granite mine: expected 20/2+10+3.6 = 23.6 sec; real 29 sec
Basic coal mine: expected 45/2+10+3.6 = 36.1 sec; real 41.5 sec
Deep coal mine: expected 40/4+9.5+3.6 = 23.1 sec; real 26 sec
Deepest coal mine: expected 37/5+7+3.6 = 18.0 sec; real 20.5 sec
Deep iron mine: expected 40/4+9.5+3.6 = 23.1 sec; real 26 sec
Deepest iron mine: expected 38/5+10+3.6 = 21.2 sec; real 23.5 sec
Deepest gold mine: expected 38/4+9+3.6 = 22.1 sec; real 25.25 sec

Do you have explanation for this? Is it similar also for other tribes?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2023-01-12, 08:37

I don't have explanation rather then you might have missed the first delivery after the 40 sec sleep.
what I see from the times is a 13 sec interval for the different attempts, which is as expected (9.5 plus 3.6) but the pause for sleep is 64 secs which would be approx 40 secs plus 2 attempts.


Top Quote
palino
Avatar
Topic Opener
Joined: 2022-12-19, 07:06
Posts: 13
OS: Windows 10
Version: 1.1
Ranking
Pry about Widelands
Posted at: 2023-01-12, 09:28

For deep iron mine I don't have more times noted, but for others it is obvious, there is bigger delay. I took care not to jump into depleted state.

basic coal mine:
  sleep 55:16 55:31 sleep 56:39 56:53 sleep
  sleep 1:54:32 1:54:46 sleep 1:55:55 1:56:09 sleep
  sleep 1:54:38 1:54:52 sleep 1:56:01 1:56:15 sleep
  sleep 1:54:38 1:54:52 sleep 1:56:01 1:56:15 sleep

granite mine:
  sleep 3:26:36 3:26:50 sleep 3:27:34 3:27:47 sleep
  sleep 3:26:39 3:26:53 sleep 3:27:37 3:27:51 sleep

deep coal mine:
  sleep 6:03:35 6:03:49 6:04:02 6:04:15 sleep 6:05:19 6:05:32 6:05:45 6:05:59 sleep
  sleep 6:02:18 6:02:32 6:02:45 6:02:58 sleep 6:04:02 6:04:15 6:04:28 6:04:42 sleep 6:05:45 6:05:59

deepest coal mine:
  6:07:12 6:07:23 sleep 6:08:21 6:08:32 6:08:43 6:08:54 6:09:05 sleep
  sleep approx 6:07:10 6:07:20 6:07:31 6:07:42 6:07:53 sleep 6:08:51 6:09:02 6:09:13 6:09:23 6:09:34 sleep

deepest iron mine:
  sleep 6:11:29 6:11:43 6:11:57 6:12:11 6:12:25 sleep 6:13:27 6:13:41

deepest gold mine:
  6:18:27 sleep 6:19:28 6:19:41 6:19:54 6:20:08 sleep 6:21:09 6:21:22

I can later propose update of data/tribes/initialization/barbarians/units.lua, when this timing will be clarified


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2023-01-12, 12:34

OK now I understand what is going on:
if a program returns the state "skipped" it is not tried again for 10 secs IIRC. And the main program returns skipped, so this would explain the additional 10 secs.
I will investigate this whether this is common or only for some buildings.
Thanks for all the effort you have put in to get this clarified


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2023-01-12, 12:51

OK,
I can confirm it is only for special productionsites where the workers need some experience.
it was introduced here to fix an issue with experience https://github.com/widelands/widelands/pull/4905
My proposal would be:
1. add a comment to the lua files where the return=skipped is present that this causes a 10 sec delay.
2. reduce the sleeptime in affected main programs by 10 secs where this is the case to reinstate former timings as they are relvant for balance.
3. check and eventually update the units.lua files with the correct values for performance.


Top Quote
palino
Avatar
Topic Opener
Joined: 2022-12-19, 07:06
Posts: 13
OS: Windows 10
Version: 1.1
Ranking
Pry about Widelands
Posted at: 2023-01-21, 14:48

To the 3rd point, I checked how it looks like in units.lua. There are two forms, depends on whether it is real number or whole number:

performance = pgettext("barbarians_building", "The gamekeeper pauses 52.5 seconds before going to work again.")
performance = pgettext("barbarians_building", "The carrier needs %s to get one bucket full of water."):bformat(ngettext("%d second", "%d seconds", 40):bformat(40))

I suppose second form is more suitable for translators. Do you have a ngettext alternative for real numbers?

Or maybe a game suggestion - what about modifying sleep duration in all buildings (where needed), so that the resulting time is always whole number? (e.g. gamekeeper will get rounded value 53 seconds.) It is then easier to remember/compare.

With the 3.6 sec addition almost every building will have real number.

Edited: 2023-01-21, 14:57

Top Quote
palino
Avatar
Topic Opener
Joined: 2022-12-19, 07:06
Posts: 13
OS: Windows 10
Version: 1.1
Ranking
Pry about Widelands
Posted at: 2023-01-27, 09:30

Hello

I processed these barbarian buildings: Lumberjack's Hut, Gamekeeper's Hut, Bakery, Ax Workshop, Barracks, Deep Coal Mine, Deeper Coal Mine, Deep Iron Mine.
Please review attached patch, if this is correct way to continue. I modified sleep duration to have whole numbers in encyclopedia.

The Lumberjack's Hut had incorrect value 12 seconds in encyclopedia (time to fell a tree). According to data/tribes/workers/barbarians/lumberjack/init.lua it should be 15 + 2 sec.

Time example of releasing axes to the flag by Ax Workshop before my changes:

13:12:26 - ax
13:13:27 - sharp ax
13:14:28 - broad ax
13:15:39 - ax

After my changes (corrected average time):

13:12:27 - ax
13:13:28 - sharp ax
13:14:19 - broad ax
13:15:30 - ax

Attachment:
barb_perf_1.diff.txt (16.3 KB)

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2023-01-27, 14:36

this looks like the way to go. Only I am unsure about the fix for the productionsites with multiple outputs. I tend to distribute the reduction of sleep times over the programs rather then favoring production of the last ware by making it much faster. Background is that in case only this ware would be needed it will get produced much faster then before.

Would you like to create a branch and Pull request on github, so we can use the review funtions there and get it into the game? I would very much appreciate that.


Top Quote