How do I Make a AI

0 favourites
  • 8 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • How can i make a AI that with shoot bullets at me andtarget me and try to doge bullets

  • Shooting at you and targets you, should be easy enough to do with a Turret behavior.

    Dodging bullets would take a bit more work. But i guess that it could be done with the Turret as well. If the turret has the "Bullet" as an enemy and when it see the bullet or targets it, it will then move.

    More on turret behavior: https://www.scirra.com/manual/152/turret

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is a very helpful community and will many time spend their valuable time making capx examples for peoples problems. However, it is you the budding game designer who is ultimately responsible for learning your craft and no amount of piecing capx examples together is going to do that for you. The question you asked covers a half dozen topics in and of itself and assumes we the reader know you are talking about a side-scroller, platformer, isometric, top-down, grid based, turn based, etc to infinity. Break down what you are trying to accomplish into parts and slowly piece it together yourself using tutorials and forum for specific help being detailed in exactly what you are trying to accomplish and exactly what roadblock you have encountered. Do that and you will find it much more rewarding.

  • Ok i just wanted to make it short and sweet so someone will want to answer it other than read a 5page problem solving question

  • Easiest way I did it was... Just compare the X values of the AI to your player.

    Shooter/Platformer : enemy.x >player.x+100 = Simulate left . This will cause AI to not overlap your player

    • Assign a platform behavior to the enemy and use the event wall is to left/right - Simulate jump.

    Shooting: Use another condition : enemy.x is greater than 0 but less than 300 ( Insert shoot action )

    Top down: Just use line of sight and move towards player.x/y

  • NobalChase, I get that but my point in the above rant was that what your asking in such a generic way is a very large topic with lots of different methods of handling.

    It like if Columbus prior to sailing to the Americas asked "How do you navigate?"

    What you are trying to do is the FPS or MMO version of 2d game design.. as in everyone wants to do that to start with. What this means to you is there are TONS of tutorials and forum threads on how to do everything you asked due to others that have came before.

    You will benefit yourself using them and learning your own style over having a dozen "How I would do it" or useless capx your never going to use posted here

    That said (and rest assured it wasn't aimed at you alone.. but many, many, many Construct2 users...)

    If you really want help, you can still keep it short but also to the point:

    EXAMPLE:

    Hi all, I am wanting to make a top-down shooter where my player shoots at enemies who are smart and hide behind cover and pop out to shoot at him.

    I have already got my player moving and shooting and the enemies are destroyed when I hit them but I can't figure out how to make the use cover, or pop out.

    Can anyone help me with this?

  • I would like to point out that although what you said is to most technically correct, this is a help forum; telling people they should try harder or do it themselves is not something posters are looking for. A bit more information would have been nice though.

    NobalChase

    In regard to dodging bullets, you could just pick the closest bullet to the turret and move at a 90 degree angle to it, which wouldn't be terribly difficult.

    Edit

    This was quite interesting to me, so I tried it.

    Outside link to example capx

    I would upload it here, but it seems the attachment system is utterly broken:

    General Error
    SQL ERROR [ mssqlnative ]
    
    SQLSTATE: 22003 code: 8115 message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Arithmetic overflow error converting expression to data type int. SQLSTATE: 01000 code: 3621 message: [Microsoft][SQL Server Native Client 11.0][SQL Server]The statement has been terminated. [3621]
    
    An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.
    
    Please notify the board administrator or webmaster: noreplyshh@scirra.com
    [/code:20qfnjcq]
  • Ok thanks Guys ill try your your guys advice thanks

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