fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(streaming/rdr3): change entity level cap to `PRI_OPTIONAL_LOW`

Open Ktos93 opened this issue 9 months ago • 12 comments

Goal of this PR

Adjust entity streaming behavior by setting the level cap to PRI_OPTIONAL_LOW

How is this PR achieving the goal

  • Replaces hardcoded level cap values with PRI_OPTIONAL_LOW (value 3) in the entity streaming logic.
  • Disables code responsible for recalculating the level cap at runtime to prevent overrides.

This PR applies to the following area(s)

RedM

Successfully tested on

Game builds: 1491

Platforms: Windows

Checklist

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

Fixes issues

Ktos93 avatar Apr 08 '25 11:04 Ktos93

this was previously closed by the contributor and we decided to bring it back (for reference) credits to @0x-FADED original https://github.com/citizenfx/fivem/pull/1782

outsider31000 avatar Apr 08 '25 13:04 outsider31000

It's for sure interesting contribution, but from my experience I can say that it possibly will affect low-end PC users. It will be not so noticable but 5-10% FPS drop can appear. Are you sure that we need that?

prikolium-cfx avatar Apr 09 '25 15:04 prikolium-cfx

If FiveM has this feature so should RedM, I dont see how one can have and the other not. but thats just my opinion.

outsider31000 avatar Apr 09 '25 15:04 outsider31000

I did also suggested a convar but if is really neccessary it can be done, but that means users with good pcs can't have it because of those with bad

outsider31000 avatar Apr 09 '25 15:04 outsider31000

It's for sure interesting contribution, but from my experience I can say that it possibly will affect low-end PC users. It will be not so noticable but 5-10% FPS drop can appear. Are you sure that we need that?

This is already something in FiveM (see here), I don't see a real reason not to apply the same thing to RedM.

I'd also like to know where the 5-10% number comes from. But either way there's probably more important things to be optimized on the RedM side (like its single threaded entity update logic) that would more than make up for this.

AvarianKnight avatar Apr 09 '25 15:04 AvarianKnight

Yeah get it in give it a convar to enable it or just better a method script developer can give their players a command as example to deactivate it when the fps for the concurrent user is to low. So the players which has the specs can fully immersive red dead how it is.

DaNeo61 avatar Apr 24 '25 01:04 DaNeo61

Yeah get it in give it a convar to enable it or just better a method script developer can give their players a command as example to deactivate it when the fps for the concurrent user is to low. So the players which has the specs can fully immersive red dead how it is.

It should be consistent between all users, so the only way is to use server side convar.

prikolium-cfx avatar Apr 24 '25 08:04 prikolium-cfx

It's for sure interesting contribution, but from my experience I can say that it possibly will affect low-end PC users. It will be not so noticable but 5-10% FPS drop can appear. Are you sure that we need that?

This is already something in FiveM (see here), I don't see a real reason not to apply the same thing to RedM.

I'd also like to know where the 5-10% number comes from. But either way there's probably more important things to be optimized on the RedM side (like its single threaded entity update logic) that would more than make up for this.

If it's already implemented in this way in FiveM doesn't mean that it's best way to do it. Math of FPS is pretty simple: More props = more drawcalls, more drawcalls = higher frame time, higher frame time = lower FPS.

prikolium-cfx avatar Apr 24 '25 08:04 prikolium-cfx

Yeah get it in give it a convar to enable it or just better a method script developer can give their players a command as example to deactivate it when the fps for the concurrent user is to low. So the players which has the specs can fully immersive red dead how it is.

It should be consistent between all users, so the only way is to use server side convar.

Yeah that's right and would be fully okay if the server owner says I want that feature they can activate it, if not then not.

//Edit to have the possibility would be fine enough

DaNeo61 avatar Apr 24 '25 10:04 DaNeo61

Yeah get it in give it a convar to enable it or just better a method script developer can give their players a command as example to deactivate it when the fps for the concurrent user is to low. So the players which has the specs can fully immersive red dead how it is.

It should be consistent between all users, so the only way is to use server side convar.

is that the path for it to be merged using a convar? we can work on that if yes.

outsider31000 avatar Apr 24 '25 13:04 outsider31000

Yeah get it in give it a convar to enable it or just better a method script developer can give their players a command as example to deactivate it when the fps for the concurrent user is to low. So the players which has the specs can fully immersive red dead how it is.

It should be consistent between all users, so the only way is to use server side convar.

is that the path for it to be merged using a convar? we can work on that if yes.

Yeah, if you make it convar controlled we will accept it. You can even make it enabled by default, but people should have possibility to return previous behavior.

prikolium-cfx avatar Apr 24 '25 13:04 prikolium-cfx

@Ktos93 whenever you can , that convar to be added so this can be merged please.

outsider31000 avatar May 17 '25 02:05 outsider31000