[ENet-discuss] A few polishing points

Ben Johnson bencelot at gmail.com
Fri Jun 13 20:26:00 PDT 2008


Hey all, I'm almost finished with my networking now.. and I'm loving it!

I have a few questions though:


1) When correcting for lag, should I use roundTripTime, or
lastRoundTripTime? For example.. a bullet is fired on the server and sent to
the client, and I want the client to extrapolate it forwards by half the
roundTripTime, so it matches up with where it actually is in the server.
Would I be better doing:

bullet.position += bullet.velocity*(peer.roundTripTime/2000.0);
OR
bullet.position += bullet.velocity*(peer.lastRoundTripTime/2000.0);

2) When sending out packets from the server to the clients.. Should I try
bunch as much data into a single packet as possible? At the moment, Every
timestep (10 times per second), I'm sending out all the necessary data in a
single packet. For each client, this packet is about 600bytes on average. Is
this too large? Are there any general principles I should be aware of? I
know that I save bandwidth on header information if I send it all in just 1
packet. But does the increased size slow the time it takes to arrive? Or
perhaps it makes it less likely to arrive? In that case, would it be better
for me to separate the information? Also, how large are the combined headers
of Enet and UDP per packet?

3) I can connect to my computer, and other computers in my house via LAN..
but not to my friend's computer over the net. Is this because I'm using a
router? Also, how do I find out what IP to search for if I want to play with
my friend online?

Thanks! Ben.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20080614/d6fa61c7/attachment.htm>


More information about the ENet-discuss mailing list