A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [Help] Pathfinder for isometric tiled game engine

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    2

    [Help] Pathfinder for isometric tiled game engine

    Hi, I am currently making an isometric tiled game based on the mmorpg Dofus in AS2. My grid creator algorithm is done and work well. Now I'm trying to create a pathfinder for it, but this type of grid has an unusual order (see the second picture).
    Normal Grid:

    My isometric grid:


    I already worked with a pathfinder with normal tiled grid using pre-made code. I have attempted to create one for my grid type but it was a failure. I also tried to adapt an existing pathfinder code to my grid but I failed to make it work.

    please help!

    Edited: now pictures works!
    Last edited by polymaker; 01-06-2011 at 12:12 AM.

  2. #2
    Junior Member
    Join Date
    Jan 2011
    Posts
    2
    sorry, in my first post the pictures dont show and i'm not able to make them work .
    here are the pictures links :
    first
    second

  3. #3
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    The way I see it, you have two options: Define the nodes to which each node is linked, seperate your data structure from it's presentation. The latter is a good design principle btw.

    Define links
    When you create a node, you can give it a Array with it's neighbors (after they've been created ofcourse). This works for any kind of graph, but if you're using a square grid, you'd be better off basing the neighbors by using x and y coordinates.

    Seperate data from presentation
    Like you show in your first picture, an isometric grid is still a 2D grid. So you can have a 2D array or whatnot to store your tiles in, but when you render them onscreen they're isometric. You just have to calculate what x and y positions the representations should have based on the coordinate of the grid cell it represents.

    I get from the second picture, that you'd like a grid with jagged edges. This can still be achieved with a square grid, by using a null tiletype. Just as you define a grass,rock or sand tiletype, you can define a null tiletype, which in game terms means that there is nothing there. You can't step on it, it has no properties etc.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center