Inspiration

Nothing is more strangely calming than low poly, other than rain maybe. This game is both! I've always wanted to make a game — try as I might, my bread-and-butter web, graphic and print design by nature really do lack in the interactivity department.

What it does

The "cloud layer" is a procedurally-generated ball pit in body-centered cubic formation contained in a hollow box. I was going to randomly percolate balls from this layer to fall into the terrain, weighted on their downwards pressure, but Unity doesn't provide accessible, component-by-component static forces for analysis, so while that is in the works, this POC shows a "heavens opening" model. The terrain at the time of writing is waiting for implementation of the objectives.

How I built it

Terrain is a default mesh/MeshCollider populated by a Delaunay triangulation of a point cloud with Perlin noise creating the elevation map. The ball pit is generated by a base square grid of RigidBody spheres to which I iteratively shifted coordinates and found stable positions on top of the previous layer (at least 3 points of contact).

Challenges I ran into

So it turns out, meshes in Unity have orientation of clockwise vs. counterclockwise that dictates the hemisphere they can be viewed from. Rendering the meshes was a nightmare because the Delaunay triangulation returns a list of line segments in an undefined order, which I had to cluster into proper triangles without foresight about the orientation. At first, the terrain was rendered like swiss cheese, which I thought was a problem with the triangulation.

After realizing that orientation was causing problems and patching it, the map was more consistent but half of the tiles had opposite orientations still! Unity truly has no forgiveness: in trying to fix another two problems, I was causing this new one.

Gravity and orientation in Unity are Y-up, but their Vector3Vector2 cast truncates the Z axis. I was intending on preserving Y-axis gravity and rotating the terrain on the XY plane into the XZ plane. However, my quaternion rotation for some reason changed the orientation as far as Unity is concerned, so +Z-facing components were visible in one Z hemisphere and vice-versa.

Instead, I had to rotate the camera and gravity to follow the Z axis.

Furthermore, I made a mesh myself instead of using the standard Terrain library because I thought I could force triangulated low-poly, but while the geometry is coarse, the shading is smoothed without any way to disable it, even with Toon shading.

Accomplishments that I'm proud of

I thought I picked up a good chunk of Unity for my first time! Getting the mesh to render was cool too.

What I learned

3D game programming is an endeavour.

What's next for Tectonic

The way the game is supposed to operate is the following:

  • There are pits and objectives. Objectives are tiny tiles perched on intense slopes that require balls stay on the surface for a while before rewarding the player with currency. Pits just swallow balls without replacement.
  • The currency dictates how much the user can change the terrain. Every world unit of modification comes at a certain price. Pits and objectives can't be moved.
  • The weighted percolation was meant to serve as the strategizing point for the user, who has to prioritize sources of balls with the cost and risk of the route they build to the objectives. Since objectives take time, balls might queue in a route and overflow into a pit.

All of this is yet to be completed.

Built With

Share this project:

Updates