Implement boundary-stitching algorithm for cross-tile room connectivity #54

Open
opened 2026-03-14 23:57:23 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: feat(worldgen): implement cross-tile boundary stitching
  • Branch: feature/m3-cross-tile

Background and Context

The world cover generator processes ESA WorldCover GeoTIFF tiles independently, creating rooms within each tile's area. Currently, rooms at tile boundaries are not connected to rooms in adjacent tiles, resulting in disconnected regions. A boundary-stitching algorithm is needed to create exits between edge rooms of adjacent tiles, producing a seamlessly connected world.

Expected Behavior

After world generation, rooms at the edges of adjacent tiles are connected via exits in the appropriate cardinal direction (north/south/east/west). The stitching algorithm iterates over boundary room pairs and creates bidirectional exits between matching positions.

Acceptance Criteria

  • Rooms at adjacent tile boundaries are connected via exits
  • Connections are bidirectional (exit from tile A room to tile B room and vice versa)
  • Stitching handles both horizontal (east-west) and vertical (north-south) boundaries
  • No duplicate exits are created at boundary rooms
  • Stitching works correctly when tiles have different grid dimensions

Subtasks

  • Code: Add a stitch_boundaries(area_a, area_b, direction) method to the world cover generator that finds matching edge rooms and creates exits between them
  • Code: Implement edge room detection — identify rooms at the north/south/east/west boundary of an area's grid
  • Code: Implement position matching — pair edge rooms from adjacent areas that share the same position along the boundary axis
  • Code: Create bidirectional Exit objects between matched room pairs using the appropriate direction (e.g., east exit from A to B, west exit from B to A)
  • Code: Integrate boundary stitching into the world generation pipeline, calling it after all tiles are processed
  • Code: Handle edge cases: tiles with no shared boundary, tiles with different row/column counts along the boundary
  • Docs: Update RDoc comments on the world cover generator to document the stitching algorithm
  • Docs: Add a section to the Docusaurus world generation documentation describing cross-tile connectivity
  • Tests (Cucumber): Add tests/unit/boundary_stitching.feature covering: basic stitching between two adjacent areas, bidirectional exit creation, handling of mismatched grid dimensions, no duplicate exits
  • Tests (Cucumber Integration): Add integration feature in tests/integration/ verifying a player can walk across tile boundaries in a generated world
  • Tests (Profiling): Run bundle exec rake unit_profile and verify no performance regressions in world generation
  • Quality: Verify coverage >=85% via bundle exec rake unit. If coverage is <85% then review the current unit test coverage report at build/tests/unit/coverage/ and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun bundle exec rake unit to verify all tests pass and coverage is above >=85%. Only mark this as complete once coverage is >=85%, if not repeat this task as many times as is needed until coverage reaches >=85%.
  • Quality: Run bundle exec rake (default task: unit tests with coverage) and bundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `feat(worldgen): implement cross-tile boundary stitching` - **Branch**: `feature/m3-cross-tile` ## Background and Context The world cover generator processes ESA WorldCover GeoTIFF tiles independently, creating rooms within each tile's area. Currently, rooms at tile boundaries are not connected to rooms in adjacent tiles, resulting in disconnected regions. A boundary-stitching algorithm is needed to create exits between edge rooms of adjacent tiles, producing a seamlessly connected world. ## Expected Behavior After world generation, rooms at the edges of adjacent tiles are connected via exits in the appropriate cardinal direction (north/south/east/west). The stitching algorithm iterates over boundary room pairs and creates bidirectional exits between matching positions. ## Acceptance Criteria - [ ] Rooms at adjacent tile boundaries are connected via exits - [ ] Connections are bidirectional (exit from tile A room to tile B room and vice versa) - [ ] Stitching handles both horizontal (east-west) and vertical (north-south) boundaries - [ ] No duplicate exits are created at boundary rooms - [ ] Stitching works correctly when tiles have different grid dimensions ## Subtasks - [ ] Code: Add a `stitch_boundaries(area_a, area_b, direction)` method to the world cover generator that finds matching edge rooms and creates exits between them - [ ] Code: Implement edge room detection — identify rooms at the north/south/east/west boundary of an area's grid - [ ] Code: Implement position matching — pair edge rooms from adjacent areas that share the same position along the boundary axis - [ ] Code: Create bidirectional Exit objects between matched room pairs using the appropriate direction (e.g., east exit from A to B, west exit from B to A) - [ ] Code: Integrate boundary stitching into the world generation pipeline, calling it after all tiles are processed - [ ] Code: Handle edge cases: tiles with no shared boundary, tiles with different row/column counts along the boundary - [ ] Docs: Update RDoc comments on the world cover generator to document the stitching algorithm - [ ] Docs: Add a section to the Docusaurus world generation documentation describing cross-tile connectivity - [ ] Tests (Cucumber): Add `tests/unit/boundary_stitching.feature` covering: basic stitching between two adjacent areas, bidirectional exit creation, handling of mismatched grid dimensions, no duplicate exits - [ ] Tests (Cucumber Integration): Add integration feature in `tests/integration/` verifying a player can walk across tile boundaries in a generated world - [ ] Tests (Profiling): Run `bundle exec rake unit_profile` and verify no performance regressions in world generation - [ ] Quality: Verify coverage >=85% via `bundle exec rake unit`. If coverage is <85% then review the current unit test coverage report at `build/tests/unit/coverage/` and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `bundle exec rake unit` to verify all tests pass and coverage is above >=85%. Only mark this as complete once coverage is >=85%, if not repeat this task as many times as is needed until coverage reaches >=85%. - [ ] Quality: Run `bundle exec rake` (default task: unit tests with coverage) and `bundle exec rake integration`, fix any errors if needed ensuring both pass across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v1.1.0 milestone 2026-03-14 23:57:23 +00:00
freemo self-assigned this 2026-03-15 04:25:22 +00:00
freemo modified the milestone from v1.1.0 to v1.2.0 2026-03-16 00:28:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: aethyr/Aethyr#54
No description provided.