Donation

Help us to pay our server!
(: Consider a donation :)



Social Media

  • Facebook
  • Google+

Currently Online

Latest Posts

Topic: Production Time

stonerl
Avatar
Joined: 2018-07-30, 00:03
Posts: 44
Ranking
Pry about Widelands
Location: Earth
Posted at: 2018-08-11, 01:04

hessenfarmer wrote:

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.

Well at line 915 the handling for a program end starts.

    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:
        break;
    } 

According to the switch, the case skipped doesn't calculate statistics. Only the failed and completed. If that is what you mean by not screwing up statistics. So maybe a 4th case needs to be added.

But on the other hand, doesn't a "return=skipped" at the end of a program-routine mean, that this very program will never ever have completed as a return value? Even if it was successfully completed.


Top Quote
stonerl
Avatar
Joined: 2018-07-30, 00:03
Posts: 44
Ranking
Pry about Widelands
Location: Earth
Posted at: 2018-08-11, 01:39

hessenfarmer wrote:

Sounds like a real problem, cause we need this unconditional skips to not screw up statistics.

Sorry, just one more question. How does not having this screw up the statistic. I tested this with the Barbarians Reed Yard on over the course of time i could not see any difference in the stats. Where in the game stats do is see misbehaving stats?

And why does it only mess up stats for some production sites and not others?

Edited: 2018-08-11, 01:47
Top Quote
stonerl
Avatar
Joined: 2018-07-30, 00:03
Posts: 44
Ranking
Pry about Widelands
Location: Earth
Posted at: 2018-08-11, 11:51

stonerl wrote:

hessenfarmer wrote:

Sounds like a real problem, cause we need this unconditional skips to not screw up statistics.

Sorry, just one more question. How does not having this screw up the statistic. I tested this with the Barbarians Reed Yard on over the course of time i could not see any difference in the stats. Where in the game stats do is see misbehaving stats?

And why does it only mess up stats for some production sites and not others?

Okay, I can answer this question myself now. I screws up the productivity stats. Without the "return=skipped" it increases the productivity by 10% instead of 5% when a working program has multiple subroutines.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 341
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-11, 16:12

Correct.
in most of the programs (especially the mines) real productivity is only generated in the subprograms not in the overall program itself. Therefore only the subprograms need to be taken into account for productivity and this is currently ensured by having the "calling" programs terminate with return=skipped.


Top Quote
stonerl
Avatar
Joined: 2018-07-30, 00:03
Posts: 44
Ranking
Pry about Widelands
Location: Earth
Posted at: 2018-08-11, 16:31

@hessenfarmer

I'm curious about one thing. There are several production sites with a sleep before a conditional "return=skipped".

Barbarians:

         actions = {
            "sleep=20000",
            "return=skipped unless economy needs barbarians_bread",
            "consume=water:3 wheat:3",
            "animate=working 20000",
            "produce=barbarians_bread",
            "animate=working 20000",
            "produce=barbarians_bread"
         }

Shouldn't these also be between return=skipped and consume? As we did with taverns?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 341
Ranking
Tribe Member
Location: Bavaria
Posted at: 2018-08-11, 18:43

Probably yes. Depends a little bit on the outcome of the solution for the 10 seconds problem


Top Quote