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

[EE 2.7] Map freezing fix!


Akselj
 Share

Recommended Posts

Everything here is client-side

In modGameLogic, in the Dim's in Sub GameLoop add:

```
    Dim TickMapTracker As Long
    Dim MapTrackTag As Byte

```
In the same sub, just under

```
            ' Check if we need to restore surfaces
            If NeedToRestoreSurfaces Then
                DD.RestoreAllSurfaces
                Call InitSurfaces
            End If

```
add:

```
            If GetTickCount > TickMapTracker + 1000 Then
                If GettingMap And IsConnected Then
                    If MapTrackTag = 1 Then
                        SendData "refresh" & SEP_CHAR & END_CHAR
                        MapTrackTag = 0
                    End If
                    MapTrackTag = 1
                End If
            End If

```
That's it!

All credits go to unnown for this fix. I just made the tut.

–AkselJ
Link to comment
Share on other sites

@Admiral:

> There are many times, when you warp (switching maps, or warping in general), the system will freeze up and forever say, "Loading Map" or w/e the switching-map msg says.
>
> This is a pretty crippling bug for active games.

hmmmm never encounter that in my game. but i will remember this just incase ^_^.
off topic: by the way admiral do you know how to fix this., when i warp/enter a map, the monster are gone. then when i return on the same map nor pressf1 then save, they appeared.
Link to comment
Share on other sites

  • 2 weeks later...
I believe credit should go to correct creator of this, and it is Technorobbo, and it can be found about 3/4 the way down this thread:

http://209.85.129.132/search?q=cache:j_4eT4DfFmYJ:www.vbforums.com/showthread.php%3Ft%3D555941+Set+DDSurf+%3D+DD.CreateSurface(DDSD)&cd=3&hl=tr&ct=clnk?=tr

As far as I knew, techno was not Unnown…
Unfortunately that fix only checks the map has loaded or not, and does not actually resolve the problem. If the fix I gave Nikkos works, then it resolves the issue without the need for a timer or more than 2-3 lines of code.

My fix works for me, and if it works for him also it may be a better solution, but time will tell.
Link to comment
Share on other sites

Well, what if I say unnown wrote the same thing? He might have, just because there is some code out there that is about the same it doesn't mean it isn't unnowns work cuz unnown as I know him isn't a thief.
Link to comment
Share on other sites

This isn't really a fix >_>

You're not fixing the actual problem which causes the freezing, you're just checking if it takes more than a second for the map to download, then automatically switching it off.

If your server has shit upload speeds, and/or the map is horribly big, then you're gonna cause more problems than fix.
Link to comment
Share on other sites

@Crimson:

> True, codes may be the same but it doesn't mean they're stolen.

The variables are named MapTrackTag and MapTracker.Tag. I could understand if it was "x" or "y", but names that close don't appear much. Unless Unnown is this guy, which I doubt (Unnown's not from Chicago), then yes, it is likely a copy. However, Unnown still modified it for Eclipse. It's likely that he could've found that code a while back, modified it, and told AkselJ the reworked code when he asked.

But that's not even the real issue, though I'll have to ask you to contact Unnown about the source of this fix, or we'll have to remove it for plagiarism, as much as I don't want to. The real issue, though, is fixing the problems with the maps being sent over. This, for me, only happens when the player's client is out of sync with the server, and this happens usually when another player enters a map. Maybe a refresh is needed upon other players entering. I'll check it out and see what I can come up with.
Link to comment
Share on other sites

@♪♫♪:

> This, for me, only happens when the player's client is out of sync with the server, and this happens usually when another player enters a map. Maybe a refresh is needed upon other players entering. I'll check it out and see what I can come up with.

Yes, that's the real issue.

I usually just solve it by using a "Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))" on the sub when a player changes his map (via main.txt).
Link to comment
Share on other sites

You don't need _any_ refreshing, and you certainly don't need to stop the damn thing after a second.

That's like adding a check to any game which stops the process if the loading screen stays open for over 5 seconds.

Whenever a player moves, send the player's movement data to _all_ the players on the map. Including the moving player himself.

Client-side movement is there to make the game appear smoother. That's fine, but double check the bloody thing. Don't expect the client to calculate anything, or keep itself in check.
Link to comment
Share on other sites

@AkselJ:

> Well, what if I say unnown wrote the same thing? He might have, just because there is some code out there that is about the same it doesn't mean it isn't unnowns work cuz unnown as I know him isn't a thief.

No, Im sure the two of them are psychic and shared their thoughts over a mind meld.

Robin, I agree once again - this is scary..

Its not a fix as ive said, and only detects if the map has been loaded every second or so, and was absolutely no good for people like me that dont use static maps.
Link to comment
Share on other sites

It's in Nikko Stalwarts tale threak Aksel, and its not really a fix, well it is sort of, it definately improves the problem not happening.

For me anyway, it was dependant on the speed of the PC running the server. The slower the PC, the less frequent it would happen. So eventually I put a few sleep commands in the sub joinmap and it stopped happening. I tried various things, but the receiving map problem only seemed to occur on higher end pc's. Im sure a guru programmer will explain how the packets need time to be read before being sent again etc.. but anyway..

so yeah just slow down sub join map server side by like .3 of a second. Not ideal, but effective without really doing too much at all.

Im yet to see a proper fix for it… as the Sleep timer value is dependant on cpu speed.
Link to comment
Share on other sites

  • 3 weeks later...

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...