Advice on How To Setup AI...

This forum is currently in read-only mode.
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • So, I set up my engine and the mechanics are working fine (yay!) now, I need to figure out the best method for handling AI.

    Just to be clear, I'm not asking how do I get my sprites to act as enemies, but the best structure for going about doing that.

    And for an example of what would need to work...

    I have a ship heading towards a planet. This ship has no reverse engines and it's purpose is to dock with said planet. So what to ship would need to do is turn off it's engines (so it won't be propelled into an incorrect heading) then rotate 180 degrees, and when it is 180 from it's original heading it needs to fire back up it engines to slow down.

    I have all the math for how long this would take worked out (ReverseCalc).

    So, essentially, it goes like this:

    If SHIP.REVERSECALC is greater than {DISTANCE TO TARGET}: Turn engines off & turn to SHIP.ANGLE-180
    
    SHIP rotates...
    
    Now that SHIP has rotated 180 degrees, turn engines back on[/code:1qlbl85a]
    
    It seems pretty simple, but there will be other things such as if the ship DOES have reverse engines, if the ship is actually on course, and how to get back on course.
    
    So, if this explains enough what would be the method to do this, or the materials to read up on?
    
    Thanks.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)