The aim of this project is to produce a transport simulation game set in space. It will implement a supply and demand system that the player will have to manipulate to make money. This genre usually consists of connecting various nodes together. Nodes are generally represented as industrial buildings, but they can be anything that consumes or generates resources. The player can assign vehicles to carry resources between the nodes. They can then use the money earned from doing this to buy vehicles or repair existing ones and also set up more routes.
Space will be the setting for this game. Nodes will be space stations, vehicles will be space ships. The player will not construct routes in this game like in OpenTTD where the player builds roads and railway lines. Instead, they will assign ships to carry resources from node to node. The ships will use a pathfinding algorithm to navigate space, avoiding asteroids and other obstacles the space setting will provide. There will also be more of an emphasis on the supply and demand aspect of the game. This means that if a station has more than it needs of a particular resource then it will buy that resource for less. To account for this, the player will need to make sure they send ships to buy from stations with high supply and sell to stations with high demand to maximize their profits.
This is my current progress on my third-year project.
Currently, the ships use the A* pathfinding algorithm to find their way from station to station. They buy resources from a station and sell at the next one. The supply and demand system is also fully functional with prices being based on current stock. I have also begun work on making the pathfinding dynamic to allow for moving obstacles and disaster style events like black holes opening up in random places.I am going to also use splines to smooth out the paths and make the ship movement look better. I also plan to add pirates that will pursue layer ships and destroy them. To counteract the pirates, the player will be able to hire guard ships that will follow their trade ships keeping them safe. I will also add events like fires in stations that will happen randomly throughout the game to keep players on their toes forcing them to rearrange their trade routes if they want to carry on making money. If time is available I want to add in an AI competitor as well.
Update : I have changed the pathfinding algorithm to be more dynamic now if a tile is changed in the map, ships that use that tile in their path will be alerted and recalculate that part of the path or their whole path if needed. A spline is also calculated along the path using bezier curves from tile to tile. The ships then move along the spline to give a more realistic looking path. I have stress tested the pathfinding with over 100 ships and the impact on the frame rate is minimal. Pirates and navy ships have also being added they will engage enemy ships which enter a radius around their base, pursuing the enemy until it is destroyed or escapes.