Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 22, 2025

Fixes an issue where the cityMap algorithm was not accessible through the UI algorithm cycling, despite being fully implemented and set as the default in DungeonConfig.

Problem

The game defines 4 dungeon generation algorithms in GenerationAlgorithm enum:

  • roomsCorridors
  • bsp
  • cellular
  • cityMap (default algorithm)

However, the GameScene.algorithms array only contained 3 algorithms, missing cityMap:

// Before - missing cityMap
private let algorithms: [GenerationAlgorithm] = [.roomsCorridors, .bsp, .cellular]

This meant that:

  • Users could only cycle through 3 of 4 available algorithms
  • The cityMap algorithm was never accessible via UI despite being fully functional
  • The DungeonConfig default of .cityMap was always overridden by the limited selection

Solution

Added the missing .cityMap algorithm to the algorithms array:

// After - includes all algorithms
private let algorithms: [GenerationAlgorithm] = [.roomsCorridors, .bsp, .cellular, .cityMap]

Verification

  • All infrastructure for cityMap already exists (CityMapGenerator, HUD display, DungeonGenerator routing)
  • Added test testAllAlgorithmsAvailable() to prevent future regressions
  • No existing functionality is affected - this only adds the missing algorithm to the cycling selection

The fix is minimal and surgical, addressing the root cause without modifying any existing logic.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] FIx issue where no matter what algormim is picked in map config Fix algorithm selection issue - add missing cityMap to algorithms array Aug 22, 2025
Copilot AI requested a review from SpaceTrucker2196 August 22, 2025 14:54
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