This is my first contribution to spring. Any feedback and comments are welcome.
- Area build now builds every second row in the opposite direction.
- Perimeter build now builds in counterclockwise or clockwise order.
- Circle build now builds in counterclockwise or clockwise order.
- Using non-square buildings for circling something now works.
- Basically totally rewrote GetBuildPos to do this, the new code is shorter and cleaner.
Before, the build order was horribly inefficient and required lots of walking around. Also, if you wanted to circle any building with non-square buildings, they would block each other and not form a full ring.
fitch.tky.hut.fi/~semi/GetBuildPos_semi.diff
There's one small glitch. If you try to circle a radar tower with vehicle labs (I don't know why anyone would, but still), only the top and bottom ones are queued instead of all the 4 that are required. Any square building works, and if circling a perimeter camera or a defender or any other size of buildings with vehicle labs there are no problems. And even the radar tower will get correctly circled by vehicle labs if the buildfacing is flipped 90 degrees.
I think I've tested everything heavily, and this should not have any other issues. The small glitch is basically much smaller than the bug I did fix with the same stuff. However if anyone can easily see what I missed, tell me.
Since I totally rewrote one function, it's probably easier to look at my code by looking at this snippet:
fitch.tky.hut.fi/~semi/GetBuildPos_semi.cpp
which contains just the reimplemented function and the helper functions I needed to make.
So, umm, what am I supposed to do now?
patch: improved build order for all kinds of area build
Moderator: Moderators
Its fun to read about these weird glitches like radar tower not being circled by factories and not even a coder knows whats going on there and has no idea of how to find out. It seems spring has developed a conciousness of itself, and is now growing in resistance.. first sync errors, then crash errors and now this thing that makes no sense... :d
I found and fixed the bug about being inable to queue a radar tower and vehicle labs circling it.
It turned out that it's much easier to reproduce that bug. Just need to queue a single radar tower, flip buildfacing once, and try to queue a vehicle lab right next to the tower on the left or right. This will actually result in cancelling of both.
Another way would be just queueing a flipped fusion and trying to circle it with DT. Not all DT would appear.
The issue was just that when checking if queueing a building order would cancel another, flipped buildfacing was not considered at all.
Now I can submit both of my patches to mantis.
It turned out that it's much easier to reproduce that bug. Just need to queue a single radar tower, flip buildfacing once, and try to queue a vehicle lab right next to the tower on the left or right. This will actually result in cancelling of both.
Another way would be just queueing a flipped fusion and trying to circle it with DT. Not all DT would appear.
The issue was just that when checking if queueing a building order would cancel another, flipped buildfacing was not considered at all.
Now I can submit both of my patches to mantis.