How marct1me/pyqc works
1. Top-level split: engine, game content, and user data
- The repository is organized into three clear boundaries:
- QuantumCore/ = the reusable engine/runtime layer.
- core/ = game-specific content and scripts.
- GameData/ = externalized player data, configuration, saves, and mods.
- This separation is the main architectural feature to reflect in a diagram.
2. Entry point and runtime bootstrap
- main.pyw is the launch entry for the packaged game.
- It likely boots the engine, loads config, creates the rendering window/context, and then starts the main scene loop.
- Quantum game.lnk is just a desktop shortcut artifact, not part of the architecture.
3. Engine core responsibilities
- QuantumCore/app.py, scene.py, model.py, and time.py suggest the engine owns:
- application lifecycle,
- scene management,
- 3D model abstraction,
- frame timing/update cadence.
- QuantumCore/__init__.py exposes the package boundary.
4. Rendering subsystem
- QuantumCore/graphic/ contains the low-level graphics pipeline:
- camera.py for viewpoint/matrix state,
- light.py for lighting,
- shader_program.py for GLSL program management,
- vao.py, vbo.py, texture.py, mash.py for GPU resource binding and mesh/texture handling.
- The README indicates rendering is done with ModernGL/OpenGL, with GLSL shaders stored in QuantumCore/data/shaders/.
5. Asset and shader pipeline
- Engine assets live under QuantumCore/data/:
- models/ for OBJ/MTL content and generated sidecars like .bin and .json,
- textures/,
- shaders/,
- messages/ for UI/message resources,
- config files such as config.py, graphic.config, and settings.config.
- The model directory structure implies the engine loads external model files, then caches or preprocesses them into binary/JSON helpers.
6. UI and in-game interface layer
- UI exists in both engine and game layers:
- QuantumCore/UI.py, widgets.py, and graphic/interface.py look like reusable UI primitives.
- core/UI/ contains game-specific interface definitions (ingame_interface.py, .itrf files).
- This suggests a layered UI model: generic engine widgets plus game-specific screens and layouts.
7. Message and screen subsystem
- QuantumCore/messages/err_screen.py and loading_screen.py indicate engine-level screens for startup and error handling.
- These are likely used during bootstrap and asset loading before the main scene is active.
8. Game-specific content layer
- core/elements/entities.py and locations.py define gameplay objects and world/scene content.
- core/skripts.py likely contains gameplay logic or scenario scripting.
- core/models/, core/textures/, and core/sounds/ provide the game’s unique assets, distinct from the engine’s reusable assets.
9. Persistence, configuration, and modding
- GameData/config.json and GameData/settings.py handle user/runtime settings outside the engine package.
- GameData/saves/ contains persisted game state files (.sav).
- GameData/mods/unitext/ is a mod/plugin namespace, implying extensibility through Python modules loaded at runtime.
10. Runtime dependencies that shape the architecture
- The engine depends on Pygame for windowing/input and ModernGL/OpenGL for rendering.
- Numpy, PyGLM, and PyWavefront support math and model loading.
- Loguru suggests structured runtime logging.
- The README also mentions Bullet Physics and Cython, which indicates the project is designed with future/optional physics and performance optimization in mind.
11. Likely data flow through the system
- Launch starts in main.pyw → engine app/config initialization → asset loading from QuantumCore/data and core/ → scene creation → per-frame update/render loop.
- During runtime, gameplay state is driven by entities/locations/scripts, rendered through the graphics layer, and overlaid with UI/widgets/messages.
- Saves, settings, and mods are kept outside the engine code so content can change without rebuilding the core package.
12. What to emphasize in an architecture diagram
- Show a hard boundary between engine runtime and game content.
- Show graphics pipeline as a separate subsystem fed by models/shaders/textures.
- Show UI/messages as an overlay layer above scenes.
- Show GameData as persistent external state used by the runtime, not compiled into the engine.
Main entry points: scene.py Scene · app.py App · interface.py Interface · shader_program.py Shaders
Components 20
QuantumCore
Reusable engine and runtime
- App · Application lifecycle and bootstrap
QuantumCore/app.py - Scene · Scene management and runtime flow
QuantumCore/scene.py - Model · Engine-level model abstraction
QuantumCore/model.py - Time · Update cadence and frame timing
QuantumCore/time.py - __init__ · Engine package export boundary
QuantumCore/__init__.py
Graphics
Rendering pipeline and GPU resources
- Camera · View and projection state
QuantumCore/graphic/camera.py - Light · Scene lighting state
QuantumCore/graphic/light.py - Shaders · GLSL program compilation and binding
QuantumCore/graphic/shader_program.py - GPU buffers · VAO/VBO, mesh, and texture bindings
QuantumCore/graphic/vao.py - Interface · Renderable interface layer
QuantumCore/graphic/interface.py
UI / Screens
Reusable widgets and engine screens
core
Game-specific content and logic
Connections 21
- main.pyw → App: launches · Starts the engine runtime
- App → __init__: imports · Uses the engine package boundary
- App → Config: reads · Loads external runtime settings
- App → Scene: starts · Creates and runs the active scene
- Scene → Time: ticks · Drives frame/update cadence
- Scene → Model: uses · Consumes engine model abstraction
- Scene → Camera: views · Updates viewpoint for rendering
- Scene → Light: lights · Supplies lighting state to render passes
- Scene → Entities: hosts · Contains gameplay objects
- Scene → Locations: loads · Pulls world/location content
- Scene → Scripts: executes · Runs gameplay scripting
- Scene → Ingame UI: overlays · Displays game-specific interface
- Ingame UI → Widgets: builds on · Uses reusable UI primitives
- Screens → Widgets: uses · System screens share UI primitives
- App → Screens: shows · Uses loading and error screens during bootstrap
- Scene → Interface: renders · Feeds the renderable interface layer
- Interface → Shaders: binds · Uses shader programs for drawing
- Interface → GPU buffers: draws · Uses GPU buffers and textures
- Shaders → GPU buffers: drives · Shaders operate over GPU resources
- App → Mods: loads · Optional runtime plugin/content extension
- App → Saves: persists · Reads and writes save-state data