How do I detect an automatic terrain path?

Get help using Construct 2

Post » Tue Apr 18, 2017 4:29 am

Message: JeffSims can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
See what I want to say on my youtube video
https://www.youtube.com/watch?v=7fmhx77JxaE

In this situation, i programed each condition of terrain.
Have a way to make this more easy?
If have a grass block, and I click on it, its will become a circular dirt block.
If have a Dirt block, and I click on the side block, both will become a "U" dirt block.
And so on.
And I have a "T" Block, for two diferent path, "X" block to three and "L" block for curve.

Image
B
7
S
2
G
1
Posts: 6
Reputation: 989

Post » Tue Apr 18, 2017 4:48 am

You're looking for "bitwise" or "neighbor aware" auto tiling. The should be some working examples floating around the forums if you do a search.

Ref: http://www.saltgames.com/article/awareTiles/
Mistakes were made.
B
53
S
27
G
114
Posts: 1,698
Reputation: 64,444

Post » Tue Apr 18, 2017 10:43 am

I did this before in my cellular automata cave generator. The solution was fairly simple... I did a "for each tile" loop and check for overlap at offset each surrounding tile... and did a comparison of an instance variable for each tile (I used a variable to keep record of the type of tile in that particular place).

As Oos said, it's called bitwise method. The tricky part happens when you might have tiles next to each other that you want to behave differently than the method would do by default.

~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


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests