Game Development Community

Projectiles not appearing soon enough?

by Eric Hartman · in Torque Game Engine · 09/12/2004 (7:15 pm) · 8 replies

I'm having a problem where projectiles are not always starting at the end of the gun barrel but rather several feet in front of it. Its like the client isnt getting the projectile until the next tick or two after it is created.

I set up a bunch of ghost players to test weapons on. While those players were alive the problem appears, but only when I shoot at certain angles. After I kill most of the players, the problem doesnt happen anymore for me, but it still happens for the bots no matter which direction they shoot.

Here is a video of the problem.

www.filebox.vt.edu/users/ehartman/problem.avi (1.3MB DivX)

Notice that at cetain angles, the vapor trail starts about 10 feet infront of the muzzle. Bots have this problem no matter what angle they shoot at. I suspect network players would have the same problem, but i havent tried it yet as this is primarily a single player game.

Any ideas about where to look?

#1
09/13/2004 (8:09 am)
Sure. The issue is that the server is creating the projectile, so you won't see it until the creation notice gets back to the client. There are ways to deal with this but they all involve trade offs in terms of accuracy of visual feedback.
#2
09/13/2004 (8:27 am)
Since I'm hosting the server, whats causing the delay? What would be some ways to deal with it?
#3
09/13/2004 (8:32 am)
Some sort of replication on the client, is my guess.
#4
09/13/2004 (9:35 am)
One solution would be to backtrack to the initial position of the projectile and fill in the particle trail. That would work over the internet.

For local/LAN play, it seems like it would be better to make sure that the initial update is sent before any ticks are processed on the projectile. But i'm not really sure how to do that...
#5
09/13/2004 (1:00 pm)
The best way to deal with it is to get zero pingtime. :)

Or you can write something to replicate back to the client, which would be difficult and complicated. Some games just do projectiles entirely client side.

TGE has the design stance that it's better to show the user "reality" as the server sees it, even if that means lag is more visible. After all, if you're lagging enough this is a problem, you're lagging enough to affect gameplay...
#6
09/13/2004 (3:05 pm)
I DO have zero ping time, thats the problem. I made that video hosting locally.
#7
09/13/2004 (4:24 pm)
Zero is relative. Your ping to localhost can be from 0 to 10 ms or more, depending on system load. At light speed, 10 ms is a long way. Even under optimal circumstances nothing is instantaneous.

You may need to have the client start drawing the projectile as soon as you fire and notify the server in the next update.

Rich
#8
09/14/2004 (6:07 am)
Ok, I increased the packet size and that seems to have solved the problem for my player. At certain angles there must have been too much info to fit in one packet.

The problem still happens for the bots, though. I think it has something to do with setImageTrigger because thats how the bots shoot and when I do setImageTrigger on myself, the problem occurs. Clicking the mouse works just fine though. hmm.