Rant's is a resource management survival game for the PC with the premise of the player being an advanced AI that is being sent to a planet that humans want to inhabit, to terraform the land and set up a starter base for the humans to arrive at and use.
There where two main game inspirations I had when I was coming up with the design for my game. The first was a game called 'RimWorld'.
RimWorld is a resource management, strategy, colony sim game where you crash land on an island and you have to manage your resources, fend off invaders and eventually advance your technology enough to build a rocket to escape the planet. I really enjoyed the science system and random events that can happen in RimWorld so my systems are built in a very similar fashion.
For starters the science tree in RimWorld with its outward branches and it both offering upgrades and new things to build are what made it into my game. My game differs however since I have an additional research tree for my story based buildings, as well as the fact for my research facilities I want to be able to fit multiple researches into one space rather than having one space dedicated to one researcher, like in RimWorld.
As for the other main inspiration for my game, Colony Survival, It is a resource management, colony simulator where you have medieval workers who will collect and generate resources for you as well as defending your base from monsters who attack at night.
I always really enjoyed the visual of all the workers sort of merging together as they move from place to place, so I implemented the same thing into my game. The main difference is, that I have pre-set roads that I have the bots move on when they path find from place to place, whereas in Colony Survival it is more open world and you can have all the workers move more freely which is good for human workers, but didn't really match the feel I wanted for my robots.
The game uses Dijkstra's pathfinding for the bots to get from to one location to another. This is done by having various nodes laid out on the spawnable pathways and assigning them to a list. Then whenever a bot needs to path find from one place to the next it can use the algorithm to find the shortest route through the available path.
There are also other checks done when working out a path. First of all when checking Fcosts it will also check to see if there is an obstacle between the nodes by using a ray cast between the two nodes to make sure the path is clear. If it is then it can add the node to the list of nodes in which the bot will need to travel down.
Whenever a bot reaches a node it will also pause the travel to make sure it rotates towards the next node before travelling to it. This makes the movement more natural as the bot will always be looking where it is going before moving in that direction.
Dijkstra's works well as it helps make the bots movement look very pre planned and robotic which is ideal for the game as it helps to keep player immersed in the game.
Building in this game is done by placing pre made structures on a pre set grid so that everything snaps together in a very appealing manner.
The system works by having a flat square of nodes spread out across the map floor, then when selecting a building to spawn, it will give you a preview of where it can be placed. It will automatically snap to the grid and will only be placed if its not overlapping with another building and also only if you have enough resources.
There are also scene objects in the game to provide ambience, since its still a work in progress there are only a couple but it still gives the scene some character. When placing a building it will automatically get rid of the scene element while it is placed down, and if you delete or move the building then the scene object will re appear.
When creating the assets for the game I made sure that the dimensions of every building would snap and fit nicely on the grid so that there would be no overlapping of models and the make sure that everything was very uniform.
Some of the larger buildings are made up of multiple square pieces fitted together and that is because of the limitations of sizing in the application I'm using to create them. I'm using an app called MagicaVoxel where you can only make voxel assets up to 255 x 255 x 255 so I split some of the structures into pieces and fitted them back together as blueprints in game.
Ui is a big element of this game as a lot of the main gameplay loop is spent going through and looking at various menus. I created all the menus myself with the help of an icon asset pack which is where the black icons came from.
My main bar menu system was inspired by a game called "RimWorld" which has a similar expanding bar system which I am very fond of, however from player feedback I have discovered that many find it to "Clunky" feeling while others are a big fan of it, so this menu system may be re done at a later date but for now I am happy with it.
The large majority of the placeable buildings also have there own unique menu which can be used to interact with the building itself. This allows to user to turn specific buildings on and off while also controlling and tracking specifically what each building is creating for your colony.
For all the UI elements I have done my best to keep it all consistent across all the menus with similar icons, buttons and feeling so that it is intuitive for the user to explore and use which is essential for any Ui.
The job system in the game is very intuitive to use and is still in progress of being completed. Currently when you place a building down you can set it to active and when you do, the correct bots needed will be assigned to work there. This works by every bot being assigned to a list when they are spawned, there are separate lists depending on the type of bot that was spawned. When a building is then set to active it will take the first picks of bots from that list and assign them to itself as the bots that work there.
The bots are then updated in themselves as to of where they now work and they will automatically go there and start working when they have enough charge. If there are not enough bots to work there when a building is set to active then the next bots that are spawned that are of the correct type will then be automatically assigned to that building to work there.
In the future there will be a system so that you can micro manage what bots work where so that you can make sure that bots that are closest or bots that are at a specific location will work at the exact place that you want them to. This will be done through a large menu system that will show all the bots, what they are doing, what jobs and charging stations they are assigned to, as well as giving the player the option to go in and edit details as they see fit.
On top of the actual assignment there are the individual job scripts for each building. This sorts out and tracks what should be happening at each building at a time. For example with the farm the Farm job script will track the growth level of the crop, which crop is currently being grown at that specific farm, how many bots are ready to deliver the crops to a delivery bot, how many bots are working there currently as well as tracking if a bot needs to go back to a charging station to refill its battery. Each building has a slightly different script with slightly different working conditions which is why all the buildings have a separate script for each of them.
Farm Job Code Snippets