Skip to content

Implement interactive Terminal UI with real-time engine integration#82

Merged
SorraTheOrc merged 4 commits into
mainfrom
copilot/colossal-pony
Dec 8, 2025
Merged

Implement interactive Terminal UI with real-time engine integration#82
SorraTheOrc merged 4 commits into
mainfrom
copilot/colossal-pony

Conversation

Copilot AI commented Dec 7, 2025

Copy link
Copy Markdown

Task 12.2.3 adds player interactivity to the Terminal UI, wiring all panels to the simulation engine with bidirectional real-time updates.

Implementation

Input handling (input_handler.py)

  • Keyboard event system with 23 mapped actions (navigation, view switching, overlays, simulation control)
  • Non-blocking input processing using ActionType/ActionEvent pattern

Interactive controller (terminal_ui.py)

  • Real-time UI loop at 10 FPS with state synchronization
  • View management (Map, Agents, Factions, Focus) with overlay support
  • Terminal mode handling (raw mode entry/exit, size validation)

Shell integration (shell.py)

  • Added --ui flag to launch interactive mode
  • Maintains backward compatibility with existing CLI commands

View layer fixes (map_view.py)

  • Fixed district data access for GameState compatibility
  • Added delta attribute handling (unrest_delta, pollution_delta)

Testing

21 integration tests covering:

  • Keyboard navigation and action dispatch
  • View state transitions and overlay toggling
  • UI-to-engine bidirectional updates
  • Event feed population from simulation state
  • Focus management integration

Example usage:

python -m gengine.echoes.cli.shell --world echoes_of_emergence --ui

Keyboard shortcuts: arrow keys/hjkl for navigation, m/a/f/o for views, u/p/s/r for overlays, space for tick, q to quit.

Original prompt

"Issue 81 - Player Interactivity & UI Wiring" to gamedev agent

Created from Copilot CLI via the copilot delegate command.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 7, 2025 23:35
…ssue #81)

- Add interactive Terminal UI mode with keyboard navigation
- Implement input handler with 23 different actions
- Wire UI components to game engine for real-time updates
- Add 21 comprehensive integration tests
- Enable --ui flag to launch interactive mode
- Support view switching, overlays, and simulation control
- All tests passing with no regressions

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
- Document delta attributes usage in map_view.py
- Clarify focus metadata key comment in tests

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add player interactivity and UI wiring Implement interactive Terminal UI with real-time engine integration Dec 7, 2025
Copilot AI requested a review from SorraTheOrc December 7, 2025 23:43
…_echoes.md; update agent/faction view logic for GameState compatibility; minor UI/test improvements
@SorraTheOrc SorraTheOrc merged commit c80e065 into main Dec 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants