Latest Posts

Topic: main roads becoming normal again

king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2018-04-25, 18:02

ypopezios wrote:

Have you realized what is wrong with the old algorithm? Or are we talking here about fuzzy improvements which are beyond perception?

what is wrong there is what I was criticizing the first time I saw your proposal: a road is penalized for being efficient. If I remember the specifics, it gains 10 points whenever a ware at its flag has to wait, and it loses 1 point whenever it is carried immediately. So the aforementioned road with a ware every 6.5 seconds gets promoted, but once it has a donkey it will get demoted eventually anyway, giving rise to a small - and annoying - traffic jam before it's promoted again.

Since then, the numbers were probably tweaked a bit, because I haven't noticed it happening much again. Oh, it still does, but very rarely. Even in my recent nile play, where roads were my main limitation, I did not see any problem connected with road promotions. With limited traffic, yes. WIth the code mindlessly routing wares through chokepoints when it had other routes, yes. but not with roads getting demoted.

So, we are talking about fuzzy improvements beyond perception. To be fair, it was fuzzy even when I raised the question in the first place, three years ago; It was more annoying visually than anything else. It caused a temporary drop of efficiency in particular circumstances, but those were rare enough, and the drop short enough, that it didn't impact game significantly. And it was improved since then.

Could things be improved? certainly, but not in a way that would impact much the game play.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-04-25, 21:02

ypopezios wrote:

Tibor wrote:

In fact I dont care about this algorithm change, but there are guys who understand it and discuss it.

Where are those guys and those discussions? Why not on this thread? Or are they waiting to see the final thing before appearing?

They are discussing with you all the time here in this thread. We have handful of extreme players - they like extreme situations and they would be first to see benefits of new algorithm. I dont think that for small maps without choke points there will be any relevant speed up - but can be wrong, of course

Tibor wrote:

For me it would be nice to see some overall number confirming that the fix improves situation, but if not - I will not oppose the merging if all other will be satisfied..

I could provide you with number confirmation, as long as you give me your definition of what consists improvement in this case. Cause since you don't care about this algorithm, I suspect that you don't fully understand the involved improvements.

That is life. Most people are interested only in results, not underlying algorithm now matter how great it can be... But it is true, the metric is a problem....

Tibor wrote:

Also input queues on productionsites works as buffers against traffic slowness, so this also must be considered when evaluating the speed up from the fix...

I'm not sure if this affects the algorithm. Unless a full buffer didn't stop requests, it is kind of irrelevant to traffic, cause nothing is routed there anymore.

I mean if you have a buiding with input queue of 6 and two scenarios:

  • slow algorithm: 2 ware on stock and 4 being transported to site
  • fast algorithm: 4 ware on stock and 2 being transported to site

...the result is that site is working on 100% capacity in both cases and efect of speed up is zero...


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-04-25, 21:03

@ypopezios

Ok, I tested your changes to code - again no promotions within 2 hours. The code was pushed to launchpad as usual..

Edited: 2018-04-25, 21:03

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2654
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-04-25, 21:22

Have a Look at the unit of gametime. I am afraid it is ms Which Means You loose 1000 coins instead of 1


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2654
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-04-25, 21:22

Have a Look at the unit of gametime. I am afraid it is ms Which Means You loose 1000 coins instead of 1


Top Quote
ypopezios
Avatar
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-04-25, 21:25

Tibor wrote:

Ok, I tested your changes to code - again no promotions within 2 hours. The code was pushed to launchpad as usual..

So the code isn't working yet, it simply compiles. Could you make a few prints of the following, in a readable way?

wallet_, carriers_count, gametime, last_wallet_check_, flags_[flagid]->current_wares(), path_.get_nsteps()

Top Quote
ypopezios
Avatar
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-04-25, 21:58

king_of_nowhere wrote:

So, we are talking about fuzzy improvements beyond perception.

Consider two non-promoted roads A and B. Starting from zero busyness, road A gets a traffic of 16 wares/minute, while road B gets a traffic of 32 wares/minute. Do you bother that the old algorithm treats them about the same (granting them 10 busyness per ware), just because they both have more traffic than 8 wares/minute? Would you consider a fuzzy improvement the fact that the new algorithm would promote road B much faster than road A? Would you perceive the difference of a road getting promoted considerably earlier, and its wares served much sooner in the end? The questions are not personal. They are just a simple example of how the two algorithms differ in their performance. I guess some people won't get it until they see it live. Some maybe not even then. For the rest of us (whether majority or minority), some of the improvements are already obvious.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-04-26, 06:47

hessenfarmer wrote:

Have a Look at the unit of gametime. I am afraid it is ms Which Means You loose 1000 coins instead of 1

You are probably right. I can change it in the code....

@ypopezios: What do you think?


Top Quote
ypopezios
Avatar
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-04-26, 10:33

Tibor wrote:

hessenfarmer wrote:

Have a Look at the unit of gametime. I am afraid it is ms Which Means You loose 1000 coins instead of 1

You are probably right. I can change it in the code....

@ypopezios: What do you think?

I think the same thing which I've been thinking for a while now: We need a few prints. Those would immediately reveal what's going on with the coins. If hessenfarmer's mention is correct, then the needed change would be as simple as adding a division to the maintenance formula like this:

wallet_ -= carriers_count * (gametime - last_wallet_check_) / 1000;
Edited: 2018-04-26, 10:37

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-04-26, 11:33

ypopezios wrote:

Tibor wrote:

hessenfarmer wrote:

Have a Look at the unit of gametime. I am afraid it is ms Which Means You loose 1000 coins instead of 1

You are probably right. I can change it in the code....

@ypopezios: What do you think?

I think the same thing which I've been thinking for a while now: We need a few prints. Those would immediately reveal what's going on with the coins. If hessenfarmer's mention is correct, then the needed change would be as simple as adding a division to the maintenance formula like this: ~~~~ wallet_ -= carriers_count * (gametime - last_wallet_check_) / 1000; ~~~~

I will provide printfs tonight


Top Quote