Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OG bug: Obelisk keys are positioned slightly too low #2006

Closed
aredfan opened this issue Dec 11, 2024 · 6 comments · Fixed by #2008
Closed

OG bug: Obelisk keys are positioned slightly too low #2006

aredfan opened this issue Dec 11, 2024 · 6 comments · Fixed by #2008
Assignees
Labels
OG bug A bug in original game TR1

Comments

@aredfan
Copy link
Collaborator

aredfan commented Dec 11, 2024

Copied over from 2004:

There's a new issue with the Obelisk keys being partially buried in the drawbridges.

Edit: The sprites are also partially buried in the DOS version - which doesn't suffer from the clipping issue. It's an OG bug.

Sprite pickups

Dev snapshot
1 1 Dev
PR build
1 2 PR

3D pickups

Dev snapshot
2 1 PR
PR build
2 2 PR

@rr-
Copy link
Collaborator

rr- commented Dec 11, 2024

Also when tackling this, let's remember to fix the origin point for the drawbridge object (items 19,20,21, and 22).

@lahm86 While playing with the injector, I put together a utility function that you might find handy:

diff --git a/src/Types/ItemBuilder.cs b/src/Types/ItemBuilder.cs
index 300bea0..c80a9b3 100644
--- a/src/Types/ItemBuilder.cs
+++ b/src/Types/ItemBuilder.cs
@@ -34,4 +34,30 @@ public abstract class ItemBuilder : InjectionBuilder
             },
         };
     }
+
+    protected static TRItemEdit NudgePosition<T>(TREntity<T> item, short itemIndex, short x = 0, short y = 0, short z = 0) where T : Enum
+    {
+        return new()
+        {
+            Index = itemIndex,
+            Item = new()
+            {
+                Angle = item.Angle,
+                X = item.X + x,
+                Y = item.Y + y,
+                Z = item.Z + z,
+                Room = item.Room,
+            },
+        };
+    }
+
+    public static TRItemEdit NudgePosition(TR1Level level, short itemIndex, short x = 0, short y = 0, short z = 0)
+    {
+        return NudgePosition<TR1Type>(level.Entities[itemIndex], itemIndex, x, y, z);
+    }
+
+    public static TRItemEdit NudgePosition(TR2Level level, short itemIndex, short x = 0, short y = 0, short z = 0)
+    {
+        return NudgePosition<TR2Type>(level.Entities[itemIndex], itemIndex, x, y, z);
+    }
 }

@rr- rr- moved this to Ready in TRX Dev tracker Dec 11, 2024
@aredfan
Copy link
Collaborator Author

aredfan commented Dec 12, 2024

A new issue I noticed - the senet table which previously had some clipping with the floor, now has z-fighting instead.

PR build:
20241212_073046_Obelisk_of_Khamoon

Dev snapshot:
20241212_072945_Obelisk_of_Khamoon

@rr-
Copy link
Collaborator

rr- commented Dec 12, 2024

Yeah that one will also need to be raised a bit.

@lahm86
Copy link
Collaborator

lahm86 commented Dec 12, 2024

There is also a floating chair in this room. May as well include it while shifting the senet table.

image

@lahm86 lahm86 self-assigned this Dec 12, 2024
@lahm86 lahm86 moved this from Ready to In progress in TRX Dev tracker Dec 12, 2024
lahm86 added a commit to lahm86/TRX that referenced this issue Dec 12, 2024
This fixes the angle of the drawbridge when open so that Lara's shadow
isn't occluded and the artefacts aren't embedded. It also lifts the
senet table and lowers the toppled chair in room 57.

Resolves LostArtefacts#2006.
@aredfan
Copy link
Collaborator Author

aredfan commented Dec 12, 2024

@lahm86 The same chair type is also present in Return to Egypt (static 151) and Temple of the Cat (static 72).

@lahm86
Copy link
Collaborator

lahm86 commented Dec 12, 2024

Oh thanks, I always forget UB.

lahm86 added a commit to lahm86/TRX that referenced this issue Dec 12, 2024
This fixes the angle of the drawbridge in Obelisk of Khamoon when open
so that Lara's shadow isn't occluded and the artefacts aren't
embedded. It also lifts the senet table and lowers the toppled chair in
room 57. The toppled chair is also fixed in Return to Egypt and Temple
of the Cat.

Resolves LostArtefacts#2006.
lahm86 added a commit that referenced this issue Dec 12, 2024
This fixes the angle of the drawbridge in Obelisk of Khamoon when open
so that Lara's shadow isn't occluded and the artefacts aren't
embedded. It also lifts the senet table and lowers the toppled chair in
room 57. The toppled chair is also fixed in Return to Egypt and Temple
of the Cat.

Resolves #2006.
@github-project-automation github-project-automation bot moved this from In progress to Done in TRX Dev tracker Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OG bug A bug in original game TR1
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants