Unfortunately that type of FIXED (0.2) lerping has EASING the closer you get to destination and gives a FLOATY experience. I was hoping someone made an REAL WORLD project with moving client entities around in the scene... smoothly... Bummer :(
Posts made by MackeyK24
Hmmm... I dont see how you ever get smooth movement by just setting the position in the onChange event.
Are there NO examples on smooth movement ???
I finally got working. I think the issue was in the package.json and the nom install and npm start that runs. Not sure.
But basically i sated from scratch made Arena based server app and deployed the JS output from my lib folder (actually dist folder, i changed that output folder)
But, is working now... thanks for the suggestions :)
So i see and am using the joinOrCreate client option to join rooms.
But i dont quite understand the Lobby System and basic match making process.
I see i can simple call joinOrCreate from client with room name. But that dump everybody in the same ROOM TYPE (Deathmatch Logic room for example).
I think i can use the filterBy option with some like MAP as the key. So if i specifies the room option of options.map = "Level01" for example only users who specified options.map = "Level01" can see each other in the room, and when broadcasting messages from the server. they will only go to clients who also have the room options.map = "Level01"
IF that is the case, i see how you cam make KEYS for room filtering.
But how does the LobbyRoom work... This there a process for say like hosting a room and having other join that session or what is the deal there.
Are there any detailed examples or documentation of REAL WORLD lobbies and matchmaking ???
Hi guys. I am trying to use colyseus with Babylon JS. I am following the Unity example on making a server... I have a version of the server that i ported from the Unity Shooting Gallery. Server works great. However, i cannot get smooth interpolated movement from the clients.
I have tried everything from basic lerping from current entity position to the synced network position (which has unwanted easing). To buffering the last 20 updates from the server and trying to interpolate between the updates (porting different techniques i found on the internet for smoothing out movement)
But i still always get choppy/jittery movement. The one example i see from colyseus in Unity makes no sense.
// Use interpolation if the target playback time is present in the buffer
if (proxyStates[0].timestamp > interpolationTime)
{
// The longer the time since last update add a delta factor to the lerp speed to get there quicker
float deltaFactor = (ExampleManager.Instance.GetServerTimeSeconds > proxyStates[0].timestamp) ? (float)(ExampleManager.Instance.GetServerTimeSeconds - proxyStates[0].timestamp) * 0.2f : 0f;
if (syncLocalPosition) myTransform.localPosition = Vector3.Lerp(myTransform.localPosition, proxyStates[0].pos, Time.deltaTime * (positionLerpSpeed + deltaFactor));
if (syncLocalRotation && Mathf.Abs(Quaternion.Angle(transform.localRotation, proxyStates[0].rot)) > snapIfAngleIsGreater) myTransform.localRotation = proxyStates[0].rot;
if (syncLocalRotation) myTransform.localRotation = Quaternion.Slerp(myTransform.localRotation, proxyStates[0].rot, Time.deltaTime * (rotationLerpSpeed + deltaFactor));
}
// Use extrapolation (If we didnt get a packet in the last X ms and object had velcoity)
else
{
EntityState latest = proxyStates[0];
float extrapolationLength = (float)(interpolationTime - latest.timestamp);
// Don't extrapolation for more than 500 ms, you would need to do that carefully
if (extrapolationLength < extrapolationLimitMs / 1000f)
{
if (syncLocalPosition) myTransform.localPosition = latest.pos + latest.vel * extrapolationLength;
if (syncLocalRotation) myTransform.localRotation = latest.rot;
}
}
How the heck could this line ever be true
(ExampleManager.Instance.GetServerTimeSeconds > proxyStates[0].timestamp)
When the GetServerTimeSeconds is in seconds and the proxyStates[0].timestamp is in milliseconds... That should never work. So it seems like the sample would always have a delta factor of 0. So i dont get that.
Anyways after weeks of trying different techniques ... I still get choppy movement.
Can you please make a sample using Javascript client that has smooth interpolated movement.
NOTE: I am willing to pay for this development help. Either from colyseus directly or any other develop who has dealt with smooth interpolated movement
I am basically dead in the water. I got all the other game server stuff working great, but the my shitty movement on the client is freaking deal breaker.
Please Help, Someone :)
NODE_ENV=production
Yes. It says its deployed and spits out the log listed above
I made a small demo app and uploaded server code. But when I deploy it gets a bunch of errors:
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | Colyseus 0.14.18_Node-14.17.3-Buster_uWS_WS_RD_v2: Listening on ws://cu7ksr.us-east-vin.colyseus.net:2567
7bff7b7b5b-lmzk2 | ✅ uWebSockets.js + Express compatibility enabled
7bff7b7b5b-lmzk2 | No Transport provided... Arena is Defaulting to uWS
7bff7b7b5b-lmzk2 | }
7bff7b7b5b-lmzk2 | requireStack: [ '/colyseus/app/server/index.js' ]
7bff7b7b5b-lmzk2 | code: 'MODULE_NOT_FOUND'
7bff7b7b5b-lmzk2 | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
7bff7b7b5b-lmzk2 | at Function.Module._load (internal/modules/cjs/loader.js:790:14)
7bff7b7b5b-lmzk2 | at Module.load (internal/modules/cjs/loader.js:950:32)
7bff7b7b5b-lmzk2 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
7bff7b7b5b-lmzk2 | at Module._compile (internal/modules/cjs/loader.js:1085:14)
7bff7b7b5b-lmzk2 | at Object.<anonymous> (/colyseus/app/server/index.js:86:19)
7bff7b7b5b-lmzk2 | at require (internal/modules/cjs/helpers.js:92:18)
7bff7b7b5b-lmzk2 | at Module.require (internal/modules/cjs/loader.js:974:19)
7bff7b7b5b-lmzk2 | at Function.Module._load (internal/modules/cjs/loader.js:746:27)
7bff7b7b5b-lmzk2 | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
7bff7b7b5b-lmzk2 | - /colyseus/app/server/index.js
7bff7b7b5b-lmzk2 | Require stack:
7bff7b7b5b-lmzk2 | Error: Cannot find module './arena/arena.config'
7bff7b7b5b-lmzk2 | INFO : *** Have you DEPLOYED your server code? ****
7bff7b7b5b-lmzk2 | INFO : Arena-Config: No valid file provided
7bff7b7b5b-lmzk2 | }
7bff7b7b5b-lmzk2 | path: '/colyseus/app/server/arena/production.env'
7bff7b7b5b-lmzk2 | code: 'ENOENT'
7bff7b7b5b-lmzk2 | syscall: 'open'
7bff7b7b5b-lmzk2 | errno: -2
7bff7b7b5b-lmzk2 | at internal/main/run_main_module.js:17:47 {
7bff7b7b5b-lmzk2 | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
7bff7b7b5b-lmzk2 | at Function.Module._load (internal/modules/cjs/loader.js:790:14)
7bff7b7b5b-lmzk2 | at Module.load (internal/modules/cjs/loader.js:950:32)
7bff7b7b5b-lmzk2 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
7bff7b7b5b-lmzk2 | at Module._compile (internal/modules/cjs/loader.js:1085:14)
7bff7b7b5b-lmzk2 | at Object.<anonymous> (/colyseus/app/server/index.js:54:25)
7bff7b7b5b-lmzk2 | at Object.config (/colyseus/node_modules/dotenv/lib/main.js:101:29)
7bff7b7b5b-lmzk2 | at Object.readFileSync (fs.js:394:35)
7bff7b7b5b-lmzk2 | at Object.openSync (fs.js:498:3)
7bff7b7b5b-lmzk2 | Error: ENOENT: no such file or directory
open '/colyseus/app/server/arena/production.env'
7bff7b7b5b-lmzk2 | Arena-Env: No Valid File found
7bff7b7b5b-lmzk2 | Arena-Env: Could not find 'arena.env'
checking for production.env instead...
7bff7b7b5b-lmzk2 | --- Completed Prelaunch ---
7bff7b7b5b-lmzk2 | npm WARN using --force Recommended protections disabled.
7bff7b7b5b-lmzk2 | npm notice
7bff7b7b5b-lmzk2 | npm notice Run `npm install -g npm@8.4.0` to update!
7bff7b7b5b-lmzk2 | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.4.0>
7bff7b7b5b-lmzk2 | npm notice New major version of npm available! 7.24.0 -> 8.4.0
7bff7b7b5b-lmzk2 | npm notice
7bff7b7b5b-lmzk2 | Run `npm audit` for details.
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | npm audit fix --force
7bff7b7b5b-lmzk2 | To address all issues (including breaking changes)
run:
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | npm audit fix
7bff7b7b5b-lmzk2 | To address issues that do not require attention
run:
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | 4 vulnerabilities (3 low
1 moderate)
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | run `npm fund` for details
7bff7b7b5b-lmzk2 | 10 packages are looking for funding
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | added 16 packages
removed 103 packages
changed 2 packages
and audited 209 packages in 27s
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | lerna success Bootstrapped 0 package
7bff7b7b5b-lmzk2 | lerna info Symlinking packages and binaries
7bff7b7b5b-lmzk2 | lerna info Bootstrapping 0 package
7bff7b7b5b-lmzk2 | lerna notice cli v4.0.0
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | > lerna bootstra
7bff7b7b5b-lmzk2 | > boot
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 |
7bff7b7b5b-lmzk2 | > npm run boot
7bff7b7b5b-lmzk2 | > postinstall
7bff7b7b5b-lmzk2 | åå
7bff7b7b5b-lmzk2 | Running NPM Install...
7bff7b7b5b-lmzk2 | Pointing Org Workspaces
7bff7b7b5b-lmzk2 | No additional package.json found to merge... installing standard Arena package.json
7bff7b7b5b-lmzk2 | Check / Merge Override Package JSON
7bff7b7b5b-lmzk2 | 'arena.secret.env' does not exist.
Does not look like it finds my server app even though its uploaded
Whats going on here ???