I am still learning about ECS because I have a large project in mind. But I needed a smaller project that could maybe become a game in the process. So I though why not remake the first game I did with JME Multi-Dominoes?
I decided to resemble a real life game where we shuffle the pieces and pick them from the table to the hand. I made a prototype in Unity to see how it was possible and them went back to JME.
I chose to use ECS mostly due to the physics of shuffling. using a 3D physics engine with constraints causes plenty of headaches, so I went to use 2D and it was amazing how well it looked.
I also added a system for “tween?” so I can animate transform components and have the rendering state just update the spatial positions.
I went a bit back to add multiplayer before I proceed any further. I went to use Zay-es-net to see how it went and I love the result!.
For the moment I am using Lemur’s tween to smooth the positions changes since the server sends messages at 20 fps. I will use something else for the next milestone.
Note: I don’t know if you control the position on the server or just send events or whatever… but for real time synching where the server is the authoritative position, SimEthereal may save some trouble.
…it’s also more efficient than the TCP messages that Zay-ES sends. (The two libraries work quite well together because that’s how I use them.)
An example of using Zay-ES and SimEthereal together is here:
In that example, you can see how a BodyPosition component automatically handles the tweening between frames.
Plus, for an over-engineered domino project, there is something that seems perfect about using a real-time network sync library designed for twitch FPS games. lol
As to efficiency, my memory says SimEthereal can fit ~80 object updates in less than 1500 byte UDP messages. It uses a custom change-based reliable protocol built on UDP. Another user’s game was able to handle many thousands of simultaneous players.
Adding some dragging functionality to the tiles from the hands and reflecting that to the other players online. My goal is to have the experience a bit closer to reality, like when I play with family and friends.