   Staggered Maps
  I like the fact that staggered maps are rectangular. From what I grasp moving south or north will cause a sprite to move in a zig-zag pattern visually on the screen? Am I missing something!?To move in a straight line I need the sprite to "skip" a row. This causes many problems:1) My pathfinder doesn't find paths by skipping rows2) On the screen two characters can appear right next to each other, while they in reality are one row apart. This causes problems when calculating things like battle.3) My engine switches from an "top-to-bottom" to "isometric" view and it doesn't make sense that a character is skipping rows in the "top-to-bottom" view when moving about.[edited by - spyder on February 5, 2004 5:40:41 AM]
  I''m also using staggered maps but I haven''t begun pathfinding yet. When you say that sprites will zig-zag when going north, won''t you have the same problem with a "normal" diamond shaped isometric map?Maybe you could move the sprite in pixel units and optimise the path if it is just straight line. like:x-x-x-x \  x / x-x-x-xwould become:x-----x | | | x-----xMaybe it''s hard to do... I''m not into pathfinding just yet, as I said ;  The map data looks like this:147258369And is displayed like this:147_258369If your character is standing on 1. And plans to move two steps south to 3. It should move from 1 to 2 to 3.This makes a zig-zag pattern on the screen.For it to move in a straight line it should move from 1 to 3, which doesn't make sense at all whenviewing the map from above. [edited by - spyder on February 5, 2004 3:58:23 AM];quote:won't you have the same problem with a "normal" diamond shaped isometric map?No it works perfectly with a dimaond map. The problem with staggered is that every other horizontal row is shifted a little east or west. I think I may have misunderstood something as many games use staggered maps with success. I don't know if this implies that they have weird hardcoded if-then statements, enabling you to reach another character albeit an entire row sets you apart. [edited by - spyder on February 5, 2004 4:04:18 AM];quote:Original post by Spyder   No it works perfectly with a dimaond map.ah, yeah I know the conversion will work fine. I was refering to the zig-zag movement   on an diamond-shaped map. You get that with those also... wasn't talking about the conversion or unit location =) For the units location problem I would have solved it with a couple of if-statments... Just check the neighbouring tiles surrounding the tile you want to check. You might need to have two sets of if-statements depending on if the player is on an even or uneven row of tiles.   [edited by - Herr_O on February 5, 2004 7:17:46 AM];  I''m glad I''m not the only one doing staggered maps =) I like those much better hehe ;  Ok, but can I use staggered view in a game that also supports top-to-bottom view? Probably not, the movement in the staggered map seems illogical when looking down from the top?All logic is in the server. I understand that staggered is great for a standalone client, but having wierd hardcoded methods for on the server to support an interface seems like a bad idea. Or am I mistaken? ;  The only easy way I see on using both a top-down view and a staggered iso-view is to make the top-down view staggered also. Just treating them the same. The top-down view has a more steep camera tilt (90 degrees, straight up). But that''s a whole new design for the top-down view... ;  Doesn''t it bother you that the staggered map data is "wrong"? The client can display the server data any way it wants, but its bad to have the server storing and moving unit locations all wrong? ;  Staggered maps aren''t "wrong" per se, they are just differently formatted than rectangular maps.  if you want an isometric map that can use the same layout as a rectangular map, then use a diamond map and continue to use the same algorithms as you use for your rectangular maps.  or, if you like the staggered map, use different algorithms with them.  last weekend, i posted the following equations for converting between diamond and staggered coordinates:DiamondX=(StaggeredY>>1)+StaggeredY&1+StaggeredX;DiamondY=(StaggeredY>>1)-StaggeredX;StaggeredX=(DiamondX-DiamondY)>>1;StaggeredY=(DiamondX+DiamondY);when in staggered mode, convert to diamond coordinates to do your pathfinding calculations, and after you have decided on a new location to go to, convert back. 