Topic: main roads becoming normal again
Tibor |
Posted at: 2018-05-23, 20:35
I think there are two questions:
If the aswers are YES and NO, I would vote for merging it Top Quote |
Tibor |
Posted at: 2018-05-23, 20:44
Exactly. AI but knows about buildings in vicinity (f.e. count of supporting/supported buildings, perhaps mines or space consumers) but even if it knows the number, it has no idea about actual layout (position). E.e. when placing lumberjack, how could AI cope with information, there is one ranger in SE direction - in distance 5 fields and another one WWN - 6 fields away? So it now only knows: there are 2 rangers in vicinity up to 6 fields and 12 trees in vicinity up to 6 fields. Again - it has no sense of actual layout. Top Quote |
hessenfarmer |
Posted at: 2018-05-23, 21:34
which branch do you refer to?
that doesn't prevent any future improvements my thoughts were more generally spoken Top Quote |
ypopezios |
Posted at: 2018-05-24, 01:21
Fear is a bad adviser. Current AI failures are not because of complexity, but because Widelands was developed without AI in mind (kind like AI was a luxury to have). I guess that was a choice of coding complexity at the time, not an effort to achieve a specific complexity-level for the human players. In any case, if for any reason the process of improving AI-friendliness affects game's complexity, adjusting it is much much easier than improving the AI. And I have zero hope that anyone will ever bother improving the AI as long as the material to work with is unfriendly (coding C++ is already unfriendly enough).
I have to save that for another thread.
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. Moreover, Widelands is a strategy game, not a tycoon, thus perfect building grounds are rare (as well as boring). Top Quote |
ypopezios |
Posted at: 2018-05-24, 02:19
That's an easy one. The implementation of the new algorithm in the presented branch is an improvement in every single scenario. Not because it is particularly smart (it isn't, it just uses a better model), but because the old algorithm is particularly inefficient. However, the change which broke compilation is certainly a step back.
Generally, he is. But those will need more familiarity with the codebase and may take some time to reach there, during which he'll probably focus on other issues.
Apart from the setback mentioned earlier, I have already voted for merging (therefore, the votes so far are 2-1 for merging). And if that counts at all, merging would be quite a motivation boost (expectedly enough, not merging would have the opposite effect). To further help things, I have some news to share: After many hours of troubleshooting, I now have a dedicated virtual machine which successfully compiled Widelands a few times (that was excruciating, since Widelands' code is way more intermixed than necessary, so small changes often lead to recompilation of many files). Let's hope that it will provide some wares to Widelands' economy.
In my understanding, includes are not related to that. And messing with the code at structure level would be dangerous for my current level of involvement (I wouldn't really be fully aware of the consequences of such changes). I don't think that it's a big deal to go back to separate constants and leave a comment for future unification (like in revision 8683). After all, the old algorithm used plain numbers instead. Let's make a favour to the codebase and free it from some old and dirty code. Top Quote |
Tibor |
Posted at: 2018-05-24, 07:34
I am glad to hear that now you can compile the game by yourselves. What I dont agree with is opinion that the engine of game itself is some complication for writing the AI. Also C++ is not that bad, because performance matters here. But what would help is multithreading in the game, f.e. make AI's parallel. Top Quote |
ypopezios |
Posted at: 2018-05-24, 09:02
Adding multithreading is like adding better hardware, i.e. a mere relief to the problem, not an actual solution. Moreoever, multithreading favors functional programming, while Widelands' codebase is mostly object-oriented, and C++ is not particularly designed for multithreading. More importantly, AI is mostly high-level stuff (its DNA part is not), while C++ is mostly a low-level language. Programming the AI in C++ is like programming the graphics in Assembly. Having to think about pointers is something that some other languages' compilers can figure out, for the programmer to focus on logic. My point was that C++ repels many programmers. Like the low quality codebase repels all programmers. Likewise, current engine repels AI programmers. The first point won't change, so that part of the discussion is fruitless. The other two points have plenty of room for improvements. At the moment it seems that making routing static will boost performance more than any other improvement (but this is for another thread). However, routing is just one aspect. An overall better engine has also the potential of increasing the AI's awareness of what is going on in the empire, to take more informed decisions and do less guesswork. And a log of such decisions can provide the AI programmer with useful feedback for future improvements. Now such things are close to impossible. All in all, when I say that AI-friendliness is an issue, I'm not saying something counter-intuitive. Still we live in the beginning of AI age and most people (even programmers) don't grasp the involved concepts. Therefore, I don't expect an early agreement on my approach. I just want to assure you that this is not a mere opinion, it is a well-supported theory. Top Quote |
Tibor |
Posted at: 2018-05-24, 09:15
It this it can be viable to make AI parallel, because AI does 2 things when it "thinks":
So it makes no changes to the map by itself. AI itself does not use pointers and references extensively, so it friendly also to people who are not deeply familiar with them... As usual: deliver something and we will see and understand better what you mean Top Quote |
WorldSavior |
Posted at: 2018-05-24, 18:36
You're right
Not necessarily. The AI could also just build buildings at "correct" places and then it could link the buildings in the "correct" way...
... so this is not necessarily the case.
?
Actually Tibor is already improving the AI. So the "shortcomings of Widelands which make it hard to improve the AI" are not in the gameplay, but only in the code? I know just one shortcoming: Soldiers are able to conquer hostile military buildings, while it would be better if they could only destroy them...
You could just open it...
What would be better? 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.
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. Wanted to save the world, then I got widetracked Top Quote |
ypopezios |
Posted at: 2018-05-24, 19:35
Despite Tibor's hard efforts, the weak AI remains one of the biggest weaknesses of Widelands.
The shortcomings are primarily in the models used in the code.
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.
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.
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.
Really? I don't know how I missed that... Until I do, let's try keeping current thread on topic please. Top Quote |