Add some intelligence to your games using logic bricks.
Aidy Burrows writes:
Be careful with this stuff, with enough logic bricks Blender might become self aware.
Yup, In this game development installment we’ll be taking a look at artificial intelligence in the Blender game engine.
- How to get an enemy to roam around the level?
- How to get the enemy to recognize the player?
- How to get an enemy to pursue the player?
- What happens when the enemy loses sight of the enemy?
Also thank you to everyone who offered feedback however small. It was a huge help and immensely encouraging! Thank you again! :)
4 Comments
does it cause the enemy to not go through walls?
collision detection and A* might be a good starting point for your research, Charles :)
The enemy uses a navmesh, so yes, it will not go through any walls.
Hi Charles, that's a good question and isn't covered in the tutorial, the solution is quite simple though. Because the walls don't change position throughout the level the AI here doesn't require a setup that needs to detect for wall collision, simply the navgraph that the enemy is using is generated with the walls in mind so it doesn't try to go through walls.
In other words make sure the floor and the walls are selected when building the navgraph. Hope that helps! - Aidy.