lexa Posted September 26, 2011 Author Report Share Posted September 26, 2011 Aaaah okI will fix this then, befor you fix the bug on uour side thank you histo bruno Quote Link to comment Share on other sites More sharing options...
UV_Completion Posted September 27, 2011 Report Share Posted September 27, 2011 (edited) 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 September 27, 2011 by UV_Completion Quote Link to comment Share on other sites More sharing options...
quantumstate Posted September 27, 2011 Report Share Posted September 27, 2011 - 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. Quote Link to comment Share on other sites More sharing options...
lexa Posted September 27, 2011 Author Report Share Posted September 27, 2011 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 endKeep up the contributions, we will go faster this way !Bye! Quote Link to comment Share on other sites More sharing options...
lexa Posted September 29, 2011 Author Report Share Posted September 29, 2011 (edited) 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 happenThe isObstructed method should have returned true... Instead it returned false, the bot started to build and failed after a while.Can you explain me? Edited September 29, 2011 by lexa Quote Link to comment Share on other sites More sharing options...
lexa Posted September 29, 2011 Author Report Share Posted September 29, 2011 @historic_bruno Thank you for putting me in CC of the ticket http://trac.wildfiregames.com/ticket/969So, how do you think AI should handle territories ? Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted September 29, 2011 Report Share Posted September 29, 2011 @historic_bruno Thank you for putting me in CC of the ticket http://trac.wildfiregames.com/ticket/969So, 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 )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. Quote Link to comment Share on other sites More sharing options...
lexa Posted September 30, 2011 Author Report Share Posted September 30, 2011 (edited) 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 September 30, 2011 by lexa Quote Link to comment Share on other sites More sharing options...
gudo Posted September 30, 2011 Report Share Posted September 30, 2011 (edited) Still I do not understand how it is possible that the case in the attached screen shot can happenThe 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 September 30, 2011 by gudo Quote Link to comment Share on other sites More sharing options...
lexa Posted September 30, 2011 Author Report Share Posted September 30, 2011 Ah ok, I'll try to check for block foundations tooAlso, I'll check on the whole surface, not only 5 points like I did.Any "good" player tried the bot ? Bye! Quote Link to comment Share on other sites More sharing options...
Pureon Posted September 30, 2011 Report Share Posted September 30, 2011 Any "good" player tried the bot ? 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? Quote Link to comment Share on other sites More sharing options...
gudo Posted September 30, 2011 Report Share Posted September 30, 2011 (edited) 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 September 30, 2011 by gudo Quote Link to comment Share on other sites More sharing options...
Pureon Posted October 2, 2011 Report Share Posted October 2, 2011 After about 5 minutes the latest splitbot started throwing the error reported by gudo above: http://pastebin.com/ej2wS176 - it was building well up to that point. Quote Link to comment Share on other sites More sharing options...
Linux_Eki Posted October 3, 2011 Report Share Posted October 3, 2011 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. Quote Link to comment Share on other sites More sharing options...
JuliusColtranePille Posted October 4, 2011 Report Share Posted October 4, 2011 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 Quote Link to comment Share on other sites More sharing options...
lexa Posted October 4, 2011 Author Report Share Posted October 4, 2011 HelloThank 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 herebut 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 workHmmm, not normal, it is supposed to work... Can you tell me more about your version of the game? Quote Link to comment Share on other sites More sharing options...
lexa Posted October 4, 2011 Author Report Share Posted October 4, 2011 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 Quote Link to comment Share on other sites More sharing options...
JuliusColtranePille Posted October 4, 2011 Report Share Posted October 4, 2011 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...?! Quote Link to comment Share on other sites More sharing options...
lexa Posted October 12, 2011 Author Report Share Posted October 12, 2011 (edited) 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 geroniumDid 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 October 12, 2011 by lexa Quote Link to comment Share on other sites More sharing options...
lexa Posted October 12, 2011 Author Report Share Posted October 12, 2011 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? Quote Link to comment Share on other sites More sharing options...
lexa Posted October 12, 2011 Author Report Share Posted October 12, 2011 After about 5 minutes the latest splitbot started throwing the error reported by gudo above: http://pastebin.com/ej2wS176 - it was building well up to that point.FixedCan you verify it is ok?The files are here in the trunk on google code Quote Link to comment Share on other sites More sharing options...
Linux_Eki Posted October 12, 2011 Report Share Posted October 12, 2011 (edited) I will test it again with newest build from svn and 0ad.dev repository. Maybe I didn't wait enough 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 128TypeError: 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 October 12, 2011 by Linux_Eki Quote Link to comment Share on other sites More sharing options...
lexa Posted October 12, 2011 Author Report Share Posted October 12, 2011 For the placement of the buildings, I now check the whole surface for obstructionIt 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"; Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted October 12, 2011 Report Share Posted October 12, 2011 It could be because farms have a special obstruction? Units can walk over them. Quote Link to comment Share on other sites More sharing options...
lexa Posted October 12, 2011 Author Report Share Posted October 12, 2011 (edited) It could be because farms have a special obstruction? Units can walk over them.Yes this is it, but how can an AI know ? Edited October 12, 2011 by lexa Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.