I'm in the beginning stages of developing a co-op platformer (steam), and I have a few questions that I'm hoping some c2 veterans can help me on.
1. Conceptually, I usually have 1 sprite (box) for the platform object and another sprite for the character. I then either pin the character to the platform box and everything works wonderfully. On the peer when connected to a host, the collision box runs fine, but the character sprite lags behind (similar to if you pinned something to an already pinned sprite). Is there a better way to do this in multiplayer? I have both the sprite and collision box syncing at the beginning of the layout, and I'm setting the position every tick.
2. I'm only syncing 2 sprites and 1 instance variable from one of those sprites. To get my movement, I am using the "setbit" broadcast message way similar to the real-time example given by C2. There's not a whole lot going on in my game, yet the lag is ~600-1000 ms (I'm assuming you multiply peer latency by round(PeerLateencty*1,000?). The jump from the platform seems to vary in height when the peer jumps, as well, and the peer doesn't feel as smooth as the host (obviously). Has anyone else experienced this? Is it because of the wss server I'm using?
3. The way I'm testing this game is by opening chrome, run the build, open 2 new tabs and run the build again (it opens 2 instances total of the game that one can host and the other can connect as a peer). Is this a poor representation of what I can expect, or should I be testing it a different way?
4. I know the host has to send the peer all the information, but is there an easy way to let the peer send information to the host and then just update the position of the peer on the host machine instead (so for both the host and the peer, the other player will look a little laggy, but you'll be able to play fine on your own)
5. The main question, and this is a big one - can C2 handle a real-time multiplayer game in its current state? (node-webkit export)