Jump to content

new Ai bot: Petra


Recommended Posts

I've commited in svn a new ai bot (Petra) which was developped starting from Aegis, but heavily modifying it with the goal to be more robust according to external conditions.This is only a first version, so still very WIP. Nonetheless, any tests and constructive comments are welcome.

  • Like 3
Link to comment
Share on other sites

A couple of questions:

1) do you plan to replace the time based events (phase advance, attack, ...) with events based on the current game status?

2) is Petra eventually intended to replace Aegis (as previously done with qbot) or is supposed to be kept as an alternative AI?

Link to comment
Share on other sites

@MIMO: Today, I tested the new AI (Petra) you publish, there are some warnings:

<h2>0 A.D. Main log (warnings and errors only)</h2><p class="warning">WARNING:  target 4090 needs repair 45.290505434243755 max 100</p><p class="warning">WARNING:  target 3639 needs repair 65.35065344168771 max 100</p>...<p class="warning">WARNING:  plan health_regen_units invalid and suppressed</p><p class="warning">WARNING:  plan health_regen_units invalid and suppressed</p>...<p class="warning">WARNING:  target 5103 needs repair 96.35270036228292 max 100</p><p class="warning">WARNING:  target 3692 needs repair 93.07013068833754 max 100</p><p class="warning">WARNING:  target 3872 needs repair 798.2052550307703 max 800</p><p class="warning">WARNING:  target 3701 needs repair 1608.9265522660332 max 2000</p><p class="warning">WARNING:  target 4515 needs repair 1496.9605836352357 max 1500</p>
Edited by sanderd17
Shorted the report a bit, got rid of redundancy
Link to comment
Share on other sites

When I save the game, load the game again, there are some errors: (AI:Petra)

<h2>0 A.D. Main log (warnings and errors only)</h2><p class="error">ERROR: Error in timer on entity 6818, IID 40, function MissileHit: TypeError: point.horizDistanceTo is not a function  (6645,[object Object],180.62897548638284)@simulation/components/Attack.js:544  ([object Object],180.62897548638284)@simulation/components/Attack.js:579  ([object Object])@simulation/components/Timer.js:93</p><p class="error">ERROR: Error in timer on entity 6255, IID 40, function MissileHit: TypeError: point.horizDistanceTo is not a function  (4253,[object Object],125.69510492030531)@simulation/components/Attack.js:544  ([object Object],125.69510492030531)@simulation/components/Attack.js:579  ([object Object])@simulation/components/Timer.js:93</p>...
Link to comment
Share on other sites

Another error:

<p class="error">ERROR: FinishOrder called for entity 4282 (units/gaul_support_trader) when order queue is empty  ()@simulation/components/UnitAI.js:3411  ()@simulation/components/UnitAI.js:5117  (4170,4147,"APPROACHINGFIRSTMARKET")@simulation/components/UnitAI.js:5106  ([object Object])@simulation/components/UnitAI.js:2531  ([object Object],[object Object])@simulation/helpers/FSM.js:274  ([object Object])@simulation/components/UnitAI.js:3757</p><p class="error">ERROR: FinishOrder called for entity 6260 (units/gaul_support_trader) when order queue is empty  ()@simulation/components/UnitAI.js:3411  ()@simulation/components/UnitAI.js:5117  (4170,4147,"APPROACHINGFIRSTMARKET")@simulation/components/UnitAI.js:5106  ([object Object])@simulation/components/UnitAI.js:2531  ([object Object],[object Object])@simulation/helpers/FSM.js:274  ([object Object])@simulation/components/UnitAI.js:3757</p><p class="error">ERROR: FinishOrder called for entity 4321 (units/gaul_support_trader) when order queue is empty  ()@simulation/components/UnitAI.js:3411  ()@simulation/components/UnitAI.js:5117  (4170,4147,"APPROACHINGFIRSTMARKET")@simulation/components/UnitAI.js:5106  ([object Object])@simulation/components/UnitAI.js:2531  ([object Object],[object Object])@simulation/helpers/FSM.js:274  ([object Object])@simulation/components/UnitAI.js:3757</p>
Link to comment
Share on other sites

I've commited in svn a new ai bot (Petra) which was developped starting from Aegis, but heavily modifying it with the goal to be more robust according to external conditions.

I'm looking forward to testing it! :)

Could you elaborate a bit on how it reacts better to external conditions?

  • Like 1
Link to comment
Share on other sites

gameboy: thanks for the reports. Your first report was only warning messages I forgot to remove. I will fix them.

The second report about saved games : i've not yet looked at the behaviour of saved games, but as it was not working with aegis, I was expecting it not working with petra. That will come in a second step.

What about your third report ? I've never seen it such errors. Is it also after loading a saved game ? and if not, can you provide the command.txt

Yves, by external conditions, I meant the level of available resources. I've not yet seen a case where it was unable to start and develop its economy, which happens sometimes with aegis. Also in the end game, it should not stay inactive as was sometimes the case with aegis.

Link to comment
Share on other sites

A couple of questions:

1) do you plan to replace the time based events (phase advance, attack, ...) with events based on the current game status?

2) is Petra eventually intended to replace Aegis (as previously done with qbot) or is supposed to be kept as an alternative AI?

1) yes, the goal is to remove all the time based events. But that's not finished yet.

2) for the time being, I think an alternative bot with a different logic should add more variety to the games. How that will evolve in the future, we will see : I believe the default bot should have a decent naval support, and we are not yet there for the moment.

  • Like 2
Link to comment
Share on other sites

An AI that trades! Got the same error as gameboy posted above. commands.txt attached (r14867).

ERROR: FinishOrder called for entity 8028 (units/ptol_support_trader) when order queue is empty ()@simulation/components/UnitAI.js:3411 ()@simulation/components/UnitAI.js:5117 (7592,7840,"APPROACHINGSECONDMARKET")@simulation/components/UnitAI.js:5106 ([object Object])@simulation/components/UnitAI.js:2518 ([object Object],[object Object])@simulation/helpers/FSM.js:274 ([object Object])@simulation/components/UnitAI.js:3757

commands.txt

  • Like 1
Link to comment
Share on other sites

@MIMO:My friend, MIMO! I provide two documents to you, maybe they can help you solve these problems.

@Wraitii: My friend! Why is it (AI) efficiency so low, maybe really need this patch in order to enhance its efficiency, this patch needs to be improved

http://trac.wildfiregames.com/ticket/2430#

On this patch, how do you progress? Whether to update it? I want to test the latest patches. Thank you!

commands1.txt

commands2.txt

Edited by gameboy
Link to comment
Share on other sites

I'm testing it a bit too. I started a 3-player map (gallic fields), and killed all my entities to resign.

I got this warning a few minutes later:

WARNING:  no position for rushTargetFinder 0
That's most likely related to my resign.

So far, I really like how the two AI players don't attack each other at the same time (which was rather silly with Aegis, as one then cancelled the attack and rushed back home). I also like how they react to attacks.

It would also be nice if it could build houses a bit sooner. Now I think it only builds houses when the population cap is reached. I think adding a margin on that to account for the build time would help. Certainly during the first phase.

It also got stuck on the Ptolemies. It reached a 35 units pop cap, but refused to build houses (while it kept collecting resources).

The position you pick to gather your army before attack can also be a bit better. I saw Petra sending all rams to the opposite part of the terrain to gather. Maybe pick the center point of your slowest units?

And I also saw the rams sometimes idling in the middle of an attack. I think they were either trying to attack humans (which isn't possible), or some unreachable building. I think in that case, they should just pick the closest target and attack it to create space.

I'll keep on testing.

Link to comment
Share on other sites

Hi sander,

thanks for the tests, I agree on most points you noticed and I'm working on improving them.

but there is one thing I can't reproduce, it is the ptolemies blocked at 35 pop cap. The possibility I see for that to happen is if there was not enough space to build new houses ? on what map were you playing ? and if you see it again, can you provide me the commands.txt.

Link to comment
Share on other sites

but there is one thing I can't reproduce, it is the ptolemies blocked at 35 pop cap. The possibility I see for that to happen is if there was not enough space to build new houses ? on what map were you playing ? and if you see it again, can you provide me the commands.txt.

It went well until they got rushed by the opposing AI. From that point they stopped building. I was playing on Gallic Fields, against the Romans. There was still enough space on the map to build houses, though when switching perspective, I sometimes saw those "failed to build ... on top of another building or resource" messages. I saw it for both players, but the Romans eventually found space to build, while I had to place some house foundation myself as the Ptolemaic player to get them going again.

I'll try to reproduce it.

Link to comment
Share on other sites

My friend MiMO!

Once again, I tested your AI(Petra).

Another problem: the enemy of workers and the military a strange action: When the game save again loaded, the workers will not go to collect resources, they will stand next to the resource (for example: farmland beside), enemy forces will not attack me .

Link to comment
Share on other sites

I'll try to reproduce it.

It seems to happen when the Ptolemies have player3 on Gallic Fields (skirmish map). There's still place to build foundations, but there's no single open space. Together with the quite large, but only 5-pop houses of the ptolemies, this can cause problems I guess. Though even when they cut down trees, and thus an open space appears, they don't place buildings.

Possible strategies would be phasing up as quickly as possible to expand, or trying to cut down strategic places of resources that obstruct building (a single tree doesn't take long to take down).

My friend MiMO!

Once again, I tested your AI(Petra).

Another problem: the enemy of workers and the military a strange action: When the game save again loaded, the workers will not go to collect resources, they will stand next to the resource (for example: farmland beside), enemy forces will not attack me .

Mimo already said that saved games aren't supported, just like with Aegis (as it's based on Aegis).

Link to comment
Share on other sites

@Sander17:Perhaps not support Aegis AI temporarily stored loaded.
But petra AI support in the next version to load saved it?
Because the load needs to save AI support, most people need this support.

@MIMO:My friend, I need to emphasize the importance of this feature, when a single game does not have enough time to finish it, the game needs to be saved, when we have time, we are again in order to load the saved game continue to play if the game's AI at this time does not support the preservation, then the next game will feel no fun.
For example: The enemy AI is not saved before no longer attack players as the enemy AI no longer build troops and harvest resources.

On this issue, how do you see, my friend MIMO?

Edited by gameboy
Link to comment
Share on other sites

Yes, my friend, MINO!

AI just a long period of time does not support AI saved and I know everyone expects, are striving to achieve this support functions (AI can be saved), I hope Petra AI able to implement this feature (hopefully in the second Petra AI version), thank you for your efforts and support, thank you!

BTW: Thanks again my friend wraitii.

Link to comment
Share on other sites

Though I had no time to playtest for months, I have a feeling that 0AD is becoming more and more fascinating.

Thank you two for the API work, Aegis improvements, numerous bugfixes and now even a new AI. And all for our blue jewels honour, really remarkable.

Serialisation is a bigger issue and without it we had to never store any dynamic state (so no weighted decision tree, no awareness of which plyayer the AI was allied to some turns ago, .. all that.).

Though this is not fault of anyone around here .. it's a bigger issue and not too important currently as saved games might not even be compatible from commit to commit. Still it can be replaced with the PAUSE/HALT mode. No natural friendly, but in the case of a laptop and power saving mode or even rest/hibernation mode, that keeps the whole state saved on the disk, it's even nor longer an environmental problem. :D

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...