[Twisted-Python] "3D Game Using Twisted?", or: "Ach du lieber..."

Donovan Baarda abo at minkirri.apana.org.au
Thu Mar 14 21:51:59 EST 2002


On Thu, Mar 14, 2002 at 01:13:51PM -0800, Derek Simkowiak wrote:
> -> "Lag" is much more of an issue than just protocol design.
> 
> 	Of course, and I have been studying heavily all of the things you
> mentioned (prediction, et. al.).  But just to give you an idea of how
> optimized the 3D protocols are, Sony's PlanetSide only uses 4 bits for the
> Z component of it's entity origin update packets (because they are using
> tricks to get around the loss in granularity).
> 
> 	Also, as the guy who going to have to write the code, I'm kind of 
> looking forward to playing with different optimizations and "tricks".  If 
> I'm just calling somebody else's library, I lose all that fun :)

My advice with "tricks" is avoid them until the last moment of
implementation. Too many designs get complicated beyond redemption by
"clever tricks" too early in the piece. You end up with a tangled mess that
breaks every time you look at it, and usualy turns out slower than a
"trick-free" clean implementation of a good design.

> -> least consider using extensions to pb rather than writing your own protocol
> -> framework.
> 
> 	Because you are so persistent in this recommendation, I will take
> a very close look at pb.  But presently my intuition says I'll be writing
> my own.

My advice would be to prototype using Twisted, then optimise to C later if
it is needed. Python will allow you to easily re-factor the whole design
again and again untill you get it right. If you start in C, the re-factoring
will hurt enough that you will avoid it and employ "tricks" instead :-)

My gut feeling is that a good twisted implementation will be fast enough at
throwing bytes over a wire. Optimising to C will only buy you CPU, not
reduced latency and/or bandwidth. The really critical thing will be the
design, ie what data you send, and how it is used to present a consistant
world view.

Be prepared to think "outside the box" when at the design stage, and
prototype and experiment extensively. There are some potentialy groovy ideas
floating around based on "distributed data fusion", where all the nodes
maintain their own view of the world, which is used to correct and is
corrected by the other nodes "world views", using karmen (spel?) filter
techniques. This is a generic approach to resolving a concensus world view
between multiple distributed sources of information.

-- 
----------------------------------------------------------------------
ABO: finger abo at minkirri.apana.org.au for more info, including pgp key
----------------------------------------------------------------------




More information about the Twisted-Python mailing list