Grid enemy

For questions about using Classic.

Post » Tue Jan 24, 2012 11:20 am

I am creating a grid based rpg and I have problems with creating enemy AI. I havent found any examples which could help me. If you have any ideas/examples please tell me. Thanks in advice.
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Tue Jan 24, 2012 1:58 pm

"creating enemy AI" is a bit vague. What exactly will they do? A simple pathfinding can be done with the rts behavior or by implementing the A* algorithm. http://en.wikipedia.org/wiki/A*_search_algorithm
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Jan 24, 2012 2:20 pm

One tip I can pass along is that in order to know where something is, you have to know where it isn't. The array object is very practical in that regard.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jan 24, 2012 2:44 pm

I want npc move towards player if they have player in LOS (i know how to do that). But the problem is that I want them to move not just randomly but using grid movement.
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Tue Jan 24, 2012 2:45 pm

I've found this game and I want to know how did he managed to do the enemy AI: http://www.scirra.com/forum/griddy-rpg_topic43858.html
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Tue Jan 24, 2012 6:00 pm

If you want to know how Nillo made it, I'd say, simply ask him ;)

A simple example showing how to move objects grid-based can be learned here:
Grid Movement Alternative.cap

I made it as an example for another issue, so it's just a basic hint, something to start with. It does not use the grid movement behavior, that makes it versatile.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests