-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ai roads getting jammed a lot #3099
Comments
(by lainluigi86) |
1 similar comment
(by lainluigi86) |
(by lainluigi86) |
(by lainluigi86) |
3 similar comments
(by lainluigi86) |
(by lainluigi86) |
(by lainluigi86) |
(by lainluigi86) |
(by lainluigi86) |
(by tiborb95) I would say, there are two primary problems: Transportation got stuck (this savegame could be used to debug and perhaps develop a fix, but this is not AI issue) Improving the road algorithm - it is difficult to make the AI more intelligent, I have to admin.... |
(by lainluigi86) |
(by tiborb95) I would prefer if flags have some timer like last_time_ware_left, and then number of wares + this information + the fact whether there is a warehouse in economy would give reliable info if the transportation is stuck.... Then AI would dismantle such road. Also this info could be used for possible 'traffic jam map', if there was an interest for this stuff. But I still believe, there stopping some production sites would generally improve the situation. But this will not be done before build 19 probably. |
(by lainluigi86) I would prefer if flags have some timer like last_time_ware_left' yeah, that's exactly what I was thinking. a timer on the flag that would activate only when the 8th ware is deposited on the flag, and would reset anytime a ware is removed. Since it is rare that flags get an 8th ware, it should not generate too much calculus. This would not be a function of AI, but a function of the program. The ai could then be thought to do something about it, while a human could receive a message. Because those circular traffic snags that I described are relatively rare, but when they form there is no other way they can be removed except cutting some roads or destroying some of the destination of those wares. |
(by tiborb95) BTW you are not right with this:
Generally it means adding one uint32_t to each flag and two small tests when ware is delivered and is leaving the flag |
(by w-aaaaa) |
(by lainluigi86) |
(by w-aaaaa) |
(by gunchleoc) |
(by w-aaaaa) |
(by gunchleoc) |
(by lainluigi86) |
(by w-aaaaa) |
(by lainluigi86) |
(by ypopezios) |
(by gunchleoc) If we have some thing like A grape -> B and B grape -> A, swapping the routing is a good idea - I don't see any potential problems here. Another thing that the AI might consider is amount in stock for wares that don't have a default target quantity. Stopping production for a bit if here is more than a certain threshold in the warehouses could help, let's say 150? That should be plenty as a stockpile. |
(by ypopezios) Concerning my proposal, yes, it would cause a ripple effect backwards, halting the excessive transportation of the ware that has the potential to choke the transportation system. In other words, blocking the problematic ware (or forcing it to choose a different route) so as the transportation system won't get blocked. Isn't this the goal? Suppose that you are a carrier working in a road. How would you handle a similar situation? Stop working? Waiting orders from the HQ? I would try to do the best of the situation, given the limited information in my knowledge. That would be to serve the wares which leave my flags and not serve those which spam my flags. |
(by gunchleoc)
I'm not saying that your proposal is wrong, I only meant that we need to think about it carefully, because it's a complex issue. If it works, great! :) |
(by ypopezios) |
(by franku) https://bazaar.launchpad.net/~widelands-dev/widelands/trunk/changes/7578?start_revid=7578 This version was between release 18 and release 19. From what i remember the new AI was implemented after releasing Build19. So it should be clarified if this bug is still valid. @tibor: Is the road system part of the genetic algorithm of AI? In other words: Is there a possibility that such a traffic jam would not appear anymore because the genetic algorithm has learned a lot in the meantime? Just before some one puts too much time on this bug... |
(by tiborb95) So yes, fixing it by ypopezios is highly welcomed |
(by ypopezios) |
(by franku) Fatal exception: [/home/kaputtnik/Quellcode/widelands-repo/congestion2/src/logic/map_objects/bob.cc:593] MO(1406): start_task_movepath(index): not on path The savegame was created with current trunk. Loading with current trunk no crash happens. I have tried to reproduce the crash with a savegasme created with the linked branch, but didn't get it. |
(by ypopezios) if (carrier.get_state(taskWaitforcapacity)) { |
(by franku) So your branch will break savegame compatibility, just mentioned it here, because it was not clear to me. |
(by gunchleoc) |
(by stephan-lutz) |
(by stephan-lutz) |
(by lainluigi86) a study showed that an insoluble traffic jam is created when flows of wares from three different directions intersect. There can be ways to prevent that by coding, for example by recognizing that all carriers around a flag are standing still. but adding carriers won't do much. Also, I hope you don't take it badly if I decline trying concentric rings again to check the fix: it toook 50 hours of gameplay to reach that point last time, and given the random nature of that kind of jams, it may not even help. |
While I do not know how to fix roads buildings by AI directly, but I think we can improve two things:
The roads are congested mainly with theirs outputs. |
I noticed while playing my latest map (concentric rings) that AI will get hopeless traffic jams over time. I'm not talking just about wares taking a long time for delivery, I'm talking those kind of jams where no ware moves anymore and the whole economy is completely stuck. Words fail in front on the images I'll attach to this post.
And I'm playing the map again, and I see it happening again, this time with another ai player and even earlier in the game. Apparently a long and relatively narrow land is bad for the ai roadmaking process.
I know teaching ai to make good roads is a near impossible task, but hopefully a fix for the worst cases should be possible. I noticed that the AI response to jammed roads is to build more roads, which rarely will help. One possible solution would be, instead of building short road segments, to build long road segments, which may help bypassing the critical section entirely. Or, the AI could have some way to realize carriers are not moving, and cut roads until they start moving again.
Imported from Launchpad using lp2gh.
The text was updated successfully, but these errors were encountered: