* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Pathfinding  (Read 193 times)

0 Members and 1 Guest are viewing this topic.

Offline E37

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

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: 2670
  • Post Rating Ratio: +17/-1
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • View Profile
    • 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???)

In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii:

YUKI-CHAAAANNNN

Online kotu

  • Walrus Dehumidifier
  • Super User
  • Join Date: Aug 2016
  • Location: Bristol, UK
  • Posts: 776
  • Post Rating Ratio: +6/-5
    • dj_kotu
    • @UCAy2ZF4hbc08iStnTn6jgxQ
    • rowanmedhurst
    • @djkotu
    • View Profile
    • futurerave.uk
  • Gender: Male
Re: Pathfinding
« Reply #2 on: January 04, 2017, 03:05:26 am »
Yes A*.......... this explains it....... https://www.raywenderlich.com/4946/introduction-to-a-pathfinding

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... http://www.mediafire.com/file/r4hthvfxoc3i927/pathTest.zip
  • 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 Calc.news BroniesQC BosaikNet Velocity Games