Jumpy Player when using split server/client
by Vijay Myneni · in RTS Starter Kit · 11/27/2004 (5:35 pm) · 6 replies
Hi,
I'm using the regular FPS Player which I brought into the RTS engine. I have it set up to where I can switch between controlling the RTSCamera and controlling the Player. When I play in normal mode (where I'm the server and the client), it works great. When I run a separate server (on my machine or another machine), and try to control the Player, he still runs around pretty well, and it looks mostly okay, but his movement is noticeably jumpy. Most often, he runs forward and then flickers back to where he just was, and then flickers forward again to where he should be and keeps on running. It all happens so that his rate of travel across the terrain is as it should be.
Can anyone think of reasons why this might be happening? Hints as to where to look in the code? What happens differently when you're playing as just a client vs. when you're both the client and the server? I've been hunting through the code but I just don't know enough about how moves happen on the client and server and how they're kept in synch (although I'm learning more every day).
If I can get this last problem fixed, my integration will be complete and I can post a resource.
I'm using the regular FPS Player which I brought into the RTS engine. I have it set up to where I can switch between controlling the RTSCamera and controlling the Player. When I play in normal mode (where I'm the server and the client), it works great. When I run a separate server (on my machine or another machine), and try to control the Player, he still runs around pretty well, and it looks mostly okay, but his movement is noticeably jumpy. Most often, he runs forward and then flickers back to where he just was, and then flickers forward again to where he should be and keeps on running. It all happens so that his rate of travel across the terrain is as it should be.
Can anyone think of reasons why this might be happening? Hints as to where to look in the code? What happens differently when you're playing as just a client vs. when you're both the client and the server? I've been hunting through the code but I just don't know enough about how moves happen on the client and server and how they're kept in synch (although I'm learning more every day).
If I can get this last problem fixed, my integration will be complete and I can post a resource.
About the author
#2
- separate RTS camera
- RTS build of the engine
Does anyone know if any part of the network code changed to accommodate RTS functionality that might be messing up the non-RTS Player?
11/27/2004 (6:27 pm)
Thanks for the reply Stephen. If that's all it is, then I'm okay with that. The only reason I thought it might be something else is that it doesn't seem to happen when I'm running around my Player in starter.fps with the old FPS engine. The main differences between that and what I've got now are:- separate RTS camera
- RTS build of the engine
Does anyone know if any part of the network code changed to accommodate RTS functionality that might be messing up the non-RTS Player?
#3
Quite honestly I've been focused on completely different aspects of the pack right now, so I haven't followed through much on our plans to integrate a third/first person player control yet, but Ben and Josh have suggested that there shouldn't be too many issues, and it sounds like you've gotten most of the work done.
If you don't find something in the next couple of days, you may just want to post what you've done so far in a resource, and possibly someone will notice something while implementing it!
11/27/2004 (6:59 pm)
Well, yes, a lot has changed, but as far as we've been told it's been "leaning down" a lot of the information that got passed into a tighter packaged RTSUnit.Quite honestly I've been focused on completely different aspects of the pack right now, so I haven't followed through much on our plans to integrate a third/first person player control yet, but Ben and Josh have suggested that there shouldn't be too many issues, and it sounds like you've gotten most of the work done.
If you don't find something in the next couple of days, you may just want to post what you've done so far in a resource, and possibly someone will notice something while implementing it!
#4
11/28/2004 (4:37 am)
@Vijay I seem to remember seeing something about simulated lag in the scripts/engine code. Might hunt around a bit and see if thats enabled.
#5
11/28/2004 (9:26 am)
@Gregory thanks for the suggestion. I didn't know about that. I checked, and it isn't enabled, but it's still good to know about, might help me test some things.
#6
11/28/2004 (9:41 am)
Maybe it's a priority thing? Can anyone think of why a Player being controlled while viewed through an RTSCamera in an RTSConnection might get less priority for updates than that same Player being controlled in an FPS environment?
Torque 3D Owner Stephen Zepp
When the server packets do show up, they are saying, "no, you should be HERE", and warping your player back. Then, you are most likely catching the rest of the delayed packets, and "warping" to catch up to where the server is when it catches up.
In general, the behaviour you describe is "as advertised"--what's wrong is why you are getting the lag you are, and in spurts.
Either it's real network lag, or the computer you are running as server is maybe not very powerful? In general, you shouldn't notice this interpolation/extrapolation/warping very often at all, but just like in AAA games, it does happen some.