Jump to content

NPCs having choppy movement (MP)


Go to solution Solved by Aldro Koon,

Recommended Posts

Posted

We are troubleshooting this over at {JoF} with our Coding Team but so far we can't make much sense of it.
We believe it's something between servers and clients that are mismatched.
Does anyone have any ideas at all for why Desann here is moving in such a "choppy" way?

It's applies across OpenJK/EternalJK/JA+/JA++/Base, but some combinations don't reproduce it.

https://i.imgur.com/N1ePFSN.mp4

There are combinations of certain server executable/mod/client where the NPC moves perfectly smooth, so this is not normal incase anyone thinks it is.

  • Aldro Koon changed the title to NPCs having choppy movement (MP)
Posted
On 1/25/2025 at 6:22 PM, Aldro Koon said:

UPDATE: @Milamber has found that it's something related to g_smoothClients / cg_smoothClients.
Fingers crossed that we manage to figure it out.

The above results appear to have been inconclusive, what appeared better and made us suspect this is just not being reproduced today.
It is a very strange thing and I honestly don't know if we can figure it out for we have been trying to (on and off) since 2021.

Posted

I came across a similar issue in SP on one of my maps – it included too many func_doors and other entities, so the game would have problem processing the NPC movements. This affected walking and running animations only, but not jumping, talking, etc. And OpenJK was also installed.

  • Solution
Posted
On 1/27/2025 at 4:35 PM, NumberWan said:

I came across a similar issue in SP on one of my maps – it included too many func_doors and other entities, so the game would have problem processing the NPC movements. This affected walking and running animations only, but not jumping, talking, etc. And OpenJK was also installed.

We have solved it.

Turns out it's an issue with SV_FPS being above 20, this should be an issue for everyone who plays with values above that (usually 30 or 40).

Milamber has made a patch and he'll get it to OpenJK as well.

Circa likes this
Posted
9 hours ago, Aldro Koon said:

We have solved it.

Turns out it's an issue with SV_FPS being above 20, this should be an issue for everyone who plays with values above that (usually 30 or 40).

Milamber has made a patch and he'll get it to OpenJK as well.

Hm, makes sense. Mine's always been 40. Is the fix specifically to g_SmoothClients or to sv_fps or both?

Posted
11 hours ago, Circa said:

Hm, makes sense. Mine's always been 40. Is the fix specifically to g_SmoothClients or to sv_fps or both?

Sv_FPS 20 will fix it but if you want 30 or 40, you need Milamber's fix.

SmoothClients won't matter and it currently doesn't either.

Posted
36 minutes ago, Aldro Koon said:

Sv_FPS 20 will fix it but if you want 30 or 40, you need Milamber's fix.

SmoothClients won't matter and it currently doesn't either.

I was just more curious what the actual fix is but perhaps @Milamber could elaborate. Mostly just curious.

Aldro Koon likes this
Posted
On 1/30/2025 at 3:59 PM, Circa said:

I was just more curious what the actual fix is but perhaps @Milamber could elaborate. Mostly just curious.

Something like npc movement/interpolation(?) is being divided by a harcoded value that takes into account sv_fps 20 so when you try 30 or 40, it doesn't take that into account

The fix corrects this and calculates based on what sv_fps you have set

Circa likes this
Posted

So g_smoothClients 1 will make the game code try to extrapolate position of entities after clients have done their prediction. However 2 things seem to be wrong here, 1 it's also hardcoded to a sv_fps of 20, and even on jampded setting g_smoothClients 1 causes laggy updates. So I'm not sure if this code has ever worked as intended.

I'll be pushing a fix to the npc think code to OJK that solves the hardcoded reliance on 20 fps, I'll do this for g_smoothClients 1 extrapolation as well but it doesn't seem to fix it fully. However, this fix when combined with disabling g_smoothclients 0, causes smooth movements for npcs and players  if the client code has unmodified prediction code. So for JoF's EJK client I'll be pushing a new version that resets some of the legacy code we inherited from EJK where attempts were made at improving prediction, setting it back to if not identical to original prediction code, then very close to it.

That being said there's a lot of other things that are hardcoded to be at 20 fps, like how dismembered limbs update, I was not planning on bothering to fix these as of now.

If you got any other questions for me feel free to reach out on discord too 🙂

Circa likes this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...