You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
recently i run some test with my friend girl assistant koteq/cybergoth
the test app was 2 dots in window one i move with mouse other my assistant move and the other-person coordinates was sent per frame (via tcp socket)
i think i would like to make some kind of peer-to-peer pong game (two paddles and one ball) but the problem may be i guess the delay betwean sending and incoming packets
(i know what i ask is basic in network programming vut i never was coding it so i think i must rethink those basics and overall it is/should be interesting for every c programmer that want to touch a network at all)
i guess the typical pessymistic delay
between a time of sending and time of receiving may be 100 (200?) ms ..
if game is moderatelly dynamic i think the element like paddle or ball may move with speed of one screen width/height a second so the difference in a position then could be
1/10 or 1/5 of size of screen
right now i got no idea how to make simple code for that game that would minimalize the inpact of this deley
to players
how to code that?
should i code it in some symmetric way
make the delay be halved on two players or what?
bitrex
unread,
Dec 6, 2017, 4:57:05 PM12/6/17
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
You have to use some kind of client-side prediction; the two clients
can't be expected to be hard-synced to each other. That is to say the
packets being exchanged aren't used for a direct update of the paddle on
the other player's screen, but more as verification that what the other
client is doing already is correct.