The AI player is supposed to scan a region for placed structures and place its own structures according to a 2x2 grid (means no empty spaces in between the structures should remain where placing structures is impossible).
I can imagine some kind of algorithm that determines the distance to the nearest structure and checks if the X and Y distances are zero or a multiplier of 2. Do you think this can work?
Hello again,
Premise: All structures have a 2x2 footprint.
The AI player is supposed to scan a region for placed structures and place its own structures according to a 2x2 grid (means no empty spaces in between the structures should remain where placing structures is impossible).
I can imagine some kind of algorithm that determines the distance to the nearest structure and checks if the X and Y distances are zero or a multiplier of 2. Do you think this can work?
Thanks!
@Winryamo: Go
If I understand what you mean:
You should first get all structures in the region, place them into a unit group and then scan the unit group, calculating the distances you need.
Then use "Add Bully at Point" with the point given by the offest relative to the calculated distances.
Battle.net wants to call me InsaneMst, Insane... but you should call me InsaneMonster!
Author of InsaneAI library, InsaneCredits library, InsaneDebug library, InsaneTransmission library, InsaneUI library and InsaneBriefing library.
Author of Mercenary Business - Top 10 Rock The Cabinet 2017: Co-op edition.
@InsaneMst: Go
Thank you, I'll give it a try.