lostartefacts / tr2x Goto Github PK
View Code? Open in Web Editor NEWDecompilation project for Tomb Raider II (1997), along with additional enhancements and bugfixes
Home Page: https://lostartefacts.dev/
License: GNU General Public License v3.0
Decompilation project for Tomb Raider II (1997), along with additional enhancements and bugfixes
Home Page: https://lostartefacts.dev/
License: GNU General Public License v3.0
In addition to the sky texture changing in Bartoli #43, the overall brightness of the level changes. Apparently this happens even on OG PC TR2 too, as shown in this clip by Troye: https://cdn.discordapp.com/attachments/394838132643725314/709033420965150740/Tomb_Raider_II_2020-05-10_08-15-21_Trim.mp4
Arsunt had found that this happens over a period of 20mins. However, Core apparently messed up the timer:
Core made this feature. But they did not sync it with level timer
They made separate frame counter, which was reset every time when you load game
So if you load game, you need to wait another 20 minutes
It's so stupid
I just check the timer in statistics menu
It always ticks from level start. Not level load
He then fixed the feature in TR2Main:
By the way, I made sky darker with sunset for Bartoli's Hideout. Here is how it looks now. Here is the day (start of the level).
And here is the sunset. 20 minutes passed. In the original game sky keeps brightness unchanged.
Done at hand of the TAB
key in TR1X. Very convenient for block pushing or long ladder climbing in TR2 during testing.
I would toggle double the game speed. Walkaway had added two different speeds to step through at hand of the TAB key. Personally I find this a little unintuitive to use.
I think a darkened background for end-of-level statistics could be similar to how it's done on TR1X, and I gather it's also a PS1 thing. It would be nice to have this feature as a standalone option.
Same as TR1X
https://core-design.com/goodies_tr2_loadingscreens.html
Although not necessary to bridge loading, they are definitely well made and transport some additional context and meaning about the level you're playing.
Again Arsunt had done hi-res upscales himself for TR2Main that looked nice, but I reckon in the 4-5 years since and the improvements in image AI, it's likely worth a shot to do new upscales for TR2X, if it's decided to include them.
Arsunt had made an elegant extension to the glyphset by adding icons of the entire keyboard himself:
If he permits, maybe this could be used in TR2X?
He had also done an upscaled version, although this is beyond the scope of this issue:
He then displayed them like so in the control settings:
^NB he had combined default and user keys into one, hence showing the mappings side by side, with only user keys remappable. In TR2Main/OG you cannot not have the default keys inactive. Any user keys are just additional mappings on top. This is unfortunate and thankfully had been changed in TR1X, where only one mapping at a time is active. So I would suggest to only show the respective mapping.
This would also be useful for potential later visual consistency with gamepad support:
PS1
TR2Main
Another find by Arsunt:
it seems Core made a bug with M16. If you shot while running, it supposed to reduce M16 damage from 3 to 1 and accuracy from 4 degree to 12 degree. But they made a typo, and reduced accuracy and damage of grenade launcher. The cool thing is that grenades are individual objects and their damage is hardcoded, so reduced by M16 accuracy and damage didn't change anything for grenades.
But I think I must fix this bug, so bye-bye good M16 damage while running
Probably something people want optional as they're so used to the (too) good damage the M16 does.
Some more explanation by him (if it's relevant):
M16 is an "Lara with M16" object ID LG _M16 is a weapon type index
Weapon table with damages and accuracies uses weapon type indices So since this ID is equal to grenade launcher index...
The funny thing would be if Grenade Launcher used these values.
But it does not.
The Golden Mask expansion could perhaps be launched with " -gold" at the end of shortcut's target path.
A list of files contained within the DATA
folder from the free downloadable Golden Mask pack. I also took inspiration from Arsunt's list to assist with this issue, from here.
The files in bold are unique GM files, and the rest are already included with TR2.
(x) is used to indicate GM files with a name that is identical to a TR2 file and thus will clash.
Cf TR1X
This was something Arsunt deliberated on for quite a while but eventually made it happen. He presented it like this:
Arsunt:
DirectX 5 has limited texture lighting formula. Every texture cannot be displayed lighter than it is.
But it can be displayed darker than it is. PS1 had full range of texture brightness, so PS1 is more contrast when it comes to dynamic lighting and bright rooms
So I made 3 modes of lighting contrast:
- Low: texture lighting is clamped in 0%-100% range (that's how behaved PC version with hardware renderer).
- Medium: texture lighting is clamped in 0%-150% range (that's most comfort way to play in my opinion, compromise between Low and High).
- High: texture lighting is clamped in 0%-200% range (that's how behaved PC version with software renderer and PS1 version).
This is especially noticeable when you use flare or flashing with guns
In some levels that are naturally dark it can be quite striking - compare the dragon:
PC:
Since like TR1 they are higher quality again for TR2, it'd be lovely to have TR1X's ability to feed the .FMV files.
The ESC button seems to be the only option to trigger the "go back" functionality. In the default keys, ESC is mapped to "inventory". If this is remapped when using user keys, the respective button has no effect however. It will still only listen to ESC to trigger this.
To test you can just open/close the passport.
If the player want to access the external settings window, it can only be done after deleting the TR2 registry folder.
Cf TR1X
Along the lines of what we have in TR1X and PS1.
LMK if I missed any and whether this should remain 1 issue or split up into separate issues.
First half is OG, second half is TR2X.
Currently no demos seems to be available, or they are turned off. It would be lovely to have the option toggle from TR1X to en/-disable them.
Info from Arsunt on this:
Just extracted water colors from TR2 PS1 levels. I'll add them as individual customizable parameters for each PC level.
For Lara's Home (for example) the color on PS1 is the same as PC
But for Venice levels, yes. It is green rather than cyan
My script is parsing whole levels data right now. I'll provide exact colors per each level file soonhttps://www.htmlcsscolor.com/hex/CCFF80
- Venice
- Bartoli's Hideout
- Opera House
https://www.htmlcsscolor.com/hex/CCFF98
- Temple of Xian
https://www.htmlcsscolor.com/hex/CCFFCC
- Floating Islands
- Dragon's Lair
https://www.htmlcsscolor.com/hex/B2E6E6
- The Great Wall
- Tibetan Foothills
https://www.htmlcsscolor.com/hex/80FFFF
- All other PS1 levels
https://www.htmlcsscolor.com/hex/80C0FF
- PC hardware renderer uses this color for all levels
https://www.htmlcsscolor.com/hex/AAAAFF
- PC software renderer mode uses this color for all levels
Colors ordered by tone: from green to blue, and then to lavender
I
in TR1X
Add dozy mode for flying and resurrection. Super useful during testing.
Old:
Always useful for testing.
Basically what we know from TR1x:
- Dozy
- Weapons
- Level skip
- Door open
Additionally the TAB key "turbo mode" is also handy (block pushing, ladder climbing), although I'd make it a toggle instead of a step through two speeds for better intuitiveness.
Just because it's more conventional than the default F12.
I've come across a very specific audio bug. These are the steps to reproduce:
If done correctly, Lara would have stopped speaking and all other music tracks doesn't play. Exit to Title and there's no music on the Main Menu. Quit and reopen the game and the bug itself can be reproduced with the same steps laid out above. The bug itself persisted until after I opened the ingame Sound settings.
Note the "165" in MusicVolume - this is the default value when setting up TR2 for the first time. I'm guessing this is the cause of said bug because the value changed to "10" after I accessed the ingame Sound settings (which also fixed the bug).
If the player is using the TR2 Steam version's cdaudio.dat file (not sure about GOG), there's an error that prevents a music track from playing properly in The Great Wall and Temple of Xian levels.
I found this response on TRF which outlines the problem: The second code for track 33 in cdaudio.dat file is incorrect. It should be "01179345".
This link gives an insight into how PaulD's audio solution works: https://www.tombraiderforums.com/showpost.php?p=3240199&postcount=1
Saves.zip for the two locations affected by this bug.
Super convenient for testing
Currently ESC is the only key that can skip FMVs. Like TR1X, it would be nice if FMV skipping would listen to the action key (and maybe even inventory also?)
Most notably on the pizza slicer and blade traps:
Apparently Arsunt was preparing an article on this, and had shared some musings:
Preparing the article about all of it. Here is a "teaser" for you. It's about how TR reflection UV mapping works. The square central area of the last rendered frame is taken as texture. Only the centred incircle area is used for reflection, everything beyond is never reflected. Let's suppose for now that radius of the circle is 1 and coordinates of its center is (0; 0).
For each vertex of the mesh, a view rotated normal vector is taken (vertex itself coordinate does not matter). Normal vector coordinates in the XY plane will indicate the desired point of the texture. Since the length of the normal vector is always equal to 1, and the Z coordinate is discarded, it is guaranteed to stay inside the circle.
So now the XY coordinates inside this "circle area" are in range -1..1, but for UV we want 0..1. This part is fairly simple:
U = (X+1)/2;
V = (Y+1)/2;Bingo!
https://en.wikipedia.org/wiki/UV_mapping
https://en.wikipedia.org/wiki/Vertex_normal
There are some oddities where I find it unclear if the reflection was intentional or not:
Sometimes when leaving the game, I notice how other open windows (like for instance my browser) are resized to a 4:3 ratio, and have assumed a smaller size than the max dimensions of my display I had before running the game. It's hard to reproduce this, but it's a behaviour I've sometimes seen with older games.
In the vanilla game - there's a limit of five enemies/monks within Lara's FOV (I think this includes dead ones).
This limit can cause vanishing enemies/monks, and Barkhang Monastery level is notorious for this bug if the player decide to rescue every monk. I think it's possible for 13-14 monks (1 on upper floor) to gather in the big hall with the Buddhist statue.
Similar to how it had been added to TR1X.
In OG you have to step through slots and cannot hold up/down.
Currently once the track finishes, it does not start again.
I guess this is partly due to the missing demo modes #7 where upon main menu return it restarts the music.
When #27 is implemented, it'll be worth doing a playthrough of TR2/GM to identify pickups that'll need rotating - in particular plot items like keys, masks, seraph etc. We can use trview waypoints to mark these pickups.
Once the waypoint(s) is created for a particular level, make sure to export the route file using the level's name. Once all levels are done - the next step is to upload all route files on here as a zip file.
Whenever priorities and time allows, it would be great if the input detection for keymapping could be looked at. It seems it's too sensitive and fast in OG.
We'll need the sunglasses option for some graphic settings such as #25.
To reproduce, have Lara do a standing jump in this spot and grab to climb, but don't use legs.
First half is TR2X, second half is OG.
On my setup, there is either a black frame or a windowed border around the game:
After switching to windowed and back to fullscreen by toggling F12.
When starting a New Game (after skipping FMV):
Switching between apps (Alt+tab) makes the windowed border go away but the black frame remains:
My setup if it's relevant:
L
Does not seem to exist in OG PC, but does exist on PS1:
Notice how audio fades down quickly, and is held/resumed during pause/unpause.
Arsunt realised it like this for TR2Main.
Curiously TR1 also had a black fade, which consequently was also added to TR1X for this feature:
I think that's the best way of handling this feature, and would plea to do it like that for TR2X too.
Currently the game will force a 4:3 resolution when in windowed mode, and then proportions will look correct. When toggling to fullscreen, it will stretch to fill the screen. It would be nice if it would support non 4:3 displays dynamically, ie widescreen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.