How do I Create Bitwise Tilesmaps with 3 terrain types

Get help using Construct 2

Post » Thu Aug 11, 2016 3:45 am

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
Image
B
36
S
14
G
11
Posts: 142
Reputation: 8,465

Post » Thu Aug 11, 2016 9:54 am

Calling @mudmask, come in mudmask...

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Thu Aug 11, 2016 11:39 am

I found this a very helpful and complete tutorial on Bitwise - scroll down for the info on multiple terrain types :)

http://gamedevelopment.tutsplus.com/tut ... -cms-25673
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314

Post » Thu Aug 11, 2016 1:55 pm

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

Here you go - tilemap-auto-tile-help_t92366
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Thu Aug 11, 2016 1:56 pm

mudmask wrote:@SoldjahBoy haha uhhhh... I think rojo made a slick example... let me find it.

Here you go - tilemap-auto-tile-help_t92366


I knew you'd know somethin'!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Thu Aug 11, 2016 1:56 pm

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.
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Thu Aug 11, 2016 2:00 pm

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.
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Fri Aug 12, 2016 3:21 am

Thanks All.

@Mudmask. 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!!



|
Image
B
36
S
14
G
11
Posts: 142
Reputation: 8,465

Post » Fri Aug 12, 2016 2:38 pm

@Gillis, are you wanting the two terrain types to mesh, or just live in the same space?
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Fri Aug 12, 2016 6:59 pm

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.
B
94
S
33
G
114
Posts: 5,358
Reputation: 73,777

Next

Return to How do I....?

Who is online

Users browsing this forum: jezjones24, Lancifer, newt, R0J0hound and 21 guests