-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(extra-natives/five): Add SET_INTERIOR_PROBE_LENGTH
for FiveM
#2371
feat(extra-natives/five): Add SET_INTERIOR_PROBE_LENGTH
for FiveM
#2371
Conversation
Great work! |
50788c2
to
ff84a3f
Compare
I assume the expectation is the script command will be invoked from an existing spatial check/trigger script on a server, correct? The checks in |
Set it once and forget or have individual spatial checks, I guess that's entirely up to whoever implements it. I've tested noclip:ing around with it set to 150f without any issues, but not with full test coverage, of course. I think most people would survive with 16f as length. And yeah, it's unreasonably expensive to implement this on a per interior basis.. due to the nastiness of the internals of this function. |
Really looking forward to this extra native as it will greatly help my team in being able to create the visuals they want in their MLO interiors when using dynamic props. Is there a chance this is in an update coming up? |
Looking at This conceptually seems different to the "we are in X, increase Another question would be on the naming here, e.g., |
Completely indifferent to that too. Happy to accept suggestions.
I think you're talking about the case that is guarded behind That bit seems to be only ever set from one specific system:
If you want to look at that its at The default value for these "interior entity registration" probes is 1.0. I assume this is a mission script fix. Probably a floating or ceiling mounted object somewhere. PS: There is something else to consider. Currently this version of the PR is patching one call to the probing function inside a function that is only ever invoked from the function you referred to as
I do think a few of those listed points are worth considering, but I would welcome some thought on that |
I trust Disquse's judgment on this.
This is part of the confusion. From my own testing this path seemed to be hitting quite a few ped and vehicle entities with registered Consequently, one concern is whether this override (esp. large values) for this specific case will cause any weird interactions with any interior-related bits in netcode. This would include our own Hard to be definitive here since so much of this (dis)assembly is nasty and gross. I do not think this should be prohibitive of throwing this on canary and seeing if users notice any unusual artifacts. Although, some clarity here would be nice.
Overriding this specific value seems like an instant value add.
Keeping this value default would probably be best 😅. The others I have no strong opinion on (e.g., modifying native behaviour vs. providing two new ones which offer custom probe lengths.) |
This is awesome! I have been wanting a solution like this for a long time. Thank you, can't wait to try it out. Hope to see it on canary soon. Out of curiosity, did you look into why vehicles do not seem to care about floor distance in the same way peds do? |
ff84a3f
to
226cf72
Compare
Finally had some time to work on this. Added:
Tested on all builds, debug and release
The game has quite a few conditions in which it either forces or prevents a re-scan of the interior. |
Would it be possible to split the Other comments:
|
3835425
to
aab84c4
Compare
CPortalTracker probeLength adjustments via custom ScRT Native Co-authored-by: nikez <[email protected]> Co-authored-by: okqut <[email protected]>
aab84c4
to
020f7c5
Compare
Rebased branch to 1b01a54 and included a small fix for |
Goal of this PR
Allow servers to customize the probe distance used in
CPortalTracker
.All dynamic entities own an instance of
CPortalTracker
. It is used to detect traversal from and into interiors, through portals and other related actions.By default the probing function inside
CPortalTracker
's tick/update function probes downwards 4.0 units, trying to extract the interior the entity is in from collision data (staticboundsstore).In many cases this will not work, leading to ~30 hard coded special cases based on interior archetype hash. Rockstar extends the probing distance for these interiors, most notably in
xs_arena_interior
to 150.0f.How is this PR achieving the goal
By adding a new FiveM native
SET_INTERIOR_PROBE_LENGTH
to give servers individual control of game behaviour depending on their needs.0.0f - 150.0f
Test code:
Examples of use cases:
Demo:
https://streamable.com/jxm0ux
This PR applies to the following area(s)
FiveM
Successfully tested on
Game builds: All available FiveM builds
Configurations: Debug / Release
Platforms: Windows
Checklist
Fixes issues
Base game behavior