Map Breaks After Moving Too Fast

When the player moves from room to room too quickly, this can sometimes break the map when one of the destinations is an unexplored room. The map stops updating and the yellow dot representing the player no longer changes position. I'm currently trying to fix this with the following code:

  JS.Grid_ClearAllLayers ()
  Grid_Redraw
  Grid_DrawPlayerInRoom (game.pov.parent)

This seems to redraw the map properly but it fails to reenable the player indicator's movement; the indicator will remain in place even though the map's focus will move to the new room. What can I do to refresh the indicator?


When you say "moves too quickly", do you mean number of moves, or distance? I can see a possible issue if the player moves again while the previous movement is still being animated; and a different one which could crop up if the player teleports to a room a very large distance away.

I think the second case is probably handled correctly by grid.js, because I think one of my games would have struggled with it otherwise. So you're probably referring to a rapid-fire series of normal-length moves. But would be good to clarify.


Yes, I think the first case might be what the issue is. It's not something I can reliably reproduce either, so I think latency might play a factor as well.


I've gone through the code by hand, and didn't see the particular error I expected to find based on your description of the issue.
Can you check if there are any messages in the JS console (Ctrl+Shift+J on Chrome; not sure about other browsers) when this happens?

If the player object is falling off the list of objects for the current layer, moving it should re-add it; which makes me wonder if onFrame is failing to run; but then I think that clearing the screen wouldn't start it again. Unless the issue is that some object in the redraw queue is corrupt, meaning that it generates an error on every redraw until it's removed by clearing the screen. This would likely always affect the player object, because gridApi.drawPlayer moves the player circle to the end of the queue, to ensure it appears on top of all the rooms.

But it's hard to say more… if there's an error message, I think that would help.


I actually can't reproduce this issue in the browser version. From what I can tell, the compass won't register input until the player has finished moving to the next room on that platform, so rapidly moving between rooms isn't possible. In the desktop client, however, this wait doesn't exist. For instance, I can stack up three clicks north before I've moved to the next room, and it will send me three rooms north. This different behavior seems to be where the bug is rooted.


Oh, and I just realized that I should clarify that I'm using version 5.8 for my game, not 6.


Hmm… I suspect that the lag on the web version would make it impossible to move that fast. Unless you have a huge map, I guess. What about if you use multiple commands? (like entering "north.north.east.north" if your game supports it)

I don't have the desktop version here, so debugging will be pretty hard if I can't replicate the problem.
I'll try a couple of ideas to see if I can make this work on the web version; but I'm really not sure about the nature of the issue.


Hmm, I can't get multiple commands to work like that. Is there a way to enable that?


I think there's a box to tick somewhere in the game settings.


Log in to post a reply.

Support

Forums