Open Alicecomma opened 4 years ago
Some original intentions:
erode the texture for area larger than k else dilate, or use the second directive of the texture to get the "content width of the sprite" if it has a contour or a shadow-like thing.
https://www.mathworks.com/help/images/morphological-dilation-and-erosion.html
IMO the biggest reason that CE is so widely love-hated is because it is incompatible with anything unless someone writes a specific patch for it. Here it seems like the ideal strategy would be to use the sprite graphic calculator for any pawn race definition that lacks a body size def (which might even be better as a modextension, so manual support could be added as a patch instead of as a load-on-demand def that swells the def database and bloats the cross-referencing pass).
With a hybrid system, non-manually-adjusted mods would retain basic compatibility, and any behaviour that isn't "good enough" out of the box can be fixed with an enhancement pass by a patch author.
That is more or less the current system, however it could be expanded to handle ALL cases also handled by the texture-based approach.
The texture approach distinguishes between the following:
So, the Def-based approach would need to hold information for each of those -- and be kept at least moderately up-to-date to the RaceDef changes
I think the texture erosion stuff would not be performant enough for loading a few thousand textures on startup, although I wouldn't know. I thought before of requiring a separate mask texture for each pawn with exact hitbox boundaries, so it'd be a more visual thing, although perhaps that'd also increase loading times significantly.
Some issues with hitboxes:
Some solutions: