Skip to main content
gamedev.net
🔒 Locked

Solving latency issues

Started by Witchcraven Feb 21, 2005 at 2:18 PM 4 replies 450+ views
Original Post
Witchcraven
Witchcraven
I was playing some battlefield vietnam online, with a ping of around 80, which is very acceptable. My friend was playing in the same server, on my team. We both spawned at the same time. He was looking at me, so just for the hell of it, I moved left. There was a noticable delay between when my character moved on my screen an when he saw me move. So it got me wondering how this is handled. If one of us were on opposite teams sniping the other, that could mean a lot. Like if just by coincidence I moved a little, and he fired just a instant later, from my perspective I would dodge the bullet. But that would not have happened on his screen yet, and he should have scored the kill(from his POV). So how would this be handled? Who should the game favor? In reality it would favor me, because I moved first. But from his perspective, it would be frustrating, as he clearly had a bead on my head, fired, and the bullet would have plenty of time to reach my brain, yet he would miss. I suppose in online gaming I would probably favor the gunner, because it is almost impossible to determine from a targets perspective whether a sniper was aiming will enough. But there are all sorts of glitches like this in BFV if you have a friend to compare to. For example, one game we were on opposite teams. We had the displeasue of running into eachother. We both opened fire, I was aiming at his head with the type 56. I got 4 rounds off, with the little feather damage indicator telling me I hit him. I should have either killed him or damaged him severly. Even BFV told me so with the indicator. But he killed me. I looked over at his screen, and noticed he had taken no damage. I dont know how that happened, but it was very frustrating. I suppose that is why I cant just use time stamps to make sure verything happens at the right time. The shooter may end up frustrated. It needs to seem instantaneous, even though the game is actually playing in the past. So how would you handle these problems? [Edited by - Witchcraven on February 21, 2005 2:34:16 PM]
--------------------------I present for tribute this haiku:Inane Ravings OfThe Haunting JubilationA Mad Engineer©Copyright 2005 ExtrariusAll Rights Reserved
Witchcraven
Witchcraven
Consistently no. This one server, despite the low ping, had issues. But sometimes it happens. I am using BFV as an example of the possible problems. I would like to know how to best solve them. The events cannot occur in the order they actually occurred all the time, otherwise bullets will mysteriously miss, or hit you while behind cover.

Although, sometimes I think BFV just makes stuff up, because it knows you will not notice. One time, I was driving a tank, when it suddenly exploded. It told me a person killed me with a scoped M16, which is impossible. M16 bullets cannot destroy tanks. What made it even more interesting was the person happened to be in the same cyber cafe as me, 2 computers down. She had not even spawned yet (as in, not playing), and was reclining in her chair talking on the cell phone.
--------------------------I present for tribute this haiku:Inane Ravings OfThe Haunting JubilationA Mad Engineer©Copyright 2005 ExtrariusAll Rights Reserved
oliii
oliii
How about that.

The client send "At that frame, I've hit this guy in the head from this position and direction, with this gun, with this much ammo left, ...".

The server will then confirm the kill, to make sure the client isn't cheating (like checking consistencies in the movement and position, ect...). The server can also do a re-run of the bullet trajectory check himself, track back entities to the moment the shot was fired, and give a kill or not. With big pings, the shooter is at a disadvantage if the server can't predict back in time far enough to confirm the kill (usually, the server only bothers to interpolate up to 3/10th of a second at most).

Even then, if the Target's movement was erratic, the prediction can get it slightly wrong, and then a headshot can be missed (since the head is a pretty small target compared to the speed a player can move).

Server could also store the game state in a stack, up to say, 1 second, then go back to the frame the shot was fired, or store the game state every 10th of a scond and interpolate, and do a perfect hit test. But that can be a lot of trouble for not much.
Everything is better with Metal.
oliii
oliii
of course, with the lag, you can have the comical situation where two players shoot each other dead, or the wrong one dies. Basically, one player being dead still sends a hit data to the server, who would happily process the data. If packet ordering is a bit screwed, that can be funny. Or very annoying.
Everything is better with Metal.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.