LostArtefacts / TR1X

Open source re-implementation of Tomb Raider 1 (1996), along with additional enhancements and bugfixes
https://lostartefacts.dev/
GNU General Public License v3.0
469 stars 32 forks source link

Add support demo levels (try 2) #1378

Closed carlo-bramini closed 1 month ago

carlo-bramini commented 1 month ago

Checklist

Description

This patch adds support for playing the demo levels of City of Vilcabamba. It supersedes the patch at #722 and additional description can be found there and at #667. It has been splitted in two commits:

Richard-L commented 1 month ago

Been hoping for this for a long time 🙏

Since there are several demos, I wonder which (or all?) are supported?

Many thanks for doing this.

rr- commented 1 month ago

Hey @carlo-bramini, I appreciate your efforts in refreshing the initial pull request. The proposed refactoring looks great, however, there are a few code style deviations we'd need to clear before giving it a go. I understand you've had challenges with the build process, so I don't want to burden you with these. Would you be okay with us making some stylistic adjustments directly in the PR, or, if it turns out we lack the access to push to your fork, creating a sibling PR with the changes?

@Richard-L @lahm86 @walkawayy to make this feature less esoteric, I think we could create a checkbox in the installer to download also the demo files from our server to make the demos accessible to a wider audience. But if there is more than a single demo floating around, this becomes problematic – kind of like with what version of UB to bundle. What are your thoughts on this subject?

Richard-L commented 1 month ago

@rr- thanks for bringing this up. My hope is still that immediate and no-purchase no-nothing accessibility to playing the game (and that isn't confusing UB), will help attract a few more players' interest.

I'm in Paris atm without my main PC, but of the top of my head, for PC, there are these demos:

lahm86 commented 1 month ago

I think if it's a single download then adding it to the installer is a good call. If it becomes more complicated with various alternative downloads, then I'd be inclined to keep the support just for one type.

Would a "launch demo" button also be needed in the config tool, similar to "launch UB", or would that be going too far?

And - this is just another thought - if we were to provide the demo files, could we not just edit them to move the palette into the expected position, therefore reducing the amount of code changes needed in the first place? I appreciate that would affect the playability of independent demo downloads, but thought it would be worth mentioning. It would also mean we could open the files in trview and suchlike.

rr- commented 1 month ago

Good call on editing the files especially since there is finite amount of them IMO. Adding the button to launch the demo might be too much, same with creating a desktop shortcut.

carlo-bramini commented 1 month ago

Hey @carlo-bramini, I appreciate your efforts in refreshing the initial pull request. The proposed refactoring looks great, however, there are a few code style deviations we'd need to clear before giving it a go. I understand you've had challenges with the build process, so I don't want to burden you with these. Would you be okay with us making some stylistic adjustments directly in the PR, or, if it turns out we lack the access to push to your fork, creating a sibling PR with the changes?

Ok, no problem! You can just let me know which code style deviations need to be adjusted and I will squash them into the proper commit.

rr- commented 1 month ago

Oops I meant to comment rather than approving.

walkawayy commented 1 month ago

I'm not sure if I did something wrong but my game crashes like this:

image

I put the demo config in my cfg folder, made a shortcut with -gold, and put in the title and level2 .phd's in my data folder. I used the demo level linked in the issue here: https://www.allgamestaff.it/download-tomb-raider/tr-1/

rr- commented 1 month ago

The gameflow refers to the demo files with data_demo_pc/level2.phd and that's where the files should be put. Otherwise it'll try to load regular Vilcabamba as a demo level and chaos will ensue.

carlo-bramini commented 1 month ago

I'm not sure if I did something wrong but my game crashes like this:

image

I put the demo config in my cfg folder, made a shortcut with -gold, and put in the title and level2 .phd's in my data folder. I used the demo level linked in the issue here: https://www.allgamestaff.it/download-tomb-raider/tr-1/

For running demo files, you must provide -demo_pc instead of -gold. At the moment, it is needed to do it, otherwise the engine cannot distinguish between the different file format, if you are using this patch.

walkawayy commented 1 month ago

I'm not sure if I did something wrong but my game crashes like this: image I put the demo config in my cfg folder, made a shortcut with -gold, and put in the title and level2 .phd's in my data folder. I used the demo level linked in the issue here: https://www.allgamestaff.it/download-tomb-raider/tr-1/

For running demo files, you must provide -demo_pc instead of -gold. At the moment, it is needed to do it, otherwise the engine cannot distinguish between the different file format, if you are using this patch.

Oops I think was using -demo. I'll try again tonight. IMO we could probably drop the _pc part?

rr- commented 1 month ago

Thanks. We'll follow-up with subsequent PRs to try and remove the need for the new gameflow option.

carlo-bramini commented 1 month ago

@rr- thanks for bringing this up. My hope is still that immediate and no-purchase no-nothing accessibility to playing the game (and that isn't confusing UB), will help attract a few more players' interest.

I'm in Paris atm without my main PC, but of the top of my head, for PC, there are these demos:

* Vilcabamba Part 1

* Vilcabamba Part 2

* "Terracide" bundle, where a TR demo or Caves and the full Vilcabamba were included (this is the one I'd probably offer)

I just made an interesting discover: I downloaded the Terracide demo bundle which includes also a different TR demo. Inside, there is:

Unlike the two demo levels that you can download separately, these ones have the sections like the full game. In other words, they don't need to use "level_demo_pc" and "title_demo_pc", you must use "normal" and "title" instead. This is something unexpected.. this patch is required if you want to run the demos each one including a single level, while the demo into the Terracide bundle does not. I made another json file with only the gym, the first levels and the title and I played it: no problems.

My question after I did this last experiment: since this last demo package includes also some videos and things may start to be a bit confusing, how about adding something like prefix_path on top of the json file?

This may allow to organize data files in this way:

\
 TR1_PC_RETAIL
   data
   fmv
 TR1_PC_DEMO1
   data
 TR1_PC_DEMO2
   data
 TR1_PC_DEMO3
   data
   fmv
 TR1_SATURN
   data
 TR1_PS1
   data
.....

If this prefix is not written in the json file or it is empty, it will work exactly like now.