Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So my question isn't about what technology to use or how to do this or that, but a more general question.

I'm currently developing a action third person shooter. With elements of RPG - weapon,armor upgrades and items.

Players will be able to create new games or join old ones. So my question is how to create the game server that players will play in. I have two ideas on my mind.

  1. The player who made the game is the server. All data passes trough him and he send this data to the server updating the database of the players with their XP points kills/deaths score and other.
  2. Or my host machine is the server, the player who made the game just will open new instance on my host and will be like client. And all players send their input data to the host, the host updates the game and send response back to client for any new changes like where is the enemy and other.

And if i choose option 1 is there a chance the host to change the game content and manipulate the game results? (I think there is but i'm not sure)

And if i choose option 2 isn't that raising the response time and potentially the game lag?

or maybe there is another option?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

This actually falls to a more complex analysis of your game. In the terms of what needs to be sent across the wire, what needs to be kept on each machine, and what is a system not to be trusted with?

once you answer those questions then you can start to ask the questions of where does the data get held.

In the context of your direct question: a case where the hold machine was the server, and responsible for receiving validating, and updating the other systems is Halo 1 for the PC. This had no checking for connection to that host, and so the host system could be unplugged, and the game would still be going, and then the system would be reconnected, and that system would update the others. To hilarious results of score.

An example of the server simply being a client that started the instance of the game would be more in line with an MMO.

Though this all follows from what you want your data security/validation to act like.

EDIT: it should be mentioned that in some instances letting the player update some of their characters information before validating can still be perfectly fine. For example the player should be able to update their own position (trying to do this all server side can get expensive), but still have it check in with the server every X seconds.

To avoid similar to Halo 1 for PC have the connection tested every X seconds. in terms of expense pinging every 20 seconds is a small price to pay to stop any entity from cheating.

again it is a complex analysis of your game to determine what gets determined where, and if some things are even worth sending.

share|improve this answer
    
I just want to avoid cheating and hacking in order to sustain a good gaming community. Thats what i was trying to ask. The most reliable way of construct a server-client online game. One i have learned from my gaming experience - you cannot trust the user :D –  TreantBG Apr 1 '12 at 8:16
    
10x for the answers. When i advance with my development i will ask again if i need any help :) –  TreantBG Apr 1 '12 at 9:00
    
you really need to design for networking from the beginning. I have heard many a game having to be completely redesigned because networking was put in as an afterthought, and that was after having a stable single player. –  gardian06 Apr 1 '12 at 9:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.