A lot of questions...
Hi!
First of all, sorry for my bad english. Hope to be clearer as
I can.
I'm making a simple P2P multiplayer space-combat simulation.
The network system works already, but I'm using a linear
dead-reckoning approach that's not so good with Internet latency.
I read about dead-reckoning, cubic splines and other stuff, but
I can't figure it out. Please help.
Pay attention to the fact my game is for TWO PCs only. So this
is a very specific question.
This is my idea to improve the dead-reckoning system and make
things smooth. (Now remote ship "jumps" around, this is not good)
- Both PCs sends the packet (UDP) containing updated info
(ship position and orientation, timestamp, speed and acc)
every N milliseconds.
- I take care in my physic calculations about the average lag
(this comes from a previous ping).
- Both PCs keeps the last packet received in a buffer.
- When a new packet is received, I do:
-- Using physic I get the approx position of the remote
ship at time T+N.
-- I build a cubic spline using these four control points:
1) New position received
2) New position + 1 (???) second
3) Approx position - 1 (???) second
4) Approx position
- For all the frames between two packets I use the spline to get
smooth position for the remote ship.
Almost all of this comes from a very interesting article at
http://www.gamedev.net/reference/articles/article914.asp
And here are my questions:
- In the article the author combined Newtonian physic with the
cubic spline. To use the spline MUST I use Newtonian physic?
- The packet sending rate has to be timerized? (every N ms)
- In point 2) and 3) what the hell is that 1 second?!?!
- All this stuff is used to smoothly interpolate the position
of the remote ship, but what about its orientation? How can I
get it using a way like this?
- To build the spline is it better using the last real position
and an approx one than using the last two real positions?
That's all... I know I'm asking too much, but I can't really
figure it out!
Please help me!!!
Thank you!
Bye Bye
F104/NA
[edited by - F104 on August 29, 2002 2:56:14 PM]
Ok, I can answer one. I had some problems with that 1s as well, but I think I understand it now. To calculate a spline the gamedev tutorial mentions that 4 coordinates (x,y) is needed. Refering to
http://www.tinaja.com/glib/hack62.pdf
I would say that 2 points are essential, the 2 in the middle are "influence" points. These 2 points control the shape of the curvature.
I have played some with these splines and done some simulations in MatLab. Check out the image at
http://www.efd.lth.se/~f98hfr/spline1.gif
The red points are start and end points and the green points are the "influence points", this image is with influence points calculated as just c1=x0+v0 and c2=x1-v1
And take a look at
http://www.efd.lth.se/~f98hfr/spline2.gif
as well, where the "influence" is higher. (c1=x0+3*v0 and c2=x1-3*v1).
Sounds reasonable?
[edited by - Ichabod on August 31, 2002 5:25:08 AM]
http://www.tinaja.com/glib/hack62.pdf
I would say that 2 points are essential, the 2 in the middle are "influence" points. These 2 points control the shape of the curvature.
I have played some with these splines and done some simulations in MatLab. Check out the image at
http://www.efd.lth.se/~f98hfr/spline1.gif
The red points are start and end points and the green points are the "influence points", this image is with influence points calculated as just c1=x0+v0 and c2=x1-v1
And take a look at
http://www.efd.lth.se/~f98hfr/spline2.gif
as well, where the "influence" is higher. (c1=x0+3*v0 and c2=x1-3*v1).
Sounds reasonable?
[edited by - Ichabod on August 31, 2002 5:25:08 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement