feat(gta-streaming-five): Increase fwPortalSceneGraphNode pool #3121
+35
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thatpoolStorageSize
andpoolFlagsSize
add together. Then I read thepoolStorageSize
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 thepoolStorageFlagsSize
is calculated, which is adding the current size of thefwPortalSceneGraphNode
class multiplied by the amount of addition, then we do the same but withpoolStorageSize
.Once we have the new
poolStorageFlagsSize
,poolStorageSize
we put those values in theAssignStorageMemory
function. Finally we look for theportalPoolCount
which is the default pool count (400), we addpoolAddition
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
Fixes issues