A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: [Show] Pathfinding

  1. #1
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167

    [Show] Pathfinding

    Hi everyone,

    For once I have something to show. It's not much, and it's probably just a so what? type of show and tell, but I'm proud of it! So right, as some of you know, I'm making a tactics type game with some friends and have posted numerous questions here about it, specifically regarding pathfinding.

    Well, with over a month of research, questions, and near quitting ... I've finally managed to do it! Just want to thank Flashkit/Kirupa for the help, thanks guys.


    Move Examples


    So whats next for me? Well, I'm going to animate a sprite along the given path, so it actually looks acceptable. But the more important part is designing a battle engine, and an AI calculation system. Thankfully, I have some help from some friends who are good at math (because I'm definitely not, haha).

    Thanks everyone!
    Last edited by Osteel; 04-09-2010 at 08:29 PM.

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    You have an issue with your mouse-tile selection. Seems to me that the calculation you use has a tileW/tileH set too large to the given sprite.

    Tony has a good tutorial on locating the tile under the mouse for tiles of any given size:

    Tile Based Games - Tutorial 18 - Iso Mouse
    Code:
    var ymouse=((2*game.clip._ymouse-game.clip._xmouse)/2);
    var xmouse=(game.clip._xmouse+ymouse);
    game.ymouse=Math.round(ymouse/game.tileW);
    game.xmouse=Math.round(xmouse/game.tileW)-1;
    Other than that, it seems to work just fine. Good job!
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  3. #3
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Thanks!

    Yeah, I actually posted about the issue before and it was suggested that it was due to the bounding boxes around the imported images. A fix was to mask the tile, which ... I have yet to do. Maybe I should do that first before implementing animation. Either way, I'll look at the article and if if it'll be more efficient to do instead, thanks for supplying it.


  4. #4
    President PhobiK's Avatar
    Join Date
    Jan 2005
    Location
    Guatemala
    Posts
    918
    Works pretty good, congrats!
    This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.

    This is my Blog!... The gaming Process
    Please check out my site: Giddel Creations

  5. #5

  6. #6
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    There was this one on GotoAndPlay that looks pretty fast. I remember this one posted or linked on this forum by Mike of Electrotank but I can't remember if/where there was a source for it but it was very fast.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  7. #7
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    I like it! Well done!

    Fix that selection issue that you already know about and it will be pretty slick. Then you need to add a game, heh, but that is the fun stuff.

  8. #8
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Haha thanks Alluvian.

    Yeah, the selection problem will be fixed. This thing is for a game project I'm doing with a few other people. So hopefully I'll be able to show something new and updated soon ... but we're currently working on a battle system (hate), so it might not be anything too spectacular as show and tell.

  9. #9
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    Good luck for sure, having other people on the project might help in the same way going to the gym with someone else can supply motivation and cheerleading, heh.

    My two sides of my personality are always at odds with themselves.
    <Me1:> Tiles are a crutch of the physical boardgame world! You don't / shouldn't use them in a video game! Use pure linear distance instead and have actions simply shorten the length of the string!
    <Me2:> But people LIKE tiles and grids. They are used to that mechanic!
    <Me3:>What about hexes?
    <Me1: & Me2:> SHUTUP!

    So here I am staring at 2.5 design doc fragments, heh. I think Me2 will win... but I really like Me1's ideas!

  10. #10
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Tiles are the way to go I think, although I'm the last person who can give any professional opinion. Personally, I just like how they just line up perfectly, and they're so dynamic. Do something with one, and you can use it across your entire grid.


    As for working with people, you would think that it's a motivating boost ... but it really isn't. It's hard to have people who are doing things other than programming (art, concept designer, premise) have the same vision for the end product as you the programmer.

    I've already booted two people who were at first really excited about working on it, but have yet to actually do something. Regardless of friendship, I take my project seriously. But yeah, personally, motivation is probably one of the biggest hurdles that I have to overcome ... for both me and team members.

    But I'm trekking it!

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