#4717: Nullbot performance -------------------------------------+-------------------------------- Reporter: darkling | Owner: NoQ Type: bug | Status: new Priority: normal | Milestone: unspecified Component: NullBot (AI) | Version: master but not 3.2 Operating System: All/Non-Specific | -------------------------------------+-------------------------------- Nullbot appears to be running slower with the master build. I've attached a nullbot log file from a couple of games (they both lasted about 2 hours). In both cases the check attack function in nullbot is hitting the time constraints (>=limit and >=limit/2) more frequently than I remember it doing in previous versions. On faster computer it might not be so bad (mine is starting to date), but it still seems like a lot. it hit the >=limit/2 over 450 times and the >=limit over 70 times in both games.
I think that part of it is the attackTarget function particuarly lines 234-237 in tactics.js for nullbot that are the culprit {{{ if (droid.droidType !== DROID_SENSOR) orderDroidObj(droid, DORDER_ATTACK, target); else orderDroidObj(droid, DORDER_OBSERVE, target); }}} since these lines can order a unit to attack an object that it can't hit (vtol). {{{ if (droid.canHitGround ===true && !isVTOL(target)) orderDroidObj(droid, DORDER_ATTACK, target); else if(droid.canHitAir ===true && isVTOL(target)) orderDroidObj(droid, DORDER_ATTACK, target); else orderDroidObj(droid, DORDER_OBSERVE, target); }}} these lines just check to make sure that a droid can attack it's target. -- Ticket URL: <http://developer.wz2100.net/ticket/4717> Warzone 2100 Trac <http://developer.wz2100.net/> The Warzone 2100 Project ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Warzone2100-project mailing list Warzone2100-project@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/warzone2100-project