In my tiny building game, I want your creations to exist in a world that feels alive. As a first step, I tackled ivy ๐ฟ As time passes, ivy grows on walls, bringing a bit of life with itโจ
Brief tech overview in the๐งต
#screenshotsaturday #indiegamedev #rustlang ๐ฆ #bevyengine
A new system needs to interact with all the previous systems. Finding a suitable algorithm took me a few iterations ๐๐ฆ
Ivy needs to know if a wall gets changed...
... or if a wall gets erased. (either via the player's input or by the undo system)
In my first prototype, ivy was directly tied to a wall it spawned on. That had a number of issues: (a) if wall changed, its UV->WorldSpace changed too, and ivy shifted - like a texture; (b) if wall got split with the eraser, that reordered wall IDs, and was messy to deal with๐
Thus for ivy to properly react to changes, it needs to know all the nearby walls. To make that query fast, I made a spatial hash (2D grid). This also allowed ivy to grow from one wall to another, as the data structure yields the closest wall as ivy grows towards it.
With some additional intersection checks ๐คช ivy can now continue from one wall to another ๐ (thank you for giving me a primer on AABBs and segments and stuff @h3r2tic!)
Making ivy work with arches was waaaay more straightforward. I simply discard the fragments (pixels) that overlap with the arch.
I also learned not to discard vertices in vertex shaders xD that resulted in some serious cyberpunk looks ๐คฃ
I've been developing this game in my spare time. It's been a lot of fun, but - not gonna lie - tough at times๐
However, in September I'm switching to being full-time on this project ๐ค๐ Maybe I'll even finally come up with a name ๐
But! that's not all...
I'm not going to be doing it alone anymore ๐ฎ
@h3r2tic is also joining the project in September โจ๐๐คฉ I'm beyond excited!! ๐๐๐ wooooo!
I don't know about you, but I'll take a proper Summer break now: get some sun, maybe dip my feet in a lake, and just slow down for a bit๐
I'll be back in late August. Stay tuned by following the newsletter ๐ tinyurl.com/2p8u9rzp
Have a wonderfully delightful Summer! ๐
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.