Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 608 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
best way to send angle #421630
04/21/13 19:17
04/21/13 19:17
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
Hi guys,

got the follwing problem. I am using the "mouse_force" variable to change players angle. Since I rotate my entities on the clients seperately I send the "mouse_force" value from the client (which is movin the mouse) to the server and then from the server to the other clients. This procedure needs a lot of bandwidth. Is there any better way to archive the same result with less bps?

Thanks


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: best way to send angle [Re: MPQ] #421704
04/23/13 14:04
04/23/13 14:04
Joined: Nov 2011
Posts: 274
de
lemming Offline
Member
lemming  Offline
Member

Joined: Nov 2011
Posts: 274
de
How often do you send it?
You could wait on the server til the pan changes significant and then send the pan to the clients. Then you wait til it changes again significant. About 5 or 10 degree, you have to try different values. But make sure to do smooth rotations on the clients, or they will notice.

Re: best way to send angle [Re: lemming] #421706
04/23/13 14:39
04/23/13 14:39
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
ok how I do it in my FPS game:
1. Round the angle (use integer(urVar) to check), only send pan and tilt
2. If the result of the substractio is too big, send the new angle
3. Send in UDP mode, so you save much more packets for the TCP mode (Save bandwidth)
4. Lerp between the new anf old angle

Re: best way to send angle [Re: Ch40zzC0d3r] #421710
04/23/13 15:44
04/23/13 15:44
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
You can sufficiently send yaw and pitch using two 16 bit integers, instead of a full blown 32bit integer/fixed point. You are also left with an additional 7 bits per integer (assuming you use a value of 0-360), which means that you can pack additional torque data for the angle into it (use 0x168 or 0x7F to mask out either the angle or the torque).
The torque data can be used for dead reckoning to lower the frequency you have to send packages. Like Chaoscoder said, use UDP and allow the packets to be dropped and send every few time intervals (seconds, depending on your needs), a reliable package to synchronize the orientation of the character.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: best way to send angle [Re: WretchedSid] #421850
04/26/13 09:13
04/26/13 09:13
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
thanks guys! I am gonna try out your ideas


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1