Jump to content

New Split Bot release


Recommended Posts

  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic


this.lastGoodPosition = org.zeroad.splitbot.core.Point.arrayPoint2Point(this.getCivicCenter().position());
while(true) {
this.lastGoodPosition.x += Math.round(Math.random() * (width + 10) - (width + 10) / 2);
this.lastGoodPosition.y += Math.round(Math.random() * (height + 10) - (height + 10) / 2);
if(!org.zeroad.splitbot.helper.MapHelper.isObstructed(this.lastGoodPosition,width + 10,height + 10,["building-land","foundationObstruction"])) return this.lastGoodPosition;
}

Couldn't this end in an infinite loop? And I think a random walk from the civ center is not the most efficient way to find a building space.

Are you sure that you multiply with/divide by cellSize at all relevant places?

Edited by UV_Completion
Link to comment
Share on other sites

- the error I see is much much bigger than an approximation, since it is allowed to build (but not finish, only the foundations) over the civic center - see the attached screenshot (look closely, there are 2 different foundations under the CC)

In my previous post I was trying to say that the rounding problem can move the position literally halfway across the map (in the horizontal direction). Could you try this fix:


var scaledX:Int = Math.round(x / MapHelper.TILE_SIZE);
var scaledY:Int = Math.round(y / MapHelper.TILE_SIZE);
var position1D:Int = scaledX + MapHelper.map.width * scaledY;

In MapHelper.hx line 138.

Link to comment
Share on other sites

Hey ! Thank you for all these propositions :)

Have you tried it? If you do, I'll check & integrate it very soon. I could also put you as contributors on google code..

Otherwise, I will check all this next week end

Keep up the contributions, we will go faster this way !

Bye!

Link to comment
Share on other sites

Oh ninja'd. I was getting a screencap of this. But yeah, try a constant orientation. I believe the angle that Mythos recommends and Jubot uses is 3/4*pi (.75pi).

Ok, I did this. It looks cleaner :)

In my previous post I was trying to say that the rounding problem can move the position literally halfway across the map (in the horizontal direction). Could you try this fix:


var scaledX:Int = Math.round(x / MapHelper.TILE_SIZE);
var scaledY:Int = Math.round(y / MapHelper.TILE_SIZE);
var position1D:Int = scaledX + MapHelper.map.width * scaledY;

In MapHelper.hx line 138.

Yeah !! This is much much better..

Still I do not understand how it is possible that the case in the attached screen shot can happen

The isObstructed method should have returned true... Instead it returned false, the bot started to build and failed after a while.

Can you explain me?

post-12863-0-93889900-1317328109_thumb.p

Edited by lexa
Link to comment
Share on other sites

@historic_bruno Thank you for putting me in CC of the ticket http://trac.wildfiregames.com/ticket/969

So, how do you think AI should handle territories ?

The patch includes some API changes, so I wanted to make sure all active AI devs are aware of that before they are implemented (they aren't certain, we may be making even bigger, more fundamental changes - stay tuned :D)

Territories have multiple aspects. There's the building restrictions which are fairly simple, see the second patch in that ticket for an example (I combined foundation obstructions and territory restrictions into a boolean concept). I haven't look into Split Bot's implementation, so I can't say what changes you need to make, but if it's based on Testbot/Jubot there should be a similar process.

Territory expansion is another problem, like building new civ centres when needed and in strategic locations. I haven't even thought about that, the AIs are overall lacking in strategy.

Link to comment
Share on other sites

Ok, thank you for your answer, I'll try to figure out what to do...

meanwhile, I just reached the alpha3 stage. I still have this bug in the svn version, with the structures which builds at a wrong place sometime...

In the stable version of the game, the bot starts to be really good. At least it is better than me :)

http://code.google.com/p/split-bot/downloads/list

== Development status ==

Currently the bot builds a village quickly, defends itself and attacks in teams, but do not split yet.

Split Bot builds strong soldiers, and attacks in waves of 15 soldiers.

The defense is quite efficient since it does detect that it is under attack, and counter-attacks. It also builds defense towers.

See RoadMap and ToDoList for more info.

== change log ==

* I would recommend that the buildings all face the bottom right corner.

* defend when attacked

* handle fortress and machines

* higher limit to stop attacking

* cleanup debug and messages

* cartesian's structures (to be tested)

== Use ==

Paste SplitBot.js and data.json to 0 A.D./binaries/data/mods/public/simulation/ai/splitbot/

And choose "AI - Split Bot" as the AI of your oponent

Edited by lexa
Link to comment
Share on other sites

Still I do not understand how it is possible that the case in the attached screen shot can happen

The isObstructed method should have returned true... Instead it returned false, the bot started to build and failed after a while.

Can you explain me?

The "building inside farms" problem is not unique to SplitBot, JuBot does it too (as of latest build no-less.)It's probably due to the way that the bots are checking if they can place a building there. The obstruction map checks for what, passability? If you check the structure template around line 46, you can see it has all the obstruction types on. For farms however, their template disables obstruction for path-finding and movement. If they AIs check for those, but not say BlockFoundation, then it makes sense that they'll build in farms when they won't build in any other structure.

Edited by gudo
Link to comment
Share on other sites

Just did some testing, and SplitBot is the "best" of the bots. Despite a whole bunch of building placement crazyness that causes it to waste considerable time, it still grows in population faster than the other bots, builds siege sooner and attacks in larger waves.

Though an interesting idea occurred to me, perhaps it grows so fast because it builds slowly. Sure, it wastes resources when it puts the foundation down, but that blocks the builder agent from building and placing more buildings, freeing up more resources for spawning units. Plus, it gets those resources right back when it cancels the stuck structure. Essentially, the delay in building means an acceleration in spawning.

Edit: I was playing some more 4 way FFA, when SplitBot started throwing errors.

Edited by gudo
Link to comment
Share on other sites

I can't get Splitbot to attack me. I simulated many battles and no attacks in 20 minutes. I am not attacking it. It builds base quite quickly and has much workers. Of course building placement bug slows it down a little. I am playing on build 10359 and alpha3 release of SplitBot.

Link to comment
Share on other sites

Hello

Thank you for your comments.

Though an interesting idea occurred to me, perhaps it grows so fast because it builds slowly. Sure, it wastes resources when it puts the foundation down, but that blocks the builder agent from building and placing more buildings, freeing up more resources for spawning units. Plus, it gets those resources right back when it cancels the stuck structure. Essentially, the delay in building means an acceleration in spawning.

Edit: I was playing some more 4 way FFA, when SplitBot started throwing errors.

I'll chek the problem with the error messages.... I opened an issue here.

For the "theory" about building slowly, I have made several tests, and it seams that it is even faster when it builds faster, because of the max pop count. We should open a thread about AI strategy, don't you think?

I can't get Splitbot to attack me. I simulated many battles and no attacks in 20 minutes. I am not attacking it. It builds base quite quickly and has much workers. Of course building placement bug slows it down a little. I am playing on build 10359 and alpha3 release of SplitBot.

arghthank you for the bug report, I have opened an issue here

but if i see this right... the split alpha 3 still does not work on the territorial system of alpha 7 G, right?

i tried the new version and the bot does not build up anything ... ;(

still,

keep up the great work

Hmmm, not normal, it is supposed to work... Can you tell me more about your version of the game?

Link to comment
Share on other sites

I'm not good player (I've lost almost all multiplayer games so far), but I personally haven't had enough time away from Alpha 8 to try the updated bot yet. The changes sound great though!

Out of interest, how does it compare to qBot and Jubot?

Just did some testing, and SplitBot is the "best" of the bots. Despite a whole bunch of building placement crazyness that causes it to waste considerable time, it still grows in population faster than the other bots, builds siege sooner and attacks in larger waves.

Though an interesting idea occurred to me, perhaps it grows so fast because it builds slowly. Sure, it wastes resources when it puts the foundation down, but that blocks the builder agent from building and placing more buildings, freeing up more resources for spawning units. Plus, it gets those resources right back when it cancels the stuck structure. Essentially, the delay in building means an acceleration in spawning.

Edit: I was playing some more 4 way FFA, when SplitBot started throwing errors.

I have created a thread about AIs in general here

Link to comment
Share on other sites

  • 2 weeks later...

Hmmm, not normal, it is supposed to work... Can you tell me more about your version of the game?

-------------------

im playin on 10288 the alpha 7 geronium...?!

Hi, I can not reproduce this with the alpha 7 geronium

Did you put all the split bot files in "C:\Users\lexa\AppData\Local\0 A.D. alpha\binaries\data\mods\public\simulation\ai\splitbot" ?

On which map did you test?

Please leave a comment here

Edited by lexa
Link to comment
Share on other sites

I can't get Splitbot to attack me. I simulated many battles and no attacks in 20 minutes. I am not attacking it. It builds base quite quickly and has much workers. Of course building placement bug slows it down a little. I am playing on build 10359 and alpha3 release of SplitBot.

I can not reproduce this, can you tell me your version of the game and the map, leave a comment here?

Link to comment
Share on other sites

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.

Edit: Actually I now remember one match where splitbot attacked qbot. But the situation was not clear to say if it was pure attack or defending own workers. Qbot and splitbot gathered resources from same place and other side attacked others workers and other went to defend them. Because splitbot was stronger atm it continued following worker stream to qbot base and had big battle there. Also it was sending reinforcements.

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

Edited by Linux_Eki
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...

I tried with all passability classes which I have found :

public static inline var FOUNDATION_OBSTRUCTION:String = "foundationObstruction";

public static inline var BUILDING_LAND_OBSTRUCTION:String = "building-land";

public static inline var PATHFINDER_OBSTRUCTION:String = "pathfinderObstruction";

public static inline var DEFAULT_OBSTRUCTION:String = "default";

public static inline var SHIP_OBSTRUCTION:String = "ship";

public static inline var BUILDING_SHORE_OBSTRUCTION:String = "building-shore";

public static inline var UNRESTRICTED_OBSTRUCTION:String = "unrestricted";

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