I scaled my MMO to 100 concurrent connections

  Рет қаралды 3,808

UnitOfTime

UnitOfTime

Күн бұрын

Пікірлер: 34
@djukicdev
@djukicdev Жыл бұрын
Your devlogs are awesome
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Haha thanks! Glad you like them!
@hoxorious
@hoxorious Жыл бұрын
I really liked the graph comparison! 👌It really showed the improvements.
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Thanks! Yeah I'm super glad I added some backend performance metrics. It's been incredibly helpful.
@LawZist
@LawZist Жыл бұрын
what tools did you use for the backend performances metrics? do you still work on your game?@@UnitOfTimeYT
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Hey! I'm using Prometheus and Grafana for the backend metrics currently. Yeah the game is still a work in progress. You can play the constantly updating dev-server demo here: mythfall.com@@LawZist
@LawZist
@LawZist Жыл бұрын
thanks! btw, do you use Client-Side Prediction and Server reconciliation in your game? also, is there a source of knowledge that you recommend to learn about game dev backend design etc? thanks again@@UnitOfTimeYT
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Hey @LawZist I just saw this. Yeah I do client-side prediction. My actual network tick rate is very very slow (right now its like 4 Hz, I'm thinking of increasing it though). But its viable because my game can be deterministically simulated on both the client and server. If I had a PVP game, then I wouldn't be able to get away with that kind of tick rate. These are the best articles I've found about game networking design: gafferongames.com/categories/game-networking/
@garyadamos
@garyadamos Жыл бұрын
Woah Wtf you’re a genius
@mqix3741
@mqix3741 Жыл бұрын
More goroutines then monies in the bank
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
If I had a nickle for every goroutine I've used. I'd be the richest man on earth
@wils-caru
@wils-caru Жыл бұрын
hey, what do you think about flatbuffers and protobuffers for the problem you mentioned on serialization?
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Hey, Yeah I actually started with flatbuffers, but I found the generated code really hard to work with so I stopped using it. I've never really used protobufs so I'm not sure if that's any easier. Also, According to this: github.com/alecthomas/go_serialization_benchmarks - Flatbuffers is slower and encodes to larger bytestreams than a manual binary encoder (You can compare to the MUS encoder, which my code is very similar to). Also, my packets are really small, and I almost always need to decode all of the data anyways, so the partial decoding benefits of flatbuffers doesn't really help me much. The only other benefit those would have over mine is that *i think* they provide better backwards compatibility support. So right now, whenever I update the game server code I always push a client update as well. This guarantees that clients will have the latest serialization code. That said, the structs that get serialized don't change very frequently, so its not too big of a deal. Plus my game is browser based, so I have a lot of control over when people download new versions of the game (I can essentially force it). I'm not really trying to say flatbuffers/protobufs/or any other encoding strategy is bad. I use JSON for a lot of web requests that don't need as much performance, and I use Gob for some asset data files. It just so happens that the majority of my bandwidth is the high-frequency updates, so I figured I'd make that as fast as I can. Sorry for the long message!
@wils-caru
@wils-caru Жыл бұрын
@@UnitOfTimeYT Thanks for the detailed answer, I'll read the cod code and learn a little more about this serialization part, benchmarks always saving us.
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
@@wils-caru Sure. Feel free to take a look! The AST parsing and codegen portion is a bit hacked together. But it ultimately generates code which calls these encoding functions: github.com/unitoftime/cod/blob/master/backend/backend.go
@dandogamer
@dandogamer Жыл бұрын
This is really awesome, what encoder was you using before? I'm using gob atm for my game but fortunately it's a 1v1 kinda thing :)
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Glad you liked it! I was using this one before: github.com/kelindar/binary My serialization journey looked kinda like this: JSON, Gob, Flatbuffers, binary, and now Cod. There's a good serialization comparison github repo here: github.com/alecthomas/go_serialization_benchmarks But don't get too caught up on picking the fastest possible serialization strategy if you don't need it for your game/app. Honestly Gob probably works in most cases just fine. Unfortunately in my case it didn't fit so well.
@MuhammadHosny0
@MuhammadHosny0 Жыл бұрын
you might want to try a contabo VPS those come pretty cheap and extremely fast.
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Yeah from what I've seen from benchmarks, Contabo is very good value. In the upper tiers, I think they are better value than the VPS provider I currently use (HostHatch). . So at some point I might shop around once I start purchasing more expensive servers. I'll definitely look at contabo again.
@MuhammadHosny0
@MuhammadHosny0 Жыл бұрын
@@UnitOfTimeYT Contabo costs like $8 for 4 cores and 50GB NVMe Good luck with the development
@Ahelhot
@Ahelhot Жыл бұрын
Do you try/test protobuf?
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
I actually used flatbuffers for a while in this project before eventually moving to a reflection-based binary serializer. I wasn't a huge fan of flatbuffers, I found it way too complicated to work with, then the reflection serializer was just simply too slow and caused too many allocations. You can look here for a benchmark comparison of several serializers. github.com/alecthomas/go_serialization_benchmarks Mines probably most similar to a code generated version of the MUS serializer.
@atatro-pe9ql
@atatro-pe9ql Жыл бұрын
nice i have no clue what your talkin ab but its a good video
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Haha. Still, glad you enjoyed the video!
@baxiry.
@baxiry. Жыл бұрын
awesome
@patix0331
@patix0331 Жыл бұрын
Is full game open source or only some parts?
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
When I first started, I made the full game open source, But later decided to finish the game as a closed source project. I try and push anything that's not "game-specific" out to OSS though. You can see those on my main github page: github.com/unitoftime Your more than welcome to try/use my OSS libraries. If you have any questions/feedback, I'd be glad to try and answer!
@whatthefunction9140
@whatthefunction9140 Жыл бұрын
Try rack nerd vps
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
ooo I love VPS suggestions. Thanks! I'll check it out!
@jomy10-games
@jomy10-games Жыл бұрын
Still not over 9000
@carneirouece
@carneirouece Жыл бұрын
stop vocal fry
@UnitOfTimeYT
@UnitOfTimeYT Жыл бұрын
Haha I had no idea what that meant so I googled it, but yeah I definitely do that a lot. I'll keep working on it! Thanks for the feedback!
I rewrote my dungeon generator!
4:27
UnitOfTime
Рет қаралды 167 М.
Mythfall Devlog: Banks, Boots, Hairstyles, and the Hanging Temple
13:20
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
How I reduced my networking bandwidth by over 50%
6:58
UnitOfTime
Рет қаралды 1,8 М.
Reverse Engineering Age Of Empires
12:32
Nathan Baggs
Рет қаралды 232 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,5 МЛН
Rebuilding My Units - Strategy Game Devlog
4:50
Smart Bastard Games
Рет қаралды 1,6 М.
How to infinitely scale a multiplayer game server
29:15
Web Dev Cody
Рет қаралды 9 М.
Mythfall Devlog: The second year of development
4:46
UnitOfTime
Рет қаралды 2,9 М.
Factorio teaches you software engineering, seriously.
21:27
Tony Zhu
Рет қаралды 2 МЛН
When Optimisations Work, But for the Wrong Reasons
22:19
SimonDev
Рет қаралды 1,1 МЛН
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН