Skip to content

feat(core/rdr3): block level loading #3376

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ehbw
Copy link
Contributor

@Ehbw Ehbw commented Apr 30, 2025

Goal of this PR

Block Level/Game loading once INIT_CORE has been fully loaded. This matches the behaviour on FiveM while also enabling functionality for replace_level_meta in RedM.

How is this PR achieving the goal

By preventing game loading post INIT_CORE until g_callBeforeLoad (set in RageGameInit::LoadGameFirstLaunch returns true on server connection or sp load)

This PR applies to the following area(s)

RedM

Successfully tested on

Game builds: 1436, 1491

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

https://forum.cfx.re/t/replace-level-meta/4797157

@github-actions github-actions bot added RedM Issues/PRs related to RedM invalid Requires changes before it's considered valid and can be (re)triaged labels Apr 30, 2025
@Ehbw Ehbw force-pushed the feat/rdr3-block-level-loading branch from ca9cbfc to 1e76291 Compare April 30, 2025 18:52
Currently, RedM will run through the entire gameSkeleton::RunInitFunctions (up to INIT_SESSION). This leads to several subsystems in RDR3 (such as CTrain, CNetwork, etc) being initalized before a user connects to a server. This leads to servers not being able to override these components. Rendering rdr3.meta changes pointless. The early initialization of CNetwork also leads to some minor issues with OneSync mainly effecting the future object length extension

This patch matches FiveM's behaviour by preventing the game from loading past INIT_CORE until a connection is successfully made to a server where loading resumes. This changeset also introduces support for servers to properly override the games RDR3.meta while cleaning up citizen-level-loader-rdr3 to share the same code as five's implementation
@Ehbw Ehbw force-pushed the feat/rdr3-block-level-loading branch from 1e76291 to 9ac1863 Compare April 30, 2025 19:14
@github-actions github-actions bot added triage Needs a preliminary assessment to determine the urgency and required action invalid Requires changes before it's considered valid and can be (re)triaged and removed invalid Requires changes before it's considered valid and can be (re)triaged triage Needs a preliminary assessment to determine the urgency and required action labels Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant