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

Game flow rework (pt 10) #2410

Merged
merged 17 commits into from
Jan 29, 2025
Merged

Game flow rework (pt 10) #2410

merged 17 commits into from
Jan 29, 2025

Conversation

rr-
Copy link
Collaborator

@rr- rr- commented Jan 29, 2025

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

  • Fixes TR2X bug: the title and exit commands during credits have stopped working #2404
  • Shortens GAME_FLOW_ type prefix to GF_
  • Splits GF_SEQUENCE_CONTEXT from GAME_FLOW_LEVEL_TYPE
  • Streamlines accesses to the game flow levels by introducing better accessors in TRX
  • Removes g_CurrentLevel in favor of Game_GetCurrentLevel (last played game level) and GF_GetCurrentLevel (any level, including cutscens and demos)
  • Introduces level tables to reduce duplication in the reader and similar places
  • Merges GF_StorySoFar to GF_InterpretSequence in TR1
  • Merges almost everything, short of the sequence handlers and some very game-specific bits, via TRX

reader.c is a bit #if-ridden. I hope that we soon reach feature parity in both games in this field, so that this split can go away.

We still have the big difference in how we apply save game and resume info, eg. there's still the load_level event type in TR1 and the Level_Initialise(…, GF_SEQUENCE_CONTEXT seq_ctx) extra argument in TR2. This is something I'm leaving for the next PR as streamlining this is by far the trickiest part.

@rr- rr- added Internal The invisible stuff TR2 TR1 labels Jan 29, 2025
@rr- rr- self-assigned this Jan 29, 2025
@rr- rr- requested review from a team as code owners January 29, 2025 11:05
@rr- rr- requested review from lahm86, walkawayy and aredfan and removed request for a team January 29, 2025 11:05
@rr-
Copy link
Collaborator Author

rr- commented Jan 29, 2025

Found a crash related to guns and resume info. Will address shortly

Edit: this is also visible in 4.7:

  1. /load 1
  2. /play 8
  3. Repeat

@aredfan
Copy link
Collaborator

aredfan commented Jan 29, 2025

Just one issue to report for TR1X - the fade-ins and fade-outs are now faster during credits.

@rr-
Copy link
Collaborator Author

rr- commented Jan 29, 2025

Just one issue to report for TR1X - the fade-ins and fade-outs are now faster during credits.

Fixed. Also fixed the Dragon's Lair FMV issue Lahm reported on Discord.

Potential areas where to look for breakage:

  • normal gameplay succession: fmvs, cutscenes, levels, stats, global stats
  • select level feature
  • restart level feature
  • bonus levels
  • passport interactions
  • enemy item drops
  • saving and loading (extensive – with focus on items carry over)
  • saving and loading in gym via /save
  • /play name, /play id (separately)
  • /demo id
  • /title
  • /load, /save as well as passport (different routes)
  • story so far (fmvs from the start of the saved level should play, fmvs coming after the saved level shouldn't play yet)

@aredfan
Copy link
Collaborator

aredfan commented Jan 29, 2025

Fixed. Also fixed the Dragon's Lair FMV issue Lahm reported on Discord.

Thank you. 👍

Just a quick mention that the TRUB credits fade-ins/outs are fast as well.

@rr-
Copy link
Collaborator Author

rr- commented Jan 29, 2025

@aredfan fixed. Also, fixed #2412 hopefully, though existing saves will not work (as in they won't show the death counter at all, as the information was not valid to begin with).

@rr- rr- linked an issue Jan 29, 2025 that may be closed by this pull request
@aredfan
Copy link
Collaborator

aredfan commented Jan 29, 2025

@aredfan fixed. Also, fixed #2412 hopefully, though existing saves will not work (as in they won't show the death counter at all, as the information was not valid to begin with).

Thank you again. I can confirm the death counter is now fixed when following the steps laid out in your issue.

I also came across 2 new issues:

  • new_game_plus_unlock doesn't change from false to true post-credits.
  1. /set new 0
  2. /play 15
  3. use the level skip cheat and go through the credits.
  • Accessing Select Level via Load Game on the main menu crashes the game.

@rr-
Copy link
Collaborator Author

rr- commented Jan 29, 2025

Thanks @aredfan addressed both issues.

@aredfan aredfan linked an issue Jan 29, 2025 that may be closed by this pull request
@rr- rr- merged commit 69f73ed into develop Jan 29, 2025
9 checks passed
@rr- rr- deleted the tr2-game-flow branch January 29, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal The invisible stuff TR1 TR2
Projects
Status: Done
3 participants