Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Multiplayer: highest index player has no lag, everyone else lags when on same map.


kyle9217
 Share

Recommended Posts

**(solved! for some reason this problem only existed it the server was run on windows xp, tested on windows 7 it worked normal)**

OK not sure where to start to fix this so i will describe it.

when there are multiple people on the same map the person with the highest index number has no lag while everyone with lower index numbers lag, the lag is more of a spike where people move for a sec then it freezes then 3 seconds later it updates everything at once then freezes again and so on.

while the person with the highest index moves there is no lag for anyone else, but as soon as he stops moving it lags again.

I have tested this locally on 2 computers, and over the internet with 3 other people. and the same problems exist

is there a way to have the client send information even though the person is not moving, to remove the lag for everyone else?

**HAPPENS ON: EA, EO2.0, And 3.0**

[media]http://www.youtube.com/watch?feature=player_embedded&v=7NSOPTlOnO0[/media]

[media]http://youtu.be/yeMTwR2_t1I[/media]
Link to comment
Share on other sites

> Change your index number so that they each have the same index number you can do that in vb6

Oh my goodness… That would screw everything up. Its extremely vital that each online player has a different index number. Please don't post advice about something you don't fully understand.
Link to comment
Share on other sites

heres my loop

```

Sub ServerLoop()

Dim BuffTimer As Long

Dim i As Long, x As Long

Dim Tick As Long, TickCPS As Long, CPS As Long, FrameTime As Long

Dim tmr25 As Long, tmr500 As Long, tmr1000 As Long, tmr5000 As Long

Dim LastUpdateSavePlayers, LastUpdateMapSpawnItems As Long, LastUpdatePlayerVitals As Long

Dim PT100 As Long

Dim ML As Long

ServerOnline = True

Do While ServerOnline

Tick = GetTickCount

ElapsedTime = Tick - FrameTime

FrameTime = Tick

If Tick > tmr25 Then

For i = 1 To Player_HighIndex

If IsPlaying(i) Then

' check if they've completed casting, and if so set the actual spell going

If TempPlayer(i).spellBuffer.Spell > 0 Then

If GetTickCount > TempPlayer(i).spellBuffer.Timer + (Spell(Player(i).Spell(TempPlayer(i).spellBuffer.Spell)).CastTime * 1000) Then

CastSpell i, TempPlayer(i).spellBuffer.Spell, TempPlayer(i).spellBuffer.Target, TempPlayer(i).spellBuffer.tType

TempPlayer(i).spellBuffer.Spell = 0

TempPlayer(i).spellBuffer.Timer = 0

TempPlayer(i).spellBuffer.Target = 0

TempPlayer(i).spellBuffer.tType = 0

End If

End If

' check if need to turn off stunned

If TempPlayer(i).StunDuration > 0 Then

If GetTickCount > TempPlayer(i).StunTimer + (TempPlayer(i).StunDuration * 1000) Then

TempPlayer(i).StunDuration = 0

TempPlayer(i).StunTimer = 0

SendStunned i

End If

End If

' check regen timer

If TempPlayer(i).stopRegen Then

If TempPlayer(i).stopRegenTimer + 5000 < GetTickCount Then

TempPlayer(i).stopRegen = False

TempPlayer(i).stopRegenTimer = 0

End If

End If

' HoT and DoT logic

For x = 1 To MAX_DOTS

HandleDoT_Player i, x

HandleHoT_Player i, x

Next

End If

UpdateEventLogic

Next

frmServer.lblCPS.Caption = "CPS: " & Format$(GameCPS, "#,###,###,###")

tmr25 = GetTickCount + 50

End If

If Tick > BuffTimer Then

For i = 1 To Player_HighIndex

For x = 1 To 10

If TempPlayer(i).BuffTimer(x) > 0 Then

TempPlayer(i).BuffTimer(x) = TempPlayer(i).BuffTimer(x) - 1

If TempPlayer(i).BuffTimer(x) = 0 Then

TempPlayer(i).Buffs(x) = 0

End If

End If

Next

Next

BuffTimer = GetTickCount + 1000

End If

' Check for disconnections every 30 second

If Tick > tmr5000 Then

For i = 1 To MAX_PLAYERS

If GetPlayerVital(i, Vitals.HP) = GetPlayerMaxVital(i, HP) Then

If frmServer.Socket(i).State > sckConnected Then

Call CloseSocket(i)

End If

End If

Next

UpdateMapLogic

tmr5000 = GetTickCount + 30000

End If

If Tick > tmr1000 Then

If isShuttingDown Then

Call HandleShutdown

End If

tmr1000 = GetTickCount + 1000

End If

If Tick > PT100 Then

For i = 1 To Player_HighIndex

If IsPlaying(i) Then

For x = 1 To MAX_PLAYER_PROJECTILES

If TempPlayer(i).ProjecTile(x).Pic > 0 Then

' handle the projec tile

HandleProjecTile i, x

End If

Next

End If

PT100 = GetTickCount + 50

Next

End If

' Checks to update player vitals every 15 seconds - Can be tweaked

If Tick > LastUpdatePlayerVitals Then

UpdatePlayerVitals

LastUpdatePlayerVitals = GetTickCount + 15000

End If

' Checks to spawn map items every 5 minutes - Can be tweaked

If Tick > LastUpdateMapSpawnItems Then

UpdateMapSpawnItems

LastUpdateMapSpawnItems = GetTickCount + 300000

End If

' Checks to save players every 5 minutes - Can be tweaked

If Tick > LastUpdateSavePlayers Then

UpdateSavePlayers

LastUpdateSavePlayers = GetTickCount + 300000

End If

If Tick > ML Then

UpdateMapLogic

ML = GetTickCount + 300

End If

If Not CPSUnlock Then Sleep 1

DoEvents

' Calculate CPS

If TickCPS < Tick Then

GameCPS = CPS

TickCPS = Tick + 1000

CPS = 0

Else

CPS = CPS + 1

End If

Loop

End Sub

```
Link to comment
Share on other sites

hmmm lets see if i get this right the time you tested it you had 5 people online 2 of those were connected to the server over a lan network while the other 3 over the internet. Have you checked the ping the players are getting the 2 players connected over lan shouldnt have high ping so it might be only a coincidence that the player with the highest index is one of the 2 players connected over lan. Whats the internet speed in the pc you are hosting your server also are you running your server though the exe or though the IDE (vb6)?
Link to comment
Share on other sites

ok ill try to explain this the best i can

when there is 2 or more people on the server at once, the player with the highest index value will have no lag.

when the player with the highest index does not move npc will not move and damage will not show on lower index players screens, but the high index players game will run like normal

when the player with the highest index moves then it will update all other players npc locations and battle dmg will appear, as long as the high index player moves the game seems normal to lower index players

so if the high index player dosnt move its like all the lower index players games are frozen except they can still walk around.

here is a video of me trying to explain ans show you the problem [http://www.youtube.com/watch?v=7NSOPTlOnO0&feature=youtu.be](http://youtu.be/7NSOPTlOnO0)
Link to comment
Share on other sites

> You re updating maplogic every 30seconds U_u

```

' Check for disconnections every half second

If Tick > tmr500 Then

For i = 1 To MAX_PLAYERS

If frmServer.Socket(i).state > sckConnected Then

Call CloseSocket(i)

End If

Next

UpdateMapLogic

tmr500 = GetTickCount + 500

End If

```
Link to comment
Share on other sites

change this

[background=rgb(248, 248, 248)]' Check for disconnections every 30 second[/background]

If Tick > tmr5000 Then

For i = 1 To MAX_PLAYERS

If GetPlayerVital(i, Vitals.HP) = GetPlayerMaxVital(i, HP) Then

If frmServer.Socket(i).State > sckConnected Then

Call CloseSocket(i)

End If

End If

Next

UpdateMapLogic

tmr5000 = GetTickCount + 30000

End If

to ' Check for disconnections every half second

If Tick > tmr500 Then

For i = 1 To MAX_PLAYERS

If frmServer.Socket(i).State > sckConnected Then

Call CloseSocket(i)

End If

Next

UpdateMapLogic

tmr500 = GetTickCount + 500

End If

and delete

If Tick > ML Then

UpdateMapLogic

ML = GetTickCount + 300

End If

sent from mobile check the synthax.
Link to comment
Share on other sites

I have same problem ;]

In all version :<

[http://www.touchofde…ags#entry502305](http://www.touchofdeathforums.com/community/index.php?/topic/98343-my-fix-for-the-desyncing-problem/page__hl__lags#entry502305)

Fix for Eclipse Stable
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...