-
Notifications
You must be signed in to change notification settings - Fork 5
Programming Overview
This page attempts to document at a high level the various systems that Red Homestead encompasses. Scripts and actions are broadly split into either Player-initiated or Tick-initiated.
#Player Initiated Action Scripts
"Player Initiated" means any state change that the Player causes through input.
##PlayerInput.cs
The PlayerInput
class is a Monobehavior on the Player prefab that is responsible for:
- Player Input state (Planning or not)
- Raycasting for given input state
- Handling non-movement keystrokes like Escape and Toggle Flashlight
- Computing placement and placing runtime planning prefabs
Please note that #4 is not considered to be within PlayerInput's scope and should be moved to a separate class.
#Tick Initiated Scripts "Tick-initiated" here means the various long running loops, such as the FlowManager (industrial processes), SurvivalTimer (player need bars), and SunOrbit (environmental sun effects).
##SurvivalTimer.cs A Monobehavior on the Player prefab that is responsible for:
- Storing available survival resource information (air, water, etc)
- Periodically consuming these resources
- Providing an interface for other scripts to refill these resources
##SunOrbit.cs A Monobehavior on the Sun Directional Light transform that is responsible for:
- Moving the sun through the sky
- Setting ambient light appropriately
- Lighting the skybox appropriately
- Rotating the stars (not done yet!)
- Updating the Martian clock
- Providing an interface for scripts to subscribe to dawn and dusk events (not done yet!)
- Automatically turning the player's headlamps on or off
##FlowManager.cs A Monobehavior on the original Habitat transform that is responsible for:
- Storing datastructures for industrial nodes
- Pushing and pulling industrial compounds through converters and storage
#User Interface Scripts ##GuiBridge.cs A Monobehavior on the Canvas transform that is responsible for:
- Storing references to Canvas objects
- Syncing Canvas UI elements to other script's state
#Data Structure Classes
##CuesAndPrompts.cs
##ConstructionZone.cs Module and Resource classes