Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 14 13:04
    stonekase commented #281
  • Nov 14 12:46
    stonekase commented #281
  • Nov 14 12:43
    endel commented #281
  • Nov 14 12:18
    stonekase commented #281
  • Nov 14 12:17
    stonekase commented #281
  • Nov 12 21:10
    emotionalamoeba opened #59
  • Nov 10 19:49

    endel on send-schema

    Rewrite tests (#280) * remove … update README rename 'pingTimeout' and 'pingC… and 15 more (compare)

  • Nov 10 19:49

    endel on send-schema

    experiment decoding Schema-enco… (compare)

  • Nov 10 18:38
    arslan-22 closed #282
  • Nov 10 18:38
    arslan-22 commented #282
  • Nov 10 18:26
    endel commented #282
  • Nov 10 18:24

    endel on master

    soft breaking change. bump 0.11… (compare)

  • Nov 10 18:23

    endel on master

    soft breaking change. bump 0.11… (compare)

  • Nov 10 18:13
    arslan-22 commented #282
  • Nov 10 17:59
    endel commented #282
  • Nov 10 17:57

    endel on master

    add 'funding' on package.json (compare)

  • Nov 10 17:56
    arslan-22 opened #282
  • Nov 10 08:26
    udamir commented #281
  • Nov 09 20:36
    GreenArrow18 commented #270
  • Nov 09 19:04
    endel commented #270
Endel Dreyer
@endel

@oyed the server actually closes the websocket immediately when LEAVE_ROOM is received, and the async onLeave() is performed, well, asynchronously :sweat_smile:

I believe it would make sense to wait for the promise to fulfil before closing the connection, right? If the application persists some user data during async onLeave(), and the user joins another room in the meantime, he would have outdated info on the other room

OYΞD
@oyed
@endel @LightningK0ala_twitter I believe at some point this was the behaviour (As you can see from the quote I found from @endel last November), I also remember it working in my previous project (I unfortunately can't go back and double-check), but yes I think it does make sense, especially for the given use-case:
  • User is in Room A
  • User called leave() on Room A
  • Room A persists user data and then tells User they have left
  • User receives the onLeave and can then join Room B
  • Room B fetches persisted data
OYΞD
@oyed
@endel - opened an issue for this, I'm guessing instead of room.leave() closing the connection client-side, it should send a protocol event which the server should listen for instead of client.once('close
Endel Dreyer
@endel
thanks @oyed! :heart: I'll fix this soon, I think this never actually worked as expected, I sent you the right instructions but the actual behaviour was not correct
OYΞD
@oyed
Thanks :)
Loonride
@Loonride
Hey could anyone suggest how I can improve my client interpolation code: https://gist.github.com/Loonride/2f76d04fbdd8c926c6b3f0993bb9e275 , it's something I'm struggling with. It works ok, but is a bit choppy at times. I would rather it be a bit more smooth at the cost of being slightly behind the most recent state info. Does anyone know of any libraries that can do this for me?
Endel Dreyer
@endel
thanks for sharing @Loonride, I personally don't have much experience on client interpolation, what I usually do is lerping the current value with the latest one from the server, it's not perfect but has a reasonable result:
function lerp(a: number, b: number, t: number) {
  return (b - a) * t + a;
}

// on every tick
entity.x = lerp(entity.x, entityPositionInTheServer.x, 0.2);
entity.y = lerp(entity.y, entityPositionInTheServer.y, 0.2);
OYΞD
@oyed
@endel Any reason why the colyseusid wouldn't get set client-side?
Tao Pan
@pantaovay
colyseus:errors trying to send event ("147,13,170,57,95,105,68,49,53,109,68,77,55,129,162,105,100,181,67,111,109,109,111,110,82,111,111,109,80,108,97,121,101,114,82,101,97,100,121") to non-existing remote client (null) +867ms
@endel
image.png
There is a client on Room that has no sessionId
Weird
Endel Dreyer
@endel
@pantaovay weird indeed! let me know if you figure out the scenario where this happened :scream:
Tao Pan
@pantaovay
After searching for a day, I didn't find out either....
That's terrible...
Heartbreak
Endel Dreyer
@endel
@pantaovay is it happening often? do you mind sharing your project with me so I can investigate?
Tao Pan
@pantaovay
Yes. It happens in multi-process mode with memshared
Endel Dreyer
@endel
@pantaovay created here for tracking gamestdio/colyseus#205
Tao Pan
@pantaovay
room disposed: i9gvO2Rdc0
(node:20223) UnhandledPromiseRejectionWarning: Error: remote room (i9gvO2Rdc0) timed out, requesting "_emitOnClient with args ["zEA70eTF5","close",1005]"
at Timeout.setTimeout (/data/code/node-game-server/node_modules/colyseus/lib/MatchMaker.js:160:32)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
(node:20223) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:20216) UnhandledPromiseRejectionWarning: Error: remote room (i9gvO2Rdc0) timed out, requesting "_emitOnClient with args ["hVFYSL4cL","close",1005]"
at Timeout.setTimeout (/data/code/node-game-server/node_modules/colyseus/lib/MatchMaker.js:160:32)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
(node:20216) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
OYΞD
@oyed
Quick question; how do you guys handle/plan to handle latency due to location? E.g. have Server A in Northern America, Server B in central Europe and let the user choose
Loonride
@Loonride
Are there cases where the server.onError event is fired on the client, but the connection with the room is not lost?
Loonride
@Loonride
@endel It seems if I have memshared presence and a room on every process returns false for requestJoin, then a new room wont be made on the same process as an existing room? Is this the case? If so, how do I let two rooms exist on the same process within memshared?
I'm getting this, and I believe it is because each process already has a room and all are returning false - server error: remote room (v8rFRuB5gQW) timed out, requesting "hasReachedMaxClients"
Endel Dreyer
@endel
@Loonride sounds bad, hard to say what's the reason for this. do you mind sharing your project privately with me, so I can inspect? if it's public on GitHub even better
jestarray
@jestarray
ello there
new to programming the multiplayer end of games but i have a niche question
arch.PNG
how do you guys architect your game & server ? i saw someone have the client(browser-side) and the server side both contain their own dependencies, having their own node_modules and webpack configs
Endel Dreyer
@endel
hey @jestarray, nothing stops you from having both client & server together, sometimes it's better to separate for deployment purposes, it really depends on your needs.
jestarray
@jestarray
thanks!
SkyzohKey
@SkyzohKey
Hey guys, old custom servers dev who migrated to lance.gg and now to Colyseus 3 days later here 😂
Would be nice if we could put some starter/boilerplate/create-colyseus-game cli !
Would help new users to make their debuts. And as Colyseus takes advice from React (setState style) I guess a CLI app might be cool
Might work on that once I've successfully synced my first classes/rooms so I can get a grasp of how everything works. 😉
In the meantime, if you have resources/repos that are related to Colyseus, or a game engine that you integrate often or stuff like that, I'd be happy to ear you (so the CLI might bootstrap this à la VueJS CLI) 👌
Endel Dreyer
@endel
hi @SkyzohKey, welcome! please do! that'd be wonderful
SkyzohKey
@SkyzohKey
@endel thanks for the welcoming! Any resources other than the doc to help me getting started (i.e. tips & tricks) ?
@/all I've just shared my thoughts on the current state and what I'm aiming for matchmaking & scalability issues on issue 176 any feedback is very welcome guys!
Kyle J. Kemp
@seiyria
@endel maybe fork those into the colyseus org so they're all in the same place?
then you don't have to worry about them going away
Endel Dreyer
@endel
sure!
Endel Dreyer
@endel

We're moving from Gitter to Discord, @/all!

Please join us there! https://discord.gg/RY8rRS7

Happy holidays! :heart:

Wenish
@Wenish
yey
sunlightu1225
@sunlightu1225
:heart:
Dr Silas Wiggin
@saul_wiggin_twitter
Hi
ferit özcan
@feritzcan2_twitter
hi
anyone here ? :(