Latest Posts

Topic: main roads becoming normal again

GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-05-30, 14:48

I'm not at my development machine before August, so somebody else will have to continue updating this branch. If you can give me your Launchpad account, I can add you to widelands-dev so that you can pull and push to the existing branch.


Busy indexing nil values

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-30, 15:15

GunChleoc wrote:

If you can give me your Launchpad account, I can add you to widelands-dev so that you can pull and push to the existing branch.

What account? You mean the name "ypopezios"?


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-05-31, 10:54

Yep, found you and added you. You can now push and pull branches to widelands-dev, just don't push anything to trunk.


Busy indexing nil values

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-06-01, 01:36

ypopezios wrote:

WorldSavior wrote:

Actually Tibor is already improving the AI.

Despite Tibor's hard efforts, the weak AI remains one of the biggest weaknesses of Widelands.

That's true. Maybe a new starting condition which is more powerful than the trading outpost could help a little bit.

WorldSavior wrote:

So the "shortcomings of Widelands which make it hard to improve the AI" are not in the gameplay, but only in the code?

The shortcomings are primarily in the models used in the code.

Ok

WorldSavior wrote:

I know just one shortcoming: Soldiers are able to conquer hostile military buildings, while it would be better if they could only destroy them...

And would it really not be an improvement to teach the AI the mentioned road system? It's much better on perfect building ground than the stuff which is the AI doing there right now.

Seems that you mentioned two shortcomings here. I could fill a whole page of shortcomings myself. But don't even ask about it, cause I won't do it. If the AI ever reaches a decent level, then it would make sense to make a list of remaining shortcomings for future improvements.

I think that's only one shortcoming of the gameplay.

WorldSavior wrote:

No, they are not boring, but amazing. Suboptimal building grounds are annoying. Furthermore one can invent road systems for them as well, and road systems of perfect building ground can also be used at suboptimal ground as well - to a certain degree.

It is great that Widelands provides something which you find amazing. That's one of the advantages of its open-ended design. It is not in my own interests though. Fortunately, Widelands supports maps of amazing variety (or annoyance if you prefer). And those are the ones where the AI fails the most.

But maybe the AI doesn't have to play well on any weird map...

WorldSavior wrote:

ypopezios wrote:

Teaching the AI with predefined patterns (like openings in chess) is not intelligent at all (try changing chessboard's shape or starting positions of pieces and most chess-bots will make dumb moves), so I won't go that direction.

What would be better?

Obviously to teach the AI how to make the most out of whatever is available to it at any given time, similarly to what intelligent humans do.

And obviously the AI wouldn't make the most of perfect buildable space if it would use a clever road system there? face-wink.png

WorldSavior wrote:

You could just open it...

Really? I don't know how I missed that... Until I do, let's try keeping current thread on topic please.

Maybe you missed it because of the same reasons which let you think that non-obvious things are obvious face-wink.png


Wanted to save the world, then I got widetracked

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-06-01, 13:07

WorldSavior wrote:

And obviously the AI wouldn't make the most of perfect buildable space if it would use a clever road system there? face-wink.png

An AI that makes the most of imperfect space wouldn't have problems with a perfect one. While an AI that can build well only on perfect space isn't a smart AI.

But maybe the AI doesn't have to play well on any weird map...

The AI doesn't have to always play well, but it has to always play decently. Failing to build a working economy is embarrassing and can ruin a game that lasted for hours.

Maybe you missed it because of the same reasons which let you think that non-obvious things are obvious face-wink.png

I use the same brain in every situation. But maybe that's not obvious either... Obviousness is subjective, enlightenment is not.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2018-06-01, 20:43

I just tried for three days now to understand the road building algorithm of the AI but didn't manage to do so. If somebody can explain this to me I would be very happy to participate in the discussion for a better road building algorithm.

I realized we have some A* algorithm for routing wares and solfiers and workers. But I am not sure if there is something similar in the AI road building. For me it would be an improvement if AI would build shorter roads to connect to the economy. So I would propose after having chosen to build a building to find the nearest flag (in terms of walkable nodes) connected to the HQ economy. Perhaps a dijkstra algorithm could help here. However as long as I don't understand the current algorithm there is no chance to go any further.


Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-06-01, 23:22

@hessenfarmer

We are not in that discussion yet, at least not me and not on this thread. My position has been that we have to firstly improve the underlying mechanisms (including routing), and then improve the AI on the resulting friendlier basis. So I haven't bothered understanding current AI algorithm, but it is obviously a trial-and-error variation (i.e. not planning ahead). Thus there is plenty of room for improvements, but it would be a pain to work with current material. Therefore, I'm focusing on the material for now, and more specifically on making flags smarter.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-06-02, 19:57

As for roading, there are two basic actions AI does, see comments above the two funtions:

Yes, the system is trial-error, or I would prefer "dynamic" and it is expected that road network will "settle down" eventually.

Also road network should react to two things:

* number of available buildable fields
* traffic on particular road

It is bit complex so you will have to rewrite it from scratch, but it is very interesting job, I enjoyed it face-smile.png

I can be more specific if you have specific questions


Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-06-05, 04:40

I applied the suggested fix. Idle promoted roads now get scheduled for demotion after the right amount of time. In the end, there was no need for periodical charges of the wallets, so the implementation is very light on the CPU. I tested it locally and it works. Windows version will have to wait for AppVeyor's recovery from latest break.

EDIT: Windows version now available here. Also tested and working.

Edited: 2018-06-06, 02:52

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-06-09, 13:44

ypopezios wrote:

WorldSavior wrote:

And obviously the AI wouldn't make the most of perfect buildable space if it would use a clever road system there? face-wink.png

An AI that makes the most of imperfect space wouldn't have problems with a perfect one. While an AI that can build well only on perfect space isn't a smart AI.

If you think so...

Well, making the most of imperfect space is probably much more difficult than making the most of perfect space. It would be interesting if an AI with a general optimal road system would use a known road system for perfect building ground automatically...

Maybe you missed it because of the same reasons which let you think that non-obvious things are obvious face-wink.png

I use the same brain in every situation. But maybe that's not obvious either... Obviousness is subjective, enlightenment is not.

You consider yourself as illuminated? face-wink.png


Wanted to save the world, then I got widetracked

Top Quote