Jump to content

New Split Bot release


Recommended Posts

I will test it again with newest build from svn and 0ad.dev repository. Maybe I didn't wait enough :D For me its just strange if AI doesn't do anything aggressive within 20minutes.

For now split bot attacks when it has more than 170 pop

Edit: Got it. Gives error. I have had thought its not critical because bot was still running fine but this time I read it through. Seems it can't find where my CC is.


ERROR: JavaScript error: simulation/ai/SplitBot/SplitBot.js line 128
TypeError: me.getCivicCenter() is undefined
([object Object],"11",[object Object])@simulation/ai/SplitBot/SplitBot.js:128
((function (ent, str) {"use strict";var tmpDistance;if ((tmpDistance = org.zeroad.common_api.Utils.VectorDistance(ent.position(), me.getCivicCenter().position())) < nearestOponentEntityDistance) {nearestOponentEntityDistance = tmpDistance;nearestOponentEntity = ent;}return false;}))@simulation/ai/common-api/entitycollection.js:99
([object Object])@simulation/ai/SplitBot/SplitBot.js:126
([object Object])@simulation/ai/SplitBot/SplitBot.js:1059
([object Object])@simulation/ai/SplitBot/SplitBot.js:795
([object Object])@simulation/ai/SplitBot/SplitBot.js:775
()@simulation/ai/SplitBot/SplitBot.js:734
([object Object])@simulation/ai/common-api/base.js:91
@:0

Ok, thank you for the test, but it seems that you did not take the latest version from the trunk..

And also it is like it can not find its civ center, which map do you use?

Link to comment
Share on other sites

  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

For now split bot attacks when it has more than 170 pop

Ok, thank you for the test, but it seems that you did not take the latest version from the trunk..

And also it is like it can not find its civ center, which map do you use?

Tested 2 times on Oasis II. Now it attacked several times with 15 troops before I crushed them. 170 pop and then larger force attacks? Imo its high. I would set it around 110 and then bot would start building troops for larger attack.

On second test run splitbot said that it cannot find place to build. At their base several workers were faced on their CC and tried to build something on top of it. Time warped some minutes and nothing happened.

Link to comment
Share on other sites

For the placement of the buildings, I now check the whole surface for obstruction

It still try builds farms over other buildings and fields...

One thing to watch out for is constructing multiple buildings each turn, because the obstruction map only gets updated on the next turn (not immediately when you post the "construct" command).

It could be because farms have a special obstruction? Units can walk over them.

Pathfinding obstruction is irrelevant for placing a foundation, only building passability (terrain characteristics) and foundation obstructions should be used.

Link to comment
Share on other sites

I also just tested on Oasis II and also got the message that it cannot find a place to build.

I did a bit of testing and it seems to work a bit better with the obstruction mask set to 6 which is what q/ju/testBot uses. It still makes some errors with foundations on top of foundations however.

obstructionMask = gameState.getPassabilityClassMask("foundationObstruction");

obstructionMask |= gameState.getPassabilityClassMask("building-land");

is a bit more descriptive :).

This definitely doesn't fix it though, even adding ridiculous amounts of padding to the building size still didn't seem to work correctly. I cannot see any problems though :(.

Link to comment
Share on other sites

banger.gif

Maybe there is no way for the AI to know if a place is obstructed because of this special obstruction of the farms...

Nope, see all of the other AI's for proof that the API works.

However I have discovered something a little bit crazy when testing. Swapping the x/y coordinates in BuilderAgent.hx line 261 seems to fix the problem for Oasis II. However when testing in Oasis IV an AI in position 3 started building onn the opposite corner of the map with this swapped. This might suggest that the Point data structure you are using isn't entirely stable, I haven't looked at the code for that though. I left it running for quite a while on fast speed so it built > 10 buildings with no issues on Oasis II which would be really unlikely by chance. It seems pretty weird.

EDIT: Just realized that the flip must be happening somewhere in the isObstructed() function. So your code has been checking for obstructions on a diagonal mirror image of the map I think. On line 138 MapHelper.hx you seem to have the x and y swapped for some reason, try flipping them round there.

Edited by quantumstate
Link to comment
Share on other sites

Territory data is now added to the AI state (r10408). There's a slight change that will affect Split Bot and others, the passability map returned from the engine is now called "passabilityMap" instead of "map". This is to distinguish it from the new "territoryMap". Other than that, see Jubot and Testbot code for examples of how to handle territory build restrictions :)

Link to comment
Share on other sites

  • 7 months later...

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