Quote:
regarding interpolation mark, my preferred technique is to use an exponentially smoothed moving average - however i keep it completely separate from the physics. point is when i snap physics, i want the determinism of an extrapolation from the exact server snap physics state and input, so i just 'snap' the primary simulation, i have a separate smoothed object that follows with an exponentially smoothed moving average for the primary quantities (eg. smoothed position, orientation, i snap everything else)
Yes, we also extrapolate from the exact server position -- but the player never sees the snap - since the player sees the interpolated object positions. I haven't actually played around with many different smoothing algorithms -- mostly I just dorked with it until the interpolation looked good. As far as latency goes, eventually the interpolation catches up with the extrapolated position, at which point it just extrapolates (until the next server correction).
Quote:
mark, how does your ghost stuff work in TNL, also, did you guys use integer time (eg. fixed physics timestep) for tribes, or variable? one of the biggest things i've learned just recently is that integer time for networking really simplifies a lot, especially on the proxy/ghost side. running at 100fps integer time and your time goes from 1000->1004 you know you've lost two packets for example. etc.
With Tribes we used a fixed 32 ms timestep, with Zap I changed it to be whatever framerate the client is running at. But there is no notion of time encoded in the network protocol itself, rather each connection just tracks a running round trip time, and this information can be used in the interpolation and extrapolation of the higher level objects.
Quote:
also, mark - how hard would it be for me to strip down TNL and use it as a low level layer, eg. unreliable, reliable ordered and nat punchthru only, plus your bitstream and compression etc. what i want to do is build my own rpc/network object layer in LUA or Ruby. i'm currently using RakNet for my personal project because i could easily discard most of its simple rpc and network object stuff -- tnl seemed at first glance much more framework like, and harder to strip down. but i'd be interested in using instead it if this is possible
Actually, in TNL it is very easy to strip out layers you don't need. The basic (game) connection class hierarchy looks:
NetConnection -> EventConnection -> GhostConnection
NetConnection provides an unreliable "notify" protocol -- it simply tracks which of the packets were successfully received by the remote host and which ones were dropped.
EventConnection adds "events" - unguaranteed ordered, guaranteed and guaranteed ordered messages. RPCs are just "syntactic sugar" on top of events.
GhostConnection manages object replication, partial object state updates, prioritization, scoping, etc.
You can derive a new class at any point in the hierarchy - for example, in Zap, we derive a GameConnnection from GhostConnection for game communication and a CommServerConnection from EventConnection for the community login server.