Currently Online

Latest Posts

Topic: Production Time

stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-11, 00: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
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-11, 00: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, 00:47

Top Quote
stonerl
Avatar
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-11, 10: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, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-08-11, 15: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
Topic Opener
Joined: 2018-07-29, 23:03
Posts: 327
Ranking
Tribe Member
Posted at: 2018-08-11, 15: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, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-08-11, 17:43

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


Top Quote