I scaled my MMO to 100 concurrent connections

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 34

  • @djukicdev
    @djukicdev Рік тому +10

    Your devlogs are awesome

  • @hoxorious
    @hoxorious Рік тому +8

    I really liked the graph comparison! 👌It really showed the improvements.

    • @UnitOfTimeYT
      @UnitOfTimeYT  Рік тому +2

      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 Рік тому +2

    Woah Wtf you’re a genius

  • @mqix3741
    @mqix3741 Рік тому +8

    More goroutines then monies in the bank

    • @UnitOfTimeYT
      @UnitOfTimeYT  Рік тому +2

      If I had a nickle for every goroutine I've used. I'd be the richest man on earth

  • @dandogamer
    @dandogamer Рік тому +1

    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  Рік тому +1

      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.

  • @wils-caru
    @wils-caru Рік тому +1

    hey, what do you think about flatbuffers and protobuffers for the problem you mentioned on serialization?

    • @UnitOfTimeYT
      @UnitOfTimeYT  Рік тому +2

      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

  • @baxiry.
    @baxiry. Рік тому

    awesome

  • @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

  • @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!

  • @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.

  • @patix0331
    @patix0331 Рік тому

    Is full game open source or only some parts?

    • @UnitOfTimeYT
      @UnitOfTimeYT  Рік тому +3

      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!