How do I make A Boss Fight AI

0 favourites
  • 9 posts
From the Asset Store
A well commented fighting game template to learn from or use as a base for your own game!
  • Im making street fighter 2 fan game and I to make AI for enemies and bosses how do I do it it got to be smart it needs to know when to block crouch if there is like attack tatsumaki senpu kyaku attack so it wont get hit by leg please help me thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure about this, but giving an idea. if you can set instance variable for different player attack type then convey that to boss.

  • Well I know how to do AI to randomly choose what to do i can make variables what will it perform attack special move jump ETC but i need to make it know when to do is it good time to jump attack or when to do stuff you know! just like in fighting games please share capx or help me in other way thank you for reading and sorry for not so nice language!

  • I didn't mean to set variable for Enemy. I meant to set variable for player attack. For example if the player is doing a specific attack then set variable for that. After the make the enemy to know this variable then set a counter enemy attack for that

  • I need AI like so player can fight someone im tired of making 2 player fighting games!

  • This is a pretty complicated idea to try to tackle, but I figure I can take a small shot at it. The short answer is that you're going to have to figure it out on your own, but I can provide a few examples to get you started.

    Ok, so when you're creating AI, you need your AI to be able to sense things. For example, I once created an enemy that would duck if it sensed oncoming player bullets. I did this with the "is overlapping at offset" condition. I also changed my condition from an "AND" condition to an "OR" condition and made it check both the left and right side of the enemy. Then, when my player shot at the enemy on either side, the enemy would "sense" the oncoming bullet and duck. The trick in that instance was that if the player got very close, the enemy couldn't duck fast enough.

    When you do attacks, you can make your code set boolean variables on the player. So while the player is doing a high punch, you might have a variable on your player called "highAttack". When the attack is finished, turn "highAttack" off. This would let you send information to your AI that a high attack is happening and they then could have a chance to block it. This is also how I make my character stop moving when I do attacks in some of my games, and it works that way in Street Fighter as well. If you have any of your attacking variables on, you can set your code to not allow the player to move.

    Lastly, since you're making a street fighter game, you are probably using the Platform behavior. Behaviors let you do certain conditions, and for platform, you can check if the player is on the floor or not. This is useful for things like jumping attacks.

    Does this help you at all? I hope so!

  • I am sorry it will be better if you will send me a random .CAPX file of AI for street fighter fan game please i will understand better and im gonna credit you of course

  • That is a lot of work on my end and it won't help you learn!

    Look, start with something small.

    Try making an AI that will move towards you or away from you. Use a timer and a random number inside of an instance variable to set AI patterns for your AI.

    Give it a try on your own before you read the next part here. I'll explain it, but you should try at least to figure it out on your own.

    You can do it like this.

    On start of layout -> Start AI Fighter "Random Picker" timer, regular 2 seconds.

    This starts a timer on our AI fighter when the layout begins. This timer repeats because it's regular.

    On "Random Picker" Timer -> set AI_Fighter "Behavior" number to int(random(3))

    Random will set the number randomly between 0 and 1 less than the number you put in, so in this case, randomly from 0 to 2. The int part rounds the number to a whole number. That means it can be 0, 1, or 2.

    Now, make your code do this.

    If "Behavior" is 0, don't simulate control.

    If "Behavior" is 1, simulate control left.

    If "Behavior" is 2, simulate control right.

    This will make an AI that sits still or moves left or right ever 2 seconds.

  • Its ok i will still find solution...

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