Skip to content

feat: v2 Kotor-style tile kits and tile layout compile#210

Open
th3w1zard1 wants to merge 36 commits into
masterfrom
cursor/indoor-builder-tilekit-v2
Open

feat: v2 Kotor-style tile kits and tile layout compile#210
th3w1zard1 wants to merge 36 commits into
masterfrom
cursor/indoor-builder-tilekit-v2

Conversation

@th3w1zard1
Copy link
Copy Markdown
Collaborator

@th3w1zard1 th3w1zard1 commented Apr 28, 2026

Description

Integrates v2 Kotor.NET-style tile kits (kitserializer_v0_1), Area Designer JSON v0.1 persistence on IndoorMap, GL tile kit scene preview and cache invalidation, Holocron Toolset indoor builder / Module Designer layout workflows (including parity fixes for navigation, status callback, Blender room sync, and related UI), documentation and patch notes for the GL preview workflow, unit tests for tilekit v2 and GL helpers, and CI adjustments (e.g. Defender for DevOps / Bandit path handling).

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • ✅ Test addition or update
  • 🔨 Build system or CI changes
  • 🎨 Code style changes (formatting, renaming, etc.)

Package(s) Affected

  • PyKotor (core library)
  • One or more tools under Tools/
  • Documentation
  • CI/CD
  • Other: ___________

Changes Made

  • Tile kit v2 parsing and unified loader paths; tile map compile into indoor map pipeline where applicable.
  • area_designer_v01 on indoor maps; JSON helpers for format 0.1 load/save.
  • GL preview: tile kit scene helper, render cache invalidation; Holocron submodule/docs patches for 3D preview workflow.
  • Toolset / Module Designer: Layout mode aligned with Indoor Map Builder behaviors (status callback, scroll/zoom/camera settings, Blender position sync for dragged rooms, teardown, menus, Area Designer file actions, etc.).
  • Tests expanded for tilekit v2 fixtures and GL/camera edge cases.
  • CI: workflow updates (e.g. Defender for DevOps, Bandit long paths on Windows).

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this manually
  • I have tested on multiple Python versions (3.8+)
  • I have tested on multiple operating systems (if applicable)

Test Results

Run project test suite per CONTRIBUTING.md / AGENTS.md (e.g. uv run pytest with applicable ignores for GUI/slow tests).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Related Issues

Fixes #
Closes #
Related to #

Screenshots (if applicable)

N/A (tooling and pipeline changes; optional screenshots of Holocron GL preview / Module Designer Layout mode if helpful for reviewers).

Additional Notes

  • Draft PR: Work may continue on cursor/indoor-builder-tilekit-v2 before marking ready for review.
  • Submodule / patch docs under docs/patches describe Holocron preview integration for reviewers.

@github-actions github-actions Bot added docs python Pull requests that update python code libraries labels Apr 28, 2026
Comment thread Libraries/PyKotor/src/pykotor/tools/tilekit_io.py Fixed
Comment thread Libraries/PyKotor/src/pykotor/tools/tilekit_io.py Fixed
@github-actions github-actions Bot added the size/XL Extra large PR (500-1000 lines) label Apr 28, 2026
@th3w1zard1 th3w1zard1 marked this pull request as ready for review April 28, 2026 01:30
Comment thread Libraries/PyKotor/tests/test_tilekit_v2.py Fixed
Comment thread Libraries/PyKotor/tests/test_tilekit_v2.py Fixed
Comment thread Libraries/PyKotor/src/pykotor/tools/tilemap_compile.py Fixed
@github-actions
Copy link
Copy Markdown
Contributor

📦 This PR is large (>500 lines changed).

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ece15b8bd1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

size_y=cell,
z=0.0,
)
parts.append((b, wx, wy, z + tpl.offset.z))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply template X/Y offset for generated floor walkmesh

When a floor template has no WOK, the fallback quad is translated with wx/wy only, while tpl.offset.x and tpl.offset.y are ignored. v2 kits explicitly support per-template offsets and this path is the one used for MDL-only templates, so compiled walkmesh can be visibly/collision-wise displaced from the tile geometry whenever offsets are non-zero.

Useful? React with 👍 / 👎.

Comment on lines +70 to +73
b = deepcopy(tpl.wok)
parts.append(
(b, wx + tpl.offset.x, wy + tpl.offset.y, z + tpl.offset.z),
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply template rotation when merging tile walkmeshes

The compiler loads TileTemplate.rotation but never applies it while building the merged BWM; this branch only deep-copies each template WOK and translates it. Any template authored with non-identity rotation will therefore generate a misoriented walkmesh (and the same issue exists for generated quads), causing navigation/door alignment mismatches against rendered tile orientation.

Useful? React with 👍 / 👎.

Comment thread Libraries/PyKotor/tests/test_tilekit_v2.py Fixed
@github-actions github-actions Bot added the tools label Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 This PR is large (>500 lines changed).

@cursor cursor Bot force-pushed the cursor/indoor-builder-tilekit-v2 branch from 8c078e2 to c095935 Compare April 28, 2026 01:49
@github-actions
Copy link
Copy Markdown
Contributor

📦 This PR is large (>500 lines changed).

@github-actions github-actions Bot added tools and removed tools labels Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 This PR is large (>500 lines changed).

…ool discovery in ci

Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
@cursor cursor Bot force-pushed the cursor/indoor-builder-tilekit-v2 branch from 8c078e2 to 783df4b Compare April 28, 2026 02:05
@github-actions github-actions Bot added the size/XXL XXL PR (> 1000 lines) label Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

@github-actions github-actions Bot added ci and removed tools labels Apr 28, 2026
Comment thread tool_metadata.py
except ImportError:
tomllib = None # type: ignore[assignment, misc]

LIBRARY_SOURCE_PATHS: list[str] = [
Comment thread tool_metadata.py Fixed
th3w1zard1 and others added 3 commits April 27, 2026 21:44
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

var floorTemplate = Kit.Manager.Get(floorData.kitID.Value).Floor(floorData.templateID.Value);
tile.Floor.SwitchTemplate(floorTemplate);

// TODO
// todo ienumerable extension
private List<(T Item1, T Item2)> GetCombinations<T>(IEnumerable<T> listA, IEnumerable<T> listB)
{
// TODO convert to list extensions method?
{
descriptors.AddRange(DescriptorsForModel(assets, @object.Template.Model, @object.LocalTransform));
}
// TODO - clean this up somehow
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

@github-actions github-actions Bot added the tools label May 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

…olset; use OpenKotOR HolocronToolset URL in .gitmodules
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

⚠️ This PR is very large (>1000 lines changed). Consider breaking it into smaller PRs if possible.

@th3w1zard1 th3w1zard1 marked this pull request as ready for review May 3, 2026 16:16
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@th3w1zard1
Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

…olve conflicts)

Co-authored-by: th3w1zard1 <2219836+th3w1zard1@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 75c3a81. Key resolutions:

  • indoormap.py: kept area_designer_v01 from our branch, adopted master's defensive isinstance(tl, dict) check for tile_layout
  • indoorkit.py: kept HEAD's _load_kits_internal 3-tuple API, added kits_for_indoor_build helper from master
  • New files (tilekit.py, tile_bwm.py, tilekit_io.py, tilemap_compile.py, tests, docs): kept our more complete versions
  • vendor/KotOR.js: accepted master's deletion

@th3w1zard1
Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

…olve conflicts round 2)

Co-authored-by: th3w1zard1 <2219836+th3w1zard1@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 245d0c3. Master had 24 new commits since our last merge, including the new AreaLayout module (cfab8ab) that refactored several conflicted files. Took master's versions since they represent improvements built on top of our initial work:

  • indoormap.py: area_designer_v01area_layout
  • tilekit.py: added from_xyzw_json, to_xyzw_json, __mul__, rotate_vector, DoorFrameHookTemplate, WallHookTemplate, TileCellTemplate
  • tilekit_io.py, tilemap_compile.py: updated for new AreaLayout system
  • test_tilekit_v2.py: master's richer test suite
  • Binary .pyd GL accelerator files updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci dependencies Pull requests that update a dependency file docs libraries package: pykotor Related to PyKotor core python Pull requests that update python code size/XL Extra large PR (500-1000 lines) size/XXL XXL PR (> 1000 lines) tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants