How do I Tile Procedural generation with this array?

0 favourites
  • 6 posts
From the Asset Store
Easy to use shop and inventroy populated by an array!
  • So basically I have this procedural generated dungeon which uses the bitwise method on walls and I cant figure out an easy way to set the tiles to corners, inverted corners (with black next to them) ext.

    this is what im working with, not really sure how to check each tile around a tile then set it to the correct tile as if I added another sub condition it would just tile over what was just done. I think I need to check each side then compare what they are afterwards in some long ass algorithm. Let me know if there is some easier way of doing this.

    Tagged:

  • Also so you know everything that is not a wall has a value in an array of 1 or 0, 0 meaning the value was never changed so I can easily refer to a tile with 4, 5, 6, 12,ext. with 1.

  • I Just thought maybe I should bitwise the 1s instead because the issue with my current bitewise is that im not actually using the bitwise to tile because the way it is set up now makes horizontal walls and vertical walls have the same value so I cant easily refer to which on is the cieling or floor, or left or right of a wall.

  • My last post is correct, as you can see in the last picture the 0s above and below 3s have different values Now to re-wright lots of other things using the old bitwise, fun fun.

  • You might find this demo useful:

    dropbox.com/s/ff0tic8sw1cu0od/bitwiseTilemap_01.c3p

    It doesn't use an array, just works directly on the tilemap, but it should be relatively straightforward to swap the tilemap co-ords to array indices.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is how I did it. I read various posts on autotiling. This method checks the if there's a tile north, east, west and south of the current tile. Then sets the current one according to the bitwise value.

    1) use noise to fill a tilemap with solid tiles

    2) go though every tile

    --- if current tile isn't empty, run the following function on it:

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