2D Diamond (isometric) map editor - Textures extended infinitely?

Not really an answer (as the code will be rewritten anyway) so few hints for the new code instead (some of them are already mentioned in the comments).

  1. Tileset

    In the final isometric engine use sprites. They are faster and support pixel art. For my purposes I use compilation of these two free to use tilesets (64x64):

    • outside tileset
    • medieval building tileset

    Both are compatible. I compiled and edited them to suite the needs of my engine. So this is what I use (still work in progress):

    my tileset

    White color 0x00FFFFFF means transparent. The sprite is not enough. I added info about the height of tile and rotations.

    If you see first 4 tiles from upper left corner they all are the same thing rotated by 90 degrees. So all my tiles have index of 4 tiles (the 90 degree rotations) int rot[4]. This way I can rotate the whole map or just view. I compile the set so the rotations are next to each other. There are 3 options:

    • tile[ix].rot[]={ ix,ix,ix,ix }; where ix is tile without rotation (ground)
    • tile[ix].rot[]={ ix,ix+1,ix,ix+1 }; where ix is tile with 2 rotations (those 2 tiles with chunk of chopped tree in the middle right)
    • tile[ix].rot[]={ ix,ix+1,ix+2,ix+3 }; where ix is tile with 4 rotations (like the first tile)

    The indexes are valid of coarse only for the first tile only, the others have the whole rot[] array rotated by 1 value from neighbor. Some rotations are invisible (see the wide trees) but the tile is still present to allow rotations.

    The tile height is important for placing tiles while editing and also for automatic map generations.

    tileset info

    I plan to add also A* map for each tile so I can use path finding or compute watter flows and more.

  2. Map editor

    I prefer 3D maps. with bigger resolution you need to properly select the viewed area for viewing to maximize performance. Also a good idea is to create hollow underground so the rendering is much faster (this can be also done virtually during rendering process without the need of updating map).

    I recommend to code these features:

    • make ground hollow
    • make ground solid
    • random terrain (diamond & square)
    • filter out small holes and smooth edges (add the slope tiles to cubic ones)
  3. tile editor

    Apart from the obvious paint editor you should add also another features like:

    1. floor <-> ceiling
    2. left <-> right
    3. front <-> back
    4. divide large sprite into regular tiles
    5. copy/merge/paste
    6. adjust lighting after left <-> right mirror operation

    They are really handy while compiling/editing tileset resources. As you can see my tileset has many of tiles not present in the source tilesets. They were created by these functions + some minor paint editing... The colored masks on the bottom of the tileset are used to mask out and properly combine parts of tiles to create the missing ones ... (you can take one side form one tile and other from other ...)

    tile operations

[Notes]

For more info/ideas have a look at some related Q/As:

  • Improving performance of click detection on a staggered column isometric grid
  • How to procedurally generate isometric map

    And here my Standalone no install Win32 Demo:

  • demo v1.000

  • demo v1.034