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
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests