Well... there HAS been a bug that antilagged too many shots, but even that bug (it was in 2.1 and fixed in 2.2.1, or maybe it was in 2.0 and fixed in 2.1) would not have caused misses as usual on greatwall.
Yes, g_antilag looks stupid and should get fixed, but that would need quite a large code change (especially given how bad the QC compiler is with respect to arrays). One important part would be redirecting the shot to the right spot on the player - but I have no idea how to do that.
The game code receives cursor_trace_ent (entity ID being hit), cursor_trace_endpos (the exact hit location) and cursor_trace_start (location of the player at the time of the hit). These values do not suffice to find out WHICH part of the player has been hit, so the shot can't be redirected to the right place. If we at least could get the time of the hit (MAYBE, but I am not sure, player.ping / cvar("sys_ticrate") returns the number of frames the hit is "old"), and if we find a way for QC to remember the previous locations of the player, we could get an actual hit offset (that is, we would then move the shot endpoint by the difference of previous and current position of the player). Even then it could still happen that an antilagged shot misses because of a door or rotating brush getting in the way.
Now, how to really fix this?
- Damage cursor_trace_ent anyway, no matter how far away he is - even if that means the Nex beam goes through a wall. Will make even more people complain about "cheaters" who shoot through walls. Also, it will make some really evil cheats possible - imagine a client always reporting cursor_trace_ent == SOME_PLAYER.
- Don't fix. Then an antilagged shot will use the right offset to the player. In theory this should mean the antilagged shot goes through the hitbox of the player, but even then, there can be an obstacle in between that causes the shot to miss.
- If an antilagged shot misses, adjust it so it actually hits the enemy. Sounds nice, but impossible to do in QC and extremely hard to do in the engine. It could for example use portal culling to find out which shot angles would have hit the enemy, and choosing one that's close to the actual shot.
- |Pull the enemy back to the original location, and hurt him there. Not really an option...
Currently we are at "Don't fix", but once we wrote a new antilag system (that possibly does not make any use of cursor_trace_ent any more and just uses the ping of the player to find the previous location of the enemy), we will perhaps go with the "adjust" solution, but only approximately - for example, we could try four hit locations: the one originally being hit, that one rotated by 120 degrees, by 240 degrees around the z axis, and the origin of the player. If the obstacle is horizontal like on greatwall, this is very likely to succeed. But a player who is originally hit by the shot but then disappears behind a corner won't be hurt when using that method, because any (and really ANY, no matter how it's done) antilagged shot would try to pass through the wall. And I do not want shots to pass through a wall...
BTW, antilag has another bug by concept - first the location the server knows is used to test the shot, and if it misses, the client's collision test is accepted. So that means that a running player has a larger hitbox for "ping challenged" players. Technically this would be a bug, but given that Nexuiz degrades quite much at a ping of 150ms, it isn't THAT much of a problem... but it does explain why some players CAN use the Nex with a high ping and still hit stuff. I doubt they get an advantage over a ping 0 player that way, but it certainly does compensate their laggy motion and weapon hits a bit.
The new "thought of" method of remembering the original positions of the players could also fix that issue, but I am not sure if we should fix it since it does level the playfield a bit - we certainly will fix it if we catch anyone abusing this as a cheat, even if it means penalizing people who have a high ping.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again
You can vary the number of "MS", so you can clearly see it's MS which is causing it.