Topic: AI roads rework
Tibor Topic Opener |
Posted at: 2019-06-05, 09:34
Exactly - dead end is a flag with one road and no building attached... EDIT: However, AI can decide that one of the roads is not needed that much and dismantle it. Especially if there are no wares on flags... Edited: 2019-06-05, 09:37
Top Quote |
hessenfarmer |
Posted at: 2019-06-05, 09:55
That would be a problem currently unmanageable for the AI. AI is currently able to escape the starting island on crossing the horizon in only 60 to 70 % of trials. It simply wastes to many spots with roads but this should be better with your latest fix. I'll give it a try next week. Perhaps you could merge trunk and trigger a merge request to get me some appveyor builds. (compiling lasts about 80 mins on my old machine) Top Quote |
Tibor Topic Opener |
Posted at: 2019-06-05, 10:56
ok, I will clean the code a bit and place formal merge request... Top Quote |
hessenfarmer |
Posted at: 2019-06-05, 11:27
Thanks a lot. I will not be able to test until Tuesday due to a short holiday so take your time. Top Quote |
king_of_nowhere |
Posted at: 2019-06-06, 20:04
not necessarily. Some of those things could be implemented without much hassle and without being a problem. For example, major areas that should be linked by highways. Marking that would simply ensure that the AI tries to keep a straight road without long segments between two such areas. Doesn't make it any more predictable, and the AI can work without that anyway. But I agree it's probably not worth it.
that's just a very rare situation. of course we can't make AI fit for each one of those. a human would have trouble adapting to some without knowing the map in advance. If the algorithm is coded to save build spaces, and it's not a big hassle to estimate the amount of buildable space on the map, then changing the algorithm so that it adapts the rreciprocal value of straighter roads against conserviing build spaces depending on map size would be a good idea. Only problem I can think with that is that such a value would need to be codifed for the map. I recall the AI does not save any kind of information, and it would greatly slow the game if the AI had to recalculate the factor every time it makes a road. So the AI should be able to calculate the factor once, store it and keep using it for later. Top Quote |
Tibor Topic Opener |
Posted at: 2019-06-07, 08:57
These are multiple approaches to building roads:
The last one is most complicated, but the third option an be actually quite ease to implement, the AI would add some bad bonus for every turn of a possible road - when possible roads are scored. But at the end I am not sure if it would be worth the effort... how big the difference would be. It would not guarantee straight roads, but only increase the chance for them.... Top Quote |
Tibor Topic Opener |
Posted at: 2019-06-15, 16:09
There should be builds available now in https://code.launchpad.net/~widelands-dev/widelands/ai_flag_warehouse_distance/+merge/368544 Top Quote |
hessenfarmer |
Posted at: 2019-07-07, 13:14
I did some compare testing on the maps I normally watch AI games on. (I do this to recognize areas for improvement in the AI) I believe this change is an improvement over current trunk, so I would like to see it going in. Of course it is not perfect but I think a policy of going small steps is better then aiming for a perfect solution which is not achievable probably. Top Quote |