Jump to content

WIP new API for the AIs, along with new version of Aegis.


Recommended Posts

Status is "needs to be done but I've given it a shot already and it should be easy enough using the Configure screen. Might be changed later for a different system but for now it'll do.

(and obviously I do mean after a few more days of testing.)

Fabio: that cavalry issue is actually not what I was talking about, but that's a good point nonetheless.

Link to comment
Share on other sites

Okay, then I'll probably change that in my next commit. I just committed one that fixes most of the logic errors which I know of (slight fixes in economy, attack plans and defense), also makes the AI gather food with cavalry (to some extent). Though it changes CcmpAIManager recompiling is not necessary.

The AI should send a chat message to its teammates when it starts an attack. Please report if this works incorrectly.

I think next I'll work on a difficulty system with GUI support and possibly a resource handicap (I'm thinking the "hard" mode would have none, the "medium" one would have some slight handicap, the "easy" one a strong handicap, and there could be a "very hard" mode where the AI gets additional resources).

I think this should also wait until this is committed (leper reviewed it a bit, should be mostly good) as this could help AIs slightly. And I'll change Aegis to default AI at that time.

That'll probably be it for the time being.

edit: chatting seems slightly broken, will fix.

Link to comment
Share on other sites

Okay, latest update fixes some of the remaining issues, makes it slightly more efficient, and adds difficulty support properly (in the GUI). It also changes the debug setting to false by default, and I changed the descriptions for Alpha 13. I have made Aegis default on RM.

Please try the difficulty settings, easy should feel easy but not tooooo easy. Hard should be somewhat challenging to skilled players. Very hard should be challenging. Please report if it is too challenging, or not enough (I use a system of resource cheat: Easy AI gathers 33% more slowly, hard 33% faster, and very hard 66% faster.)

  • Like 3
Link to comment
Share on other sites

I had this today in a 2vs2 (me + 1Aegis + 2 Aegis)


ERROR: JavaScript error: simulation/ai/common-api-v3/utils.js line 10 TypeError: b is undefined SquareVectorDistance([object Array],(void 0))@simulation/ai/common-api-v3/utils.js:10 ([object Object],"2777",[object Object])@simulation/ai/qbot-wc/economy.js:544 ((function (otherDropsite) {"use strict";var distance = SquareVectorDistance(supply.position(), otherDropsite.position());if (supply.getMetadata(PlayerID, "linked-dropsite") == undefined || supply.getMetadata(PlayerID, "linked-dropsite-dist") > distance) {if (distance < bigRadius[resource]) {supply.setMetadata(PlayerID, "linked-dropsite", otherDropsite.id());supply.setMetadata(PlayerID, "linked-dropsite-dist", + distance);if (distance < smallRadius[resource]) {takenOver = true;supply.setMetadata(PlayerID, "linked-dropsite-nearby", true);} else {supply.setMetadata(PlayerID, "linked-dropsite-nearby", false);}}}}))@simulation/ai/common-api-v3/entitycollection.js:138 ([object Object],"513",[object Object])@simulation/ai/qbot-wc/economy.js:543 ([object...

Edit: here's the savegame

quicksave-0007.0adsave.txt

Link to comment
Share on other sites

I got this on the latest SVN version (r13286) today: http://i.imgur.com/AubebTG.jpg

I was playing with my brother against one Hard AegisBot (yellow) and one Very Hard AegisBot (green). There was an out-of-sync error as well (about 1/4 of the way through the game -- we kept playing anyway :P), but I don't know if the AI caused that or some other factor (doubtful; we were both on the same SVN version).

Link to comment
Share on other sites

Yves: thanks, that was actually a semi-serious issue that I hadn't considered. Should be fixed.

Alpha123: thanks too... That bug is a lot more annoying as I'm not quite sure what could cause it. I'll add a check against neighboring dropsites that might avoid such situations, but I fear such an issue could remain for the time being.

Link to comment
Share on other sites

Please try the difficulty settings, easy should feel easy but not tooooo easy. Hard should be somewhat challenging to skilled players. Very hard should be challenging. Please report if it is too challenging, or not enough (I use a system of resource cheat: Easy AI gathers 33% more slowly, hard 33% faster, and very hard 66% faster.)

Any particular maps you can recommend for maximum challenge?

Link to comment
Share on other sites

Grammar nazi:

The bot's chat lacks punctuation. Here's a patch: https://github.com/zootzoot/0ad/commit/d27c5916212aeda94808288d0951bc376a7e3d45.diff

Also, is "Starting to attack x" good English in this context? I would only use that form for a slow process/tendency, like "The paint is starting to dry" or "My house is starting to collapse". IMO just cut that line, since the other lines the bot can say seems fine.

Link to comment
Share on other sites

Grammar nazi:

The bot's chat lacks punctuation. Here's a patch: https://github.com/z...376a7e3d45.diff

Also, is "Starting to attack x" good English in this context? I would only use that form for a slow process/tendency, like "The paint is starting to dry" or "My house is starting to collapse". IMO just cut that line, since the other lines the bot can say seems fine.

That is common usage in this context.

Link to comment
Share on other sites

It has been changed anyway. Thanks for the report zoot :) .

So anyway, I'll be going back to school now, I expect I will not have any time to work on 0 A.D. for the next weeks. Please report any errors (here or in the bugreports forum) nonetheless, and any weird behavior (if possible, try to debug them as much as possible, or try to find a way to replicate these errors, as this will considerably facilitate debugging).

(edit: I committed a change this morning that may or may not be good. I'll test it, and revert if it's not).

Link to comment
Share on other sites

I watched a battle between Romans and Iberians (in hard mode). The siege rams still aren't used optimally.

After a battle on Iberian grounds, some Roman siege rams were still in tact (because they didn't attack the Iberian units, so never got a reaction). Those Roman siege rams started demolishing every house, while the Iberian player was just developing his army again. He had already 15 idle cavalry units, and still he didn't attack the siege rams.

In short. Sieges that aren't surrounded by an army should always be attacked. No matter how big your own army currently is, as your units can't take damage from siege rams.

The other thing, how do sieges select the building they attack? They should attack the most vital parts first (fortresses, CCs, Defence towers, ...) but they usually start with the houses. If you demolish a CC, the houses will follow quickly, and if you demolish the defence structures, you have all time to demolish the houses.

Also, what's with the barracks? The Iberian player build 6 barracks, right next to each other. There is no way he can use those barracks simultaneously, as you'll run out of resources too fast.

I must say, great progress with the AI. I've never seen it playing this good.

Oh yeah, and the Romans are seriously overpowered. The Iberian had a better economy score, but the Romans were a lot better when it came to military. But that has nothing to do with the AI.

Link to comment
Share on other sites

Also, what's with the barracks? The Iberian player build 6 barracks, right next to each other. There is no way he can use those barracks simultaneously, as you'll run out of resources too fast.

I've used 6 barracks without running out of resources; it's really not that hard. Especially since on Hard difficulty, since it gets a +33% resource bonus.

Link to comment
Share on other sites

Basically with 6 barracks it should hardly have to queue anything, though there's often a few barracks that do nothing. I'm not sure how efficient the AI is exactly at that but generally speaking it should not be too overkill.

Choice of building to attack should be more optimal than it currently is. I think it has something to do with the stance of siege units. I'll try changing it to defensive yo see what it does.

The fact it didn't attack the siege rams is more surprising. Perhaps it was busy elsewhere, there might be weird reactions in those cases.

Link to comment
Share on other sites

I got an OOS-Error too today when playing a multiplayer game with two aegis bots and one player.

Both players were at rev 13305 but the player on windows used the autobuild version (It should be fine because there was only one CPP change that shouldn't be a problem).

EDIT:

The oos_dump is 15 MB each, but here's the diff (-u --strip-trailing-cr):

EDIT2:

Compression helps quite a bit... full logs attached.

oos_dump_diff.txt

oos_dump.zip

commands.txt.zip

Link to comment
Share on other sites

Any way to be sure this is related to the AIs?

Check the IRC logs for details.

I think we have verified that. Entity ID 4263 exists in both dumps and is owned by player2 (qbot-wc).

The move order for this unit and a few others only exists in one dump. There are about 70 units moving to the same x/z coordinates as entity 4263, so it seems to be an attack.

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