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

Peer to Peer Online Game

12 posts in this topic

I was thinking about making a game that uses peer to peer networking. There would be no PvP or trading to minimize the effects of cheating for players that don't want to cheat. I would have a built in system to cheat if a player wanted to. Each player would be responsible for all data relating to them. Stats, hp, items, etc.

 

NPC spawning and such would be deterministic and should behave the same on all systems, unless a user fiddled with the NPC system, which I no doubt some people would. Not sure what I'd do in that case. Maybe just check to see if the player is in range of certain npcs to apply damage and things to npcs on other users systems.

 

Making a central server to handle NPCs kinda defeats the purpose of a peer to peer system.

 

What do you think? Could it work?

 

 

0

Share this post


Link to post
Share on other sites

Are you intending for an online RPG play style? Kind of like Phantasy Star Online? Or do you want a single, shared, persistent world instance?

 

There's been a lot of research in this area. The VAST library/project is one that might be interesting if you're going to try for a large, shared world.

 

For smaller game instances, you could just have a player "host" and other players "join," and support host migration if the first player stops; that would let NPC spawning be controlled by the host to allow for better gameplay -- being 100% deterministic in spawning (without involving player decisions) is actually really hard; what if some players are fighting a mob when it's supposed to also re-spawn?

 

The other question in P2P is how the players will find each other on the network. I start the game, and want to play with some friends -- how do I get in contact with them?

0

Share this post


Link to post
Share on other sites

I was thinking that it might not be that bad if npc simulation is not 100% the same on every system. Some players might get some extra loot or something for killing a mob that's not there on everyone's system.

 

I have an idea where player systems could spawn mobs but on remote systems a single player could only have a few mobs by them spawned at a time. I was also thinking players could ignore mob spawns from remote systems if they wanted to, or maybe set friend ip's that they want to accept spawns from.

 

 

I'm thinking the player count could get pretty big. I might have a website where players could post thier ip's to get connected to other players, but once they have those ip's, everytime the game is run it would check to see if it can connect to them. Players that are connected to each other would share ip's.

0

Share this post


Link to post
Share on other sites

Some players might get some extra loot or something for killing a mob that's not there on everyone's system.


So what happens when a player tells another player "can you help me with Fippy Darkpaw" and the other player doesn't see that monster?

What kind of gameplay do you need? Why do you need multiple players to talk to each other?

If your website is always online, you could automate the registration of currently-online player instances. Have the game post a message to the website when it starts, and another call to the website to get the list of IPs. Note that you'd have to either set up NAT traversal/introduction, or every player would have to set up port forwarding for this to work, though. Edited by hplus0603
0

Share this post


Link to post
Share on other sites

Well it would be for multiplayer PvE. I guess I might have to have a player or server responsible for spawning monsters, and despawning them/getting killed. I just don't want to have to send position updates for all monsters to a lot of players from one machine, so I'd have to come up with a deterministic movement simulation.

0

Share this post


Link to post
Share on other sites

I just don't want to have to send position updates for all monsters to a lot of players from one machine, so I'd have to come up with a deterministic movement simulation.


What problem are you actually trying to solve?

I e, can you provide X here? "Right now, PvE multiplayer games suffer because X."
And can you provide Y here? "My solution solves X by doing Y."
1

Share this post


Link to post
Share on other sites

The problem is not being able to support large amounts of monsters/players in an area at a time while keeping server bandwidth low. Peer to Peer is a solution for that.

0

Share this post


Link to post
Share on other sites

The problem is not being able to support large amounts of monsters/players in an area at a time while keeping server bandwidth low.


Is that a problem anyone actually has?
Why does server bandwidth matter?
Is this a problem *you* have?

Peer to Peer is a solution for that.


That's yet to be shown, and there's some evidence to the contrary. Specifically, peer-to-peer grows as N-squared per client, whereas client/server grows as N per client, and N-squared only on the server.
0

Share this post


Link to post
Share on other sites

What is your solution for handling large amounts of active entities in an area for client/server? Suppose there are 100+ players and 100+ mobs in an area in an action game, what would you do to keep server bandwidth low as possible? And what would be your projected server bandwidth, for only movement? 

 

 

Peer to Peer may grow more in total data transfer per new user but it only grows by N for data that has to be handled for a single user. One more user to send/recieve from.

Edited by Butabee
0

Share this post


Link to post
Share on other sites

what would you do to keep server bandwidth low as possible? And what would be your projected server bandwidth, for only movement?


First, why are you so worried about low server bandwidth cost? Once your game is of any reasonable size, you'll be paying $2 per megabit per second per month inside some co-location facility if you want cheap bandwidth, or $8 per megabit per second if you want fancier bandwidth. That's something like $0.0008 per gigabyte of data.

Second, the actual numbers: If this is a RPG, you'd do interest management, where perhaps 10 players and 10 mobs would be of high interest, and sent perhaps 2 times per second, and 90 mobs and 90 players would be of low interest, and sent perhaps once per 5 seconds. (This is based on WoW-style RPG play mechanics.) Let's say that id + position + velocity + target + facing is about 12 bytes per entity. So, this is 10*12*2+90*12*1/5 == 792 bytes per second per player. 79 kB/s for 100 players. Not something I'd worry about on the server side.

Let's consider a MMOFPS, where you'd need your high-interest entities at 20 pps and your low-interest at 5 pps; you'd get 10*12*20+90*12*5 or about 7.8 kB/s. 100 players make that 780 kB/s -- you're at about ten megabits per second at that point.

Now, count packet overhead. In P2P, each player sends data to each other player, so each player sends at least 198 packets per second in the P2P case, and receives 198 packets, for RPG, and sends/receives 1998 packets per second in the FPS case. This is a rather high packet rate, that many residential firewalls/routers won't even be able to sustain. Then each packet has overhead -- let's count 32 bytes for framing and IP/UDP headers; that's 64 kB extra in packet overhead per player in P2P. That's almost as much as the entire payload data stream for the server to send data to all players!

Even a super-expensive bandwidth provider like Amazon EC2 charges less than $0.10 per GB per month (which translates to about four hours of payload for the hypothetical worst-case FPS gameplay session above.)

Peer-to-peer: Okay for distributed bulk file sharing; usually not the right answer for game networking.
0

Share this post


Link to post
Share on other sites

I wasn't considering packets per second. I was only looking at the bit rate. I guess peer to peer won't work for any large scale miltiplayer action game.

0

Share this post


Link to post
Share on other sites

There are all sorts of problems with using peer to peer for this kind of thing.  A server that is aware of all the state can optimize all kinds of stuff that you cannot do with p2p.  For instance what if you only want information on objects within a certain radius?  A server that knows where everyone is at can just send you what you want, p2p wouldn't be able to do that.  And then you get into who do you sync against and how, and all sorts of other problems that are fairly straight forward with a server, but really hard with p2p.

 

The problem with just comparing a simple theory of which method is more bandwidth efficient completely ignores the fact that one of the methods simply doesn't require sending as much data to solve the same problem.

 

The wall you always hit with games like this is client bandwidth (and to some extent latency they go hand in hand).  Every other problem is basically solved, but you hit the bandwidth/latency wall so fast that you never even get a chance to see how far you could push everything else.  Using p2p just means you will hit that wall much faster.

 

I'm not saying it wouldn't be fun to play around with, but I just don't see how you could ever overcome some of the obstacles there, or even if you did how it would be better then server authoritative.  It's one of those things that sounds cool but in practice just doesn't work well.

0

Share this post


Link to post
Share on other sites

The wall you always hit with games like this is client bandwidth


Actually, in my experience, the wall you hit with "massive" online games (and even not-so-massive ones) is all the content you have to build. You could have a working engine and networking setup handed to you on a platter, and building a game is still a significant challenge!
0

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