TileMapDual Documentation

repository·main·Indexed 22 days ago

https://github.com/pablogila/tilemapdual

A Godot plugin providing a custom TileMapLayer node that implements a real-time dual-grid tileset system. It supports square, isometric, and hexagonal grids, reducing the required tile count for complex autotiling. Includes TileMapDualLegacy for v4 compatibility and support for separating display tiles from world logic tiles.

Tokens
630
Snippets
0
Records
7
Agent score
28%

What's inside TileMapDual

  1. Use multiple terrains with multiple layers

    main
    If your project requires more than two terrain types, the recommended approach is to use multiple TileMapDual layers (one layer per terrain type) rather than trying to manage them all in a single layer.
  2. Implement collisions and logic using dual spritesheets

    main

    To separate visual representation from game logic (like collisions and pathing), use two separate spritesheets:

    1. Display Tiles: A spritesheet used for visual rendering.
    2. World Tiles: A spritesheet used for program logic (collisions, pathing, etc.).

    This separation allows you to place hitboxes on the display tiles while keeping the underlying logic tiles clean for pathfinding or collision detection.

  3. Install TileMapDual as a Godot plugin

    main

    TileMapDual is installed as a standard Godot plugin.

    1. Copy the addons/TileMapDual folder into your Godot project directory.
    2. Open Godot and navigate to Project > Project settings... > Plugins.
    3. Enable the TileMapDual plugin.
  4. Configure Isometric tiles

    main

    To implement isometric tilemaps, you must use an isometric version of the standard dual-grid tileset template.

    While these can be drawn by hand, it is recommended to use a tool like TileCropper (a Godot plugin) to draw tiles in one continuous image and then separate them into the required dual-grid layout.

  5. Basic usage of TileMapDual

    main

    TileMapDual functions as a custom TileMapLayer node. To use it:

    1. Create a TileMapDual node in your scene.
    2. Assign your own TileSet to the node.
    3. Configure the appropriate tile shape, orientation, and terrain settings in the inspector.

    Once configured, you can sketch levels using the fully-filled tile or the empty tile (located in the bottom-left of your tileset) to trigger real-time dual-grid updates.

  6. Troubleshoot TileMapDual configuration

    main

    Common troubleshooting tips:

    • Terrain Autogeneration: This will not work if you are editing the TileSet directly in the Assets folder. You must place the TileSet inside a TileMapDual node first to enable autogeneration.
    • Alternative Tiles: The plugin currently does not support Godot's alternative tiles feature.
    • Manual Terrain Setup: If your spritesheet does not follow the standard preset layout, you must manually configure its terrains in the inspector.
    • Multiple Atlases: You can use multiple atlases in the same TileSet, but ensure terrains are set up correctly to avoid layout issues.
  7. Use TileMapDualLegacy for v4 compatibility

    main

    TileMapDual v5 is a complete rewrite. If you need the stable behavior of the previous version or are migrating from v4, use the TileMapDualLegacy node included in the v5 package.

    Note: The legacy version only supports square and isometric grids; it does not support hex grids.