Help with RTS AI

This forum is currently in read-only mode.
  • Hi all,

    I was hoping I could find a solution to a problem I am having with trying to create a intelligent AI. I am not sure if the RTS behavior is the way to go here.

    Basically, I am creating a top down game set in space, and I am up to creating a AI that will expand its own empire. I have everything done here, the AI will go to the planet, colonize it and then set it to their team. What I am having trouble with is how to tell the AI how to go to the closest planet to their homeworld, rather than going to a random planet in the rather large system, ending up in jumbled masses.

    Is there a way to tell the RTS behavior to go to the closest planet? What events would I need to use to do this?

    Thanks in advance

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • + MouseKeyboard: On Left mouse button Clicked
    + Terrain: Pick closest to: Sprite6.X, Sprite6.Y
    -> Sprite6: Move to Terrain [/code:w2utr7pd]
    
    Have the planets pick. If you have more than one unique planet sprite place the planets into a family.
  • Thanks a ton, I didn't realize there was an event for that!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)