Babulesnik
Member
|
Sending and receiving neighbor matrix
I use to send and receive position neighbor class FastConnection. Data is transmitted normally, but sometimes twitch tank neighbor.I think that this is due to the fact that I pass the matrix actor,the physical body.Also, if there is a delay in receiving data. The object appears in the other. This leads to bad consequences. How can this be avoided? I do not know how it is being implemented in games.
Send:
Code:
void Send()
{
SockAddr addr;addr.fromText(TextAddres()());
File f;f.writeMem();f<<BRDM.actor_hull.matrix();f.pos(0);
FastConnect.send(addr, f);
}
Receive:
Code:
Send();
for(SockAddr addr;;)
{
Byte data[65536];
Int rcv = FastConnect.receive(addr,data);
if( rcv<0)break;
{
File f;f.readMem(data,SIZE(data));
f>>matrix;
BRDM2.actor_hull.matrix(matrix);
}
}
|
|
11-20-2011 07:06 PM |
|
Esenthel
Administrator
|
RE: Sending and receiving neighbor matrix
Try looking into Esenthel MMO sources for sending angles, position.
Interpolator classes are used.
which do per-frame interpolation.
instead of matrix send position + angles.
|
|
11-21-2011 12:32 PM |
|