Jump to content

Insights on how best to handle extremely large tilemaps


Recommended Posts

So I have a tile map I need to generate that is 1920px by 38400px in size. Huge I know. The tileset I'm using to generate it is considerably smaller with 42 tiles where each tile has dimensions 40px X 40px.

Naturally only a portion of the tile map will be visible at any time so my plan is to generate chunks of the tilemap on the fly that I can pan/zoom/scroll over.


So far I've created the tile map using Tiled, exporting the map data as JSON. I've also created a separate JSON following TexturePacker's format so I can load the tileset into PixiJS. My next step is to take regions of the map data and draw them to a texture (or two for double buffering), redrawing/updating said texture every time the user pans/scrolls into a new region.

I'm not sure if this is the best way to go about it though. Anyone have any experience with this scenario?


Link to comment
Share on other sites

I've gone the opposite way about it and re-used tiles going out of view by moving them and changing their appearance so that they become the tiles coming into view as you move around. It was done (quite a long time ago now!) in DOM but performance was fine, even for mobiles (old phones now). I can only imagine canvas would be far faster at doing this sort of thing.


I'm not suggesting it is a better implementation, just a different one.

Link to comment
Share on other sites

You arent' first ;) Gigantic tilemap, (tiles 32x32) in production for 4 years: https://gameofbombs.com




https://github.com/ivanpopelyshev/pixi-tilemap : RPGMaker tiles, no chunks but that implementation is very fast, it uses shaders. I'll improve canvas fallback and it will be canonic lib for pixijs :) It doesnt depend on your map format, its like a super-effective ParticleContainer.


I can help you to adjust pixi-tilemap for your project :)


UPD. i need to add Tiled to list of supported tilemaps anyway. Lets work together? :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...