Death to the nonbelievers! Finally I can drink a beer for my efforts!
This is a video showing the new netcode. First I run it without any lag just to show how it works “perfect”. Then I run Quality of Service, a program that simulates a real internet network, to simulate a 400-500ms ping and 25% out-of-order (dropped) packets. This is an environment nobody should attempt playing. Watch the video to see how it works.
For the whole week I was attempting to make a very precise algorithm to deal with smoothness. It worked on paper but not in the game. The animations and movement were very choppy. Finally I made a heuristic-like approach. It seems an approximation is always better than the real thing. This seems to correspond with Carmack’s experiences (http://www.fabiensanglard.net/quakeSource/johnc-log.aug.htm). Although I use a completely different algorithm than in any FPS game. I update the players only based on the key strokes and mouse controls. A full update based on the servers data is made only if the position or other important variables change “significantly”. The measure of this significance is a matter of a good guess. This method “just works” as you see on the video. The errors appear because of packet loss. But they are very quickly fixed and the game can continue.
The netcode is still not complete. There is a lot I have to do in terms of syncing game objects, weapons, bullets etc. I will be doing this in the following week.
Awesome!
Really nice! it is working smooth!!
(hail odin) and odin helped you.
nice job!
Very well done. I’d love to see how well it works with hit detection. I hope it doesn’t end up like in Soldat.
always nice to see something shaping up like this.
Death to nonbelievers indeed.
It would be impossible to hit that soldier. I know a 400ms ping is high.
But isn’t the only reason soldat’s hit detection is so bad because a soldier can move about once his own height and 4 times his width in 150 ms?
Another question: Are you able to make a 400ms lag look like a 300ms lag with a good netcode or are you able to decrease the lag to 300ms with a good netcode. How could you possibly decrease the effects of lag? Movement prediction? Wouldn’t that make a nice ‘worm-evasion’ bug?
LadyLoe: yes that’s why soldat netcode is hard cause it’s very fast. High lag is not a problem in itself, lag spikes and varyiness is the problem. If it varies from 300-400 it will be very hard to predict were the player is.
2nd question: I can make it look like 0ms. Look at the server screen, if I didn’t tell you what the lag is and you wouldn’t see the client screen you would not know where the player really is.
Hey MM, congrats! Glad to see all of this amazing work, especially with something as complex as networking code.
Keep rocking the world, get us a demo soon!
nice ๐ really
Oh yes, a Demo or a Beta version would be awesome!
But do not rush, just take the time you need, we can wait for the best game ๐
O_o….looks fine to me. I see what you may be trying to fix though. But in all honestly, most great games have the same ‘choppy animation from lag’ thing too. Your progress looks awesome keep going =D
Cool.