Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / why may game verly lag..(Multisync)

Author
Message
Taoie
11
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Jan 2010 15:27
I use Multisync.dll..
play on internet.. when 2 players it is work ok.
but when there more than 2 player..Host will be very slow and sometime lag.
but all clients is still ok..
KISTech
11
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Jan 2010 17:34
(I know you said Multisync, but I don't remember the commands, and MikeNet/DarkNet commands are pretty similar.)

Two things come to mind..

1. Without seeing some code we can't really tell how well your code is optimized.

2. The host is handling x^n amount of data, while the clients are only handling x*n. So unless you use some pretty serious tricks of multiplayer game networking, it's going to be slower than the clients.

(x being the movement data, n being the number of players.)

Tips:

- Don't send player movements (or any data packets) every loop. That's just going to overload the connection and cause lag almost instantly. Instead, use a timer or loop counter to control how often you send player movement data.

- If the area in the game is large enough that some players can't see each other, do a simple check on the host to see if two players are close enough to bother sending them each others movements.

So, instead of using,

mn Send TCP ALL

use,



It looks like a lot of processing, and it is, but trust me, when you have 20 players in the game, and only 5 of them are within 2000 units of each other, this is a huge time saver.

Also, using UDP to send player movement data helps. Which you may already be doing, but it's hard to tell without some code.

There are other things too, like decoupling your game loop from your display loop. But that's a whole other discussion...

NightX
10
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 10th Feb 2010 07:59
i use a timer, so it updates every 10 - 20 milliseconds if a e.g. collision, button press ect...

Benjamin
16
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Feb 2010 13:41
You've provided next to no information, so I can't really give much advice.

Login to post a reply

Server time is: 2019-10-18 21:48:51
Your offset time is: 2019-10-18 21:48:51