Gamedev In-depth: Steering Behaviors (Flee)
KidsCanCode
AI is hard, but in gamedev you often want autonomous agents in your game (animals, enemies, guards, etc) that behave in a realistic way. "Steering Behaviors" are a simple way of applying various forces to a unit's movement that generate realistic behaviors like chasing, fleeing, following, etc.
In this third video on steering behaviors, we'll try out the "flee" behavior, making an autonomous sprite that will run away from the player (or any other object).
Code for this example: https://github.com/kidscancode/pygame_tutorials/blob/master/examples/steering/part03.py
For a great resource on this topic, see the book "The Nature of Code": http://natureofcode.com/book/chapter-6-autonomous-agents/
"In-depth Topics" will explore and explain a little more deeply certain subjects that may be tricky for new programmers to understand, or that may not quite fit into the usual tutorial structure. Most will likely be math related, but they may also cover other topics that come up or are requested by viewers.
Note: While the examples here will be using Python/Pygame, the actual material will apply more generally to all game development, regardless of what language you may be using.
If you like these videos please consider supporting me on Patreon: https://www.patreon.com/kidscancode ... https://www.youtube.com/watch?v=eantey2BaL4
51319886 Bytes