Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[XP] Lag with larger maps (custom resolution used)

Roys

Member

Well. I don't know what version of the tile-class script you are using. I am guessing you are using a Class Tilemap script (?)
In that case I know there is one around (from SephirothSpawn) that "remap" things using the whole range of map datas. Which may be an issue if the map is huge

In other word : in the refresh method you should have 3 loops (in the version I know)
(version 0.91)
Code:
    # Passes Through Layers
    for z in 0...@map_data.zsize
      # Passes Through X Coordinates
      for x in 0...@map_data.xsize
        # Passes Through Z Coordinates
        for y in 0...@map_data.ysize

Obviously you dont want the loop to pass through all the datas, especially if your map is big. So you'd better have something like
Code:
    # Passes Through Layers
    for z in 0...@map_data.zsize
      # Passes Through X Coordinates
      for x in [0,$game_player.x-10].max...[@map_data.xsize,$game_player.x+10].min
        # Passes Through Z Coordinates
        for y in 0...[0,$game_player.y-8].max...[@map_data.xsize,$game_player.y+8].min

Ultimately, I am sure this is a good idea to use this script anyway, but this should at least slightly improve it

PS: If you have the same version as mine, there is a slight mistake in that script in terms of priority. I fixed it in case you want it (MP me)
 

Zeriab

Sponsor

Could you check up on your memory usage? (Task manager, Ctrl+Shift+Escape)
I believe there were problems with Seph's tilemap using way too much RAM.
I tested his script some time ago and back then I got up to around 1 GB memory usage before the game crashed (making maps bigger and bigger)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top