Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. C# XNA 4 AI for path

C# XNA 4 AI for path

Scheduled Pinned Locked Moved Algorithms
tutorialcsharpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    right now, i know how to get the mouse location and show the mouse and so left clicj right click and such. I am wondering if anyone had a formula for an AI for a path, eg o = you sprite | = wall can pass through ' = floor can pass through * = path way for the spite C = the cliked for the path to go heres my example o''''' '*|''' '****C I hope you understand basicly i want to it go a certain location it will go there, and if there is an object in its way it will use a formula to get around it. all this nis in 2d by the way. and if you have the formula can you please make it as simple as possible?

    J 1 Reply Last reply
    0
    • L Lost User

      right now, i know how to get the mouse location and show the mouse and so left clicj right click and such. I am wondering if anyone had a formula for an AI for a path, eg o = you sprite | = wall can pass through ' = floor can pass through * = path way for the spite C = the cliked for the path to go heres my example o''''' '*|''' '****C I hope you understand basicly i want to it go a certain location it will go there, and if there is an object in its way it will use a formula to get around it. all this nis in 2d by the way. and if you have the formula can you please make it as simple as possible?

      J Offline
      J Offline
      jk chan
      wrote on last edited by
      #2

      try using A* algorithm see links below. Very simple A* algorithm implementation[^] C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra's, and Bi-directional A* Algorithms[^] Hopes this helps jk chan http://cgmath.blogspot.com

      If u can Dream... U can do it http://cgmath.blogspot.com/

      L 1 Reply Last reply
      0
      • J jk chan

        try using A* algorithm see links below. Very simple A* algorithm implementation[^] C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra's, and Bi-directional A* Algorithms[^] Hopes this helps jk chan http://cgmath.blogspot.com

        If u can Dream... U can do it http://cgmath.blogspot.com/

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        ty, a* seems the most simple, but it still is allot and will take a while to understand

        J A 2 Replies Last reply
        0
        • L Lost User

          ty, a* seems the most simple, but it still is allot and will take a while to understand

          J Offline
          J Offline
          jk chan
          wrote on last edited by
          #4

          yes. I remember, I have seen some learning based algorithms .see http://gamesitb.com/pathgraham.pdf[^] jk chan http://cgmath.blogspot.com/[^]

          If u can Dream... U can do it http://cgmath.blogspot.com/

          1 Reply Last reply
          0
          • L Lost User

            ty, a* seems the most simple, but it still is allot and will take a while to understand

            A Offline
            A Offline
            Arthur F Souza
            wrote on last edited by
            #5

            A* is indeed the best option here. If you need an easy way to learn about how A* works, check it here http://www.gamedev.net/page/resources/_/technical/artificial-intelligence/a-pathfinding-for-beginners-r2003

            - A.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups