Peer-to-peer Massive Multiplayer Game
I was sent on a training course for it from work - it wasn't cheap but explained a lot.
I don't remember much code wise now though and would probably have to "rtfs" to jog my memory :)
Games/Projects Currently In Development:
Discord RPG Bot | D++ - The Lightweight C++ Discord API Library | TriviaBot Discord Trivia Bot
So in a peer-to-peer game, would there only be one topic and then each node is both a subscriber and a publisher to that topic (the game state would essentially be the topic)? Or would each node have it's own topic and subscribe to everyone else's topics (the game state would be the combination of all the topics).
Also, how would the nodes agree on what's allowed to be published in those topics? Couldn't people just publish whatever they want (i.e. cheat) since there's no central authority?
This way you can maintain some authority over the data.
Remember there are lots of types of ways to put data onto a topic though, perhaps different kinds of stream make sense for different game data, e.g. transient unreliable data for movement updates, persistent reliable data for core game state, on different topic names?
You can easily do a lot with it :)
Games/Projects Currently In Development:
Discord RPG Bot | D++ - The Lightweight C++ Discord API Library | TriviaBot Discord Trivia Bot
I see...
So simply put, a "topic" is just a group of people, and publishing to a "topic" is akin to multicasting to a group of people. Also, are you aware of how the publishing/multicasting works? You mentioned that these solution typically use a cyclic graph, but wouldn't that be very slow? I'm curious to see if it's actually better, and also if it's secure against DOSing.
Seems like I'm going to need to modify a lot of the code in order to integrate DDS into my game (having to combine all the information from subscribing into the different topics and also adding additional checks to prevent users from subscribing into topics) :unsure:
Before you do a big re-write, it's usually quite useful to measure the performance of whatever solution you're trying to add.
Make sure that network usage. latency, scalability, cost, resource utilization, latency tolerance, security, and all other parameters you care about are actually up to snuff for what your game needs.
If you don't yet know what your game needs, then it's probably better to get further with the game, than to pick some particular solution too early.
Yeah, good point.
I think I'll just go with what I currently have (octree with max depth of 2, heartbeats to detect disconnections, manual secondary host selection, and handling disconnections differently depending on the type of user) and see how things go from there. I already have a good idea as to how I'll go about implementing everything as well.
Thank you everyone for your input! I really do appreciate it :)
Wow, you're doing all this extra complex work just to
benefit of not having to purchase a dedicated server.
And, this is for a game with 50-100 players. I think this is like a case of cutting off your nose to spite your face. IMO, you're going to go through so much heart-ache, you'll be wishing you had spent a little money for that dedicated server.
My Gamedev Journal: 2D Game Making, the Easy Way
---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)
Wow, you're doing all this extra complex work just to
And, this is for a game with 50-100 players. I think this is like a case of cutting off your nose to spite your face. IMO, you're going to go through so much heart-ache, you'll be wishing you had spent a little money for that dedicated server.benefit of not having to purchase a dedicated server.
This is true. Got $5 a month? That's as much as a coffee and muffin at a certain coffee shop. For that you can get a virtual server at digialocean to do whatever you like with...
Games/Projects Currently In Development:
Discord RPG Bot | D++ - The Lightweight C++ Discord API Library | TriviaBot Discord Trivia Bot
While a regular large is "only" $4.50, the Jamaican Blue Mountain is $10. For a cup of coffee. ($120 per pound)
The problem with a dedicated server is that my game will only work while the server is active, and I don't want this to be a limiting factor in the future (how many multiplayer games have been ruined in the past due to the servers being taken down?). Also this way, I can focus on the game itself and not have to worry about administering my own server. So in this respect, I'm saving myself heartache.
Also this whole peer-to-peer architecture would at most take me one day to write up, so it's really not that big of a deal.