Closed blaberry closed 2 months ago
As discussed in #314, the distance check is slightly off compared to OG NT. It turns out nt-wincond has the same issue, and the only difference I can think of is that we take the players AbsOrigin instead of the ghost's. I tried doing that and it's the same, so either I'm missing something or there's something funky going on with the ghost position in OG NT.
I mean there absolutely is something funky going on in OG NT, because it seems you can randomly cap from further away by looking in different directions and jumping. I'm not exactly sure if that's something we even want to replicate. Anyway, I reopened this issue to get other opinions on this.
I think in general if we can make cap distance consistent and less jank, it's just parity+, ie more or less parity but better. I'm down for closing this as completed
Afaik weapons inherit the carrier's abspos, but perhaps it's calculating the distance from the entity attachment pos (i.e. roughly from where the ghost would be held, in the player's arms)?
I have to say I personally feel like 1:1 correspondence here is pretty fundamental, if we're off by an order of magnitude of >1 Hammer unit in worst case. But I guess you can close it if you want.
I'm not so worried about 1:1, especially if the current implementation is more consistent. But I'm OK with keeping this issue open until we can figure out what exactly OG NT is doing.
I made a map with some cap points with their center on the surface of the ground, and some tunnels that are 32hu in width at the very end. On the branch where the hull widths are fixed to be 32 by 32, the player can reach the very end of the tunnel, but is unable to fit through the 32hu wide hole. The distance between the player's absorigin and the end of the tunnel is 16hu (half the hull width) + about 0.2hu, depending on which wall the player was closest to when running towards the end
Placing a tunnel such that the players absorigin at the end of the tunnel is 128.8 hu (Sqrt(101^2 + 80^2)), both the player in ntre with their hull widths fixed and in the original can capture the ghost provided they hug the straight wall that is closer to the cap point, and no amount of jumping or twisting can capture the ghost if they entered the tunnel hugging the slanted wall, where their distance from the center of the capture point will be slightly larger than 129 because of the extra 0.something hu.
In conclusion I am very confident our current distance check will be identical to the original if we cast the distance from a float to an int, which in c++ always rounds down to the nearest integer
Here is the map used to test this nt_captest.zip
Provided the distance is cast to an int, both in the original and in ntre the tunel on the right does not allow capping, the tunnels on the left do allow capping. The tunnel on the far left is the most difficult to cap but is still possible to cap both on ntre and nt.
(Edit) I can open a PR with this fix soon, but it will rely on the hull width fix pr to be merged in first.
Damn that really seems like something me and rain should've realized while looking at this. But you're probably right, soft's nt_ghostcap does round down to the nearest integer. 👍
I just realised its even easier to test this using setpos. Casting to an int still works, as soon as distance is less than 129.00 hu, a cap of radius 128 hu triggers a capture
Ghost cap zones seem to be smaller in NT;Re than in Legacy, which leads to ghost capping not being possible on some maps or delayed, for example Rise heli cap. - StellaNova
Making ghost capture region the same. - Wakfu