Dual-Grid Tile System Implementation

Hello everybody,

I implemented a version of a Dual-Grid Tile System based on what is shown in jess::codes video on the topic:
(https://www.youtube.com/watch?v=jEWFSv3ivTg&t=0s)

The project linked below features the basic outline that Jess shows in her video. The concept is to draw your levels on a base TileMap while your visuals are drawn on a different TileMap which has been shifted. This allows for TileSets to be drawn using fewer tiles than a traditional 8-neighbored TileSet.

In Jess’s video she only shows drawing grass and dirt tiles, this implementation uses four “Display TileMaps” allowing for any number of TileSets to be used. Another feature is the ability to define alternate patterns which allows you to extend what tiles are available to draw with. For instance, this allows you to have square cornered tiles and round cornered tiles which work together without redrawing an entire new TileSet. The last feature is TileMaps can trim their edges which permits making chunks with smooth transitions.

The project has a simple camera which you can move with ‘WASD’ and zoom with the mouse wheel.

Check it out and if you have suggestions for improvements I’d be glad to hear them.

Note: Determining what tiles to draw on large TileMaps is quite expensive and is the main limitation of the system in this form.

I have not used GitHub before so please advise if you experience any issues

That’s a really interesting video. I might give that a go on my next project at it seems to address some issues/challenges I was facing in the prototype. I will take a closer look at your code when I come to that but I think I will implement a version myself. The translation of the co-ords seems straight forward enough and the concept seems pretty straight forward too. However for me personally I am not sure this will solve the issues, although I had been toying with the basic idea of using an invisible terrain map to build an environment on. Offsetting that seems like an approach that might work, but I would have to give it a bit more thought.

Thanks for sharing your code, I will definitely be taking a closer look in the near future.

Great food for thought though. Again thank you.