-
Notifications
You must be signed in to change notification settings - Fork 4
Code Architecture
Alex Pineda edited this page Sep 29, 2023
·
6 revisions
-
Electron
main/index.ts
: Entry point for initializing settings and browser window. Standard Electron-based initialization. -
titan-reactor.ts
: Executes after window creation, contains core application logic.
- Flow: Loading Scene -> Home Page -> Interstitial Scene -> Replay Scene or Map Scene
-
Core Logic: Centralized in
stores/scene-store
. Simplifies scene transitions.
- Abstraction: Maps and Replays are scenes.
-
Scene Loaders:
replay-scene-loader
andmap-scene-loader
manage loading. -
Global Events: Initiated by
load-map-file
andload-replay-file
, managed intitan-reactor.ts
. Event-driven architecture.
-
game-scene
: Common API for map and replay scenes. -
world-composer
: Engine used bygame-scene
. Decouples game logic from engine.
-
Global Assets: Managed by
assets.ts
for loading,game-store
for read/write. - Map Textures: Not cached, regenerated on load.
- WASM Build: Uses WebAssembly for performance.
-
Heap Mapping: Managed in
openbw.ts
andopenbw-composer
.
-
System: Centralized in
global-events.ts
. Manages system-level and user-level events.
- In-Game Events: Triggered events like unit deaths, observed by plugins and macros.
- System: Mostly managed by settings.ts and messages passed between Configuration UI and this system
- Data: Stored as JSON, contains app settings, macros and enabled plugins information.
-
Plugins: External, loaded by
plugin-manager.ts
. Plugin settings are stored in the plugins package.json config object and not in the app settings. - Macros: Internal, user-created, initiated by triggers. Macros are stored in the app settings.
-
UI: Managed by
plugin-system-ui.ts
. -
Server:
server.ts
handles runtime loading and transpiling of JSX plugins.
-
Management:
plugin-system-native.ts
initiates and manages native plugins.
- A separate window where the configuration UI is held and the user may modify settings, macros and plugins.
Questions? Join our Discord
-
-
- Runtime Server
-
Core
-
Plugins & Macros
-