Jump to content


Photo

Cheese finder - pathfinding and collision engine


  • Please log in to reply
6 replies to this topic

#1 The eleventh plague of Egypt

The eleventh plague of Egypt

    GMC Member

  • GMC Member
  • 1045 posts
  • Version:Unknown

Posted 02 October 2010 - 02:50 PM

I guess you need something simple yet effective. I think I've got a solid solution to your problems,
wheter you are coding top-down shooters, RPG or a RTS games, this engine can help you moving
your units fast and reliably.

Doesn't matter how big your maps are, or how big your armies are, this thing is designed to SCALE
for all your needs. I've tested labyrinthic maps full of bottlenecks and get it to work smoothly.

I won't lie to you, this thing is pretty advanced, but I've worked to make it as easy to use, but with
a radical design in mind, you are the one in control. You get to know how it works when you design
map, but you can change the most important parameters of your units without a need to understand
all the underlying math. However, if you are curious to know how it works, the code is commented.

Still i suggest watching this video tutorial




Here is a list of features:

Path-finding:
- quick and simple Best First Search algorithm
- incorporated smoothing
- GM-functions free (no mp_grids)
- full GML, no dlls

Path following
- units can avoid each other without smashing into walls
- can handle queues and bottlenecks
- customizable steering options

Collision engine:
- doesn't use sprites (will be easy to port on Enigma)
- can handle really fast units
- "collision_line_width" like functions
- "collision_line_first" like functions can be implemented
- splits the maps into cells to cut down pointless checks

Editor:
- easy to use
- lets you build your own paths
- eliminates the need of having dozens of wall objects

Others:
- supports units of various sizes
- GM save and load won't work, use the custom replacement

To do:
- more tutorials, on demand

Notes:
- units will never give up seeking their way until they can see their destination, can be changed on demand
- if the destination point is too close to a wall, units won't even try to get there, no quick fix

YoYo Games mirror
MediaFire mirror


Edited by The eleventh plague of Egypt, 03 August 2014 - 04:43 PM.

  • 0

#2 tabc3dd

tabc3dd

    GMC Member

  • GMC Member
  • 798 posts

Posted 02 October 2010 - 05:03 PM

Looks alot like the second room of my : http://www.yoyogames...45-node-pathing

But in much better and complex. Well done sir, i might use your system.
  • 0

Final Core is being remade, come check the new topic ! http://gmc.yoyogames...opic=683878&hl=

Final Core is an RTS/TDS in which you can design your ships using a selection of over 130 parts.
Build the ultimate battleship and challenge other players' designs!

 

Online without port-forwarding: http://gmc.yoyogames...howtopic=685273


#3 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 02 October 2010 - 05:08 PM

This looks exceptionally interesting... But I canīt test it as MediaFire gives me problems. How about a file mirror?
  • 0

U1FVsm3.png

40799.png


#4 The eleventh plague of Egypt

The eleventh plague of Egypt

    GMC Member

  • GMC Member
  • 1045 posts
  • Version:Unknown

Posted 02 October 2010 - 07:25 PM

I added a mirror. Hope you'll like it.
  • 0

#5 Candlejack

Candlejack

    GMC Member

  • New Member
  • 96 posts

Posted 10 October 2010 - 06:13 AM

Well done!
  • 0

#6 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 10 October 2010 - 07:01 AM

This is a very interesting example... It works beautifully, and the inclusion of a map editor room is great. My main concern is itīs speed. If this is used for an RTS I can see it lagging due to the amount of code being processed in the step event, especially if being used for a lot of objects... But of course I still have to test this without all the debug code and things as drawing all those nodes/lines must also use up processor time!

Anyway, this is defenitely staying on my HD and I congratulate you on an excellent node pathfinding example that doesnīt use GMīs native pathfinding system!
  • 1

U1FVsm3.png

40799.png


#7 The eleventh plague of Egypt

The eleventh plague of Egypt

    GMC Member

  • GMC Member
  • 1045 posts
  • Version:Unknown

Posted 13 October 2010 - 12:02 PM

This is a very interesting example... It works beautifully, and the inclusion of a map editor room is great. My main concern is itīs speed. If this is used for an RTS I can see it lagging due to the amount of code being processed in the step event, especially if being used for a lot of objects... But of course I still have to test this without all the debug code and things as drawing all those nodes/lines must also use up processor time!

Anyway, this is defenitely staying on my HD and I congratulate you on an excellent node pathfinding example that doesnīt use GMīs native pathfinding system!

Thanks. There indeed is a lot of code in the step event of an object, but it's in the controller object, and there will be only 1 controller object in the map.

Units have no AI on their own, when it comes to pathfinding they are controlled and moved by this powerful mastermind.

Each unit have its own destination to reach (goal_x and goal_y) you can assign them by right-clicking. The controller checks the goals of the single units, finds a way (pathfinding) and guides them there (pathfollowing).

BTW pathfollowing is more difficult than pathfinding.
  • 0