Skip to content

Some interp stuff#1657

Merged
Rainyan merged 9 commits intoNeotokyoRebuild:masterfrom
bauxiteDYS:interp
Mar 1, 2026
Merged

Some interp stuff#1657
Rainyan merged 9 commits intoNeotokyoRebuild:masterfrom
bauxiteDYS:interp

Conversation

@bauxiteDYS
Copy link
Contributor

@bauxiteDYS bauxiteDYS commented Feb 9, 2026

We can see in the SDK code FIXME_INTERP_RATIO, I believe this is because the cl_interp value is being used instead of cl_interp_ratio if it's larger and I don't really believe that's how it should work, probably ideally want clients to have the lowest interp they asked for between the two.

This doesn't change all that behaviour, it's a very quick fix that just changes the default cl_interp to match a resulting value when default ratio of 2 is used assuming cl_updaterate 66 (clamped by server). Also we don't allow clients to further increase their interp beyond 0.1s, as it's not necessary and causes greater problems in lag comp, not to mention typos and bad configs reducing the quality of the gameplay experience.

Unfortunately defaults for cl_cmdrate and cl_updaterate live in the engine so can't be changed at the moment, but these can be enforced by server settings which most server operators already do.

Ideally the clients would get the minimum interp they have asked for or the minimum server enforced interp if there is one.

Maybe this is good enough for now?

@Agiel Agiel added the Tournament Priority Issues to be prioritized for the upcoming NT;RE tournament label Feb 9, 2026
@bauxiteDYS bauxiteDYS marked this pull request as ready for review February 16, 2026 02:56
@sunzenshen sunzenshen requested a review from a team February 16, 2026 04:17
@Rainyan Rainyan self-requested a review February 16, 2026 13:28
@Rainyan

This comment was marked as outdated.

@Rainyan
Copy link
Collaborator

Rainyan commented Feb 16, 2026

Since the cl_interp value appears to be recorded in the config.cfg, I think this wouldn't revert the cl_interp default for anyone who has run the game before and/or has the value in their config, so maybe we should also add a block similar to 3dee619 based on the release version to manually update any 0.1 values to the new default?

@Rainyan
Copy link
Collaborator

Rainyan commented Feb 16, 2026

Also I feel like we could set the cl_interp default to 0, so that it defaults to using cl_interp_ratio since I think that should be the preferred interp setting anyway?

@bauxiteDYS
Copy link
Contributor Author

bauxiteDYS commented Feb 16, 2026

Since the cl_interp value appears to be recorded in the config.cfg, I think this wouldn't revert the cl_interp default for anyone who has run the game before and/or has the value in their config, so maybe we should also add a block similar to 3dee619 based on the release version to manually update any 0.1 values to the new default?

Yeah this would be good

Would something like this work (I'll get around to learning some c++ one day)?

if (iCfgVerMajor < 25)
{
...
    ConVarRef interp("cl_interp");
    if (interp.IsValid())
    {
        interp.SetValue(0.0f);
    }
}

Also I feel like we could set the cl_interp default to 0, so that it defaults to using cl_interp_ratio since I think that should be the preferred interp setting anyway?

Yeah, I think this should be possible, I was trying to be conservative in the changes, but probably makes sense to set the default for this cvar to 0.

I don't fully understand the new code addition in player.cpp but I get the gist of it. Changes seem good.

@Rainyan
Copy link
Collaborator

Rainyan commented Feb 16, 2026

Would something like this work (...)

Yeah, that seems good. But since the current release is version 25, we should check for the next future major release (< 26, or <= 25), because we also want to fix the v25 configs.

Also rather than unconditionally resetting the cvar:

ConVarRef interp("cl_interp");
if (interp.IsValid())
{
    constexpr float oldDefaultValue = 0.1;
    if (interp.GetFloat() == oldDefaultValue)
    {
        interp.Revert();
    }
}

or similar. Because we wouldn't want to forcibly overwrite changes made by the user to the cvar value, except for the cases where the value was left unchanged from the old default.

@AdamTadeusz
Copy link
Contributor

Also when i was testing this out earlier i noticed that with host_timescale 0.1 I would teleport a lot

Rainyan added 2 commits March 1, 2026 03:46
Remove cl_interp in favour of cl_interp_ratio.

cl_interp requires the user to calculate the optimal net settings from
their current updaterate and is not very user-friendly. Instead, simply
remove it and use the cl_interp_ratio, which does it automatically with
sensible defaults.

With the cl_updaterate default change from 20 to 66 (the sv_maxupdaterate default value),
this gives us a new default interp of 2/66 = 0.03030... instead of the
old 0.1.

Users who for whatever reason enjoy 100 ms extra latency could still roll back
the cl_updaterate to value 20, which with interp_rate 2 would then give
them the original cl_interp: 2/20 = 0.1

Users who wish to get an even lower interp can adjust cl_interp_ratio to
1 for cl_interp equivalent of: 1/66 = 0.01515... which is quite common
for comp. But since a dropped packet would cause visible stuttering with
this setting, we probably don't want to make it the default. Servers
however can control this with sv_maxupdaterate and sv_minupdaterate if
they so choose.
0.033 -> 0.0303030...
@Rainyan
Copy link
Collaborator

Rainyan commented Mar 1, 2026

Pushing some changes with go-ahead from @bauxiteDYS

This probably needs some testing. I got fed up with fighting the ServerBounded system for cl_interp, and it was just a weird layer of abstraction over the interp rate, so I decided to remove it entirely in favor of purely using cl_interp_rate. For the full rationale, see commit message: 43e2558

@Rainyan
Copy link
Collaborator

Rainyan commented Mar 1, 2026

@AdamTadeusz Could you test if you're seeing any stuttering with the current PR head?

You can set the effective interp with: cl_interp_ratio / cl_updaterate as shown as "lerp" in net_graph. To test the previous cl_interp we had in this PR (0.03030...), set cl_interp_ratio 2; cl_updaterate 66;

@Rainyan Rainyan removed their request for review March 1, 2026 08:38
@sunzenshen sunzenshen requested a review from a team March 1, 2026 08:39
@Rainyan Rainyan merged commit b73272c into NeotokyoRebuild:master Mar 1, 2026
7 checks passed
@bauxiteDYS
Copy link
Contributor Author

Pushing some changes with go-ahead from @bauxiteDYS

This probably needs some testing. I got fed up with fighting the ServerBounded system for cl_interp, and it was just a weird layer of abstraction over the interp rate, so I decided to remove it entirely in favor of purely using cl_interp_rate. For the full rationale, see commit message: 43e2558

Putting this here for more info, unsure if other source games also do this but the default in neo for sv_client_min_interp_ratio is 1, which means clients will get 1 tick interp no matter what they set. All this code is like 20 year old 🍝 . The original decision to just overwrite the cl_interp to 0 in cfg (if not user modified) would have worked to allow 0 interp if servers allowed it.

However I'm not opposed to removing cl_interp entirely, it probably should be removed anyway.

@Rainyan Rainyan linked an issue Mar 4, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tournament Priority Issues to be prioritized for the upcoming NT;RE tournament

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Update default Interp settings and other network CVARs

5 participants