Closed marcushutchings closed 1 week ago
I had this crazy idea to have above water/below water separation of states; though, it seems to be causing problems. I'll abort that idea.
It would be good to measure the perf cost at some point but I assume it's not worrying.
I'd like one of
* only force-align buildings with an exitonly tile in their yardmap * have `constexpr bool HIGH_RES_EXITMAP = false` such that exitmaps are compiled as 2x2 by default but one can flip the bool and they would Just Work as 1x1 in such build without the need to adapt anything * only align buildings to 1x1 instead of 2x2
It would be good to measure the perf cost at some point but I assume it's not worrying.
There will be a cost; though, I've tried to limit it, it is difficult to gauge. I'll see if AKU can get some insight.
1) builder placement UI for players is still 2x2 so it would only affect buildings spawned via Lua. 2) high resolution yardmaps (defined per 1x1 square, not 2x2) already exist. I assume (but haven't checked) that if you tag a 1x1 square as exit-only this way it would tag the entire containing 2x2 tile as exit-only. The reason I suggested that option is that I assume things could break if you used a 2x2 exitmap with 1x1 alignment, and I wouldn't want broken exitmaps to be an obstacle when working with alignment in the future. I generally want exit-only to be as un-intrusive as possible because I think the feature is of barely any use, for reasons I outlined in #453 (it doesn't solve the problems @WatchTheFort thinks it will solve). As long as it's cheap it's fine though, and I'm happy with 61d9152da1b401f8cc729713f05c6cdee84c7472. 3) which other parts of engine enforce alignment for Lua-spawned buildings?
builder placement UI for players is still 2x2 so it would only affect buildings spawned via Lua.
high resolution yardmaps (defined per 1x1 square, not 2x2) already exist. I assume (but haven't checked) that if you tag a 1x1 square as exit-only this way it would tag the entire containing 2x2 tile as exit-only. The reason I suggested that option is that I assume things could break if you used a 2x2 exitmap with 1x1 alignment, and I wouldn't want broken exitmaps to be an obstacle when working with alignment in the future. I generally want exit-only to be as un-intrusive as possible because I think the feature is of barely any use, for reasons I outlined in Exit-only yardmap types #453 (it doesn't solve the problems @WatchTheFort thinks it will solve). As long as it's cheap it's fine though, and I'm happy with 61d9152.
which other parts of engine enforce alignment for Lua-spawned buildings?
Sorry, I misunderstood you there.
I'm happy to discard this if there is a better way to solve these problems.
I ran the BAR pathing performance test and I could not discern an obvious performance impact.
I think it's cool as a minor feature and will still help BAR solve a decent chunk of their problems. Eventually BAR is going to discover the edge cases not covered by this and instate the gameside gadget anyway, but maybe this can happen organically instead of via zk trying to speedrun you through this.
builder placement UI for players is still 2x2 so it would only affect buildings spawned via Lua.
high resolution yardmaps (defined per 1x1 square, not 2x2) already exist. I assume (but haven't checked) that if you tag a 1x1 square as exit-only this way it would tag the entire containing 2x2 tile as exit-only. The reason I suggested that option is that I assume things could break if you used a 2x2 exitmap with 1x1 alignment, and I wouldn't want broken exitmaps to be an obstacle when working with alignment in the future. I generally want exit-only to be as un-intrusive as possible because I think the feature is of barely any use, for reasons I outlined in Exit-only yardmap types #453 (it doesn't solve the problems @WatchTheFort thinks it will solve). As long as it's cheap it's fine though, and I'm happy with 61d9152.
which other parts of engine enforce alignment for Lua-spawned buildings?
Point 2 is a very good one. If yardmaps can be individually set to high res regardless, then the alignment effort is insufficient. It makes sense that exit-only tiling has to be at 1x1 resolution. I agree that it will be too disruptive to trying and force 2x2 size and alignment.
Fixes https://github.com/beyond-all-reason/spring/issues/453
HAPFS raw move check hasn't been updated because the raw move code is rewritten in another PR, which calls the generic rawmove code, which has been updated to support exit-only zones.
I'm going to look to add building placemenet blocking for type 'c' as part of this change because I need the work here to do that. Note this doesn't impact the normal 'open' yardmap type as you would expect. Note, I'll also sort out 'w' since it will be minimal effort as well and it is something I wanted to offer for awhile.