LostArtefacts / TRX

Open source re-implementation of Tomb Raider I and Tomb Raider II, along with additional enhancements and bugfixes
https://lostartefacts.dev/
GNU General Public License v3.0
588 stars 38 forks source link

Underwater currents sometimes stop working #127

Closed Richard-L closed 2 years ago

Richard-L commented 3 years ago

When you start the level and fall into the stream, it sucks you down the waterfall as is expected. After you've picked up the three cogs in the level and make your way back to put them in, this happened:

TombATI:

https://user-images.githubusercontent.com/4934209/137548483-d09b6e1b-6e82-4d6e-8d83-ac0a3a5f127d.mp4

TR1Main:

https://user-images.githubusercontent.com/4934209/137548586-585ea41d-9256-4480-9f4c-4352a2d18885.mp4

Tested the full scenario of selecting the cogs in both games and then falling into the stream. If the cogs are actually related or not I don't know of course. In TR1Main, if you save whilst you're swimming in the non-working stream, and load, it'll suddenly suck you down again, as if it was reset.

rr- commented 3 years ago

Points of interest:

walkawayy commented 2 years ago

Left is bad save with broken current, right is good save with working current. Only difference seems to be the tail value getting set in the good save (line 13). Head is loaded from the save, but it gets to 255 quickly in both saves, so that doesn't seem to matter.

image

Is there any harm in just clearing the LOT values if Lara is out of water? The only time they are used for Lara is for the current. I think that would fix this issue. Though I still don't fully understand how they were badly saved.

rr- commented 2 years ago

Could someone please attach the bad save in question?

walkawayy commented 2 years ago

Here. The thing is, we don't know if @Richard-L did any weird fly cheat stuff to mess up the save and no one else could reproduce the problem.

@asasas9500 aka ChocolateFan was going to take a look at it now that they can build T1M. But idk if they started debugging yet.

broken-current-save.zip

rr- commented 2 years ago

Has anyone in the world been able to reproduce this? If not I'd suggest closing this and reopen when there are more reports.

Richard-L commented 2 years ago

I would agree. Let's close this.

Rapora9 commented 2 years ago

Can I comment on an issue that is closed? Sorry I remembered this only when I saw the notification that it's closed.

I just wanted to say that sometimes, after using the fly cheat, currents stop working for me. This does not happen every time. Should I try to investigate more?

rr- commented 2 years ago

Should I try to investigate more?

Yes please. When/if we have steps to reproduce, we can debug, but other than that it's just chasing wind…

Rapora9 commented 2 years ago

I managed to break the current both in Lost Valley and my custom level. They seem to work in a slightly different logic though so next I will try to find out how to make this consistent.

And now the current in the beginning of Natla's Mines is also broken and I have no idea why this happens.

Rapora9 commented 2 years ago

Using fly cheat is not necessary to produce this bug so it's more "severe" since it could happen even with a normal, non-cheating gameplay. Here is a clip where I've played with cheats disabled from the start of a new game to Lost Valley. The current breaks as easily as jumping into the water and saving & loading at the moment of impact.

This is not 100% consistent. The square I jump to may be relevant, and the timing as well. But it still works quite often.

https://user-images.githubusercontent.com/97730054/153275813-e1f1562d-cfcd-458f-a700-b5733138f535.mp4

EDIT UPDATE: this exactly same method breaks the current in Tombati too, so it's not really a t1m bug imo.

Richard-L commented 2 years ago

Interesting. After seeing this, what I do notice from my initial videos is that the state loaded has Lara positioned over water (too), as I saved in the moment she started climbing up. So perhaps loading from a state where Lara is on a tile with water on it has to do with it?

Rapora9 commented 2 years ago

More cases of making the current not work (bad video quality because data limits) =

The Lost Valley

https://user-images.githubusercontent.com/97730054/153300524-d748a731-fc1d-428f-9ee8-7b454a0ea367.mp4

https://user-images.githubusercontent.com/97730054/153512781-ce0bf3c5-bb71-4aa8-befa-702d0acec451.mp4

Natla's Mines

https://user-images.githubusercontent.com/97730054/153300545-e21c64b8-46e0-4c5d-a7d9-ce8b327fdb11.mp4

So in both of these videos I'm basically constantly saving and loading until the current stops working.

Rapora9 commented 2 years ago

LEVEL1.zip

I made a little test level to present another case of the broken current. There are current triggers on the tiles where it says "current", and they lead to their respective "sink" tiles.

Näyttökuva (280)

I was trying to replicate 1:1 an issue I have in my own custom level but it didn't work the same way here.

How it works in this test level

How it works in my level

In either case, it's another current that stops working, not the one Lara is on at the moment. This made me think that the issue is somehow related to having multiple currents. And indeed there are at least 2 currents in both Lost Valley (the river, and the lake below) and Natla's Mines (they're one after another at the start).

A video of this test level:

https://user-images.githubusercontent.com/97730054/153307883-d4a08878-f4d4-4287-8fc6-bb5945ff8ff5.mp4

Rapora9 commented 2 years ago

Is it okay if I write this many comments...?

I mentioned this earlier but going to put it here with my own video too. In Sanctuary of the Scion, if you save&load right after using the underwater switch that is under a big statue, the current stops working:

https://user-images.githubusercontent.com/97730054/153506799-efbdb827-e5e7-409d-a5b1-86c4ce26fd8b.mp4

Despite my best efforts, I have not been able to stop the current(s) from working in St. Francis Folly, Colosseum, Palace Midas and Tomb of Tihocan.

Should this issue be renamed since it's not only the Lost Valley current that is not working, and it's also not limited to t1m since it happens in tombati too?

Rapora9 commented 2 years ago

level1&2.zip Here is 2 test levels: LEVEL1 and LEVEL2. The geometry of the levels is following:

Näyttökuva (310)

There are only 2 rooms: upper room and water room (which has a wall sector in the middle). In the water room, there are 2 sinks and 2 rows of triggers to create the current. In LEVEL1 the sinks are mixed so that they are located behind the wall when compared to their triggers. A picture for clarity:

Näyttökuva (310)

In LEVEL2 they are placed normally (sinks are next to their respective triggers).

Test results

Now, pathfinding in Tomb Editor is not 1:1 to Tomb Raider 1. For example gorillas sadly cannot climb. So these results should be taken with a grain of salt. Still this might help to figure out why the current would stop working.

walkawayy commented 2 years ago

Potentially fixed in this build. Trying to clear Lara's LOT values when the current goes inactive.

T1M Current Fix v1.zip