How try/opengothic works
OpenGothic is a Gothic 2 game client that loads the player’s original game data, runs a scripted world simulation, and presents it through game UI, graphics, audio, and physics. Its principal startup path is the game executable into the main window and Gothic runtime. The tree also contains Spacer, a world-editing application with project management and background asset loading. Edges below are limited to relationships visible in excerpts or the source index; unsampled subsystems are included where the README or tree establishes their role, without guessing their call paths.
Main entry points: gothic.cpp Gothic runtime · world.cpp World simulation · main.cpp Game startup · mainwindow.cpp Game window
Components 27
Game runtime
- Game startup
game/main.cpp - Game window
common/mainwindow.cpp - Gothic runtime
common/gothic.cpp - Launch options
common/commandline.h
World simulation
- Game session
common/game/gamesession.h - Game scripting
common/game/gamescript.h - World simulation
common/world/world.cpp - NPC behavior
common/world/objects/npc.cpp - Physics simulation
common/physics/dynamicworld.cpp - World triggers
common/world/triggers/abstracttrigger.cpp
Game presentation
- World rendering
common/graphics/renderer.cpp - Meshes and animation
common/graphics/meshobjects.h - Graphics shaders
common/graphics/shaders.h - Game menus
common/ui/menuroot.h - Sound and music
common/sound/soundfx.cpp
Content and persistence
- Game resources
common/resources.h - Save serialization
common/game/serialize.h - World save state
common/game/worldstatestorage.cpp - Original game data
Spacer editor
- Spacer startup
spacer/main.cpp - Editor window
spacer/editorwindow.h - Project manager
spacer/project/projectmgr.h - World editing
spacer/objects/worldedit.h - Asset loader
spacer/workers/dataworker.cpp - Project items
spacer/project/projectitem.cpp - Ray queries
spacer/objects/rayquery.cpp
Other components
- Player
Connections 29
- Player → Game startup: starts
- Game startup → Launch options: parses options
game/main.cpp - Game startup → Game window: creates window
game/main.cpp - Game window → Gothic runtime: uses runtime
common/mainwindow.cpp - Gothic runtime → Game session: manages session
- Gothic runtime → World simulation: accesses world
- World simulation → Game scripting: exposes scripts
- World simulation → Physics simulation: owns physics
- World simulation → World rendering: provides world view
- NPC behavior → Game scripting: uses scripts
- NPC behavior → Physics simulation: uses physics
- World triggers → Physics simulation: uses collision world
- World triggers → World rendering: creates particle effects
- World rendering → Meshes and animation: renders meshes
- Meshes and animation → Graphics shaders: uses shaders
- Game window → Game menus: hosts menus
common/mainwindow.cpp - Gothic runtime → Sound and music: provides sound
- Gothic runtime → Game resources: loads resources
- Game session → Save serialization: serializes state
common/game/worldstatestorage.cpp - World save state → World simulation: saves and loads
common/game/worldstatestorage.cpp - Save serialization → World save state: writes save data
common/game/worldstatestorage.cpp - Original game data → Gothic runtime: supplies game content
- Player → Spacer startup: launches editor
- Spacer startup → Editor window: creates editor
spacer/main.cpp - Spacer startup → Project manager: creates manager
spacer/main.cpp - Project manager → Project items: manages items
- World editing → Asset loader: loads previews
spacer/workers/dataworker.cpp - Asset loader → Project items: loads items
spacer/workers/dataworker.cpp - Ray queries → World editing: queries world
spacer/objects/rayquery.cpp