Automatic Transform Hierarchy Experiment: Bacilli

Add to
My games
Add to
Wishlist
Save to
Collection
No reviews
Exceptional
Meh
Skip

About

Today I wanted to test an idea I had for ShipBasher wherein instead of using a traditional transform hierarchy, I could parent all of a ship's modules to it directly and handle parts breaking off based on contiguous overlapping "solid" volumes. This would allow stable structures like rings that wouldn't snap from only being broken on one side - rather, if a part of a ship is connected to the rest by two or more pieces, any one of them can maintain the connection if the others are broken.

To accomplish this I made use of a breadth first search algorithm and the PhysX API's ability to report whether arbitrary colliders overlap. Whenever it is triggered, it assembles a list of all of the given object's children, then starts at the first and checks each other child for overlap. If all children are connected, this results in a spanning tree. For any children left over, the process is repeated to define "fragments" that break off of the whole but retain one or more connected children of their own, or mathematically a spanning forest (a set of trees that together cover all items even if no one tree touches all of them by itself).

For simplicity I started out with some capsules and then, to test the stability of the system, I automatically spawned a bunch and then wrote a script to randomly connect groups of them by making them "sticky" and join together when they touch (ironically this "sticky" feature took longer to implement and debug than the main part of the experiment). The random blobs of capsules reminded me a bit of bacteria forming colonies so I decided to lean into the aesthetic with the color scheme and some post processing to make it look like a view through a microscope.

Click on any bacterium to remove it. If groups of others are connected through it, they will break away from one another unless they are connected somewhere else. Over time, more bacteria spawn and gradually connect with one another to form a connected mass. That's it. I admit this is one of my most minimalistic projects.

Platforms
Release date
Developer
problemecium
Age rating
Not rated

System requirements for Web

Read more...
Edit the game info
Last Modified: Sep 16, 2022

Where to buy

itch.io