More A.I.
Big news on the A.I. front - I’ve figured out (most of) an algorithm that will place A.I. towers near bottlenecks in the terrain. w00t! Currently, A.I. players only place towers randomly, around their bases. If A.I. players could recognize natural bottlenecks in the terrain, and concentrate their defenses there, they would play much more effectively.
“Bottlenecks” being things like a ramp up to a high mesa, or an entrance to a box canyon, or a land bridge connecting a peninsula to a continent, or a fjord proving access to an island.
The alg isn’t implemented yet - haven’t even started - but it’ll involve extruding all the natural obstacles in the terrain (i.e., blowing them up like a balloon), and the places where the extrusions first bump into each other, identify where the bottlenecks are. Then, it’ll do a frontier-walk, starting from the A.I. player’s base. The first bottlenecks that the frontier-walk reaches, are the bottlenecks that the A.I. player should fortify.
Still working out the details, but I’m pretty sure it’ll work. I got the extrusion idea from forums I read long ago, of all things, about Quake 2 (!) I’m pretty sure that’s where I’m remembering the idea from — though it seems odd that a game like Quake 2 would need to know anything about bottlenecks in its maps? Maybe it was needed for bot A.I. Then the frontier walk idea is mine, to identify which bottlenecks are relevant to a given base.
One really cool thing about this algorithm is, by varying how the frontier walk starts, the algorithm may even be able to identify bottlenecks around a player’s entire empire/territory — not just around individual bases — so the A.I. doesn’t waste too many towers fortifying bottlenecks between its own bases.