Enemy AI like in Terraria or Risk of Rain

Get help using Construct 2

Post » Fri Jan 31, 2014 6:43 pm

Hello this is my first topic posted and I am still new to construct, but i have a question (obviously ).
I want to make my enemies come towards me and when they come close enough stop and attack and then towards me again and so on.

So does anyone have an idea how to do it i have the animations required but i dont know how to make the AI.

Of course if there is a tutorial about this already i would like to get a link for it.

Thanks in advance, Mihovil.Berserky2014-01-31 19:08:49
B
7
S
2
Posts: 102
Reputation: 975

Post » Fri Jan 31, 2014 8:33 pm

Hi there

A partial answer cause i never played thoses games (even if it seems good games)
http://terraria.gamepedia.com/AI

It seems that there's a lot of tutorial to implement AI but i always used A* and Dijkstra algoritm...

I think that there is a lot of way to implement an AI and noone can give it all just in 1 topic.

Sorry :(
B
8
S
2
Posts: 35
Reputation: 838

Post » Fri Jan 31, 2014 9:36 pm

Well thanks for the reply anyway maybe i can narrow down my choice.
EDIT: well the AI i am trying to make is fighter AI(thats what its called in terraria according to the wiki)Berserky2014-01-31 21:50:19
B
7
S
2
Posts: 102
Reputation: 975

Post » Fri Jan 31, 2014 10:18 pm

Well first i think you have to refine the AI to construct 2 Event Model.
For example :
If it fails to reach its target, it will back up a bit, then re-attempt
The first event seems to be a comparison of :
Fighter.X + (size from point 0 to weapon) AND Fighter.X + (size from point 0 to weapon)
=> Fighter.attacking=true
=> Fighter set Animation "Attack"
=> ActTimer.start (0.5) // the time to reach end of attack animation

Fighter in collision with Player AND Fighter.attacking==true

This is just the begining... but i hope you understand how to.
I think you should analyse the pattern with event handler and timer

Sorry for explainning with my own understood i'm not fluent to write event of construct 2 ^^
B
8
S
2
Posts: 35
Reputation: 838

Post » Fri Jan 31, 2014 11:06 pm

Thanks man but i got it working (it needs a few tweeks though).

I used compare two values(system) and when x was bigger on my player than on the monster the monster would go right and vice versa.

But thanks anyway.
B
7
S
2
Posts: 102
Reputation: 975


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests