sarcoma Posted September 7, 2016 Report Share Posted September 7, 2016 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 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 7, 2016 Report Share Posted September 7, 2016 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 ? 3 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted September 8, 2016 Author Report Share Posted September 8, 2016 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 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 8, 2016 Report Share Posted September 8, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted September 9, 2016 Author Report Share Posted September 9, 2016 Thank you very much, Stanislas. I hope I can make something of value. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted September 9, 2016 Report Share Posted September 9, 2016 I would recommend too the Petra Bot entry of the wiki: http://trac.wildfiregames.com/wiki/PetraBot 2 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted September 10, 2016 Author Report Share Posted September 10, 2016 Thank you, fatherbushido That really helps understand the code 1 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted October 3, 2016 Author Report Share Posted October 3, 2016 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 Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 3, 2016 Report Share Posted October 3, 2016 You'll find the stats in the xml files in the folder you cited above. The (not update) doc is here: http://svn.wildfiregames.com/entity-docs/ 1 Quote Link to comment Share on other sites More sharing options...
sarcoma Posted October 6, 2016 Author Report Share Posted October 6, 2016 Thank you, fatherbushido. I can use this to search for the xml tags and get the stats. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.