Endless isometric world

Hello !

I have a question about working with isometric maps in Phaser. I need to implement infinite scrolling of the map, so that when the end is reached, it starts from the beginning. I was able to find examples for 2D maps, but they don’t work for 2.5D. I would appreciate any help.

Hi. What happened when you tried to adapt that example?

Since I have little experience with Phaser, I may be wrong. But it seems to me that this does not work because with an isometric map, the map is not rectangular but a rhombus

I tried to move it here

I see what you mean, yes. For the map it might still work if you have the camera views overlap. But that wouldn’t work well for the sprites.

The only other way would be to modify the tile map layer renderer, I think.

Yes, I was also thinking that it wouldn’t work for the sprites. Could you please advise on how to modify the tile map layer renderer?

I was just thinking, about this question. And came to this wild idea, disclaimer I didn’t test it yet(because I’m on my phone), but maybe you could create 4x tilemaps/layer(s) and offet them so that they align, and teleport the player and other stuff. if this quadruple amount of data/objects does kill the performance, this might be a “easy” workaround.

There are two rendering methods in the Phaser source. You would have to wrap the tile coordinates somehow.

I’ve spent a significant amount of time studying how Phaser renders tilemaps and have come to realize that accomplishing this task well is practically impossible. Unfortunately, all the methods I’ve attempted have had a significant negative impact on performance.

Thanks for your idea. To be honest, I didn’t quite understand how to implement it. I tried to redraw the tile map depending on the camera position

Here is a short demo showcasing what I meant, base on this official phaser demo.

I hope this make my “idea” abit more clear, even though the map of the demo is no designed to be wrapped around.

My demo just works when pressing the left arrow and it would have to be tweaked just a bit, so that the cuts aren’t as hard. ( Disclaimer: ya the code is terrible, I just whipped it up in a “few” minutes)

Did you checkout the demo I posted? Does it make now sense what I meant? :smiley:

My apologies for the delayed response. I did take a look at your suggestion, and it certainly qualifies as a potential approach to the problem.
However, in my case, this solution is not the most efficient as it has a negative impact on performance.
To address this issue, I’ve implemented a system where I divide the map into sectors. When the camera approaches the edge of the map, I simply shift the opposite sectors forward. This method has proven to be more performance-friendly for my needs.

No Problem, I just wanted to know if it helped, and if you would need some more information. Glad to here that you have found a working solution. :+1: