I found the algorithm explained at
. The filter may return multiple rooms, and when that happens, the server sorts the rooms using sortBy settings and selects which one to join.
This link points now to the version 0.13.0. If you're using version 0.12.x, you should include that version of the client instead:
Hope this helps.
Also, if you’re creating separate files to keep your code lean, I created a class with a static variable pointing to the room. In the onCreate event of Room, I assign the static room property. Then I can import that class from any file and use the room methods.
Hi @JimboAction, not yet. It would be great to have it eventually.
We already have a C++11 client written for Cocos2d-x: https://github.com/colyseus/colyseus-cocos2d-x
Godot recently released their new WebSocket implementation: https://godotengine.org/article/websocket-updates-udp-multicast
AFAIK Godot still uses C++03 in their engine, but C++11/17 is supported if using GDNative: https://docs.godotengine.org/en/3.1/tutorials/plugins/gdnative/gdnative-cpp-example.html
So you need to be sure that js got generated with ES6 features with classes and all that. Check generated index.js - it should contain classes, something like this: class server_rooms_StateHandlerRoom extends colyseus_server_Room
I'd love to see the Defold client evolving to eventually support all major LUA platforms, such as the ones you suggested, and löve2d.
The problem currently is the platform-specifics of WebSocket implementations, basically. Defold has its own WebSocket client that works for them, CoronaSDK also has one made by the community - which AFAIK it doesn't work with binary data.
@Apollo144 do you know if Gideros have a WebSocket client?
Thanks for the detailed answer!
AFAIK these platforms you mentioned will provide servers and resources to host your game. As Colyseus is just a networking framework, it also doesn't provide any kind of game logic out of the box. You'd need to implement everything by yourself.
Right, both platforms are also social networks, and I don't need that. (Though BYOND doesn't host the servers.) A networking framework is exactly what I'm looking for.
This works great if your game state is not too big.
How big is too big?
I've seen the splitting and filtering views feature. It seems like a must-have for a networking framework, not only for performance, but also for cheating prevention purposes.
Currently, we haven't seen a use case for this. Most games need to have multiple sessions, and matchmaking comes along with it.
My (hypothetical) use case is a ss13-like: every server uses their own fork of the game code with minor tweaks, and the servers can have up to a hundred players and are barely ever full.
Not at the moment. I believe client-side prediction is not easily pluggable in a way that the framework abstract everything for you.
Wait, do you run the game code on the client at all?
Client-side prediction can depend on the game, but all games could benefit from changing the local state immediately. And many games aren't performance-bound on the client by the size of the local game state and can handle recalculating several game states every time the server sends something unexpected. Right?