Skip to content

Remove Combat navigation panel and integrate spatial combat into AI Game Master#18

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/remove-combat-panel-ui
Draft

Remove Combat navigation panel and integrate spatial combat into AI Game Master#18
Copilot wants to merge 4 commits into
mainfrom
copilot/remove-combat-panel-ui

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 7, 2025

Overview

Removed the standalone Combat section from the navigation menu and integrated spatial combat functionality directly into the AI Game Master (Story Generator), creating a more streamlined and immersive gameplay experience.

Problem

The previous implementation had combat management separated from the storytelling flow:

  • Users had to navigate away from the AI Game Master to a separate Combat page
  • Combat felt disconnected from the narrative experience
  • The Combat page had two tabs (Quick Combat and Spatial Combat), making the interface unnecessarily complex
  • Users requested having only spatial combat accessible directly from the story generator

Solution

This PR makes the following changes:

1. Navigation Simplification

  • Removed "Combat" from the navigation menu (6 items instead of 7)
  • Removed combat page routing from the main application flow
  • Combat functionality is no longer a separate page

2. Spatial Combat Grid Extraction

Created a new reusable function show_spatial_combat_grid(combat_id, key_suffix="") that:

  • Displays a 20x20 tactical grid using Plotly
  • Shows character positions with color-coded health indicators:
    • 🟢 Green: >70% HP (healthy)
    • 🟡 Yellow: 30-70% HP (wounded)
    • 🔴 Red: 1-30% HP (badly wounded)
    • ⚫ Gray: 0% HP (unconscious/dead)
  • Provides interactive movement controls with X/Y position inputs
  • Integrates with existing spatial combat APIs (/api/spatial/{combat_id}/state and /move)

3. AI Game Master Integration

Updated show_gm_combat_scene() to provide inline spatial combat:

  • When a combat scene is triggered, users see a "Start Spatial Combat" button
  • The spatial grid appears directly within the story context (no navigation required)
  • Users can move characters on the grid and manage tactical combat
  • An "End Combat" button cleanly terminates the encounter and returns to the story

4. Bug Fixes

Fixed missing characters variable initialization in:

  • show_combat()
  • show_spells()
  • show_story_generator()

Also removed UTF-8 BOM from streamlit_app.py for better compatibility.

User Experience Improvements

Before:

  1. User is in AI Game Master
  2. Combat is triggered
  3. User clicks "Start Combat Manager" → navigates to separate page
  4. User selects between Quick Combat or Spatial Combat tabs
  5. User manages combat on different page
  6. User navigates back to continue story

After:

  1. User is in AI Game Master
  2. Combat is triggered
  3. User clicks "Start Spatial Combat" → grid appears inline
  4. User moves characters on grid
  5. User clicks "End Combat" → continues story seamlessly

Technical Details

  • All changes contained in streamlit_app.py
  • ~200 lines added (new function + integration)
  • ~5 lines removed (navigation + routing)
  • Maintains backward compatibility (show_combat function still exists)
  • All API integrations preserved

Testing

Validated with comprehensive automated checks:

  • ✅ Navigation menu updated correctly
  • ✅ Combat routing removed
  • ✅ Spatial combat grid function exists and works
  • ✅ AI Game Master integration complete
  • ✅ Bug fixes applied

Ready for manual testing in the full application environment.

Original prompt

The combat system right now is very lackluster - I want to remove the combat section panel in the app, but have it incorporated in the "Story generator" instead where the user can start combats when they want! It should be the spatial combat only where you can move the characters in this grid


💡 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 3 commits October 7, 2025 18:29
Co-authored-by: NusretSalli <110097112+NusretSalli@users.noreply.github.com>
Co-authored-by: NusretSalli <110097112+NusretSalli@users.noreply.github.com>
Co-authored-by: NusretSalli <110097112+NusretSalli@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove combat section panel and integrate with story generator Remove Combat navigation panel and integrate spatial combat into AI Game Master Oct 7, 2025
Copilot AI requested a review from NusretSalli October 7, 2025 18:41
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