Skip to content

Flatten diagonal wall QA/WS floordata collision to the exposed triangle#1208

Open
Copilot wants to merge 4 commits into
developfrom
copilot/fix-diagonal-wall-slide-issue
Open

Flatten diagonal wall QA/WS floordata collision to the exposed triangle#1208
Copilot wants to merge 4 commits into
developfrom
copilot/fix-diagonal-wall-slide-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

Tilting the QA side of a diagonal wall could leak its slope into the nominally flat lower triangle, producing invalid wall collision and letting Lara slide into void space. The same compiler path also affected the WS side, so both floor and ceiling diagonal-wall collision needed to preserve the flat exposed half.

  • Compiler collision shape

    • Adjust LevelCompilerTombEngine.RoomSectorShape for diagonal wall sectors so QA/WS collision is flattened to the visible flat triangle.
    • Adjust LevelCompilerClassicTR.RoomSectorShape the same way so the legacy/classic floordata compiler no longer carries the hidden sloped half into collision.
    • Zero out the diagonal step for wall collision after flattening, preventing the hidden sloped half from influencing TEN and classic floordata collision.
    • Leave non-wall diagonal sectors unchanged.
  • Documented engine/editor mismatch

    • Added in-code notes describing the current tilting hack: editor geometry can still carry tilt on the hidden half, but wall collision currently exposes only the flat triangle until extra probes exist to represent both halves.
  • Regression coverage

    • Added focused tests for all four diagonal split orientations.
    • Covered both floor and ceiling wall collision paths for the TEN and classic compiler implementations.
    • Kept a control case to ensure regular diagonal split sectors keep their original behavior.
if (wall && surface.DiagonalSplit != DiagonalSplit.None)
{
    FlattenDiagonalWallPart(surface.DiagonalSplit, ref heightXnZn, ref heightXnZp, ref heightXpZn, ref heightXpZp);
    diagonalStep = 0;
}

Copilot AI and others added 2 commits April 20, 2026 07:53
Copilot AI changed the title [WIP] Fix diagonal walls to prevent Lara from sliding into void Flatten diagonal wall QA/WS floordata collision to the exposed triangle Apr 20, 2026
Copilot AI requested a review from Nickelony April 20, 2026 07:56
@Nickelony
Copy link
Copy Markdown
Collaborator

@copilot What about the classic, legacy compiler? You seem to have only fixed the TEN compiler.

Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/42f7e77a-8155-49bf-a37d-1e8232bf44c3

Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 20, 2026

@copilot What about the classic, legacy compiler? You seem to have only fixed the TEN compiler.

Handled in 8bf2b29. The classic/legacy compiler had the same diagonal wall QA/WS collision shape issue, so I applied the same flattening there and extended the regression tests to cover both classic and TEN.

@Nickelony Nickelony added bug Something isn't working as intended. ready for review The Pull Request is finished and ready for review. labels Apr 20, 2026
@Nickelony Nickelony marked this pull request as ready for review April 20, 2026 08:16
@Nickelony Nickelony added this to the Version 2.0 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as intended. ready for review The Pull Request is finished and ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TE: Diagonal walls can sometimes make Lara slide into the void

2 participants