Topic: Decongestion algorithm
LienRag![]() Topic Opener |
Posted at: 2024-07-25, 18:02
Hi Widelands;. I understand that avoiding Congestion is a skill and requires careful planning, but the way congestion works now is way too punishing imho, especially for non-hardcore players. Especially, Congestion where all the carriers go in the same direction is harsh but manageable, it just delays the transportation of wares by the bottleneck it produces, but the wares get where they need to be, it just takes way more time. But Congestion where carriers try to transport wares in both direction sometimes lead to a complete breakdown of the economy, with no easy way to solve : the carrier who's supposed to take away the ware is prevented from depositing his own ware, so the flag doesn't allow for ANY transportation at all. It also brings paradoxical behaviors : I had bakeries with water in front of them, but not producing anything because water was missing, and as such not serving as the sink for water and flour that they were supposed to be. I also had buildings not completing (and so not functioning as a sink for building materials and input wares) even though the building material was in front of them. So, my suggestion is to have a very simple decongestion algorithm, which should be easy to implement : when a flag is full, the building which are in front of it check if they need an item that is on the flag, and if they do then they take it whatever destination the ware was initially supposed to go. A similar algorithm could be proposed as an option for Warehouses, aside the existing ones "normal, don't accept wares, remove wares, fetch wares" : decongestion ware. It makes careful planning a little less mandatory, but not that much (you still need to plan for the right warehouses on the right spots) so imho it is quite balanced. ![]() ![]() |
kaputtnik![]() |
Posted at: 2024-07-25, 19:02
Take a look at my-roads-are-congested-with-too-many-wares While i understand that new players might get congestion on the roads, i think it is a thing one has to learn. Formerly, especially on some specific maps, i had this problem also. But in the meantime i never get into such situations. Ok, never say never widelands is a game where you have to mange your economy, and roads are a fundamental thing in the economy of widelands. If we change this widelands will not be widelands anymore, imho. Fight simulator for Widelands: ![]() ![]() |
LienRag![]() Topic Opener |
Posted at: 2024-07-25, 21:04
Yes, this is precisely what I said in my first phrase (well, technically the second, the first being "hello widelands"). I'm not sure that my proposal would entirely remove the necessity to manage one's economy, though - it will just make it less punishing and easier to correct. "Managing your economy" != "having everything break down in a spiral of doom if you make one mistake" and is imho more fun in the "if you make mistakes your economy gets slower", which my proposal keeps. ![]() ![]() |
hessenfarmer![]() |
Posted at: 2024-07-26, 07:42
well, ![]() ![]() |
kaputtnik![]() |
Posted at: 2024-07-26, 14:39
As i said one can solve congested roads: Build more roads as alternative routes. Beside building new roads a warehouse should have roads which bypasses the warehouses flag. So wares which doesn't go to the warehouse will not clogging the warehouses flag. As a last resort one can also remove flags with lots of wares and build a new road, or better roads. But keep in mind that destroying a flag that holds a lot of wares, the wares will be lost. If possible you could also use double-roads, like in the screenshot. Fight simulator for Widelands: ![]() ![]() |
LienRag![]() Topic Opener |
Posted at: 2024-07-26, 15:01
Thanks for the explanations. What I mean is that it could be a simple override, like what happens (I guess) when a flag is destroyed. And wares put back on the flag (for decongestion of Warehouses) could be treated as new wares, I also guess. It's true that I don't know your codebase, but from what I understand the changes should be limited (by reusing existing mechanisms, as mentioned above). Of course cancellation of requests would be more frequent with a decongestion algorithm than with flag destruction (as I guess that most players don't usually destroy flags with wares), so the impact on the processing resources needed may be a problem. ![]() ![]() |
mxb2001![]() |
Posted at: 2024-07-27, 00:30
Just don't destroy the flag in front of your buildings (such as was the case Lien had) as that would be rather more costly. : ) Depends on the building though. Some are pretty damn cheap. Bakeries could be torched and rebuilt I guess... -- ![]() ![]() |
teppo |
Posted at: 2024-07-27, 12:22
Presently, wares are carried to buildings by the same person who brings it to flag. If a ware needed by building is sitting on the flag, then the ware was probably not intended to that building at all. Or at least it was so previously. With source code available, it might be possible to change the behavior so that the worker picks his stuff from flag, instead of deliver to door. Some things that could happen when the flag is stuck:
Making these in a cpu-efficient way might be a challenge. ![]() ![]() |