Latest Posts

Topic: Congestion Competition

ypopezios
Avatar
Topic Opener
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-28, 22:29

@einstein13

I'm here because of Settlers (for its strengths and for its weaknesses). I'm afraid that I'm older than 22...

The half-full-congestion you described is interesting. Could you make an effort to produce it with less buildings? Also make clear which flags on the map are A-F?


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

ypopezios wrote:

I'm here because of Settlers (for its strengths and for its weaknesses). I'm afraid that I'm older than 22...

Me too. Main weakness for me was limit of 16-bit system, so that you had limited number of units on the map (few thousands). So I wanted to play Widelands and to have the limit bigger. Now we have it like 64-bit integer. The limit is now CPU, not number of units face-smile.png .

(half-full-congestion) Could you make an effort to produce it with less buildings?

I am sorry, but I don't want to reproduce again. I should calculate first what can be done. The only limit here is "production from both sides should be slightly above capacity of bottleneck". So if the capacity of connection B-C is (let's say) 4 units/minute, you need to produce a bit above 4 units per minute to have there a queue and congestion. Shorter roads (higher capacity) means less possible gaining congestion like that.

Also make clear which flags on the map are A-F?

Here you are:
image

Water and flour is going A-B-C-D, wheat is going D-C-B-A, trunks are going E-B-F. And the last route is congested. No possibility to pass the road.

My guess is that this type of congestion is very common with big AI empires. Also the AI is doing something like spiders' net without rings: every flag has only one possible route to get any other flag. This can cause terrible queues. I can't remember any circle congestion in my previous games with the AI.

Edited: 2018-05-28, 23:18

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

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2018-05-28, 23:30

einstein13 wrote:

My guess is that this type of congestion is very common with big AI empires. Also the AI is doing something like spiders' net without rings: every flag has only one possible route to get any other flag. This can cause terrible queues. I can't remember any circle congestion in my previous games with the AI.

It's not only a problem with AI; any empire big enough is at risk. The best way to prevent that is to make roads that bypass all points. Avoid bottlenecks and flags from which all traffic is routed. Try to have a transportation net as flexible as possible. And even then, something will occasionally go wrong locally. In a really large empire (we're talking nile challenge) congestion of roads is the limiting factor to how much you can grow.

The problem is further exacerbated with the AI because the AI doesn't have the skill to build bypasses. it will try, but it it lacks the proper terrain - say that iit blocked the path with a building or another road - it lacks the smart to dismantle and rebuild. In general, the best way is to plan in advance where you want to build, and AI can't do that.


Top Quote
ypopezios
Avatar
Topic Opener
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-29, 03:29

Here is the simplified version of the half-full congestion (explanation follows):

Widelands Logo

The base roads are normally serving high traffic between the base warehouses (i.e. plenty of wares going back and forth, plus a bottleneck in the middle). As long as this goes on, the top road remains fully congested, without hope of recovery. The reason that the flag at the crossroad serves only two roads out of the three, is that the carrier of the non-served road never finds a ware to swap in the queue of the full flag, because no ware has the HQ as its destination. I consider that to be a design problem as well and not a feature of the game. Even though it is not a full congestion, that case should get prevented as well in the coming fix.


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-05-29, 14:17

king_of_nowhere wrote:

In general, the best way is to plan in advance where you want to build, and AI can't do that.

I understand that ypopezios wants to improve that. From my point of view, dismantling and rebuilding roads is a first step. Hmmm... or maybe there are many steps where we can upgrade the AI? Tibor for sure knows lots of them face-wink.png .


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

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-05-29, 14:30

einstein13 wrote:

king_of_nowhere wrote:

In general, the best way is to plan in advance where you want to build, and AI can't do that.

I understand that ypopezios wants to improve that. From my point of view, dismantling and rebuilding roads is a first step. Hmmm... or maybe there are many steps where we can upgrade the AI? Tibor for sure knows lots of them face-wink.png .

Roading is not controlled by genetic algorithm, it is all hand-coded instead, so there is a lot of rooms for improvement. And if you build a road proactively, you can affect where AI will place buildings, of course...

Edited: 2018-05-29, 14:31

Top Quote
ypopezios
Avatar
Topic Opener
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-29, 14:32

@einstein13

For me improving the AI has to wait. For now I only plan to make flags smarter, so as to prevent congestion. Inefficient road-configurations should simply serve wares slower, not stop serving whole roads.


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2018-05-29, 15:47

What do you think about wares importance algorithm? As I remember, that was in Settlers II and III. So carrier/flag will decide which ware is more important to transport. This is on the wishlist on launchpad for a long time.


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

Top Quote
ypopezios
Avatar
Topic Opener
Joined: 2018-04-19, 23:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-29, 16:54

@einstein13

I have importance/preciousness on my radar (and I have thought of an algorithm better than Settlers' one). But I consider that issue as separate from congestion, cause avoiding congestion has higher priority.


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2018-05-29, 22:18

I have an idea that could fix those worst cases with little impact: train flags to not accept more than 3-6 wares going in the same direction. that way, even though traffic in one direction is congested, there will be some space on the flag for wares going different directions. All the cases here mentioned should be fixed by that change.

Regular traffic would make longer queues on more flags, but it would not affect the amount of transported wares per time, nor would it block other flags, so it should not create any problem.

That would however require a bit of reworking on the numbers for road upgrade, since there will be less wares queueing and increasing a road value. It's only going to be a small fix, though.


Top Quote