Latest Posts

Topic: Measuring working time of productionsites

Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-01-12, 20:04

Also I think in never reaches 0% neither. We can just map range 2-98 to 0-100 in user interface and it would be good enough..


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-01-12, 20:22

Tibor wrote:

Also I think in never reaches 0% neither. We can just map range 2-98 to 0-100 in user interface and it would be good enough..

that was what I had in mind if the community is voting for this.
I really would like some feedback before merging this, and I had an idea how to maintain savegame compatibility (currently we can't load old savegames with this change). so there is still work to do, but again feedback is highly appreciated.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-01-15, 07:42

Tibor wrote:

Also I think in never reaches 0% neither. We can just map range 2-98 to 0-100 in user interface and it would be good enough..

ok testing showed that it reaches 0% and I saw a building having 99% as well, while most buildings stay with 98%. So for me this is good enough.
Only thing is I'd love to hear some feedback of the community before merging this.

in my branch I have renamed the related functions and variables to better reflect what is going on.


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-01-15, 08:17

hessenfarmer wrote:

Tibor wrote:

Also I think in never reaches 0% neither. We can just map range 2-98 to 0-100 in user interface and it would be good enough..

ok testing showed that it reaches 0% and I saw a building having 99% as well, while most buildings stay with 98%. So for me this is good enough.
Only thing is I'd love to hear some feedback of the community before merging this.

I think people expect to see 100 % sometimes, and I would vote for a tweak here. Also this might be an issue with rounding in C++ when 999 / 10 is rounded to 99 instead more logical 100.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-01-15, 08:45

Tibor wrote:

hessenfarmer wrote:

Tibor wrote:

Also I think in never reaches 0% neither. We can just map range 2-98 to 0-100 in user interface and it would be good enough..

ok testing showed that it reaches 0% and I saw a building having 99% as well, while most buildings stay with 98%. So for me this is good enough.
Only thing is I'd love to hear some feedback of the community before merging this.

I think people expect to see 100 % sometimes, and I would vote for a tweak here. Also this might be an issue with rounding in C++ when 999 / 10 is rounded to 99 instead more logical 100.

in C a integer division is basically always a floor function, which is causing this. Problem is that i saw 99% as well once, while the majority stayed at 98%. so if we normalize by 100/98 we may get 101% in some rare cases.


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-01-15, 08:49

Of course "normalize" would involve also cropping to 0-100. Note that we would normalize only the string to show, not actual variable


Top Quote
JanO
Avatar
Joined: 2015-08-02, 11:56
Posts: 177
Ranking
At home in WL-forums
Posted at: 2020-01-15, 08:57

How about finding a theoretical output for each productionsite (easy for the ones which work inside) and take the real outputs' deviation (within the last 10 minutes or whatever) from that for the calcualtioin? All the stuff about how to handle skipped cycles would be obsolete then. If a building's productivity drops because of 'ware not needed', then the number might stay green, even if it is below 66%.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-01-15, 10:04

JanO wrote:

How about finding a theoretical output for each productionsite (easy for the ones which work inside) and take the real outputs' deviation (within the last 10 minutes or whatever) from that for the calcualtioin? All the stuff about how to handle skipped cycles would be obsolete then.

as we use integer arithmetics this would result in the same issues or even worse results if the cycle does not fit into the time base for which you calculate the deviation. Furthermore it is much more complicated then what we have now. Currently we have a short elegant formula that delivers good results for all Productionsites without the need of deeper knowledge of the site. The problem arises simply from the integer arithmetic which delivers a gap at the top dependent on the length of a working cycle from 4% at the shortest working cycle (e.g. atlantean and empire mill) to about 1% for longer cycles (e.g. bakeries). But I believe this could be solved

If a building's productivity drops because of 'ware not needed', then the number might stay green, even if it is below 66%.

that would be nice but complicated as the format function has no knowledge of the reason why the productivity drops.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-01-15, 10:14

Tibor wrote:

Of course "normalize" would involve also cropping to 0-100. Note that we would normalize only the string to show, not actual variable

Sounds reasonable. will try this out


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-01-16, 21:19

Does this new method also work fine when the worker walks a lot around or if there are a lot of animations? And what about buildings with various output?


Wanted to save the world, then I got widetracked

Top Quote