Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Nov 2011
Offline Last Active Apr 25 2013 06:43 PM

Posts I've Made

In Topic: Article #2: Managing Entities (gameprogblog)

15 January 2013 - 10:40 PM


In Topic: Article - Generic Game Loops (gameprogblog)

09 January 2013 - 05:39 PM

Thanks for the input!

In Topic: Article - Generic Game Loops (gameprogblog)

08 January 2013 - 07:34 PM

Thanks for the advice, I meant to do that but forgot/was not motivated to.


It has been done!

In Topic: Client position and the unreliable nature of networking

21 November 2011 - 10:51 AM

Since you know the client update time is 100ms...

I don't know how you're updating the server, but you could increment a counter by 1 every 100ms and make sure a sequence sent from the client is never more than 2 (or something) more than that counter.

Or if your server reacts based on input rather than an update loop you could just keep track of the last time the server received a packet, and the sequence of that packet.

For Example

Client { lastPacketTime, expectedPacketSequence, updateInterval }

on packet receive

elapsedTime = currentTime - client->lastPacketTime;
elapsedFrames = floor( elapsedTime / client->updateInterval );

client->lastPacketTime += ( elapsedFrames * client->updateInterval );
client->expectedPacketSequence += elapsedFrames;

if (  packet->sequence > client->expectedPacketSequence ) {
	// sending packets too quickly, no no!

1. Account for expectedPacketSequence overflow.
2. Maybe let there be a difference of += 2 for expectedPacketSequence just to account for a slight unsynchronization in packet->sequence and the initial value for client->expectedPacketSequence.
3. If they appear to be coming at once, just think of it as the first one (or several) came late and the other one is perhaps on time (it can never be "early", thats what the above code should account for )

In Topic: How do you test servers?

20 November 2011 - 03:36 PM

In the past I've used http://www.vpsfarm.com/ to quickly boot up some nice VMs, run the simulations, and then stop them. With the cheapest package it was 3 cents (US) an hour for 1gb ram (or 12cents for 8gb). That would be sufficient I'm sure for a set of simple bots per machine.