• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
savail

Which peer is the best to host game for others?

14 posts in this topic

Hey,

I would like to know if there is any way to find out who of the peers in a particular group is the most appropriate among others. So far all of them are connected to external server which now has to make decision about who of them would be best to host game for others. Can external server somehow examine who would be best? I guess RTT only is not enough becouse I still lack information about direction of peers(They can be in the same direction or in the opposite in relation to server's location)

I would be very grateful for help!

0

Share this post


Link to post
Share on other sites
Hmm, maybe you can let all clients measure the RTT to all other clients and send the data to the server. Then the server could use that information to decide which client to choose.

You could choose the client with the smallest RTT sum, or the client with the smallest maximum RTT value, or something more complex, not sure what is best.
0

Share this post


Link to post
Share on other sites

Assuming you must choose the host out of a fixed group of players that will all play the same game (not a big pool of players that needs grouping into games such that everyone has good RTT with their host)

 

You could:

1.Connect all the players together

2.Measure round trip times, possibly bandwidth and other data

3.Use some algorithm to sort everyone based on how good hosts they are. Combine the above RTT etc. data along with player data you have recorded earlier (like how often they disconnect mid game, frequent problems with connection...)

4.Pick the best one

 

For sorting you might want to measure, in order of importance:

-Connectivity - can all players connect to the host

-Bandwidth (can the player handle the required traffic at all)

-RTT (best playing experience for all players. Minimum RTT, minimum variance in RTT)

-Quality of connection (occasional slowdowns, quitting mid game, corrupted/lost packets)

 

So first make sure he can act as a host, then look into the quality of the connection.

1

Share this post


Link to post
Share on other sites

@Wooh: well yeah, that's a solution but it hardly appeals to me becouse it requires a lot of work on both sides of connection (the master server and peers). Maybe there's some algorithm which uses RTT values from each peer to match-making server and could calculate which client would be best regardless of server's  and peers' location?

@Waterlimon: Hmm, that seems like a lot of work to do as well, but I guess it's all necessary? Now I know why I load into some games so long :P.

 

Ok, so I have another question. To measure the RTT between each peer I have to send to each of them their addresses and ports, so Is that fine in the matter of security?

Edited by savail
0

Share this post


Link to post
Share on other sites

If someone is playing a game that allows remote servers, then they are by definition OK with that game going through their firewall to get to those remove game servers. In this case, each remote player peer is a "game server" for the duration of the measurements. If you're not OK with that, then don't use peer-to-peer servers.

0

Share this post


Link to post
Share on other sites

hmm I'm fine with that :P. But if all players know each other's addresses I'm wondering if is there anything I can do (or have to do)  in order to secure players so that no-one will be able to hack into their computers by my game?

0

Share this post


Link to post
Share on other sites


But if all players know each other's addresses I'm wondering if is there anything I can do (or have to do)  in order to secure players so that no-one will be able to hack into their computers by my game?

That is two issues.

 

For the first issue, if you have a peer-to-peer system every machine needs to know the address of the peers.  That is just how networking works.  It must happen if you choose that route.

 

 

For the second issue, that would be possible on ANY network connection if you are careless in your programming.  Most games require a very simple communications protocol. Always validate the input. That is enough to mitigate the problem.

1

Share this post


Link to post
Share on other sites

Thanks for answer. Do you know maybe some popular games which use peer to peer (1 peer hosts game for others)? I'm asking becouse I actually haven't heard about hacking into sombody's computer becouse of knowing its address from peer-to-peer game and wouldn't like my game to be worse :p. I don't know but I think that League of Legends might be peer-to-peer and never heard about hacking into sb's computer using this game... Can that actually happen? Do hackers tend to do such things?;p

0

Share this post


Link to post
Share on other sites

The only way to determine the quality of the connection between two machines is to test it.

 

You can use testing between the matchmaker and a client to eliminate it from consideration (for example, it might not have the bandwidth necessary), but you cannot determine if it will have acceptable connections to all of the other machines from the client/matchmaker interaction.

 

As far as hackers attacking games, I'd recommend that you look here: http://aluigi.altervista.org/poc.htm and here: http://revuln.com/research.htm#casestudies

Edited by Dave Weinstein
0

Share this post


Link to post
Share on other sites

Games that use user-hosted servers will sometimes suffer from flooding, where some sore loser will turn on a network packet flood to bring down the internet connection of the user hosting the game.

 

The only way to somewhat insulate players from other players is to host the servers yourself, and not letting players get information about other players. Of course, players will often trade information through chat on their own, and sometimes they might end up regretting it at some point.

 

The internet is a scary place.

0

Share this post


Link to post
Share on other sites

hmm ok thanks for answers. I've decided to judge which peer is best to host game by 2 values: average RTT and average RTT variance. Does anyone know any algorithm which could help me calculate which peer would be most suitable based on this info?

0

Share this post


Link to post
Share on other sites

The simplest algorithm will work:

 

1) Send packets

2) Receive responses

3) Measure timing

4) Calculate RTT and variance

0

Share this post


Link to post
Share on other sites

yeah, I already measured both of these things and now I thought I could combine them into 1 value and judging by it I could choose the best host, hmm? But how to combine those 2 values into one? Add them? In what ratio, etc? Or maybe that's not a good approach?

0

Share this post


Link to post
Share on other sites

yeah, I already measured both of these things and now I thought I could combine them into 1 value and judging by it I could choose the best host, hmm? But how to combine those 2 values into one? Add them? In what ratio, etc? Or maybe that's not a good approach?

 

There is no "one size fits all" here. Adding them with some kind of weighting factors would probably work okay. If you really worry about jitter, you might weight the standard deviation by a factor 20 compared to the RTT, and choose the smallest value. If you don't worry as much about jitter, you might add standard deviation by a factor of 1.

 

For what it's worth, if the jitter is Gaussian distributed (it may or may not be,) adding one standard deviation gets you to about 65% of the curve; two standard deviations 95%, and three standard deviations to 99.7%, IIRC.

 

And Standard Deviation is the square root of variance, and a better unit to compare to the actual average, because it has the same unitless cardinality as the average -- variance is the square, by contrast.

 

So, to start somewhere, I'd calculate "RTT + 2 * SDEV" and pick the host that has the smallest value.

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0