How happyseaweed/solaris works
1. What this repo is
- Solaris is a native 2D game built in C++ on top of SFML.
- The architecture is not client/server or web-based; it is a single desktop executable with a game loop, rendering, input handling, and state transitions.
2. Top-level runtime flow
- src/main.cpp is the entry point.
- src/driver.cpp and include/driver.h act as the central coordinator for the application: window setup, the main loop, dispatching events, and switching between game modes/screens.
3. State / screen-based structure
- The codebase is split into separate gameplay and menu modes:
- titlescreen.cpp
- overworld.cpp
- outerspace.cpp
- ship.cpp
- paused.cpp
- This strongly suggests a scene/state machine architecture, where the driver routes control to whichever mode is active.
4. Gameplay domain separation
- The state names imply distinct responsibilities:
- Title screen: start/menu flow
- Overworld: exploration or planet-side play
- Outer space: space traversal or combat
- Ship: player ship interior or management view
- Paused: pause overlay or menu state
- For an architecture diagram, these should be shown as peer states controlled by the central driver, not as independent apps.
5. UI subsystem
- src/UI.cpp and include/UI.h form a dedicated UI layer.
- This likely handles HUD elements, health bars, prompts, and interactive widgets shown across multiple states.
- Because it is separated from the state files, UI appears to be a shared rendering/input overlay rather than embedded directly inside each scene.
6. Rendering effects
- include/blur.frag is a fragment shader, so the project uses SFML’s graphics pipeline plus custom shader support.
- This is likely used for visual polish in menu/pause/overlay states, or for background blurring behind UI panels.
7. Asset pipeline
- media/aseprite/ contains many .aseprite source files, which means the art pipeline is built around Aseprite-authored sprites and animations.
- The asset names show the core visual set: astronaut variants, health bars, oxygen tanks, plants, asteroid, habitat, interaction button, and background imagery.
- media/astronaut and other media entries suggest exported runtime assets are stored alongside the source art.
8. Data flow between systems
- Typical flow is: SFML input/events → driver → active state module → UI/rendering → window display.
- State modules own their scene-specific logic, while the UI module draws shared interface elements on top.
- Assets from media/ feed the render path; the shader adds post-processing where needed.
9. Build and packaging
- Makefile is the build entry point, so the repo is set up for local compilation and linking rather than a higher-level engine workflow.
- The checked-in .o files indicate build artifacts are present in the repository tree, but they are not part of the architectural runtime boundary.
10. Repository boundaries
- include/ contains the public headers and shader assets used by the C++ sources.
- src/ contains the implementation files.
- media/ is the content layer: art source files and runtime assets.
- This clean split is useful for diagrams: code layer, game-state layer, and content layer.
11. External dependency
- The only material external runtime dependency called out by the README is SFML.
- There is no sign of network services, databases, or backend APIs; the game is fully local and graphics/input driven.
12. Overall architectural picture
- Solaris is best represented as a single-process, SFML-based 2D game with:
- a central driver/main loop,
- multiple scene/state modules,
- a shared UI layer,
- shader-based visual effects,
- and an Aseprite-driven asset pipeline.
Main entry points: media Media Assets · titlescreen.cpp Title · overworld.cpp Overworld · outerspace.cpp Outer Space
Components 14
Runtime
Single-process game loop and scene/state modules.
- main · Program entry; starts the game executable.
src/main.cpp - Driver · Central loop, window setup, event dispatch, and state switching.
- Title · Start/menu screen and entry flow.
src/titlescreen.cpp - Overworld · Planet-side exploration or main gameplay view.
src/overworld.cpp - Outer Space · Space traversal or combat view.
src/outerspace.cpp - Ship · Ship interior or management view.
src/ship.cpp - Paused · Pause overlay or pause menu state.
src/paused.cpp - SFML · Graphics, windowing, input, and audio dependency.
Presentation
Shared UI and visual effects used across states.
- UI · Shared HUD, prompts, and interactive interface elements.
- Blur Shader · Fragment shader for blur and visual polish.
include/blur.frag
Content
Aseprite-authored source art and runtime media assets.
- Aseprite Art · Editable sprite and animation source files.
media/aseprite - Media Assets · Exported or checked-in game art and other media files.
media
Build
Local build entrypoints and repository-level packaging artifacts.
- Makefile · Local compilation and linking entrypoint.
Makefile - Object Files · Checked-in compiled outputs present in the repository tree.
Connections 21
- main → Driver: starts · Main hands off control to the central game driver.
- Driver → SFML: uses · Driver creates the window, polls events, and presents frames.
- Driver → Title: selects · Driver routes execution to the active scene state.
- Driver → Overworld: selects · Driver routes execution to the active scene state.
- Driver → Outer Space: selects · Driver routes execution to the active scene state.
- Driver → Ship: selects · Driver routes execution to the active scene state.
- Driver → Paused: selects · Driver routes execution to the active scene state.
- Title → UI: draws · Title screen can use shared UI rendering and widgets.
- Overworld → UI: draws · Gameplay overlays share the common UI layer.
- Outer Space → UI: draws · Gameplay overlays share the common UI layer.
- Ship → UI: draws · Gameplay overlays share the common UI layer.
- Paused → UI: draws · Pause presentation uses the shared UI layer.
- UI → Blur Shader: applies · UI and overlays may use blur for depth and emphasis.
- Aseprite Art → Media Assets: exports to · Aseprite source art feeds runtime media and sprites.
- Media Assets → Title: assets for · Visual assets support the title/menu scene.
- Media Assets → Overworld: assets for · Visual assets support the overworld scene.
- Media Assets → Outer Space: assets for · Visual assets support the space scene.
- Media Assets → Ship: assets for · Visual assets support the ship scene.
- Media Assets → UI: assets for · Icons, bars, and prompts feed the UI layer.
- Makefile → main: builds · Makefile compiles the executable from the source tree.
- Makefile → Object Files: produces · Local builds leave object files in the repository tree.