How would I "autotile" multiple 3D objects into a single 3D object?

0 favourites
  • 2 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • The title doesn't do a great job of explaining what I hope to do, so let me explain.

    I have a procedural generator that carves dungeons using a tilemap and brush. Once the tilemap carving is completed, I check every tile in the tilemap and if it is an edge tile (in the brush editor this is any tile that isn't the 10th tile in the brush) and place a 3D object on it.

    The end result is this:

    Which looks fine. But, for several reasons, I would prefer to only place one 3D object down per uninterrupted instance of an edge tile. I.E. a straight wall of the same tile places one 3D object that spans the entire length or height of that wall.

    I'm not sure how to go about doing that though, any suggestions?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • A quick follow up because I had an idea on how to approach this that I think would work, but presents edge-cases I can't account for and just isn't as stable as the original brute-force method.

    My idea was to identify corner tiles in the generated tilemap and then assign each one a direction. The system then repeats a check in that direction from that corner until it identifies a tile different from the wall connected to the tile:

    Tilemap being used (arrows id corners and which direction they check for):

    I couldn't use the Auto-16 tilebrush and had to use the 47 in order to identify both inner and outer corners. This ALMOST works:

    There are some positioning issues I could work through, the bigger issue is that using this method, sometimes a wall is created that has no "spawn corner":

    Short of brute-force checking corners for connecting walls and fixing them after the original run, I can't think of an elegant solution to this. I'm probably going to revert back to the "one tile one 3Dobject approach", but I wanted to document this here in case anyone has a similar issue and wants to refine my approach. Here's my function:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)