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

feat(gta-streaming-five): Increase fwPortalSceneGraphNode pool #3121

Conversation

DaniGP17
Copy link
Contributor

@DaniGP17 DaniGP17 commented Feb 2, 2025

Goal of this PR

Increase the size of the fwPortalSceneGraphNode pool as suggested in the forum.
Recently it was attempted to add them to the gameconfig(#2695) but as prikolium said they are allocated from another precomputed heap and should be looked for in fwSceneGraph::InitPools.
This was already done by blattersturm here but 2 days later they reverted his change due to Potential cause for 'missing doors after a while'. What they did was hook the PortalSceneGraphPool constructor to multiply the size and allocate the memory elsewhere.

How is this PR achieving the goal

What I'm doing is first hooking the constructor call to check in the F8 if the pool sizes are as expected. I get the sizeof the fwPortalSceneGraphNode class, then I read the poolStorageFlagsSize which is the size of the memory that poolStorageSize and poolFlagsSize add together. Then I read the poolStorageSize individually without the flags. Once I have this information I have created a variable that is the number of new entries that are going to be added to the pool, in this case 50, and the poolStorageFlagsSize is calculated, which is adding the current size of the fwPortalSceneGraphNode class multiplied by the amount of addition, then we do the same but with poolStorageSize.
Once we have the new poolStorageFlagsSize, poolStorageSize we put those values ​​in the AssignStorageMemory function. Finally we look for the portalPoolCount which is the default pool count (400), we add poolAddition to it, and finally we put that value from where we have obtained it.

I think it may be a better option to establish each size of these pools from fivem instead of replacing exactly the one we want to modify, this way we will have more control over all of them and not just one, I don't know what you think.

Waiting For

This is just a test right now and from what I've been able to test it works fine, but I'd like to ask someone where I should put the new pool value, should I get it from gameconfig.xml? Or should I multiply it by some static number?

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: 1604, 2060, 3095, 3258, 3407

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

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Feb 2, 2025
@DaniGP17 DaniGP17 closed this Feb 5, 2025
@DaniGP17 DaniGP17 deleted the feat/increase-fwPortalSceneGraphNode branch February 5, 2025 12:12
@DaniGP17
Copy link
Contributor Author

DaniGP17 commented Feb 5, 2025

I've closed this to create a separate PR that will allow editing most of the SceneGraphNode pools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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