Jump to content

Modifying AI


Recommended Posts

Hi, community

How do I go about understanding the AI code?

I was hoping I could implement some logic and prediction for the AI without delving too deep in the GUI code.

It would be nice if somehow I could get the information learned as the game progresses and inject commands in response to that, like from a black box, then I might be able to focus on the logic.

Thanks

  • Like 1
Link to comment
Share on other sites

Hello Sarcoma, if you haven't already I'd suggest you look at http://trac.wildfiregames.com/wiki/GettingStarted aswell as the programmer section on that website. You will need to get the source to be up to date with the development version, if you want to contribute to it.

AI is in JavaScript, which means you don't have to recompile the game each time you change something.  You can find the code in binaries/data/mods/public/simulation

To reproduce a game we use commands.txt which are text replay files. but I don't think that's how the AI works. Unfortunately @mimo our lead AI developper has taken a break for the game and will (might ?) not be able to answer your questions. If you need general guidance, I'd suggest you to drop by IRC on the #0ad-dev channel, you should find someone that might give you clue on how to do it.

Might I ask what do you want to achieve ?

  • Like 3
Link to comment
Share on other sites

Hi, Stanislas

I had a look at

http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/ai

I was wondering if it were posible to create an inference engine and use Q-learning to command the AI to make better decisions but I would need a way to get stimuli from the ongoing game.

Or maybe if the commands.txt is parsable to extract the actions people normally do, I could use that to create blind build orders.

I found http://yieldprolog.sourceforge.net/ hoping to translate prolog into js.

Thanks

Link to comment
Share on other sites

If you look at the replay code in the source folder you will find how we parse it to replay games, we basically execute player commands one by one to replay the exact same thing, So I guess learning from that is doable, though it will require some data extracting cause it's quite raw. But that's an interesting project. Maybe you'll find more stuff here :

https://github.com/agentx-cgn/Hannibal and https://github.com/lexoyo/split-bot/blob/master/src/BotAI.hx unfortunately both dead projects AFAIK, maybe @agentx is still around to help you.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Hi, guys

I will have time to work on this in 2 weeks when I'm off of work.

I need to model the agents: units, structures, resources, etc.

Where in the code can I get the numbers of each? HP, speed, attack, armor, etc.

I couldn't find that info in

http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/templates

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...