A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Non-tiled based Mouse click Path finding for Adventure games

  1. #1
    Junior Member
    Join Date
    Sep 2017
    Posts
    14

    Non-tiled based Mouse click Path finding for Adventure games

    I've been racking my brain (which isn't helping much.. I keep feeling like i'm almost at someplace but then failing) trying to sort out a basic pathfinding system for a non-tile based Adventure game system. The ol' point and click.

    I've tried a few systems I could find and tried converting code into a usable form and kept rolling blanks.

    What I got right now is this, the playing 'walkable' field is defined as a square. Inside that, I have created 4 points making another square. this draws as a solid square (Block). the player starts at one place (top left) and when you click on someplace in the playing field, a point is created at that mouse position. The code then draws a straight between the two points and then checks with the points on the block to see if the line created from current position to target position intersects with any of the lines of the block (sides). If I does, it creates a new point at that intersection line and tells it to move to the next point around the block and then uses that as a new starting point to create another line to the target, and so on, until it can get to the target. It's not the most efficient way, and I want to find a method to speed it up (like it would make more logical sense to walk directly to the corner point instead of walking to the intersection point and then along to the corner) but i'm more keen on getting it working first.

    anyway, it kinda works, though problems with it like it has to take a longer route (can't loop backwards through an array of points) also, adding a second block throws it out of the window as it'll keep looping around the first block trying to find a way to walk around that and around the second to get to a target.. there is also a big problem with corners and such like intersection.. I'm willing to upload a copy of my source code if wanted..

    anyway.. Does anyone know a good system or have a link to a good guide or something on a decent pathfinding for mouse click movements? I did wondered about trying to adapt a tile based system but it didn't work out well.. also wondered about node points spread out around the maps so it finds the closest node point and just plans a path to that, and from that to the clicked location but it doesn't seam that good a system to me..

    thanks.

  2. #2
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    This is the tile based path finding game I have been working on this forum for a few years 3k by 3k tiles on the map, can be endless.

    this is about 8 years of development, I released the script but I am working on a more clean way for users to download the script and use it.

    I don't see why you want non-tile based pathfinding when you can have it tile based and scrollable but take a look if parts of the game engine will work for you.

    Last edited by AS3.0; 06-26-2019 at 07:22 PM.

  3. #3
    Junior Member
    Join Date
    Sep 2017
    Posts
    14
    yeah.. Tilebased might be good enough with it then converted over to needed use.. mostly just means some movement might look slightly off but that's no problem.

  4. #4
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    ok well the main version is really tied up and wont run without the server and loads the map much better in small chunks.
    (requires NAS, reserved file system, Ethernet, port forwarding, paypal manager to setup api,paypal webview script injector files decompre$$or server)

    The simple 1 script version I'm going to give you has no multiplayer implemented and loads the map with an initial bloat because of single file decompression, if you want me to explain how to get parts of the script to act how you want I will help.

    game.fla_download_link

    map_file_for_same_directory_download_link

    pm me for it if the link breaks in a few years.
    Last edited by AS3.0; 06-28-2019 at 07:37 PM.

  5. #5
    Junior Member
    Join Date
    Sep 2017
    Posts
    14
    thanks ^_^ I think I got stuff sorted out

  6. #6
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Im posting source builds if you click the link in the description:


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