4 Replies - 675 Views - Last Post: 23 June 2010 - 06:52 PM

#1 Guest_FlashWizard*


Reputation:

Finding the way Algoritm

Posted 22 June 2010 - 05:59 AM

Hello everyone. I do turn-based strategy in Flash. I need to deal with the algorithm search ways. Could you help me with this.
Is This A Good Question/Topic? 0

Replies To: Finding the way Algoritm

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10771
  • View blog
  • Posts: 40,102
  • Joined: 27-December 08

Re: Finding the way Algoritm

Posted 22 June 2010 - 06:27 AM

You might want to look into implementing a solution based in Graph Theory for this, and you can adapt Dijkstra's algorithm for finding all the paths, including the shortest.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_FlashWizard*


Reputation:

Re: Finding the way Algoritm

Posted 22 June 2010 - 06:50 AM

To be honest - I didn't understand nothing looking at the page in Wikipedia, can you tell me about "Graph Theory" easier?

In fact, in my game (as in all turn-based strategy) cells of this kind:
Posted Image
Was This Post Helpful? 0

#4 Guest_FlashWizard*


Reputation:

Re: Finding the way Algoritm

Posted 23 June 2010 - 06:01 AM

Hey people! Somebody help me! :helpsmilie:
Was This Post Helpful? 0

#5 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10771
  • View blog
  • Posts: 40,102
  • Joined: 27-December 08

Re: Finding the way Algoritm

Posted 23 June 2010 - 06:52 PM

That picture helps explain a lot. Honestly, it might be easier to just use a 2D array rather than a Graph, especially if you aren't familiar with Graph Theory. It sounds to me like you are trying to determine available spots to move to for a turn, correct me if I'm wrong. Some checks you should consider for this include checking to see if the space is adjacent to the current cell and is empty. If so, then it is a valid spot to move.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1