Skip to main content

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

prototype/client/screens/game/GameScreen.tscn
prototype/client/screens/game/game_screen.gd
The script extends 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 by GameScreen and added as child nodes. HudController is already in the scene tree via @onready and owns InventoryPanelController and EquipmentPanelController as its own child nodes.
ControllerFileResponsibility
WorldChunkRendererworld_chunk_renderer.gd3×3 chunk neighborhood tile rendering from shared map JSON
NpcControllernpc_controller.gdNPC presence, movement tweens, and StaticNpc scene lifecycle
LocalPlayerControllerlocal_player_controller.gdPlayerComposite position, facing, movement tweens, and client-side step prediction
RemotePlayerControllerremote_player_controller.gdRemote player presence, position interpolation, and equipment visual updates
GroundItemControllerground_item_controller.gdGround item sprite rendering from authoritative world snapshot
ContextMenuControllercontext_menu_controller.gdRight-click menu display, action button construction, and action_selected signal
PlayerInteractionControllerplayer_interaction_controller.gdAll click input: world tile clicks, inventory slot clicks, context-menu action routing, and pending interactions such as move-to-pickup
HudControllerhud_controller.gdRight-side HUD tab switching; owns InventoryPanelController and EquipmentPanelController as children
GameStateStorestate/game_state_store.gdAuthoritative state ownership for local player, ground items, NPCs, and remote players
GameSessionPresenterstate/game_session_presenter.gdWebSocket 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 through PlayerInteractionController. 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:
SignalWebSocket 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:
  1. Load world JSON from prototype/shared/maps/world.json
  2. Instantiate and configure WorldChunkRenderer; locate the starting chunk for SessionState.map_id
  3. Instantiate NpcController, LocalPlayerController, RemotePlayerController, and GroundItemController
  4. Instantiate ContextMenuController and PlayerInteractionController; wire intent signals to GameScreen handler methods
  5. Configure HudController; wire inventory and equipment slot click signals to PlayerInteractionController
  6. Instantiate GameStateStore and connect its output signals (world_snapshot_changed, movement_applied, remote_player_state_updated, npc_state_updated) to GameScreen apply methods
  7. Instantiate GameSessionPresenter; call configure(_game_state_store, SessionState.session_client)
  8. Render the initial chunk neighborhood and position the local player
  9. Apply SessionState.world_snapshot to GameStateStore to 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.

Build docs developers (and LLMs) love