You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Cobra on function cobraBaseArea() within mapDynamics.js
const EXTRA_TILES = 20
area.x1 = area.x1 - EXTRA_TILES;
etc..
Where the baseStructures subtract from our available build area.
Now I might add that two terrain types should also be factored into this equation to also subtract from our available build area, namely:
if (tileType === TER_WATER || tileType === TER_CLIFFFACE) - As... those terrain types cannot be built upon.
This could explain why Cobra makes odd building choices exposing baseStructures out in the open near the base, where TER_CLIFFFACE is apparent and blocking much of nearby area. ( A simple test on Sk-Rush shows this. )
Also occurs to me that destructible features should also subtract from our available build area, until they are destroyed.
Along with oil resource(s).
This logic doesn't affect build position decisions. It's used for tactics code to scan if enemy units are encroaching upon Cobra's territory, and if so, to allow attacking behavior. Very useful for NTW maps I will add.
The reason for why strange build locations happen is a little more complex. From what I remember bots build in a circle, usually around the startPosition coordinates with pickStructLocation() returning a valid position. Poor building placement on Rush in particular can be dependent on the specific player slot, and also influenced by the build order that occurred. Cobra may be more likely to hit bad spots due to faking its startPosition with a small random offset each time it builds (to improve something I've forgotten about by now--maybe to prevent trucks building on top of themselves and getting stuck forever, idk). But it's not a unique problem with Cobra as I've seen other bots build behind their base often.
Ultimately if pickStructLocation() accounted for path distances instead of straight lines it would massively improve bot build locations on all maps, probably. Without the need for clever and complex logic at the script level.
I've ran out of ideas on improving Cobra, so feel free to add ideas to my issues section in my Cobra repo if you want.
"used for tactics code ... Very useful for NTW maps" - Noted, I would like to observe this in action so will take a look later.
"(to improve something I've forgotten about by now--maybe to prevent trucks building on top of themselves and getting stuck forever, idk)" - yes I have seen something about this and it is commented within some code on that basis.
This specific issue has, very recently been fixed I believe. This can be tested to verify.
Now that you mention it, when it comes to Sk-Rush every or most AIs build south of whatever base they occupy.
Another off topic quirk I discovered, is that as an enemy player if you place a unit on the location underneath where the AI wishes to build... it never builds and hangs on looping trying to place the structure on that otherwise valid location.
For Cobra on function cobraBaseArea() within mapDynamics.js
const EXTRA_TILES = 20
area.x1 = area.x1 - EXTRA_TILES;
etc..
Where the baseStructures subtract from our available build area.
Now I might add that two terrain types should also be factored into this equation to also subtract from our available build area, namely:
if (tileType === TER_WATER || tileType === TER_CLIFFFACE) - As... those terrain types cannot be built upon.
This could explain why Cobra makes odd building choices exposing baseStructures out in the open near the base, where TER_CLIFFFACE is apparent and blocking much of nearby area. ( A simple test on Sk-Rush shows this. )
Also occurs to me that destructible features should also subtract from our available build area, until they are destroyed.
Along with oil resource(s).
Thoughts @KJeff01 ?
Digression:
This value for const EXTRA_TILES = 20, may be better off being set based on some other set of conditions on map analysis.
The text was updated successfully, but these errors were encountered: