Automized Factory Game

For an intake assignment to a HBO Game art study I had to make a project based on multiple goals to improve the world. I chose to base it on making factories more productive and safer for the workers. What could be safer for workers than removing them from the picture. So replace them with Robots.

The goal is to complete a delivery in a certain time frame. To make it to this time frame you are required to create robots that will automize the workflow in the factory.

My main focus for this project was to make an amazing enviroment, that is detailed yet still readable. The way I handled this is by applying an line between the walls and floor, and then keeping the floor really clean and simple. Making the machines, character and items a bit more cartoony makes then pop out more aswell.

Machine Grid

The most noteworthy programming in this project is the machines, how they work and connect with eachother.
And what makes them work is the way I made the grid. 

The grid is made by using a 2D array with a tile constructor. Each contructor saves the data if there is already a machine on there and what direction the machines faces. Some of these tiles are premarked as “Intake” or “Outtake” tiles. The Intake tiles are tiles that deliveries made at te factory doors will be deposited on there, meaning if you place a conveyor belt there items will automatically be placed on it. And the Outtake tiles are the tiles that are used to take objects for completing the objective.

The way you place machines on the grid is done through the player who has an inventory of a single index. If the index is connected to a machine the player will highlight the location it would want to place said machine. If there already is something there the highlight will turn red, otherwise it will remain blue.

 

The Machines

The machines function through the grid. When they are placed they will get their location saved in order to located their surrounding tiles. Each machine also has their own script that inherits from a base machine script. 

For the conveyor belt it only has an index for the item that is on there, and a function to move the item that is on it.

The Slicer/Refine/Press robots have a really simular code that uses their location and direction to check if there is a conveyor belt in front of them. If there is, and it has an item it will check the index for an available recipe. If a recipe is found it will start to process that item by stopping the conveyor belt and switching the index of the item that is on it.

The Combiner robot is a different story though. It needs to keep track of 3 different conveyor belts. 2 for the intake and 1 for the output. So it will first check if there are items on the conveyor belts on his sides. And if they are found with a valid recipe it will check if the output belt is empty. When it is it will take the items from his side, and place the output on the conveyor belt behind him.

Because of how this works you are able to place multiple machines on the grid and you are able to automatically make the items required for the objectives.

Art Assets of the project