Bitwise Auto Tiling

Post » Sun Apr 23, 2017 9:03 pm

Surprise! This isn't a feature request!*

https://www.dropbox.com/s/wyiz1r06s2p3o ... e.c3p?dl=0

Two examples of different bitwise methods for autotiling, created in C3.

Layout 1 uses edge based bit indexing for "whole" tiles, generally side view/platformers. Includes single event version on layout start, and also a more readable version that uses more events to draw tiles with the mouse. Both use the same method described at http://www.saltgames.com/article/awareTiles/.

Layout 2 is more complicated and uses corner based bit indexing for "half" tiles, usually used for top down views. Starcraft is an example of a game that used this method. As with the first example, I included both single event and multiple event versions. This method is great when used with layered transparent tilemaps - one for each terrain, such has dirt, grass, forest, mountain ect. ref: https://www.codeproject.com/articles/10 ... n-a-tile-m

Bonus - I also included a nifty lightweight way to make a "animated" tiling water illusion where it should basically be impossible to see the tiles (0 events, 2 tiled backgrounds, sine behaviors).

* Just kidding, I lied. Here are a few tilemap feature requests: Tilemap.Tilesize expression, and also Tilemap For Each Tile condition (along with curx, cury, like arrays). Honestly probably not widely needed/used and obviously there are workarounds, but they would be nice to have.

I'm going to use this opportunity for a shameless plug for an unrelated expression that WOULD be very useful, as many mobile games take advantage of this feature. I imagine it would be easy to implement as well - System expression for Unix Timestamp to keep track of "offline" time https://construct3.ideas.aha.io/ideas/C3-I-143
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Fri Oct 13, 2017 5:05 pm

This is extremely cool! I also love the animated water effect. Very creative.
B
86
S
28
G
9
Posts: 95
Reputation: 9,775

Post » Fri Oct 13, 2017 7:10 pm

Thanks!

Now that you brought this up I took a look and it looks like there was an update that changed the way mouse over tilemap worked since I made it. Fixed it so it should work again now (you should be able to draw new tiles anywhere).

Seems like the "Cursor is over object" condition now requires a collision box to be true? I think it used to be bounding box for the tilemap.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Sun Oct 15, 2017 8:05 am

Very useful thanks.
B
12
S
4
G
1
Posts: 54
Reputation: 1,025


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests