How do I create GOOD ennemis AI for a Diablo like game

Get help using Construct 2

Post » Tue Jan 16, 2018 5:23 pm

The title says it all, i've yet to find a good tuto on how to make good AI for my type of game.. I don't want clear and premade answers. maybe just ideas or tips. Thanks!
This image is to give you an idea of the perspective in the game https://imgur.com/a/gfcFa
B
31
S
12
Posts: 10
Reputation: 2,399

Post » Tue Jan 16, 2018 7:45 pm

....
B
250
S
139
G
15
Posts: 198
Reputation: 27,929

Post » Tue Jan 16, 2018 8:19 pm

English is not my native language.. Did I say something weird?
B
31
S
12
Posts: 10
Reputation: 2,399

Post » Tue Jan 16, 2018 8:50 pm

Ai can be many things. You’ll have to break it down in more detail what you want the enemy to do.
By doing that you should be able to have a lot of simpler things you can figure out how to do easier.
Then if you still get stuck you’ll have some more specific questions and be able to get more specific help.

Anyways as broad a question as it is you could look into the pathfinder or line of sight behaviors as a start. But there is a lot more different ways to do ai.
B
101
S
39
G
134
Posts: 5,588
Reputation: 85,514

Post » Tue Jan 16, 2018 9:05 pm

I can't speak for others, but you didn't say anything weird.

However, designing an AI is very involved question. In my opinion, before you can think about AI, you have to design your gameplay mechanics because the AI will work based on that.

So the question is not easily answerable because it's too general.

In my opinion, it's better to start from the beginning. If you want to work on NPCs (ie enemies), create a framework for movement first. In your example, that's a top-down orthographic grid-based movement.

- Create obstacles on the grid.
- Create your enemy entities to move on the grid.
- Create a method by which you can instruct an NPC to move to a certain place using grid pathfinding (avoiding or moving around obstacles). This instruction can be pre-defined. It's only to make sure you can tell an NPC to move.
- Create methods which trigger an NPC to move to a specified place. For example, the trigger can be a countdown timer, or it can be based on a keypress, or it can be based on a player moving over a grid square. Also, for example, make the NPC go to a location if its 'health' is low or some other variable condition is met.

Those things are obviously basic and only related to movement. But when you succeed to achieving those basic things, I think you will have just enough exposure the concept of AI and start expanding those things to reflect the gameplay mechanics that you are designing. For example, you can include things like the enemy will consider closed/open doors for movement, or attack the player using ranged weapons if the NPC has any, or if the enemy's health is low, you can make him use some 'healing' item. But that is more advanced and I think you need to concentrate on the very basic stuff first.

When I was going my AI in my RND project (I have an RND project alongside my actual game project to test concepts), the movement was the most important bit because it was the one that was easily full of bugs. And it was made much harder due to multiple enemies who sometimes could not pathfind correctly amongst other moving enemies.

Hint: if you are still researching grid movement, I suggest using rexrainbow's Board system.
B
57
S
20
G
1
Posts: 120
Reputation: 4,420


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests