Netcode – A personal review

“I didn’t expect this to work, but I had hope.”

That’s effectively been our motto for netcode. Any time we tried a different solution to fix a problem and it proceeded to fail, this was what we would say. Every so often, though, our solutions worked and we’d either rejoice that that’s over and done with, or cry in pain when we worked out it was deceptively simple.

We’d put most of our development time into the netcode, blocking out a good 5+ weeks to get main functionality working. We worked hard, came across many issues and tried to learn as much as we could to ensure development went as smoothly as possible. Progress was consistent; we managed to go quite a while without falling too far behind our goals. But ultimately, even with all the documentation, all of the examples, and the many forum posts, no one has ever done net code for our game.

We have unique mechanics, such as phasing through walls, turning invisible while moving, and possessing objects to gain their powers and abilities. As far as my understanding goes, no one has made a game quite like that and frankly, if they had, their solutions for implementation was probably vastly different to ours. So, for a bunch of otherwise quite competent engineers, we were always in for a bumpy ride. We knew from the outset it wouldn’t be easy and we were willing to hedge our bets on getting online play working. The whole team backed us in, everyone knowing the consequences if we did ultimately fail.

Fast forward to now. We have been working on a bug for nearly 2 weeks now. It’s been blocking development. Players’ movement as a weapon doesn’t sync between the rest of the clients. We try literally everything we can think of. Nothing. Endless Google searches. Nada. Then, I had one final glimmer of hope. We had a very similar issue with the ghosts earlier on. I plugged in the same solution as what we used for the ghosts.

This was one of those moments where I was sure it would work. I had full confidence that we would have this fixed and we could move on. One of those rare moments where we said:

“I expect this to work”

It didn’t. At this point, we’d exhausted all of our options and spending more time to determine another possible solution was impractical. 2 weeks on a single issue was already too long and our morale was right down. We had no energy left to keep working on it. We decided to call it off there and then.

Overall, I’m disappointed we didn’t get it working. I felt like we had a point to prove when some people suggested it may be too difficult. If we didn’t have lockdown, we would never have considered online play. Probably. But we felt it necessary to help facilitate playtests during Stage 4 restrictions. Things were going pretty well and to fall off on just 1 bug… it’s annoying. That’s why we aren’t committing to giving up on netcode. The branch will be there and, if we feel so inclined and have the free time, we can go back and try another thing or 2.

For now though, it’s back to focusing on the rest of the game. I don’t know if we’ll ever try netcode again for this project, and I don’t think I’ll ever want to try again on any project again after this. I have a new-found respect for network engineers, as there is far more to it than I had anticipated.