Latest Posts

Topic: Artificial artificial intelligence. ;)

hulagutten

Topic Opener
Joined: 2009-07-19, 21:34
Posts: 56
Ranking
Likes to be here
Posted at: 2010-05-02, 10:24

I have an idea. What if we did something radically different with regards to the AI. If we made challenges like the one here (http://wl.widelands.org/forum/topic/439/) on all maps, we could use this towards the AI. This means that the AI will pick one out of the 10 best strategies in the beginning of a game. It will, then basically do the exact same things as the human did (basically replay the game). Once the AI sees an enemy military building, it will switch to a normal AI (like the one today). At this stage, there should be a really good infrastructure, which should make it really challenging to beat the AI.

If I submitted replays, is there anyone competent enough to make it into an AI?

Edited: 2010-05-02, 10:26

Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-05-02, 13:25

I have to say, this feels a lot like cheating in the implementation of the AI face-wink.png

Also, you cannot actually always build at the exact same places, because rangers place trees at random locations, and so you might - in one run of the game - get a tree somewhere you would like to build a building. The idea of letting the AI learn from players' replays is definitely an interesting one, but just dropping them in is problematic and feels wrong.


Top Quote
hulagutten

Topic Opener
Joined: 2009-07-19, 21:34
Posts: 56
Ranking
Likes to be here
Posted at: 2010-05-02, 16:53

It is not cheating. it is just an artificial AI. face-wink.png

The question is: How long time do you expect it to take before a challenging AI is up and running? 6 months? 12 months? 5 years? I believe that it is so challenging to create an AI that it will take forever. I have seen a really good AI OS projects before. The reason for this is that developers come and go. Digging into the AI code of another developer is so difficult, that it might never be challenging at all.

My solution is something that can be done in the meantime. It could be up and running in a matter of days, after that it is a matter of feeding the AI with replays. To get something up and running, I suggest making a seeded random number when it comes to foresters (they will be placed the same place as in the replay), this could be replaced later with an AI that will place the same buildings as in the replay as closely to the spot in the replay as possible.

I believe that the point for Widelands now is to get as many people as possible to play it. A proper AI would make this possible. Also people would feel that they had another way of contributing, which is good for the community.


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2010-05-03, 20:18

It would just be very special to a very special map. Making an AI that is challenging is rather impossible. Just play games like Starcraft (or Starcraft II for that matter): The AI is very polished, but it is not hard to beat it. The scenarios are as difficult as the starting conditions of the AI. Our AI is in a comparable state atm, just not as polished and not as founded probably.


Top Quote
hulagutten

Topic Opener
Joined: 2009-07-19, 21:34
Posts: 56
Ranking
Likes to be here
Posted at: 2010-05-04, 20:05

This AI would certainly be challenging. It would not have to be adapted for each map, apart from the replays that are used as input. I do not understand how the starting positions are difficult. They are the same every time.

There is as such nothing wrong with the current AI, the Artificial AI would just be more challenging. We would still keep the old one as an option.

How difficult would it be to implement this? Could the existing replay funtionality be reused?


Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-05-04, 20:36

The existing replay functionality could be involved somehow, but it would probably be better to preprocess the replays once and extract an instruction stream from there. After all, we do not guarantee replay compatibility, and it would be a bit sad to have to throw out all this data when something changes to break replay compatibility.


Top Quote
hulagutten

Topic Opener
Joined: 2009-07-19, 21:34
Posts: 56
Ranking
Likes to be here
Posted at: 2010-05-04, 20:45

I guess the data that needs to be extracted is the position, types of buildings and time of building, and the paths of the roads. This should be compatible. I suggest csv format so one could make basic modifications (search & replace) in emergencies. It would be a pleasure to me to post such replays. Even if the rules changed.

It would be cool if this preprocessing could be done on the client, so one could play against oneself just from a different starting position.


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2010-05-04, 20:56

Actually that could be possible right now: extract the build commands from the replay, write a lua file that replays those commands. I don't know anything about the replay format, but creating a replaying lua script would be a piece of cake.


Top Quote
hulagutten

Topic Opener
Joined: 2009-07-19, 21:34
Posts: 56
Ranking
Likes to be here
Posted at: 2010-05-04, 21:41

That would clearly be the best solution, to have it all in Lua. In the future, one could put some basic "real" artificial intelligence into the Lua scripts. Meaning that it could react differently based on whether the opponent is aggressive or defensive. If the opponent is determined to be defensive, then it becomes important to build training facilities to train your soldiers. If aggressive, then I believe in having hordes of untrained soldiers.

I believe it is time to put some challenges up on the front page. One challenge per week, for example. The best 10 times are asked to submit their replays. We can preprocess them into Lua scripts once this functionality is up and running.

It is important that the players do not submit their replays before be best times have been determined as their strategies will be different, then, which means that the AAI will be more interesting to play against

Edited: 2010-05-04, 22:46

Top Quote
hulagutten

Topic Opener
Joined: 2009-07-19, 21:34
Posts: 56
Ranking
Likes to be here
Posted at: 2010-05-07, 10:39

Who has info on the replay format?


Top Quote