Jump to content

new Ai bot: Petra


Recommended Posts

Link to commands.txt:

https://drive.google.com/file/d/0B4ijp-kf8RV0aTZOMDBOSDg3MWM/edit?usp=sharing

I was playing against two petra bots and they stopped fighting after I destroyed their expansion.

This happened two weeks ago. I was playing using the unstable build:

http://play0ad.com/download/linux/#Ubuntu

What versión SVN or Release ?
Link to comment
Share on other sites

What versión SVN or Release ?

I was using the unstable version from the instructions on this page: http://play0ad.com/download/linux/#Ubuntu

Here is a quote from the web page:

Unstable version: You can try a more up-to-date but less-well-tested version from our development snapshot PPA, which should be updated each week. Follow the instructions above but use the ppa:wfg/0ad.dev repository name.

Correction: this did not happen two weeks ago, happened last week, game started July 13. Version info: Build: Jul 12, 2014 (15513-development)

Link to comment
Share on other sites

I was playing against two petra bots and they stopped fighting after I destroyed their expansion.

This happened two weeks ago. I was playing using the unstable build:

http://play0ad.com/download/linux/#Ubuntu

Really ? from your commands.txt, you've been defeated and have no more units. So I guess to stop fighting is the expected behaviour for the AI ;)

Link to comment
Share on other sites

Really ? from your commands.txt, you've been defeated and have no more units. So I guess to stop fighting is the expected behaviour for the AI ;)

Odd, I've never been in a scenario where I have no more units. Is it easy to determine that from the commands.txt file? Or you have to run through the simulation to figure it out? Does the commands.txt you looked at start with this?

start {"settings":{"PlayerData":[{"Name":"Ptolemy Eurgetes","AI":"petra","AIDiff":2,"Civ":"ptol","Team":1},{"Name":"Player 2","AI":"","AIDiff":2,"Civ":"rome","Team":0},{"Name":"Acharya Bhadrabahu","AI":"petra","AIDiff":2,"Civ":"maur","Team":1}],

Notice that I'm not the first player. The first player is petra.

If I look at commands.txt the last command was building a tower by me, with many units.

cmd 2 {"type":"construct","template":"structures/rome_defense_tower","x":432.3590393066406,"z":604.5962524414062,"angle":2.356194490192345,"actorSeed":50244,"entities":[16711,16402,16373,16367,16359,16204,16157,16156,15591,15430,15395,15776,16360,16161,16051],"autorepair":true,"autocontinue":true,"queued":false}

Hard to fathom how I can do that and all my units die quickly later. I had close to 300 units at the time.

Edited by DanCar
Link to comment
Share on other sites

mimo,

I played several times with Petra (build 15148P-release) in "Very Hard" mode with pop limit 150 and saw the same perfomance problem :

The first time I attack the AI with some decent army (e.g. entering its territory and starting attacking its structures) I see a dramatic decrease in performance, which remains even after the attack.

My impression is that it is related to the Petra AI.

The command.txt is attached. You should see the performance problems appearing around turn 19000 :

post-15707-0-02291500-1405969295_thumb.p

BTW, thx for your work on the AI. It is way better now.

commands.txt

Edited by meap
Link to comment
Share on other sites

Hi meap, r15148 is really old for petra: huge parts of the code have changed, some of them giving performance improvments. So I would really advice you to switch to svn. In addition, I'd be really interested to see if you still have the same problems on svn: I've not yet monitored the performance, but my feeling from playing is that it's reasonnable when petra is being attacked. The main slowdown is when petra attacks (certainly connected to pathFinder).

I don't plan to look seriously at these performance issues before A17 is released (still lots of basic functionalities to be implemented and misbehaviours to fix). But you can nonetheless submit a ticket on trac, may-be that will motivate somebody to look at it.

Link to comment
Share on other sites

Hi meap, r15148 is really old for petra: huge parts of the code have changed, some of them giving performance improvments. So I would really advice you to switch to svn. In addition, I'd be really interested to see if you still have the same problems on svn: I've not yet monitored the performance, but my feeling from playing is that it's reasonnable when petra is being attacked. The main slowdown is when petra attacks (certainly connected to pathFinder).

I switched to svn and confirm the problem seems to be solved :thumbsup: (same game, same parameters). The only performance slowdown I noticed was indeed under a heavy attack from the AI, but it is now completely playable.

Thx !

Link to comment
Share on other sites

  • 4 months later...

I get this with latest AI (I have mod delenda est installed):

WARNING: PlayerID 1 | Petra baseManager 1 problem with accessIndex 2 while metadata access is undefined

It's possible I have changed a template in some way to hurt the AI's performance. What could this change be?

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

Trying to run your mod, it seems that you have changed the way the default skirmish entities are replaced by the specific civ ones. This is now done after petra has been initialised, while it was done (and is better to be done) before. That's supported by the fact that your problem happens only with skirmishes maps.

Link to comment
Share on other sites

Trying to run your mod, it seems that you have changed the way the default skirmish entities are replaced by the specific civ ones. This is now done after petra has been initialised, while it was done (and is better to be done) before. That's supported by the fact that your problem happens only with skirmishes maps.

I don't remember changing anything like that though. So, I am confuse. I have not (consciously) changed when skirmisher units are initialised.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

Strange because your skirmisher replacement happen later than in vanilla game.

But anyway, as it may be a useful feature to have, I've just commited a fix in http://trac.wildfiregames.com/changeset/16029

Thanks. That did the trick. Not sure what happened either. I did not pewrsonally or intentionally change the order of initialisation.

Link to comment
Share on other sites

But why do you have a full (and old) copy of the simulation/helpers directory in your mod ? The version of InitGame.js there is quite old and certainly not fully compatible with svn. That is looking for troubles :wink2:

Same for simulation/data/cheats, simulation/ai, simulation/templates/{campaigns,formation,other,rubble,skirmish,special,special_units} and a lot of files in simulation/templates/ that just provide a base for generic stuff and not anything balancing related (mostly).

There are also lots of files that aren't changed from svn but copied over for no reason. Copying/changing them when needed would make that more maintainable. I'd advise you to take care audio/music/ and some of the icon files which are clearly infringing copyright.

Link to comment
Share on other sites

Same for simulation/data/cheats, simulation/ai, simulation/templates/{campaigns,formation,other,rubble,skirmish,special,special_units} and a lot of files in simulation/templates/ that just provide a base for generic stuff and not anything balancing related (mostly).

There are also lots of files that aren't changed from svn but copied over for no reason. Copying/changing them when needed would make that more maintainable.

The repository is a working one. The mod is at version 0.0.1 after all.

I'd advise you to take care audio/music/ and some of the icon files which are clearly infringing copyright.

Noted. Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

  • 6 months later...

Hi,

I am new to AI programming. Found 0 AD a good fit for my undergrad class project. Downloaded the latest code files from: http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/ai/petra

and placed them in C:\0 A.D\binaries\data\mods\public\simulation\ai. When running the game, I get the following errors (plz see attachment). Is there something that I am doing incorrectly for the setup?

Is there a simpler version of AI that I can develop based on (other than common-API)?

Thanks for your help.

post-20078-0-07820700-1436490855_thumb.p

Link to comment
Share on other sites

Thanks! I have Alpha 18 - Build Mar 3, 2015 (16404) - it seems to be upgraded to "Empires Ascendant". Shall I download a newer version? The latest I can find online seems to be Alpha 18...

I have tried qBot but that did not work either (I think because of the new API).
Thanks for your time!
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...