Jump to content

  • Log In with Google      Sign In   
  • Create Account

2d RPG game - grid/coordinate movement VS per-pixel movement


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 santod   Members   -  Reputation: 100

Like
0Likes
Like

Posted 18 February 2010 - 06:44 AM

Hi guys, For couple of weeks now, I've been writing small online RPG game in C#. I decided to implement 'grid' based movement - where map has i.e. 100x100 tiles, and player can move diagonally between neighbouring cells. I'm using pathfinder for NPC movement, and few other algorithms to let them wonder around more naturally. But now, when I'm working on my networking module, I'm stuck with one big issue: is grid-based-movent really a good idea? The problem is, when I want to move player on the neighbouring cell, I am checking, if cell is free: if (this.Map.Tiles.IsWalkable(Direction.Up)) { } When method returns false - it means tile is already occupied by other player/npc. BUT when I use this method I must ensure local grid is updated as frequently as possible to avoid synchronization issues... My questions are: 1. How do you normally cope with 2D movement where you need to respect blocks created by other players. 2. How should I deal with packet round trip time? In theory, I should use dead reckoning and move character up as soon as player presses UP arrow, but what if my method returns false, what do I do then? I can't gradually push player to another position, as he would end up in completely different place, on different coordinate. 3. Using grid system I must update position of every element EVERY time when it changes its coordinate. Isn't that bit of the overkill? Compare to per-pixel, where all I need to know is ending point of current 'walk' and few checkpoints on the path. I would appreciate your help, santod

Sponsor:

#2 badjim   Members   -  Reputation: 100

Like
0Likes
Like

Posted 19 February 2010 - 09:43 AM

"In theory, I should use dead reckoning and move character up as soon as player presses UP arrow"

Save that for Quake. In most RPGs a 1/4 second delay between clicking and getting a response is acceptable. Make that concession and your synchronization problems are gone.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS