I recently made a tool for Halo CE that draws other players slightly ahead of where they are, using their velocity and your ping. That is, it draws them such that you can often shoot without leading. It works for vehicles too. It is not perfect; obviously, there is no way of predicting that a player will change direction. "Draw" is also the wrong word, as it does actually affect the physics in a weird way (but only briefly, unlike one of the prototype versions, which constantly had players falling through the floor).
What would be better is if the server could correct the actions of players based on their ping. For example, the server could store the positions of players for the last second. I am not sure how many positions that is (how many updates there are per second) but I am guessing it might be 30 positions for each player. Then, when player X fires a shot (and the server is doing the collision test for the shot), all other players would have their position (temporarily) set to one of the earlier stored positions (depending on the ping of player X). Hence, player X would not need to lead his shots, although the actual hit would still be delayed.
This is a slightly simplified example. Ideally, all objects could have their positions and various other important state information stored from the previous 1 second (or the maximum allowed latency that is desired). I am also not certain how easy it is to relate events (such as the collision test of a vehicle that has been pushed by a player) to the player that caused it and how easy it would be to hook into the code for these different types of collision tests. I guess it would also be challenging to identify which bits of state need saving, especially if other objects are referred to.
I thought this idea seemed like a rather naive form latency correction and that it may not really work well enough in practice. However, I recently saw that Valve's Source engine uses this type of hit detection. Therefore, I guess it can work well.
This does allow the situation where player X appears to be in cover on his screen, but is killed by player Y, because the latency of player Y caused player X to be moved back out of cover when the server performs the hit testing. However, this is usually the case with any kind of hit detection that does not require players to lead their shots and I think it is probably a reasonable sacrifice. A limit could also be set on how much latency correction is applied.
I have thought about implementing this, but I fear that my knowledge of Halo's engine is probably too limited. I am also just about to start some other work that I should probably give priority to. I don't know much about Halo's object list and how objects are deleted/added etc. I don't know where the different collision tests are performed and what parameters are accessible. I thought that, to start with, it might be worth just trying a proof of concept, where only player positions are stored and only immediate hit tests (e.g. pistol?) are considered. I remember in the Halo 2 engine you could figure out who had caused the damage (or who owned the bullet), but I can't remember the details. Thus, I think it would be possible to intercept the hit detection function and adjust player positions as explained above.
I know that "idea" posts are not appreciated, but I hope those with a good knowledge of the Halo engine can see that this is perhaps reasonably plausible. Of course, I have probably missed many issues that would arise and maybe this is just not feasible. I may attempt this one day, but it would be even better if those more knowledgeable are interested in trying it.
(On a somewhat related note, does anyone know the units of velocity that is found in Halo's memory for players? How many updates are there to player positions per second? The overall related question: What is the formula for working out where a player should be drawn given the velocity and current position (of others) and ping (of the client)?)
Bookmarks