Archived

This topic is now archived and is closed to further replies.

Arowin

Pathing problems and tile types

Recommended Posts

Arowin    122
Hi, OK, I''ll get to the point, heres my probelm. We''ve created an isometric engine that works on tiles and can display maps Baldurs gate style (ie, full maps, not just layed out tiles) We have thought of using hexes for the characters to move on and have developed a pathing algorithm to fit this. Heres my problem: Is there any way to allow smooth movement (No wobbly up/down when walking left/right) of characters when they are walking from point A to point B with hexes as a base or can you have it based on something other than hexes (ie pixels) where a completely smooth path can be found. Thanks in advance, I hope I''ve made my post clear enough

Share this post


Link to post
Share on other sites
Ironside    122
yeah, try to think of the problem differently, instead of making some huge array to hold all the possible locations where a player or monster could stand. Just add an x,y coordnate to all the classes that represent objects in the game that will move around. These coordinates should be global, by that i mean they should be in relation to the world map.

For example the bottom left corner of the map would be 0,0 and the top right would be whatever the hight of your map is in pixels... or maby height in pixels/2

then you can place your creaters, players on the map within two pixles of any location on the map.

as far as storing these objects, create a linked list of all the objects that can move, when you update your games state,traverse the list, find the objects that are on the screen, convert their world coordinates to screen coordinates and your ready to go.

Share this post


Link to post
Share on other sites
ghytoo    122
Hi, I agree to IronSide''s suggestion, you should allow your characters to stand anywhere on the map and not only on the center of the tiles. Also, you may want to use the "path smoothing algorithm" which is described in this article

http://www.gamasutra.com/features/20010314/pinter_01.htm

This algorithm eliminates unnecessary waypoints in your path, thus elimitating the need for "zig-zagging".

Share this post


Link to post
Share on other sites