How can I add an advanced ai

0 favourites
  • 6 posts
From the Asset Store
Customize the animation of character when item changed
  • I would like to see if I can add an ai that can wait for a random guy time and then move toward a player at increments stopping in between, like a guard on watch

  • There are many different ways of doing enemy AI but the simple and effect way I handle AI is giving each of your sprites an AI instance variable and set their behaviors to coincide different values.

    Enemy AI=0 the enemy does nothing

    Enemy AI=1 move up

    Enemy AI=2 move down

    Enemy AI=3 move towards the player and attack every random(1,3) seconds

    Then set the variable based on time or distance or collisions. So if the enemy does not have line of sight to the player every 3 seconds switch between 1 and 2 then if the enemy gets line of sight set the variable to 3. You could also do this by creating invisible checkpoints and mapping out paths for them to walk changing their AI variable based on which checkpoint they collide with. It can get very complex but that is my quick explanation on how I do it.

  • Just an idea

    https://

    drive.google.com/open?id=0B1SSuCVV8v74Rll5cktQcGR1Skk

    But, you have to finetune it yourself.

  • Talking about advanced AI......

    I wonder if it is possible to create a game like street fighter, to fight against different characters, each one with a particular AI.

    maybe it is too difficult to do.

  • That would be an interesting game to play, you could make it retro style and retro graphics as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • State Machines would be the best practice method I guess. This Tutorial for example: https://www.scirra.com/tutorials/1139/h ... e-machines

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