tomjn / Shard

A reprogrammable AI framework for the Spring Engine
https://shard.tomjn.com
17 stars 13 forks source link

A Proper Building Placement Algorithm #130

Closed tomjn closed 6 years ago

tomjn commented 7 years ago

At the moment Shard uses closestbuildsite, which is an algorithm implemented by the engine for figuring out where to place buildings. It does the job, but it's a bit rubbish.

It also looks like eronoobos' version has some issues, as demonstrated with a quick chat with the EvoRTS players.

So, we need a building placement algorithm with these requirements:

Bonus optimisations:

tomjn commented 7 years ago

Example of one of the issues the ShardLua placement algorithm has: 0_20170510215041_1

NTai tried to solve this by beginning the search at a random offset from the builder. I wonder if it's wise to use the position of the builder as the search location? Perhaps if extractors and other predefined units could be used as starting points?

There's also the option of instead trying to find the edge of the nearest cluster of buildings and then try to place a structure closest to that?

I'm also mindful that some games may have limitations that need to be accounted for. E.g. in Starcraft, Zerg can only build on Creep, and Protoss need to place pylons

tomjn commented 6 years ago

Recent advances have resolved this