experience with Steamhammer’s new map analysis
I’ve been trying out Steamhammer’s new map analysis for a while. It’s time to talk about it a little.
When I removed BWTA, the DLL file dropped to less than half its size. BWTA and its dependencies are big. It feels like a burden lifted. When I can get rid of BOSS too, the size will shrink again.
I settled on Zone
as the name. The most straightforward replacement of BWTA::Region *
is with const Zone *
; I kept the pointer representation so I wouldn’t have to redesign any other data structures. Some uses only care about zone IDs and can be slightly simpler (and microscopically faster). Zones don’t have as many features as regions. A zone data structure has only a few fields; I don’t need anything fancy.
Unlike BWTA, there is no separate data structure to represent chokes. If you want to know how choke-like a place is, call the.tileRoom.at(const TilePosition & tile)
, which looks up the approximate distance between the walls around a given tile (as measured in 8x8 walk tiles, at least in the current version). At a main base entrance, a typical tileRoom is 9; at a natural base entrance, a typical tileRoom is 21; in an open area, tileRoom is much larger. The tile room is calculated at game start from the inset of each walk tile, accessible via the.inset.at()
, which is the distance from the walk tile to the nearest unwalkable walk tile (BWEM calls this the “altitude”). The tile room algorithm uses a simple approximation to estimate the room from the inset in one pass.
After dropping BWTA, the first thing I did was run test games on random, mostly large and irregular, Blizzard maps. It was delightful to start up quickly without cached data.
There are still bugs on some maps, affecting the plan recognizer and the scouting worker’s looping path. The scout path needs to be rewritten anyway, it was never very good, but it will take time. I’m not entirely surprised, but still I didn’t realize how closely Steamhammer’s behavior is tuned to the exact regions returned by BWTA.
Still still next: Longer-term Steamhammer plans. Apparently “next” means at some point this year.
Comments
krasi0 on :
Jay Scott on :
Barcode on :
Jay Scott on :
BWEM is good and I could use it. My original reason to avoid it is that it doesn’t do everything I want. I had the idea that it was structurally difficult to extend it as I wanted. Then again, what I have written so far also doesn’t do everything I want yet.
A more objective reason is that a monoculture is limiting. Variety is good in itself. Though I notice that some of my independent decisions are similar to BWEM because BWEM has good ideas.
Maybe the underlying reason is a preference to write it all myself, so all the parts can be custom fitted and optimized for each other. My goal is not the best performance in the short run, but in the long run. Someday I will write a replacement for FAP too, though it will not be a combat simulator as such.
jtolmar on :
Jay Scott on :
Tully Elliston on :
Jay Scott on :
Tile room is useful more for tactical decisions, and again for all races. Defend a choke and you protect all spaces behind it. When retreating, fall back behind a choke and then make a stand. The tile room tells you how wide the choke is, so you can decide whether your army is the right size to defend it—a small army can’t hold a wide choke, a large army isn’t needed for a narrow choke. On the other side, wide open areas are needed to space out tanks or lurkers, or to surround before engaging, or to place buildings where they don’t interfere with unit flow. There are tons of uses.