peer-to-peer user-count experiences (lock-stepping)

Hello :slight_smile:

I’m thinking about the peer-to-peer architecture. Right now it’s just hypothetical, because our client-server architecture works really well. I’m a little bit concerned about future server costs though, so that’s why I’d like to get some information on peer-to-peer architecture.

Do you have experiences on the count of players (in one game) such an architecture will seamlessly be able to handle? Any other problems you stumbled across?

Going this route, I’d have my concerns with establishing the connection through NATs. I know of UDP hole punching, but I don’t know if I want to implement that :wink:

If you’re wary about NAT punch through, you are in over your head :point: You’d need each peer to punch through the NAT of any other peer. That is n*(n-1) punch through ‘sessions’ to perform, they all have to succeed, for every peer to properly join the game.

Why not let users host their own servers, to work around the cost issue.

To add on to this, if you don’t want the typical “Server List”, just use UPnP and don’t blatantly notify the user they are the server.

Have them search for a game through a server list, and just attempt to join each one until you can connect to one. If the player is UNABLE to connect to any servers AND UPnP fails, notify them there is a problem with their network and that they need to manually port forward whatever port if they wish for other people to be able to join their game. Else if there are no games and UPnP is successful, just simply add their IP to the server list and have them begin hosting the game.

It mainly has to do with control. We will probably release the server software sometime in the future. But since we are planning on releasing this game as free-to-play with revenue made from in-app purchases (kind of, we have an interesting idea that we want to try out) we want to be in charge of the running servers.

I know I’m contradicting myself a bit here, because I asked about peer-to-peer architecture…

@Soul Foam: That’s an interesting idea, but it would give the hosting part an advantage over the other players, because he/she will never suffer from any lag :slight_smile: The game is highly competitive and we want it to be as fair as possible.

It’s funny because were making the same style of game.

My game is very competitive, and has micro transactions as well.

Remember, you can ALWAYS transition over to hosting your own servers once it becomes a viable solution, I was once at the point you are now, wondering and questioning what to do about it.

About your issue with lag and such, you can either ignore this and always let the host have a small tiny advantage (alot of games actually do this… ever played Halo or Call of Duty? I’m sure you’ve played a game where you were screaming “DUDE HE HAS TO BE HOST WHAT THE f**k”.) or you can deal with it a couple different ways. You can implement artifical latency to the hosts client, just averaging out other peoples latency and take that average and apply it to the host.

As far as hosting your own servers, realize this…

Say a server holds 16 players right. Now, if 100 people play your game, not ALL of them will be online at once of course, but lets say out of the 100, there are 16 online, which fills up your server. Your server costs $20 a month lets say, now say those 100 people buy $20 worth of in game things, which means your server has just paid for its self… AWESOME! Now lets say you get another 100 people playing, so you have 200 people playing your game… exciting huh?!

Well now… you need 2 servers, because you have double the people, so now you will be paying $40 a month for 2 servers.
Oh shit… what do you know, this month those 200 people only bought $10 worth of things, now you lose $30!

Point being your playerbase can grow a ton, and you have to keep supporting all those players, even if they aren’t buying anything in game. So just make sure it’s a viable solution before hosting your own servers.

Yeah, indeed I did make some calculations and those weren’t very motivating actually… What I’m really missing though is some real data from similar games with in-game currency and revenue. I know even if the games are similar it’s hard to predict the outcome, but I’m wondering about the percentage of paying gamers. Is it more like 5%, 1% or 0.1% ? That of course again depends on what you sell and how you sell it, and so on…

It’s probably a big experiment after all.

But yes, for unlimited growth of the player base, probably the only viable solution will be to let the players host themselves. I’m thinking about a system, where we still host the lobby server were the players can connect and then detect which player would best fit for being the host and if none, we could still host the game on one of our servers. So that would allow everyone to play and would save us the precious resources.

I can’t really answer the first part of the question as I don’t have the analytics to provide you that info.

Anyways, the second part of your reply seems like a good idea, it’s more work for sure and still will be costly but I think it’s a great inbetween option. Also, don’t forget about host migration, it’s literally the biggest downfall of player hosted servers in a competitive setting.

Best of luck to you :slight_smile:

[quote=“Soulfoam,post:7,topic:54984”]
No worries.

[quote=“Soulfoam,post:7,topic:54984”]
Yeah, thanks for pointing that out. We actually thought about that already a little. Will be interesting to implement that :wink: I already see hours of time passing by in the blink of an eye :wink:

[quote=“Soulfoam,post:7,topic:54984”]
Same to you! :slight_smile:

Remember once everyone is connected to each other through 1 person, you should check every other player to see if they are able to host a server as well. Make a list on the servers client, of everyone who is able to host a server. Then from there, check their connections to see who would be the best 2nd host, best 3rd host, etc etc. After you get that list gathered, send all the info needed (just IP and Port really) to every client.

The reason I’m saying to do this is because if the player who is the server happens to rage quit and closes via Task Manager, or just shuts their computer off, or disconnects their ethernet cord, your host migration code will never run, so everyone will just drop the game. So in this case, you now have that list on every client, and each client can attempt to connect to the 2nd best host or 3rd best etc etc and the game can continue on even if the original host migration fails. This way it’ll be a lot harder for a game to actually drop and fail completely.

Hope that helps a little bit with host migration since you haven’t looked into a lot.

Edit: Just ran across a related article on the analytics I was unable to provide in previous posts: http://www.gamasutra.com/blogs/AlexanderZacherl/20150528/244532/The_Buying_Habits_of_Hardcore_PvP_Gamers.php

That’s a good idea, thanks! And also thank you for sharing that link!