Solved

Network Interpolation

Posted on 1998-12-21
13
365 Views
Last Modified: 2013-11-20
How can I achieve a good network interpolation for realtime games. I want to write code that does the same that is done in Quake. If you have packet loss or if packets arrive in a wrong order the game should still behave approximately as it usually behaves (as in Quake). Please help.
0
Comment
Question by:MarcoHelmers
  • 7
  • 4
  • 2
13 Comments
 
LVL 4

Expert Comment

by:nil_dib
ID: 1326504
Why dont you use stream sockets?
Are you sure that games like quake works with datagram sockets?
0
 
LVL 86

Expert Comment

by:jkr
ID: 1326505
My usual answer to this kind of problem is taking a look at RPC, which makes life easier concerning all the different network transports (TCP, IPX, NetBios etc.)... You might want to take a look at the 'Hello' sample that comes with VC++ ('\DEVSTUDIO\VC\SAMPLES\SDK\RPC\HELLO') before we continue...
0
 
LVL 86

Expert Comment

by:jkr
ID: 1326506
nil_dib - sockets are usually OK, but what to do if there's no TCP/IP installed...?
0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1326507
mhh but in MFC I have socket support for DECNet, TCP/IP, IPX/SPX, NetBui ...
I think its also a problem to decide on which layer to put on ..4,5,6 ...
0
 

Author Comment

by:MarcoHelmers
ID: 1326508
I think you did not understand my problem. I have no problem sending packets or so (I use DirectPlay) ... I only want to know how to interpolate movement in a realtime (3D) game like Quake when you have situations where packets arrive very late (e.g. internet) ! In Quake the server in some way interpolates the movement of the clients so that the game seems to run smooth (even if no packets arrive for a while !!). Can you tell me a good way how to do it ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 1326509
I'd recommend keeping track of the recent packets and 'extrapolate' the movement sequence from the behaviour in the near past (liear or nonlinear, depends on what applies better...)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:MarcoHelmers
ID: 1326510
Does that really help ? What if a person ran directly towards a wall and shortly before he can turn around no packets arrive any longer ? Shall he run against the wall for a few seconds ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 1326511
Nope ;-)
But the player has to remain there, as you hardly can make an assumption on what could be done...
0
 

Author Comment

by:MarcoHelmers
ID: 1326512
Ok ... perhaps I did not completely understand you proposal ... could you explain it more precisely or perhaps even give some pseudo-coude to illustrate it ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 1326513
OK ;-)
Think of the following:
- you maintain a list of the last (let's say 2 for explanation purposes...) movement notifications

if there's a packet, all's well, add it to the list & remove the last

if there's no packet, calculate the (vectorial) difference of the last 2 moves and add the difference to the last move to create a new one and use it as if it was the arrived packet (this e.g. helps to maintain a circular movement - ok, it _could_ turn out to give a rediculus result)

if you decide to use more moving states, it might come in handy to treat them as a vectorial signal and use signal processing algorithms to extrapolate it (you see, i usually don't write games, but have done quite a lot signal processing... ;-)
0
 
LVL 86

Expert Comment

by:jkr
ID: 1326514
Hmm, what's gonna happen with this Q? ;-)
0
 

Author Comment

by:MarcoHelmers
ID: 1326515
Ok ... it would have been great if there would have been other ideas and suggestions but as this is not the case:
jkr: Please lock the question so that I can give you the points.
0
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 1326516
Thanx ;-)

BTW/PS: 'MarcoHelmers' sounds quite 'german', so: 'Gruß aus Schwaben' ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 48
repeatEnd java challenge 42 84
Macro to save highlighted rows as a separate file 5 41
sumDigits challenge 9 127
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now