Jump to content

  • Log In with Google      Sign In   
  • Create Account

gfxgangsta

Member Since 06 Dec 2011
Offline Last Active Jul 22 2016 01:29 PM

Posts I've Made

In Topic: I'm Getting An Index Out Of Bounds When Trying To Add Buttons Pragmatically.

20 July 2016 - 09:46 AM

The reason you're getting out of bounds is because "num" is 1. And you're creating an array of size 1. But then you're trying to access the array at index 1 (and arrays are zero-based).


In Topic: I'm Getting An Index Out Of Bounds When Trying To Add Buttons Pragmatically.

20 July 2016 - 09:38 AM

Looking at the inner loop, you have

 

for(j = 1; i < col; j++)

 

I think you want "j < col" instead.

 

Also, you don't seem to recompute "num" inside the loop... it'll always have the same value. But you are recreating your array every time inside the loop which is incorrect....


In Topic: Planetary Annihilation networking

09 December 2014 - 04:24 PM


The situation where t=0.67 when the latest receipt from the server is t=0.5 shouldn't happen in the general case. The client will try to keep itself at the server time + the average latency + a bit extra. Most of the time you're playing you will be interpolating toward the latest receipt from the server. Occasionally with a network hiccup you might accidentally catchup and overtake, I don't know what they do in that case. Probably they allow a little bit of running ahead with extrapolation, but if you end up too far ahead the time on the client probably slows then stops so you're not seeing too much made up stuff.
 
This also answers questions 4, 5, and 6, I think.

 

Thanks for shedding some light into this. I guess that makes sense... if the client gets too far ahead of the server values, that's when you could start seeing strange behavior or harsh corrections.

 

For question 4, then I guess stopping could happen naturally when you've reached the endpoint of your curve (or the "not too far ahead" point).


In Topic: Game server frame rate

29 October 2014 - 04:00 PM

hplus0603, thanks for that first detailed reply. It helps me a ton.

 

At some point, I won't be able to bring down my "upper limit" anymore. So, assuming a frame rate value that works without tunneling (i.e. 30Hz)... there will come a time when my server won't be able to handle more clients because I won't be able to guarantee each frame takes 1/30s. That's when I would need to add servers, correct?


In Topic: Game server frame rate

29 October 2014 - 10:33 AM

The game is very simple at this stage (and will probably remain simple). The player clicks to go somewhere, so it's given a velocity, and the simulation step on the server computes their position at the current time. Then, 10 or 20 times per second, the server sends the client its new position, and the position of other clients. The client can do prediction by checking the last few positions to compute a velocity estimate, or by using the last received velocity value(s) (if sent).

 

So, assuming that the server ticks as fast as it can (with an upper limit)... I can make that upper limit as low as possible (as long as I'm not "seeing" tunneling or other artifacts on the server, it should be fine), right?

 

Because clients will tick as fast as they can (and therefore, process packets at different times), they will see different things. But if the difference in latency between the different clients is not too far off, then it shouldn't be a big deal (depending on the game), right?


PARTNERS