Skip to content

Other Technical Trivia

Red Reaper edited this page Oct 11, 2026 · 1 revision

Global-scope variables and functions

The followings variables are exposed to the global scope (available by window. in your browser's console):

  • apoapsis_generator - the system generator instance (system-gen.js).
  • apoapsis_renderer - the renderer instance (renderer.js).
  • apoapsis_system - the instance of a currently generated system (types.js).
  • apoapsis_version() - returns current app version.

Generation settings setup

Generation settings implementation is spread out across multiple different spots inside the project.

  • Default values constants inside the consts.js.
  • Properties definition for the GeneratorSettings class inside the types.js.
  • Enum for a setting's value change event, with an assigned setting name string inside the events.js. Strings should be named exactly like the property name, prefixed with setting_ (star_binary_chance -> setting_star_binary_chance). Prefixing is needed for loading setting from file (see settingsLoader.addEventListener('change', async () => { ... }) in ui.js)
  • A setting element description inside the settings.js, takes enum and constants from above.
  • Events subscriptions for the generator inside the system-gen.js. Properties and events enums are used.
  • Properties inside the code of generator's modules. Example: star-gen.js.

Clone this wiki locally