How do I Create Bitwise Tilesmaps with 3 terrain types

0 favourites
  • 14 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Using the many examples on this forum I was able to understand how to create bitwise tile maps, but can someone provide an example capx of how to use one that is 4-bit + 1 bit (5-bit) that I can have smooth transition tiles between two terrain types?

    I've been struggling to get it working.

    Good info in this thread:

    https://forums.tigsource.com/index.php?topic=9859.60

    This one too: (last paragraph is vague)

    http://www.saltgames.com/article/awareTiles/

    Thanks all,

    Gillis

  • Calling mudmask, come in mudmask...

    ~Sol

  • I found this a very helpful and complete tutorial on Bitwise - scroll down for the info on multiple terrain types <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    http://gamedevelopment.tutsplus.com/tut ... -cms-25673

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SoldjahBoy haha uhhhh... I think rojo made a slick example... let me find it.

    Here you go -

  • SoldjahBoy haha uhhhh... I think rojo made a slick example... let me find it.

    Here you go -

    I knew you'd know somethin'!

    ~Sol

  • oh wait I just re-read your post. so basically I made another loop that just looked for a tile that had a tile to the top, to the right, but nothing to the top right (diagonal) and then I changed that tile accordingly. I know it's not as awesome and automated as you might like... but that's what I did.

  • it's also super helpful to have an array that corresponds to your tilemap. I don't know if you already have it laid out that way.

  • Thanks All.

    I was actually using R0J0hounds example as a starting point. That example is 4-bit with only one terrain type "BlueRock" I want to be able to blend a second rock type with the first and keep it "bitwise" So I know I have to add another bit like:

    0 1 0

    2 16 4

    0 8 0

    Notice the 16 allows me to check for multiple types and jump to the next set of 0-15 tiles... I'm onto the concept but an having a heck of a time incorporating it into a working model.

    I'll let you guys know when i get it.

    Thanks all!!

    |

  • Gillis, are you wanting the two terrain types to mesh, or just live in the same space?

  • There are two ways.

    One is to do 5bit like you have above

    If a tile is blue start with 256

    And if the tile is red start with 512

    Then add the surrounding tiles.

    Blue tile values

    0 1 0

    2 0 8

    0 4 0

    Red tile values

    00 16 00

    32 00 128

    00 64 00

    If you looked at the tiles around an empty spot too there would be a total of 1024 combinations. Which is a lot to draw.

    To knock down the combination count you can put some restrictions.

    The simplest would be to have each tile type on its own layer, and do bitwise on it's own layer.

    More complex setups could be done depending on how you want it to look.

  • Thanks R0J0. That makes a lot of sense. Adding the offset at the onset of the calc was what i was missing. I will work on this tonight and share my progress:

    with the tiles i have it seems like the two tile set option is my best bet... however... later in game design having to interact with the existence of two tiles occupying the same space is not an exciting prospect to me.

    Here's where im at:

    https://postimg.org/image/opn6bih9n/

  • Gillis, are you wanting the two terrain types to mesh, or just live in the same space?

    Hey Mudmask. I think mesh would be the right term. I finally added images in my last post. they are not final. just filler for now but illustrate the problem.

    Thanks guys.

  • I went with the multiple tileset option. I am very pleased. thanks guys

  • Got it working better (3 terrain types with no slow down). I used R0J0hound's suggestion of using separate tile maps. Adding the logic for the transitions was straight forward that way... now to figure out how to do bitwise gamma shading based of depth of tile from edge...

    My first attempts used too much processing... the problem with that is you can't interact with an individual tile "gamma" level :*

    thanks guys.

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