Melee terrain damage
OK, so "simple" bullet tracing (even with several different trajectories) didn't work well.
I will try more complicated rules, depending on:
a/ direction you are facing
b/ elevation
c/ actual presence of an object (west wall, north wall, object or floor)
d/ plus a few selected trajectories (or better said only target voxels, even without LoF in some corner cases) per above hopefully covering majority of normal-shape walls and objects
Attached are the targeted objects in order per case.
The diagonal objects may be obscured by far walls, in which case (very rarely) they wouldn't be destroyed.
0 = N = up-right ... 1. north wall (origin tile), 2. object (from tile in front of you)
1 = NE = right ... 1. west wall (from right-hand tile), 2. north wall (origin tile), 3. object (from diagonal tile in front of you), unless blocked by 2 other unreachable walls?
2 = E = down-right ... 1. west wall (from tile in front of you), 2. object (from tile in front of you)
3 = SE = down ... 1. north wall (from right-hand tile), 2. west wall (from left-hand tile), 3. object (from diagonal tile in front of you), unless blocked by 2 other unreachable walls?
4 = S = down-left ... 1. north wall (from tile in front of you), 2. object (from tile in front of you)
5 = SW = left ... 1. west wall (origin tile), 2. north wall (from left-hand tile), 3. object (from diagonal tile in front of you), unless blocked by 2 other unreachable walls?
6 = W = up-left ... 1. west wall (origin tile), 2. object (from tile in front of you)
7 = NW = up ... 1. north wall (origin tile), 2. west wall (origin tile), 3. object (from diagonal tile in front of you), unless blocked by 2 other unreachable walls?
Floors will be completely ignored.
For elevation 0-11 (maybe 0-9 ? or maybe 0-X ?) the current-Z-level tiles are considered.
For elevation 12-23 (maybe 10-23 ? or maybe (X+1)-23 ?) the tiles one level higher are considered.
X could represent "chest/arms level", something like unitStandingHeight-8 resp. unitKneelHeight-8.
Probably best whatever is used for bullet LoF check.