Latest Posts

Topic: Statistics for Productivity

stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-21, 18:58

I think that there is one flaw with the current productivity statistics. Here is how they depend on the production-sites:

    switch (result) {
    case Failed:
        statistics_.erase(statistics_.begin(), statistics_.begin() + 1);
        statistics_.push_back(false);
        calc_statistics();
        crude_percent_ = crude_percent_ * 8 / 10;
        break;
    case Completed:
        skipped_programs_.erase(program_name);
        statistics_.erase(statistics_.begin(), statistics_.begin() + 1);
        statistics_.push_back(true);
        train_workers(game);
        crude_percent_ = crude_percent_ * 8 / 10 + 1000000 * 2 / 10;
        calc_statistics();
        break;
    case Skipped:
        skipped_programs_[program_name] = game.get_gametime();
        crude_percent_ = crude_percent_ * 98 / 100;
        break;
    case None:
        skipped_programs_.erase(program_name);
        break;
    }

If a production site produces a ware it updates the global stats and the one for the building in question. If fails, because of missing wares it also updates the buildings and global stats.

The problem is the handling of skipped cases. If the economy doesn't need a ware, e.g. bread the production is skipped.

"return=skipped unless economy needs barbarians_bread",

The outcome is that the buildings productivity overlay stays at the last value e.g. 45 + for as long as the economy needs the ware again. Also the general statistics don't get updated.

Just a thought experiment here: We only have one building; a bakery. The bakery produces bread and has a productivity of 100%, which means the global economy has a productivity of 100%. Now the economy doesn't need bread anymore. The bakery stops production, but as long as the economy doesn't need bread the productivity stays at 100% for the building and therefor the whole economy. That wrong isn't it? It should decrease the productivity over time, shouldn't it?

When the production for a building gets stopped a big (stopped) appears upon the building and the global productivity decreases.

So I'd propose the following: (in code)

    case Skipped:
        skipped_programs_[program_name] = game.get_gametime();
        statistics_.erase(statistics_.begin(), statistics_.begin() + 1);
        statistics_.push_back(false);
        crude_percent_ = crude_percent_ * 98 / 100;
        calc_statistics();
        break;

With this change the building's productivity would decrease as long as it's not allowed to produce wares. Furthermore this also affects the global productivity.

What are your thoughts on this?


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 03:10
Posts: 2094
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-08-21, 21:29

stonerl wrote:

I think that there is one flaw with the current productivity statistics.

Not only one flaw. Many of them are not accurate anyway.

Just a thought experiment here: We only have one building; a bakery. The bakery produces bread and has a productivity of 100%, which means the global economy has a productivity of 100%. Now the economy doesn't need bread anymore. The bakery stops production, but as long as the economy doesn't need bread the productivity stays at 100% for the building and therefor the whole economy. That wrong isn't it? It should decrease the productivity over time, shouldn't it?

It's wrong, but it has one advantage: At least you know if you supply buildings perfectly. With your approach, you don't see directly if the supply is too low or the need. Maybe we need two different kinds of numbers? face-tongue.png

When the production for a building gets stopped a big (stopped) appears upon the building and the global productivity decreases.

So I'd propose the following: (in code)

case Skipped: skipped_programs_[program_name] = game.get_gametime(); statistics_.erase(statistics_.begin(), statistics_.begin() + 1); statistics_.push_back(false); crude_percent_ = crude_percent_ * 98 / 100; calc_statistics(); break;

With this change the building's productivity would decrease as long as it's not allowed to produce wares. Furthermore this also affects the global productivity.

What are your thoughts on this?

I don't know that code, but how would it work for buildings with different outputs? Let's assume that we have a weapon smithy and we want supply barracks, but no dungeon. So the weapon smithy will skip 4 kinds of tridents, but not the light trident. The maximum of shown productivity shouldn't be 20% in that case, but 100%.

And by the way: Skipping can be faster than working. If skipping will be very fast (like it should be) the productivity could drop very fast to 0%, but then it needs much time to increase again. So how can we achieve the correct productivity number here?


Wanted to save the world, then I got widetracked

Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-21, 21:54

WorldSavior wrote:

It's wrong, but it has one advantage: At least you know if you supply buildings perfectly. With your approach, you don't see directly if the supply is too low or the need. Maybe we need two different kinds of numbers? face-tongue.png

But that means you have to look at the same building for a long time or remember the actual value. If you just look at a building you first and foremost see just the number. Furthermore we have the hover-text that gives you detailed information whether it is missing wares or the lack of need. Not sure if wee need different numbers here. 0% means 0, regardless of the reason. face-grin.png

With this change the building's productivity would decrease as long as it's not allowed to produce wares. Furthermore this also affects the global productivity.

What are your thoughts on this?

I don't know that code, but how would it work for buildings with different outputs? Let's assume that we have a weapon smithy and we want supply barracks, but no dungeon. So the weapon smithy will skip 4 kinds of tridents, but not the light trident. The maximum of shown productivity shouldn't be 20% in that case, but 100%.

I'm gonna need to test this, thanks.

But this begs a deeper question: can productivity for this building really reach 100% even though it only produces 1 out of 5 wares?

And by the way: Skipping can be faster than working. If skipping will be very fast (like it should be) the productivity could drop very fast to 0%, but then it needs much time to increase again. So how can we achieve the correct productivity number here?

Skipping adds 10 seconds before the next time production gets started. Plus the time before the skip. So the fastest productivity could drop from 100% to 0% for a building would be 100 seconds. Not that fast. Stopping the production, immediately drops the productivity for this very building to 0%. But the effect on the general statistics takes some time.


Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-22, 00:18

WorldSavior wrote:

I don't know that code, but how would it work for buildings with different outputs? Let's assume that we have a weapon smithy and we want supply barracks, but no dungeon. So the weapon smithy will skip 4 kinds of tridents, but not the light trident. The maximum of shown productivity shouldn't be 20% in that case, but 100%.

I'm gonna need to test this, thanks.

But this begs a deeper question: can productivity for this building really reach 100% even though it only produces 1 out of 5 wares?

So it does indeed stay at 20% if only 1 out 5 gets produced. But as I said before 1 out of 5 is still 20% and not 100%. So this very building isn't very productive since it doesn't produce 100% of the wares it could but only a fraction.

The problem though is when we have buildings that produce a variety of wares that can't be divided with hundred, without the result being a multiple of 5 or 10.

E.g. the barbarians big inn produces 3 wares. If only 1 would be produced, the productivity should be 33%. But it will jump between 35% and 30%.


Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-22, 01:32

So the fastest productivity could drop from 100% to 0% for a building would be 100 seconds.

It would be 200 seconds, since it decreases in 5% steps.


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

stonerl wrote:

WorldSavior wrote:

It's wrong, but it has one advantage: At least you know if you supply buildings perfectly. With your approach, you don't see directly if the supply is too low or the need. Maybe we need two different kinds of numbers? face-tongue.png

And that is exactly why I would vote for keeping this mechanism as it is. Cause I am only interested to quickly identify any problem with a building, and economy not needeing the ware isn't a problem. Or at least I would track this one from the inventory.

But that means you have to look at the same building for a long time or remember the actual value. If you just look at a building you first and foremost see just the number.

Yes and if its above 80% it is ok for me.

Furthermore we have the hover-text that gives you detailed information whether it is missing wares or the lack of need. Not sure if wee need different numbers here. 0% means 0, regardless of the reason. face-grin.png

But as explained the reason matters. One of the reasons is a problem the other is not (at least not that big a problem)

With this change the building's productivity would decrease as long as it's not allowed to produce wares. Furthermore this also affects the global productivity.

What are your thoughts on this?

I don't know that code, but how would it work for buildings with different outputs? Let's assume that we have a weapon smithy and we want supply barracks, but no dungeon. So the weapon smithy will skip 4 kinds of tridents, but not the light trident. The maximum of shown productivity shouldn't be 20% in that case, but 100%.

Agreed and it should be the case now otherwise we should fix it in this way.

I'm gonna need to test this, thanks.

But this begs a deeper question: can productivity for this building really reach 100% even though it only produces 1 out of 5 wares?

And by the way: Skipping can be faster than working. If skipping will be very fast (like it should be) the productivity could drop very fast to 0%, but then it needs much time to increase again. So how can we achieve the correct productivity number here?

Skipping adds 10 seconds before the next time production gets started. Plus the time before the skip. So the fastest productivity could drop from 100% to 0% for a building would be 100 seconds.

No. for a building with 10 different outputs where no outpt is needed it will drop in 10 secs to 0% (50% in some milliseconds and 0% after 10 secs)

Not that fast. Stopping the production, immediately drops the productivity for this very building to 0%. But the effect on the general statistics takes some time.


Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-23, 11:38

Both of you are probably right. face-smile.png What about an overlaybthat says (paused) when no production is going on?


Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-23, 11:41

WorldSavior wrote:

stonerl wrote:

I think that there is one flaw with the current productivity statistics.

Not only one flaw. Many of them are not accurate anyway.

Inaccurate in what way. Can you name/link some of the flaws? I


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-08-23, 18:36

I remember that in one of previous versions when building wasn't working because the economy hasn't need any ware, the statistics was coloured blue.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-08-23, 19:17

stonerl wrote:

Both of you are probably right. face-smile.png What about an overlaybthat says (paused) when no production is going on?

Oh that is an idea definitly worth discussing. Perhaps I would not name it "paused" but "idle". Any way this is a matter of taste. Einsteins idea is good either so we would still know how good the building has performed before it went into idling.


Top Quote