Author Topic: Pathfinding  (Read 926 times)

0 Members and 1 Guest are viewing this topic.

Offline E37

  • Full User
  • Join Date: Jul 2016
  • Location: Lihilzard Empire
  • Posts: 235
  • Post Rating Ratio: +10/-0
  • I own 2 game consoles, a ti-83 and a ti-84!
    • E37
« on: January 03, 2017, 07:22:36 pm »

I am working on a game and in my general worry-about-the-details-later programming style I ignored the fact that I was going to need to make a pathfinding algorithm. I have a couple ideas, but was wondering if there was any better ways of doing it. I am using a grid based world. It is never more than 50x50 tiles.

I could just brute force the best path, but I don't have a good way to check if the found path is the best one. Also storing the path once found could get large.

I may add waypoints so that the object can just move in a line form one to the next. This would be much smaller to store if the path has few turns but gets large if it winds.
I may add global waypoints to the map to help with navigation, especially with tricky areas.

Any thoughts?

  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 3223
  • Post Rating Ratio: +36/-2
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • @juju2143
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: Pathfinding
« Reply #1 on: January 04, 2017, 03:00:16 am »
As I heard, A* is a good one and is commonly used in games. You might want to check that out.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
On semi-hiatus until who knows when. CODEWALRUS 2.0 COMING SOON
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Offline kotu

  • -< \'V/,,,
  • Super User
  • Join Date: Aug 2016
  • Location: don't panic
  • Posts: 1160
  • Post Rating Ratio: +8/-11
  • woah
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @romanov-psyco
  • Gender: Male
Re: Pathfinding
« Reply #2 on: January 04, 2017, 03:05:26 am »
Yes A*.......... this explains it.......

I also just uploaded a C++ demo of it for PT_, but you can have the link as well. It's in C++, so obviously you will have to rewrite most of it, but having the code might help a little. If you run the .exe, left click AND right click on the map in the white area, to set start and end points. Then press the button. The important code is in mxPathFinder.cpp and mxPathFinder.h. Have fun

Here is the link...
  • Calculators owned: TI 84+CE-T
  • Consoles, mobile devices and vintage computers owned: Sega Master System, Sony PlayStation 3


You can also use the following HTML or bulletin board code to share it on your page or forum signature!

Also do not forget to check our affiliates below.
Planet Casio TI-Planet BroniesQC BosaikNet Velocity Games