How do I Make a AI

Get help using Construct 2

Post » Thu Mar 19, 2015 7:48 pm

How can i make a AI that with shoot bullets at me andtarget me and try to doge bullets
B
6
Posts: 31
Reputation: 316

Post » Thu Mar 19, 2015 8:04 pm

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
Frosty Elk AB
www.frostyelk.se
Have no fear, We come in peace!
B
13
S
3
G
1
Posts: 106
Reputation: 1,169

Post » Fri Mar 20, 2015 3:17 am

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.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
51
S
14
G
8
Posts: 592
Reputation: 8,556

Post » Fri Mar 20, 2015 3:42 am

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
B
6
Posts: 31
Reputation: 316

Post » Fri Mar 20, 2015 4:01 am

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
B
18
S
2
Posts: 48
Reputation: 896

Post » Fri Mar 20, 2015 8:38 am

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?
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
51
S
14
G
8
Posts: 592
Reputation: 8,556

Post » Fri Mar 20, 2015 2:14 pm

@chrisinfinger
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:
Code: Select all
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: [email protected]
'Good' gameplay is gameplay that gets the effect you want.
Want to make a game with me? Come here!
My example capxs
My Game Art 'Portfolio'
B
31
S
9
G
1
Posts: 135
Reputation: 3,230

Post » Fri Mar 20, 2015 9:09 pm

Ok thanks Guys ill try your your guys advice thanks
B
6
Posts: 31
Reputation: 316


Return to How do I....?

Who is online

Users browsing this forum: ThePakernator, UberLou and 9 guests