+ Reply to Thread
Results 1 to 6 of 6

Thread: 2D Pathing Tool

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Default 2D Pathing Tool

    Hi all,

    Is there a tool for creating paths for a 2d game sprite to follow? That is, say I have side-scroller and want sprites to swoop in from the top and bottom and follow a specific path on the screen. Is there a generic tool to create/edit paths like that?

    I know there are generic tools for things like 2d tilemaps/map editors, but I'm looking for one to create paths. Surely a generic version exists somewhere.

    To be clear, I'm not asking for code to traverse a path (I have that already). I'm looking for a GUI editor that I can use to make them (as opposed to editing raw numbers, guessing, and trial and error).

    Thanks!

  2. #2
    Senior Member
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    258

    Default

    Are you using a custom or standard map editor of some sort? If you can use that to place some sort of "dummy" objects as waypoints or something and just handle those appropriately in your loader, that might be an easy way out...

    Another approach is to implement a quick reload/test feature in the game, and store paths and the like in text files, scripts or something that you can tweak easily with standard tools. (That's how I've been doing all the sound and music for Kobo II so far. It's all scripted realtime synthesis.)

    In many cases, the time scale of the tweak/test feedback loop is more important than the actual user interface. If you can see/hear the results (almost) instantly, it may not matter much if you're dragging handles with the mouse or tweaking numbers in a text editor.
    David Olofson - Free/Open Source developer and aspiring indie game developer
    Olofson Arcade
    http://olofson.net

  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Default

    Quote Originally Posted by Olofson View Post
    Are you using a custom or standard map editor of some sort? If you can use that to place some sort of "dummy" objects as waypoints or something and just handle those appropriately in your loader, that might be an easy way out...

    Another approach is to implement a quick reload/test feature in the game, and store paths and the like in text files, scripts or something that you can tweak easily with standard tools. (That's how I've been doing all the sound and music for Kobo II so far. It's all scripted realtime synthesis.)

    In many cases, the time scale of the tweak/test feedback loop is more important than the actual user interface. If you can see/hear the results (almost) instantly, it may not matter much if you're dragging handles with the mouse or tweaking numbers in a text editor.
    Hmm, both are good thoughts! I hadn't considered that the feedback loop is probably going to be super important once the general gist of the path is in place. It sounds like I should spend time making a super-primitive path "editor" of some kind (probably via dummy objects in my map editor, as you suggested) and then focus on how to rapidly refine it during play testing.

    Thanks for the insight.

  4. #4
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Default

    For anyone who may be interested in the future: I'm currently using the IceCream framework for the bulk of my game. For pathing, I found Gleed 2D https://github.com/SteveDunn/Gleed2D/wiki. From the wiki:

    Gleed 2D (Generic Level Editor 2D) is a general purpose, non tile-based Level Editor for 2D games of any genre that allows arbitrary placement of textures and other items in 2D space. [...]

    Levels are saved in XML format. Custom Properties can be added to the items in order to represent game-specific data/events/associations between items etc.

    Gleed 2D is free software and is written in C# and XNA Game Studio 4.0. You need the XNA Framework Redistributable 4.0 (download from Microsoft) and the Microsoft .Net Framework 4.0 to run it.
    It doesn't try to do any rendering in your game. It just provides an editor and libraries to load the data in your game--what you do with the loaded data is up to you. So I'm using IceCream for the bulk of my engine, but then loading a saved Gleed 2D file and loading all my path data from it. So far it's working out really well!

    For anyone looking for a general 2d editor without an attached engine, but pre-built libraries to load the editor data, this is a great option.

    Thanks for helping point me in that direction, Olofson.

  5. #5
    Senior Member
    Join Date
    Jul 2004
    Posts
    799

    Default

    Hey TylerF, I'm looking for a good pathing solution for an arbitrary world (i.e. not grid squares, but rather, blocking lines). Would you be willing to share your path code?

  6. #6
    Junior Member
    Join Date
    Apr 2011
    Posts
    5

    Default

    Quote Originally Posted by Raptisoft View Post
    Hey TylerF, I'm looking for a good pathing solution for an arbitrary world (i.e. not grid squares, but rather, blocking lines). Would you be willing to share your path code?
    Sure. It's actually code I found elsewhere. The caveat is that I'm not using any intelligent path-finding for my game. I just want it to follow a pre-defined path and assume it's not going to pass through a wall or something. So, no AI, just following a path of coordinates. I'm not sure if that's helpful for you or not.

    I integrated both the code found on this blog post http://alwayschillin.net/blog/2008/0...follow-a-path/ and SharpSteer http://sharpsteer.codeplex.com/ in my game to see what worked best. Right now I'm using the former because the implementation is much simpler, and simple works in the context of my game.

    Good luck!

+ Reply to 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