How coremaze/cwsdk works
CWSDK is a C++ interface and runtime support library for Cube World mods. The primary workflow is that a mod includes cwsdk.h, exports MakeMod, and is loaded by the Cube World Mod Launcher; after initialization, the game invokes mod-overridable callbacks for events such as chat, ticks, input, rendering, and gameplay calculations. The repository also exposes game, graphics, UI, and Steam types. README documents the callback contract; sampled source is mostly type/layout declarations, so internal wiring beyond that contract is not inferred.
Main entry points: cwsdk.h GenericMod callbacks · cwsdk.cpp SDK runtime · steam_api.h Steam interfaces · Game.h Gameplay state
Components 17
Mod API
- GenericMod callbacks
cwsdk.h - SDK runtime
cwsdk.cpp
Game Model
- Gameplay state
cube/Game.h - World and zones
cube/World.h - Creature stats
cube/Creature.h - Items and inventory
cube/Item.h - Game UI widgets
cube/GUI.h
Runtime Interfaces
- Graphics and chunks
gfx/Graphics.h - Plasma UI engine
plasma/Engine.h - Math primitives
common/Vector3.h - Game controls
cube/Controls.h - Audio and music
cube/XAudio2Engine.h
Platform SDKs
- Steam interfaces
steam/steam_api.h - Steam networking
steam/ISteamNetworking.h
Other components
- Mod author
- Mod Launcher
- Cube World
Connections 16
- Mod author → GenericMod callbacks: implements
- Mod author → Mod Launcher: exports mod
- Mod Launcher → SDK runtime: loads mod
- SDK runtime → GenericMod callbacks: initializes
- Cube World → GenericMod callbacks: dispatches events
- Cube World → Gameplay state: exposes state
- Cube World → World and zones: generates zones
- Cube World → Creature stats: calculates stats
- Cube World → Items and inventory: checks inventory
- Cube World → Game UI widgets: runs UI
- Cube World → Graphics and chunks: renders
- Cube World → Plasma UI engine: uses engine
- Cube World → Game controls: reads input
- Cube World → Audio and music: plays audio
- Cube World → Steam interfaces: uses interfaces
- Steam interfaces → Steam networking: exposes networking