I ported the Endel Dreyer’s Colyseus example tic-tac-toe to the Defold. Server code is as it is, but I made slightly changes on client side code. More info is available on Github.
Cool! Thank you for sharing!
Hi, I’m trying out your game build, but ran into npm install error, saying “colyseus-starter@1.0.0 No repository field.”
I checked that newest colyseus repo has changed, so updated the dependencies link, but npm install still failed. Hope you can help me with that.
I just check it out. It works and I couldn’t find any problem.
What is the problem exactly? Do you have any errors on console when installing NPM modules?
Could you please share more info?
This is just a “warning” and it is not important. You don’t need to update dependencies.
Hi Selimanac
I tried a clean build this time, but npm install gave me this error:
code E404
Not Found - GET https://registry.npmjs.org/event-stream/-/event-stream-3.3.6.tgz
‘event-stream@3.3.6’ is not in the npm registry.
I did a ‘fetch library’ in Defold before npm install.
Never used node but I googled it for you
“Worth noting, this is easily resolved by deleting the existing package-lock.json and running npm install again”
yup, found the same thread right afterwards. good call, thanks!
One more question, how do you do local testing to simulate two players? I don’t have any experience with game development. Puzzles everywhere.
You can simply start two clients. But if you don’t have any game development experience start with basics. Multiplayer game development require lots of game development experience. There are lot’s of examples and tutorials on the Defold Learning Center.
Hey
I’ve got problem with running the project
Node.js server error:
MatchMaking couldn’t process message: 9,tictactoe,[object Object]
Defold error?
DEBUG:SCRIPT: /colyseus/room.lua:73: nil serializer doesn’t support .listen() method.
What I did :
- Installed Node.js
- Installed and started server
- Ran defold, fetched librares, build project. I click touch to start and there’s waiting for opt…In that moment the error I mantioned in node js server pops up.
- Ran windows bundled application (release) and same - I click touch to start and there’s waiting for opt…
Any ideas?
Looks like something has changed/ deprecate on Colyseus side. I’m not sure, but I’m going to check it out when I got some time.
Thanks for response. You are probably right. It might be connected with Colyseus new version. They introduced new serializer in 0.10 build (24 March update) and provided migrating notes from version 0.9 (which You used for creating thread project). I’m not too good detective in such cases, so sorry if I talk nonsense.
https://docs.colyseus.io/migrating/0.10/
Shame I can’t find out how to fix this. I will just wait then.
Edit:
As instructed in link i found I tried to add that line
Room.serialize(Room.FossilDeltaSerializer)(TicTacToe);
, but error on server says
Room.serialize is not a function
serialize
is not a function of room
class. According to docs it should be like this(I didn’t test this):
const colyseus = require('colyseus');
class TicTacToe extends Room {}
colyseus.serialize(colyseus.FossilDeltaSerializer)( TicTacToe);
I guess it is better to change the serializer to schema. I hope I’m going to take a look today
Tried thatbefore too. Still not working. Changing serializer to schema would require more code to be changed. Ok then I’ll just wait till you investigate that and meanwhile read about schema too.
I’m updating the Tic Tac Toe example and having an issue with new Fossil Delta update. I posted an issue on Github. When I have the answer, I’ll update the example.