-
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" means any state change that the Player causes through input.
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" here means the various long running loops, such as the FlowManager (industrial processes), SurvivalTimer (player need bars), and SunOrbit (environmental sun effects).
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
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
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
A Monobehavior on the Canvas transform that is responsible for:
- Storing references to Canvas objects
- Syncing Canvas UI elements to other script's state
This class contains the structures and data for all the prompts when the player hovers over an interactable gameplay element. All of the data is static.
This is where the enums for Modules and Resources and the mappings for Module Resource requirements are.