
Small Worlds
Is an open world sandbox survival game set within a field of asteroids and various space junk. The standout feature of the project is the game’s unique gravity system where the direction of gravity changes based on the various asteroids and structures present throughout the map.
Built in the Unity 3D Engine
Programmed in C# using Visual Studio
3D Models created using Blender
Sprites hand drawn in Adobe Photoshop
Technologies Used
Why I Started This Project
I felt that a survival game like this would help to force myself to tackle more diverse problems in game development. A survival game by design needs to have a handful of key features to be an actual playable game. Here are some of the survival game systems ive implemented within Small Worlds so far.
Items & Inventory System
Resource Gathering
Crafting
Building
Food / Water / Oxygen Systems
After starting the project and making some great initial progress I fell in love with the uniqueness of the game and have really enjoyed the problems I’ve ran into while developing around the gravity system.
My Gravity System In Action!
Inspired by Super Mario Galaxy, I wanted to see how a dynamic gravity system would look and feel in first person. My system works by having various “Gravity Regions” around the map. These range from being spherical triggers that pull or push from their center, to cylinders, cubes, or planes. I built the system to be able to support pretty much whatever variety I might want to throw at it.
Resource Gathering System
My resource sources are controlled by scriptable objects which can be adjusted from the inspector, these resource sources let me define a list of items and a random range for each item. When the resource source is hit it will reference the type of resource it is and return a random amount of each item based on their ranges to the player’s inventory.
Building System
The building system works by having predefined snap points assigned on each building piece. While the player is holding building piece a preview of the object is drawn where the player is looking and a region around the player’s look position is checked for nearby structures. If a structure is found the script loops through the snap points of each nearby structure and finds the closest one to the look position. Then each snap point on the closest structure is compared to each snap point on the preview structure. After finding which snap points are closest it uses simple math to adjust the position and the rotation of the preview display object so that it’s closest snap point aligns with the closest snap point of the closest nearby structure piece.
The stability of the nearby structure is also checked to ensure that the snapping target has enough stability to support the structure that is being snapped to it. There are various other checks being performed at this stage such as for overlapping ground geometry or for overlapping geometry that would obstruct the placement of the structure.
Stability System
Each structure has two stability values tied to it. One is it’s “Provided Stability” which is how much stability the structure will add to it’s neighbors. Foundations provide stability for example but require intersecting ground geometry to be considered a valid placement option. The second stability value is “Current Stability” which is a measure of how stable an object is. When an object is snapped to a structure it first locates which nearby structure pieces are its neighbors. It then checks if these neighbor pieces have enough stability to support the new structure piece. Some structures such as ceilings require stability instead of providing it, for example if a ceiling is snapped to a wall which has a stability score of 100, the ceiling will reduce its own stability by 50 to be placed and end up with a score of 50 in the process.
When a structure is broken the neighbors of it are alerted and they are prompted to refresh their stability score and in the event there score reaches 0 they destroy themselves causing a chain reaction to spread through the structure.