How dosinabox/g2_classic works
This project is a modification and scripting overhaul for Gothic 2 Classic. It’s not a traditional full‐stack web app or a stand-alone tool, but rather a game mod composed of a very large collection of scripts that affect game AI, dialogs, spells, items, and story events. There is also a dedicated section for the game menu (PrjMENU) and additional support directories for DLLs, configuration (ini), installer scripts (nsi), and patch files to fix or adjust certain behaviors in the original game engine. The project is compiled by the Gothic Sourcer tool (version 3.16) using the main solution file (Gothic_2_Classic.gsc).
Main Components
• Game Script Module (PrjGothic):
– Contains several sub-modules such as AI (with further subdivisions by Human, Magic, Monster, etc.), Items, Story (including dialogs, events, NPC, etc.), and internal helper scripts.
– Represent this module as the “Core Game Logic” or “Gameplay Scripting” layer.
• Game Menu Module (PrjMENU):
– Contains source code and scripts for the in-game menu and interface modifications.
• Configuration and Patching (src directory):
– Contains DLL code (src/dll), ini configurations (src/ini), NSIS installer scripts (src/nsi), and patch files (src/patch) that apply fixes/fixes for particular issues within the game engine.
• Build/Compilation Process:
– The primary entry point is Gothic_2_Classic.gsc which is compiled using the Gothic Sourcer. Represent this as the “Build Pipeline / Compiler” node.
Relationships and Interactions
• The Build Pipeline (Gothic Sourcer) compiles the scripts from both the PrjGothic (core game logic) and PrjMENU (menu interface) directories.
• Patches and configuration files (under src) provide necessary fixes and integrations before the game is run. They adjust and improve both the engine’s behavior (e.g., collision fixes, sound management) and script execution.
• There is a dependency flow: source scripts → Gothic Sourcer (compilation) → integrated mod (game engine run-time) → patched configurations/DLL enhancements.
Architectural Patterns and Relevant Technologies
• Modularity: The project is divided into discrete components (AI, Menu, Items, Story, etc.) which likely follow a modular pattern. Each major script category can be seen as an independent service or plugin for the game engine.
• Separation of Concerns: Game logic (PrjGothic) is separate from user interface modifications (PrjMENU), and further separated from the configuration/patch layer (src).
• External Tool Integration: Gothic Sourcer is a critical external dependency required for script compilation.
• File Organization as a “Folder-as-Module” pattern: The deep file tree shows each new category in its own folder, allowing you to map out several modules that will interact during game runtime.
• The use of patch files indicates that the design also implements a “layer on top” concept where the mod’s changes “override” or “patch” the default game behaviors.
Additional Notes
• Layering and modularity since separating each major area in the game (AI, Menu, Patching) facilitates understanding of the interactions.
• To capture the deep hierarchical tree inside PrjGothic by grouping similar components (e.g., group all “Dialogue” related scripts and represent them as one submodule within “Story”).