Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TaylorZaneKirk/MMO-Project/llms.txt
Use this file to discover all available pages before exploring further.
GameScreen is the main scene the client transitions to after a successful login. It wires together the WebSocket session, world chunk renderer, local and remote player actors, NPC actors, HUD panels, ground item rendering, and context menus through a set of focused controllers. GameScreen itself is responsible only for session wiring and applying server responses — it delegates all input interpretation, panel rendering, actor movement, and state management to the controllers it instantiates.
Scene location
Control and instantiates all controllers dynamically in _ready(). The SessionState autoload provides the SessionClient instance, which is shared between LoginScreen and GameScreen across the scene transition.
Controllers attached to GameScreen
The following controllers are instantiated byGameScreen and added as child nodes. HudController is already in the scene tree via @onready and owns InventoryPanelController and EquipmentPanelController as its own child nodes.
| Controller | File | Responsibility |
|---|---|---|
WorldChunkRenderer | world_chunk_renderer.gd | 3×3 chunk neighborhood tile rendering from shared map JSON |
NpcController | npc_controller.gd | NPC presence, movement tweens, and StaticNpc scene lifecycle |
LocalPlayerController | local_player_controller.gd | PlayerComposite position, facing, movement tweens, and client-side step prediction |
RemotePlayerController | remote_player_controller.gd | Remote player presence, position interpolation, and equipment visual updates |
GroundItemController | ground_item_controller.gd | Ground item sprite rendering from authoritative world snapshot |
ContextMenuController | context_menu_controller.gd | Right-click menu display, action button construction, and action_selected signal |
PlayerInteractionController | player_interaction_controller.gd | All click input: world tile clicks, inventory slot clicks, context-menu action routing, and pending interactions such as move-to-pickup |
HudController | hud_controller.gd | Right-side HUD tab switching; owns InventoryPanelController and EquipmentPanelController as children |
GameStateStore | state/game_state_store.gd | Authoritative state ownership for local player, ground items, NPCs, and remote players |
GameSessionPresenter | state/game_session_presenter.gd | WebSocket message classification and routing into GameStateStore |
InventoryPanelController (inventory_panel_controller.gd) and EquipmentPanelController (equipment_panel_controller.gd) are instantiated by HudController during its configure() call, not by GameScreen directly.
Input flow
All world and inventory click input routes throughPlayerInteractionController. When the player clicks, PlayerInteractionController classifies the input and emits one of its intent signals. GameScreen subscribes to these signals and sends the corresponding WebSocket message:
| Signal | WebSocket message sent |
|---|---|
move_requested(tile_x, tile_y) | send_movement_intent |
inventory_item_use_requested(slot_index, item, use_action) | send_inventory_item_use_request |
inventory_item_drop_requested(slot_index, item) | send_inventory_item_drop_request |
ground_item_pickup_requested(ground_item_id, item_name) | send_ground_item_pickup_request |
equipment_item_unequip_requested(slot) | send_equipment_item_unequip_request |
HudController forwards inventory and equipment slot click signals to PlayerInteractionController via connected callbacks, so the HUD panels feed into the same intent pipeline as world clicks.
Scene initialisation order
In_ready(), GameScreen performs the following steps in order:
- Load world JSON from
prototype/shared/maps/world.json - Instantiate and configure
WorldChunkRenderer; locate the starting chunk forSessionState.map_id - Instantiate
NpcController,LocalPlayerController,RemotePlayerController, andGroundItemController - Instantiate
ContextMenuControllerandPlayerInteractionController; wire intent signals toGameScreenhandler methods - Configure
HudController; wire inventory and equipment slot click signals toPlayerInteractionController - Instantiate
GameStateStoreand connect its output signals (world_snapshot_changed,movement_applied,remote_player_state_updated,npc_state_updated) toGameScreenapply methods - Instantiate
GameSessionPresenter; callconfigure(_game_state_store, SessionState.session_client) - Render the initial chunk neighborhood and position the local player
- Apply
SessionState.world_snapshottoGameStateStoreto hydrate all HUD panels and actors from the cached snapshot
When adding attack, talk, trade, examine, or drop-quantity interactions, add
the menu orchestration and input handling to
player_interaction_controller.gd
and emit intent signals back to GameScreen. Do not add new input branches
or WebSocket send calls directly inside game_screen.gd.