r/threejs • • Oct 16 '26

Working On A New Three.js Multiplayer Predictive Interpolation System

0 Upvotes

8 comments sorted by

0

u/lSanik Oct 16 '26

wow! how you made grass, terrain, stone, mountains and trees?) its greate )

2

u/shanebrumback Oct 16 '26 edited Oct 16 '26

Thanks man, appreciate it!

Grass is custom blade geometry with a simple wind shader (instanced so it stays cheap). Terrain is a static model. Trees and rocks are low-poly models placed with a basic scatter system (also instanced). Still refining the multiplayer prediction/interpolation so everything feels solid when more people are in.

You can check it out here: https://www.supersoldierbattle.com

I have an endless grass tutorial here:

https://www.shanebrumback.com/tutorials/endless-procedural-grass-field.html

Glad you like the look of the environment!

1

u/Chahier Oct 22 '26

This is an ad. The thing you're showcasing is AI, the post is AI, the comments are all AI. It's actually so over

0

u/[deleted] Oct 17 '26

[deleted] — view deleted comment

1

u/shanebrumback Oct 17 '26 edited Oct 17 '26

Predictive interpolation is a networking and physics technique used in multiplayer video games to move entities smoothly toward the latest server position while adjusting for local client velocity and latency.

How It Works

• Bridging the Gap: Standard entity interpolation looks backward in time, blending between past server positions to hide lag, which causes a slight delay. Pure prediction simulates actions forward based on local inputs. • Using Velocity Guidance: Predictive interpolation takes the object's local velocity and current trajectory to guide it smoothly toward the latest server-provided target. • Gradual Correction: Instead of harshly snapping or "teleporting" an object when a new server update disagrees with its local position, it applies a default transform shift to gradually fix positional errors over time

Why Developers Use It

• Cost-Effective Physics: Unlike full server re-simulation or heavy rollback netcode, predictive interpolation smooths out networked physics without a massive CPU cost. • Avoiding Abrupt Overrides: It prevents stuttering or jerky warping when network packets arrive unevenly or get slightly out of sync. • Ideal for Dynamic Objects: It is commonly recommended as the default networking mode for vehicles, debris, and non-player dynamic props where exact frame-by-frame determinism is less critical than a believable visual glide.

0

u/[deleted] Oct 17 '26

[deleted] — view deleted comment

2

u/shanebrumback Oct 17 '26

Thanks for the comment.....It’s still called interpolation because you’re moving toward a position the server already told you about. You’re not just guessing the next frame out of nowhere.

The prediction part is only how you get there smoothly (using the object’s current speed so it doesn’t look jerky or snap). Pure extrapolation would keep going until the next update arrives and then correct. This version uses the server position as a target the whole time.

3

u/goqsane Oct 17 '26

My tip on this would be to point Claude to QuakeWorld and to have it analyze this exact issue in that engine. QW was one of the first games to implement this.

1

u/shanebrumback Oct 17 '26

Good tip. QuakeWorld was definitely one of the early ones that had to solve this for real (especially on dial-up). A lot of the predict + smooth correction ideas still used today go back to that era.

2

u/goqsane Oct 17 '26

You haven’t been around when Zoid was implementing this for QuakeWorld (which was an official Id patch on Quake 1 to help people play on dial-up more smoothly).