Astronaught
Game Details
Short project with friends for 2023 Epic MegaJam.
Genre: Survival, Resource Management
Languages: C++, Blueprints
Tools: Unreal Engine 5.2, Jetbrains Rider
Platform: Windows
Timeline: September 2023
Game Brief
What started as a routine reconnaissance of S'ram quickly turned to chaos, and a critical engine failure for the Autumn.
Battle your way through the planet of S'ram, a procedurally genrated planet. Upgrade the Autumn with whatever you can find, and try to escape the planet while managing the onslaught of the mysterious robots. Find resources by day, and defend the Autumn by night. Fight to survive a grueling mission against dangerous robotic foes, and escape to the safety of your fleet.
-
Worked on AI for the robot enemies, making use of the newish State Tree's in Unreal to create enemies that spawn in at random sizes and health, move towards the ship and fire rockets at it from a short distance.
In order to fight back against the robots, the ship has 4 turrets on the corners that I also programmed. The turrets are upgradeable, using parts spawned during the day to increase damage done and fire distance. They automatically focus on the closest enemy, firing at regular intervals.
-
Implemented a simple day/night cycle that rotated the sun and moon to change the lighting and sent a delegate when the day changed to night and vice versa. During the night the enemies spawned intermittently and during the day resource nodes are spawned randomly around the world and in randomly generated structures.
The calculations for the time of day ended up being simple after initially overcomplicating with divisions by pi when not necessary. In the end it just needed to be ` CurrentTime += DeltaSeconds/DayLength ` which, mod 2 returns a value between 0 and 2, with 1 being the start of night.
-
Handled adding the attributes for the ship, including health and fuel amount, including game over events when either health hit 0 or fuel was filled.
-
Added Simple UI with Progress Bars showing the Ships Health and Fuel Amount, and a Counter for amount of Scrap collected.
In the final couple hours we also realised that it was very easy to lose the ship if you run too far, so I was tasked with adding some kind of pointer towards the ship. At first we wanted a compass but we had locked the camera to one rotation so I ended up using a radial slider with only the handle visible, then doing some maths to set the slider value using the unit direction from the character to the ship and then dot producting with global forward and right vectors.