If it's for a school project, it might not matter, so long as you make note that you realize it's a security flaw, but for testing purposes, allowed it to fly.
Otherwise, it'll be a smoother and more forgiving system than extrapolation (as I've recently been toying with, and finding out, on my own).
Since it's LAN only, if someone does cheat, I mean you can sock them in the nose.
Movement-algoritm over the network ?
I think you way you do it is fine. The better way would be to have the server being the authority (gaffer's article), as a security precaution, but for your purpose, that's overkill. You can link the article as a reference.
You can also look at how Source does its interpolation / extrapolation, but that's also overkill :)
You can also look at how Source does its interpolation / extrapolation, but that's also overkill :)
Quote:Original post by catch
If it's for a school project, it might not matter, so long as you make note that you realize it's a security flaw, but for testing purposes, allowed it to fly.
Otherwise, it'll be a smoother and more forgiving system than extrapolation (as I've recently been toying with, and finding out, on my own).
Since it's LAN only, if someone does cheat, I mean you can sock them in the nose.
Our goal is to make it public actually, but you know, the server also keeps position and velocity of the players, so if someone wants to cheat or something, the server wont let them, so I don't really know if you actually can cheat, you are only gonna fool yourself :)
But extrapolation, is that what EPIC is all about?
If so, does anyone have a good "step by step"- tutorial of how it works? Because I downloaded it and checked the source, but it's so much code so I get kinda confused.
Quote:Original post by catch
I think you way you do it is fine. The better way would be to have the server being the authority (gaffer's article), as a security precaution, but for your purpose, that's overkill. You can link the article as a reference.
You can also look at how Source does its interpolation / extrapolation, but that's also overkill :)
Ok so I guess I'll be fine to spam my server over TCP with 30 packages / s :)
But my very last question is actually; What is Interpolation and Extrapolation, since im Swedish, some words are not that common to me, and I haven't really found any article or something describing what it actually means.
Take care.
extrapolate means predict. It's basically algorithms to predict the position of an object forward in time, given his previous positions.
interpolation is calculating any position between a set of known positions to give a smooth motion.
Some algorithms use curve-fitting (catmul rom, b-splines...), trying to compute a smooth path between a set of points.
interpolation is calculating any position between a set of known positions to give a smooth motion.
Some algorithms use curve-fitting (catmul rom, b-splines...), trying to compute a smooth path between a set of points.
In Swedish, "to interpolate" is "interpolera" and "to extrapolate" is "extrapolera." So, not that far from the English versions of the words :-)
Quote:Original post by oliii
extrapolate means predict. It's basically algorithms to predict the position of an object forward in time, given his previous positions.
interpolation is calculating any position between a set of known positions to give a smooth motion.
Ok, so then I'm using extrapolation in my game, since it's like "position += velocity * dt" .
But interpolation still confuses me a bit, is there any good example out there showing it how it works?
Quote:Original post by hplus0603
In Swedish, "to interpolate" is "interpolera" and "to extrapolate" is "extrapolera." So, not that far from the English versions of the words :-)
Haha, yeah, I also checked it up but it didn't make any sense to me, lol.
With interpolation, you receive position data P0, P1, P2 ... at time t0, t1, t2 ...
Assuming the data comes in at a regular interval, then you make it so that you plot the position at time (Tcur - (t2-t1)), where Tcur is == t2 when you receive P2, and moves ahead at real-time pace.
Let's call the update interval (t2-t1, also t1-t0 etc) the Tu.
The position of the object at time T is then P1 + (P2-P1) * (Tcur - t2) / Tu.
More generally, instead of "1" and "2" you can use "N-1" and "N" when you have received an update for step N.
This will have the effect of showing the interpolated entity moving in linear segments between each update point; when you know that the entity was at point P1 and P1, the interpolation will move through exactly those points, which in general is a lot more precise match to the actual path of the object on the sending side, than a forward-extrapolated entity position would be. The draw-back is that you have to display the object back in time.
Assuming the data comes in at a regular interval, then you make it so that you plot the position at time (Tcur - (t2-t1)), where Tcur is == t2 when you receive P2, and moves ahead at real-time pace.
Let's call the update interval (t2-t1, also t1-t0 etc) the Tu.
The position of the object at time T is then P1 + (P2-P1) * (Tcur - t2) / Tu.
More generally, instead of "1" and "2" you can use "N-1" and "N" when you have received an update for step N.
This will have the effect of showing the interpolated entity moving in linear segments between each update point; when you know that the entity was at point P1 and P1, the interpolation will move through exactly those points, which in general is a lot more precise match to the actual path of the object on the sending side, than a forward-extrapolated entity position would be. The draw-back is that you have to display the object back in time.
Oh thank you for the explanation, I think I got it!
But what do you mean by displaying it back in time?
Because as far as I know, CS:S for example (thanks Olii for the link) is very synced between the players, right?
But maybe the time differance is so small that it's almost unnoticeable ?
I'm sorry if I'm bothering you with all my questions (lol), but I'm just new into this and wanna make sure I make it as good as possible and not some random hoax that just swallows my CPU...
But what do you mean by displaying it back in time?
Because as far as I know, CS:S for example (thanks Olii for the link) is very synced between the players, right?
But maybe the time differance is so small that it's almost unnoticeable ?
I'm sorry if I'm bothering you with all my questions (lol), but I'm just new into this and wanna make sure I make it as good as possible and not some random hoax that just swallows my CPU...
in the article, they take a sample back in time by (t - updaterate * 2). So it means that until you receive the next scheduled update, you will be interpolating. If a couple of packets are delayed / lost, you will be extrapolating a little.
That occurence would be pretty rare in normal conditions.
That occurence would be pretty rare in normal conditions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement