Jump to content

Building Logic for AI in Games – Part 1: Simple Movement


remvst
 Share

Recommended Posts

In this series of articles, I'm going to describe how I created the enemies' artificial intelligence in my game Infiltration.

 

waypoints-300x261.png

 

The first step was to determine how enemies should move throughout the levels when they do not interact with the player. Having them take random patterns was not an option, because I wanted them to take the exact same path every time the user plays the same level.

 

Read more

 

Link to comment
Share on other sites

  • 1 month later...

Here is the second part, a bit late but better late than never :P

 

In my previous article, Building Logic for AI in Games – Part 1: Simple Movement, I discussed how I made enemies follow certain paths in my HTML5 game, Infiltration. I then had to figure out how to make enemies see the player.

 

In order to check if an enemy sees the player, I first perform a simple distance check. Indeed, if an enemy is too far from the player, I consider that he shouldn’t be able to see him.

Then, I perform the angle check. I have two angles: the direction towards which the enemy looks, and the angle from the enemy directly to the player. Considering that the enemy has a 90° field of view, I have to check if the difference between these two angles is below or above 45°.

 

schema-cone.png

...

 

Read more

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...