The game is designed for standalone build. There are options for saving and loading game progress. Each character's position, health level and movement mode along with finished tasks by the player can be saved and loaded later.
Options for:
- Start a new game
- Continue from last save
- Delete save
- View controls
- Quit game
After a fierce space battle the player manages to escape but his spaceship is badly damaged. His only chance is to look for spare parts for the ship in an old abandoned base, located on a nearby planet. The problem is the base has been taken over by hostile aliens.
The player lands his spaceship near the old base and is now searching for supplies and spare parts to repair it. Player's ship has a broken Dark Matter Module, which can be found in the Storage Room. The game starts at this point.
When the game starts, the player is running out of oxygen and has to find the Main Control Room to turn Base Life Support Systems on. The access to the Main Computer is blocked by a password. The player has to decipher the password in order to login, turn Life Support Systems on and find the Storage Room location. When the player is near the Main Computer, the game waits for him to enter the password. After the player has the password, his oxygen level is set to full and no longer decreases. The minimap is also updated: Buildings
layer and Storage Room are added to the map. Enemies detect distance will be increased.
After the player locates and takes the Dark Matter Module he can return and repair the Spaceship. At this point enemies detect distance will be again increased and Base Commanders
will be spawned.
When the player has the Dark Matter Module and is near the spaceship he can start repairing it. In order to do that he must stay near the ship for at least 10 seconds or the process will be interrupted. After the ship is repaired, the player can get on board and leave the planet for good.
- Minimap - shows important locations and directions to the player
- Oxygen bar - shows current oxygen level
- Health bar - shows current health level
- Tasks: shown when
TAB
key is pressed - list of tasks which the player has to complete - Pause Menu: shown when
Escape
key is pressed - pauses the game and displays a menu with several options:Resume
- resumes the gameSave and Exit
- saves the game at current state and returns to the main menuMain Menu
- closes the game and returnes to the main menu - current progress will be lostQuit
- quits the game - current progress will be lost
- Real buildings imported with a script - source spatial data is stored in
Assets/Maps/Level3.txt
file - Import map data using the script for importing from
GeoJSON
asset:- The unique ID is stored in
osm_id
property - The extrusion parameter is stored in
height
property - Put all buildings in layer
Buildings
- Combine buildings in one mesh
- Add Mesh Collider using the script for generating mesh colliders
- Add Material using a script
- All buildings and base border are set to
static
- Create ground object and build the NavMesh
- The unique ID is stored in
Imported from Unity Assets - FPS Player Character.
- Gun and Body
- Second camera for the minimap (orthographic projection) - renders data only from layers
Minimap
andBuildings
. - Sphere for the minimap (layer must be set to
minimap
) - it's redered only in the minimap - Player components:
- Audio Source
- Rigidbody
- Character Controller
- First Person Controller Script
PlayerShootingScript
(attached to the gun) - responsible for shooting logic. Player's gun fires laser bullets stored inObjectPooler
script.- Damage per shot: 20 - damage to the enemy when shot
- Fire rate: 0.2
PlayerHealthScript
- responsible for managing player's health and oxygen levels. Player's oxygen level will drop down (from80
to0
) until the player activates the Life Support Systems.0
level of oxygen will decrease player's blood level. While the volume of oxygen is running low, the player's camera smooth parameter will also decrease (from5
to1
):- Health: 200 - starting health level
- Oxygen: 80 - starting oxygen level
- Walking speed: 5
- Running speed: 16
RadarScript
: responsible for drawing minimap on the screenZoomInScript
: zooms in when the player right click with the mouse
There are four types of enemies moving around the base using NavMesh. If the player is close enough to be detected or is shooting at them, they will attack.
Base commanders are spawned near the spaceship after the player has taken the Dark Matter Module. Components:
- Animator - responsible for managing animation states. There are several states:
walk
- defaultattack
- triggered when the player is in range for attackdeath
- triggered when the enemy is dead
- Audio Source
- NavMesh Agent - for navigating around the base
- Rigidbody
- Capsule collider - represents the physical presense of the enemy
- Sphere collider - trigger - responsible for detecting the player and switching to attack mode
EnemyMovementScript
- responsible for moving the enemy - setting destinations on the NavMesh- Detect distance: 60 - minimum distance to detect the player
- Wander radius: 100 - maximum travel distance for new destinations
- Wander time: 0 - time to wait before a new destination is set
- Is Chasing: false - is the enemy currently chasing the player or not
- Is Scared: false - is the enemy currently running away from the player
- Stop: false - stop moving around
- Walking speed: 3
- Running speed: 5
EnemyHealthScript
- manages enemy health level- Starting health: 1000
- Death sound - played when the enemy is dead
EnemyAttackScript
- responsible for attacking the player- Time between attacks: 3
- Attack damage: 40
Components:
- Animator - responsible for managing animation states. There are several states:
walk
- defaultattack
- triggered when the player is in range for attackdeath
- triggered when the enemy is dead
- Audio Source
- NavMesh Agent - for navigating around the base
- Rigidbody
- Capsule collider - represents the physical presense of the enemy
- Sphere collider - trigger - responsible for detecting the player and switching to attack mode
EnemyMovementScript
- responsible for moving the enemy - setting destinations on the NavMesh- Detect distance: 60 - minimum distance to detect the player
- Wander radius: 300 - maximum travel distance for new destinations
- Wander time: 0 - time to wait before a new destination is set
- Is Chasing: false - is the enemy currently chasing the player or not
- Is Scared: false - is the enemy currently running away from the player
- Stop: false - stop moving around
- Walking speed: 5
- Running speed: 13
EnemyHealthScript
- manages enemy health level- Starting health: 300
- Death sound - played when the enemy is dead
EnemyAttackScript
- responsible for attacking the player- Time between attacks: 3
- Attack damage: 20
Components:
- Animator - responsible for managing animation states. There are several states:
walk
- defaultwalk-attack
- triggered when the player is in rangegethit
- when the player shoot at the enemydeath
- triggered when the enemy is dead
- Audio Source
- NavMesh Agent - for navigating around the base
- Rigidbody
- Capsule collider - represents the physical presense of the enemy
- Sphere collider - trigger - responsible for detecting the player and switching to attack mode
EnemyMovementScript
- responsible for moving the enemy - setting destinations on the NavMesh- Detect distance: 50 - minimum distance to detect the player
- Wander radius: 70 - maximum travel distance for new destinations
- Wander time: 0 - time to wait before a new destination is set
- Is Chasing: false - is the enemy currently chasing the player or not
- Is Scared: false - is the enemy currently running away from the player
- Stop: false - stop moving around
- Walking speed: 5
- Running speed: 15
EnemyHealthScript
- manages enemy health level- Starting health: 100
- Death sound - played when the enemy is dead
EnemyAttackScript
- responsible for attacking the player- Time between attacks: 1
- Attack damage: 10
Workers are spawn only from two points: one in the Main Control Room and another in the Storage Room - they will not attack but run away from the player:
Components:
- Animator - responsible for managing animation states. There are several states:
walk
- defaultrun
- triggered when the player is in rangegethit
- when the player shoot at the enemydeath
- triggered when the enemy is dead
- Audio Source
- NavMesh Agent - for navigating around the base
- Rigidbody
- Capsule collider - represents the physical presense of the enemy
- Sphere collider - trigger - responsible for detecting the player and switching to attack mode
EnemyMovementScript
- responsible for moving the enemy - setting destionations on the NavMesh- Detect distance: 30 - minimum distance to detect the player
- Wander radius: 10 - maximum travel distance for new destinations
- Wander time: 0 - time to wait before a new destination is set
- Is chasing: false - is the enemy currently chasing the player or not
- Is scared: false - is the enemy currently running away from the player
- Stop: false - stop moving around
- Walking speed: 2
- Running speed: 20
EnemyHealthScript
- manages enemy health level- Starting health: 100
- Death sound - played when the enemy is dead
The player needs to find the passsword in order to login and switch Base Life Support Systems back on.
Components:
- Audio Source
- Sphere collider - trigger
TasksManagerScript
- responsible for emitting events
The Dark Matter Module is located in that room.
Components:
- Audio Source
- Sphere collider - trigger
TasksManagerScript
- responsible for emitting events
When the player is near the ship and has the Dark Matter Module, he can start repairing it. In order to do that he must stay near the ship for at least 10 seconds or the process will be interrupted.
Components:
- Audio Source
- Sphere collider - trigger
TasksManagerScript
- responsible for emitting eventsBrokenEngineScript
- responsible for animating ship's engine
There are several medpacks around the base. When the player walks through them, his health is reset to its starting level. The medpacks are also shown on the radar.
Components:
- AudioSource
- Sphere collider - trigger
MedpackScript
- responsible for restoring player's health
Scripts used for loading scenes or pausing game.
Used for starting the game, loading or deleting a saved game or checking game controls.
Played when the game finish.
Pause menu can be activated only if the player is not near an important area such as the Ship, Main Control Room or the Storage Room.
This is the main script for managing all game states and player's progress in the game.
Used for spawning and creating enemies. All enemies are spawn at the start of the game.
Responsible for emitting various game events.
Responsible for saving and loading game progress and characters.
This script is used for saving and loading game progress.
LoadSavedGame
- static property set from the main menuIsPlayerDead
- static property used when loading outro sceneFileName
- save file name
Game progress parameters:
IsPlayerDead
IsMainControlRoomFound
IsPasswordFound
IsStorageRoomFound
IsDarkMatterModuleFound
IsSpaceshipRepaired
Player
- saved playerEnemies
- saved enemies
Stores GameObject's Tag
, Position
and Rotation
.
Extends Character
and saves player's Health and Oxygen levels.
Extends Character
and saves enemy's Health level and movement mode.
Stores Vector3
's x
, y
and z
components.
Responsible for attaching and emitting events:
PlayerEnteredImportantArea
- when the player enters important area such as: Computer Room, Storage Room or the SpaceshipPlayerExitedImportantArea
- when the player exits important areaMainComputerFound
- when the player finds the Main Control RoomStorageRoomFound
- when the player finds the Storage RoomDarkMatterModuleFound
- when the player finds the Dark Matter Module. The spaceship can be repaired nowSpaceshipFound
- when the player finds the spaceship - if the player has the Dark Matter Module the game will endPlayerDead
- when the player diesGameFinish
ResumeGame
PauseGame
SaveGame
GoToMenu
QuitGame
Some additional functions:
FindChildrenByName
- Find all children of the Transform/GameObject by name (includes self)FindChildrenByTag
- Find all children of the Transform/GameObject by tag (includes self)
For storing map origin and scale. When spatial data is imported all coordinates are reduced due to floating point precision problem.
For importing spatial data - scripts for importing data from GeoJSON
or GML
formats.
For building and extruding meshes.
Static class with references to all tags, layers, events and messages used in the game.
Responsible for managind collisions between bullets and other game objects.
Responsible for managing bullets.
Animates ship engine status and sound.
Attached to the comamnder's spawn points - all scared workers will run to a random spawn point and when near will be destroyed.