Open Error323 opened 14 years ago
I don't know how anyone was planning on implementing this into the game, but I thought of a simple (sounding) way to determine where to build a nano tower. When a factory is first determined where to be built, spaces around the factory should be checked to determine if there is room to build say 3 groups of 2 nanos. If there is enough room, the factory is constructed, and the nano tower spots are permanently reserved for future nano towers to be built there. I don't really see a need to build nanos anywhere else.
First problem is detection a mod/game has nano towers actually. And teach it to distinguish from repair pads. Or we again will use hardcoded tags in config file? We're almost out of 32bit limit for flags :) Secondly, when commander builds a factory it has no access for nano towers from its build menu. And you suggest make some planning ahead for build places. It is not easy in current AI design.
I assumed nanos would be hard to use correctly, especially since no ai uses them coherently at all. Some assumptions are already made in the configs (builders can build, assist(other builders), reclaim, etc). Probably something along the line of factory-assister would be sufficient to single out nanos in a mod, since all assistance is not the same. Does the ai now assume that a builder can build at least one of every class of building to the point where com's lack of nanos would require major rewriting? And finally, one thing which could provide a major efficiency boost would be some kind of adaptive 'no buildings here' zone. This could be used to reserve space for future buildings (nanos, a factory in a safe location) or more importantly, prevent mmakers and stuff from clogging the front of the ai's base, reducing the late game large base clogs.(I know this is really a separate request) From my minimal coding experience, I know these are probably very difficult, but I have always have been better at spewing potentially-practical ideas first, then narrowing down later ;)
Just assign a 64 bit long and you have plenty of flags (i know it's a bit slower). i officially volunteer to write these to the config file :) I think preplanning is not so important. Just when decided to build a nano, build it where an assisting bot stands. (and send him away) Then you have a surely available place.
Maybe the std::set is better. I don't know how much it is used and if it's a cpu hog or not.
std::set
Here is my version of nanotowers. Works for me (when enabled by next patch). http://github.com/snakeru/E323AI/commit/2f09e961694faa64fbf87d3a0c1eb79ced1a8ada
Actually my version does build repair pads. But there is a way to fix it: nanotower is not onoffable (at least in BA7.12). repairpad and tracer (what does it do in this category btw?) are.
In order to stop clogging up the factories, nanotower support must be implemented.