Jump to content

tile based Mmorpg:relaying player position back to the server

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
atheium

atheium

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 298 posts
im sure its common to a lot of programmers, but one of my dreams is to create a MmoRpg.
i thought of something today, which with my little coding experience might sound completely stupid, but id like some other peoples thoughts and advice on my theory.

the game im interested in creating would use tiles much like old rpgs. however because the game is to be multi player i was thinking about how the client might possibly relay the player position back to the game. perhaps a coordinate system could be used to keep track of the position of the player, and a resulting x,y value could be sent back to the server.

one problem i could see happening is someone altering my client, and sending coordinates letting them teleport across the map.

How much stress would the server be put through if every player was constantly submitting two numerical values?

what is the normal method for communicating player location?
11ism.com <my meaningless empty website, HORAH now with link! (thx gamemaker)

#2
Milyardo

Milyardo

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
Translation across Cartesian coordinates can be done in two ways. The first is with a Ordinal Pair, like in your example with the variables x and y. The second method is with a vector. In the client-server interaction you described above, you could express the act of translating across the game world using either, however in both cases you need to perform checks and validations on the values given to the sever by the client.

When choosing a method you must evaluate the cost of efficiency of each method. With ordinal pairs, your cast is the memory and bandwidth of two numerical values. The server has to take the new position submitted by the player, and perform a check to see if the value is acceptable by calculating a vector between the players original position, and the newly submitted one, and evaluating the magnitude of this vector to see if it is within a acceptable range(ie players may not move than 3 game unit per second, if the vector sum of positions summited within the last 3 seconds are greater than 3 then you reject the change in position).

If the client and server communicate using vectors instead, your cost is the memory and bandwidth of communicate a magnitude and a direction. Your server saves in computational efficiency because it does not have to compute a vector as one is given, and instead just sums the vectors given within a time period.

Thus, it is probably more efficient in this application if your game server, and game content, communicated translations across the game world with vectors instead of ordinal pairs.