An Embarrassing Tale: Why my server could only handle 10 players
medium.com
medium.com
I feel like a lot has been lost since the days when I was in my parents garage making TCP/IP games to run over dialup.
1. Binary was the only choice
2. You had to assume packets would get delayed (sometimes 10+ seconds) thus you had to do some fun stuff like try to use math to predict where the player would be based on what they were doing last time you got an update.
3. You had very little RAM to work with so growing memory would be immediately noticeable.
#2 was the primary reason in old game you used to see other players walking into a wall for 20 seconds before jumping half way across the map. Darn n00bs who couldn't afford 56k (joking).
I fondly remember the first time I played a multi-player online game I actually had to dial into my friend's modem over POTS. I then spent the next two months reading telephony documentation trying to figure out how to use the modem to do things like that myself.
</nostalgia>
But if I'm micro-ing for example my single marine vs your single zergling then latency is just as important as in any FPS. The interesting part with RTS for me is that a person can only control so many entities, so only 'touched' entities need real-time syncing, if its for example off-screen a server simulation can just tell you the results afterward.
I quite enjoyed this classic old article (1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond): http://www.gamasutra.com/view/feature/131503/1500_archers_on...
Thankfully we have free resources from professionals in the industry to keep us on the right track:
And netcode.io, the solution developed by the author, which has a major drawback: it needs the installation of a browser extension to work (only chrome supported at the moment).
All things considered, WebSockets still seem to be way to go for most use-cases.
Basically the browser isn't a good platform for real time twitch control games like this one seems to be.
[1] https://en.wikipedia.org/wiki/Dead_reckoning#Dead_reckoning_...
Also, is collision detection currently working? I mean, just trying to keep on the platform is actually pretty zen, but running into other players doesn't seem to actually do anything right now.
- If neither is boosting, the players just pass through each other
- If one player is boosting, they'll knock the other off
- If both are boosting, the players just bounce off each other
I find the controls extremely unsatisfying. Top down driving games (which this fundamentally is) really need a sense of momentum and drifting.
How much could be gained by transferring only the information that is actually needed and using a different serialization format, perhaps protobuffers or the like?
Using JSON as serialization format for real-time multiplayer game is being very silly, unless it's just a prototype.
A game is a pretty good use case for predefined schemas like Protocol Buffers, which is used by CS:GO and Pokemon Go for example. Other games like slither.io use binary over websockets without any of these libs.
You no longer need to guess at where in your code something is taking up CPU or memory, just look. I'd say the ability to effectively use a profiler is one of the most important skills for a software dev (yet one that many people overlook).
Side note: I subscribe to Mark Brown's Game Maker's Toolkit on Game Design and Game progression, here is an example:
https://www.youtube.com/watch?v=2u6HTG8LuXQ&t=4s
I think it would definitely help
I have been looking for a continuation mechanic though. Speeding up after some knockoffs sounds like a plausible candidate.
The theoretical limit as configured is 460 concurrent players. Be sure to read the instructions, or you won't be able to shoot, and you'll drain your energy and become helpless.
Took way to long to understand how to control it and collision doesn't work
The controls could definitely use some work though