3 Replies - 3227 Views - Last Post: 07 April 2012 - 04:22 PM Rate Topic: -----

#1 Nekroze   User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 170
  • Joined: 08-May 11

How do 3d game servers work?

Posted 06 April 2012 - 09:53 PM

I haven't done a whole lot of 3d development, i am still learning but i am looking at making a test game that has a client for player input and and authoritative server for most all of the game details.

My problem is that i am confused as to how a server can deal with all the positioning and collisions without loading the entire game world(/zone/level) into memory (well where people are) like the client would in parts and dealing with position and collision using the 3d engine just not actually rendering it i guess.

That seems horribly inefficient so how do you do it. Is there some way to simulate the 3d environment in a simpler way? if so then how do you deal with collision detection and other stuff that having a loaded 3d environment could deal with easily?

I guess i am just confused on the implementation of the servers ability to provide a 3d environment that can check if the action a player is taking is physically possible or not cheating etc.

For instance a game like EVE online may have one server for each solar system, each solar system is broken up into smaller chunks to make dealing with them easier but how can it detect when one ship flys into another object in space and thus bounces off without loading that chunk as a 3d environment along with all of the object inside it to test collision against just like a single player game would.

Not the best example, rather simple, but there it is.

Any explanation on how proper games deal with this would be much appreciated, thank you.

This post has been edited by Nekroze: 06 April 2012 - 10:19 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How do 3d game servers work?

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14576
  • View blog
  • Posts: 58,439
  • Joined: 12-June 08

Re: How do 3d game servers work?

Posted 07 April 2012 - 08:31 AM

Just a heads up - this article specifically deals with how Eve runs their machines.. granted its a few years old but still good info.

http://massively.joy...s-server-model/
Was This Post Helpful? 0
  • +
  • -

#3 anonymous26   User is offline

  • D.I.C Lover

Reputation: 2
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: How do 3d game servers work?

Posted 07 April 2012 - 03:30 PM

View PostNekroze, on 07 April 2012 - 05:53 AM, said:

I haven't done a whole lot of 3d development, i am still learning but i am looking at making a test game that has a client for player input and and authoritative server for most all of the game details.

My problem is that i am confused as to how a server can deal with all the positioning and collisions without loading the entire game world(/zone/level) into memory (well where people are) like the client would in parts and dealing with position and collision using the 3d engine just not actually rendering it i guess.

What really takes up the memory and expensive processing would be to manage the meshes that make up the models in the game world, their rigging, textures and post-processing effects. It isn't the server's responsibility to do this.

View PostNekroze, on 07 April 2012 - 05:53 AM, said:

That seems horribly inefficient so how do you do it. Is there some way to simulate the 3d environment in a simpler way? if so then how do you deal with collision detection and other stuff that having a loaded 3d environment could deal with easily?

The way that is works is that the client side deals with the rendering of the game for the user, as well as the variety of game states by observing the following game loop:

1. Receive current game state over the network from the server.
2. Update the game state based on user, bot and static object interactions (like boxes, crates, etc.)
3. Send this current state to the server for broadcasting to other clients.

It is important to note that things like physics will be locally simulated client-side, and that each client may not be observing the identical animation - for instance, my character when starting to walk may put their left foot forward first, but other client observers may see the left foot put forward first in some instances. They only need to be aware of the state that you have started walking with the fine detail of which foot being put forward first being irrelevant.

View PostNekroze, on 07 April 2012 - 05:53 AM, said:

I guess i am just confused on the implementation of the servers ability to provide a 3d environment that can check if the action a player is taking is physically possible or not cheating etc.

For instance a game like EVE online may have one server for each solar system, each solar system is broken up into smaller chunks to make dealing with them easier but how can it detect when one ship flys into another object in space and thus bounces off without loading that chunk as a 3d environment along with all of the object inside it to test collision against just like a single player game would.

Not the best example, rather simple, but there it is.

Any explanation on how proper games deal with this would be much appreciated, thank you.

Kind of what I have already explained. The server(s) allow the client to download the map as data and render the environment locally, then all client interactions in that world during gameplay are transmitted over the network.
Was This Post Helpful? 0
  • +
  • -

#4 Nekroze   User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 170
  • Joined: 08-May 11

Re: How do 3d game servers work?

Posted 07 April 2012 - 04:22 PM

modi123_1: thanks i will give that a read.

ButchDean:
Sorry if i am confusing the situation, i don't mean to be rendering anything on the server i mean doesn't the server need some simplified 3d environment and by that i mean JUST the hit/collision boxes of all objects and players on a map that get moved around.

For a better example, a game where fly round in space:
Player moves his mouse and presses W this sends a new "baring" or angle to the server and the fact the player is accelerating, so the server looks up that players speed stat and sets its velocity to that so each time the server ticks to update its game state the player moves on the current baring at the velocity they should be and then their position after that tick is sent to all players. This way if a player is facing another wall or another player and try to move forwards the server can detect that the two player/object hitboxes collide and thus they are not moved forwards because that would be like walking through walls. Doesn't the server have to do this, as far as i can see the alternative is to have the client detect when he is hitting a wall or the client actually sends back their position to the server rather then just saying a direction to move in but to me this would be a problem because the player could then easily have speed or wall hacks right? so the server has to make sure that they are able to move that fast or in the direction, how else can the server do that then have a simplified hitbox only 3d environment that gets updated by client input and then each server tick when all players movements are done for that tick, the server sends out its positional data based on the simple environment it has.

Another client server example, players kick a ball to each other:
The ball has a direction and a velocity and each server tick it moves on that trajectory sending the balls hitbox data to each player each tick so that the client can render the ball inside that hitbox. A player clicks to kick, sending the kick command to the server. Then the server checks if the player is facing the ball and then if the ball is in range, if it is then set its direction and velocity to the appropriate values for the kick giving the ball a new baring to send to all players as its position is calculated each server tick.

I don't see how it could work another way, once more if we have the client detecting if the kick connected and then sending the new trajectory to the server then you get people who can kick the ball from across the map at impossible speeds etc.

So then if that's what needs to be done, a simplified 3d environment that is just the hitboxes of each map object (including the floor and walls etc) so that when a player says they want to move one way the server can see if they should be able to move that way. Then how can you accomplish that? Would you use a 3d library and just give it the hitboxes and work that out in some way? or would you simulate the 3d library some how and have like some kind of 3d array that contains all the map coordinates that each object can be in or something, i just don't get that part that if this is how i make it work how can i do that.

See i can understand this for 2d games fine as I've done a bunch of them and its not hard to have the same 2d map array on the server and players say what direction the want to move in the server can check if the tile in that direction is able to be stood on, then sets the player to there and then sends the position to all players, its the 3d part especially in an actual 3d space (like space) or when you need to calculate the physics or trajectory of things on the server like the game ball or a bullet or something so that the players cannot tamper with it, that confuses me.

Thanks for the responses so far guys they have been great!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1