How to use Context Steering AI in Unity - P1 Overview

preview_player
Показать описание
Creating a Context Steering AI in Unity that makes an Enemy move naturally can be tricky. In this video we will implement Context Steering Behaviors in Unity for Chasing the player while Avoiding Obstacles to make our Enemy appear smart.

Learn C# for Unity by making games:

Previous tutorials about this system:

Context Steering article:

Github Scripts

Patreons Link - Full Project:

𝗛𝗮𝘃𝗲 𝗮𝗻𝘆 𝗾𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀? 𝗝𝗼𝗶𝗻 𝘁𝗵𝗲 𝗱𝗶𝘀𝗰𝗼𝗿𝗱!

𝗣𝗟𝗘𝗔𝗦𝗘 support the channel:

00:00 Intro
00:49 What is context steering
02:51 Weights
03:22 Interest and Danger arrays
04:49 Selecting the movement direction
06:03 Enemy Wall Avoidance Problem

#unity2d #ai #gamedev
Рекомендации по теме
Комментарии
Автор

Love this. I've played with A* in the past but I always wanted something a tad simpler and more lightweight, and this seems perfect. Your videos are awesome, keep up the great work!

aledjones
Автор

The idea of caching the last position has *saved* my path finding. I can't believe I didn't think of that! Thanks man :)

crunchyduck
Автор

Hello, I'm not using unity for my project (using godot), but your explanation of this algorithm is so succinct that I was very easily able to translate this into an entirely different engine. Thanks!

dappercthulhu
Автор

I am so excited. I have been looking for something like this for months.

daveh
Автор

I'm glad you're doing a video on Context Steering. I've known about Context Steering for some time, but I was still always surprised at how few resources can be found out there, even though the algorithm can be really useful.

alright
Автор

This's what I need !!! I'm coding my own Pathfinding System, but pathfinding to a moving item is very costly. This is a new solution for me. Thank you bro !!! Have a good day. 😆😆

gamedevbaiyi
Автор

Thanks, your tutorials are brilliant among others on Unity & Gamedev, and offer good codestyle

laniakeadev.
Автор

I think this will be the solution I need for my current problem, thank you!

Synith
Автор

your tutorials are on point, thanks for your guidance

yairtayb
Автор

Awesome stuff, thank you so much for this amazing tutorials!

mbsnke
Автор

Very good explanation! Looking forward to the code.

tucccci
Автор

Hi, i just implement your system and it's work great with cube and box colliders. In your opinion it can olso detect and avoid mesh collider with the same procision? Because i'm doing some test with starts and others shape and seems to hang on the edges. And what about moving obstacles?

pagoda_dimensionale
Автор

Hi, thanks for tuts! Can I also use it for obstacle avoidance of enemies?

gokayakcay
Автор

I love your tutorials so much! Im very lucky to found you on youtube! I have one question. How can i make that the enemy dont stack at each other? and spread around the player to attack.

masterlewzilla
Автор

Thanks so much for this tutorial, I really enjoyed it! You managed to make context steering sound simple! 6:03 About the enemy wall avoidance problem, do you think there's any way of getting past this with another solution? Testing this system out with complex environments like moving obstacles, the last cached position can end up at the other side of a moving obstacle so the enemy tries to run at it until the obstacle moves away. I was thinking about maybe somehow mixing pathfinding with this system. Do you have any suggestions?

ariyabayat
Автор

How to make this work with a tilemap collider instead of smaller, individual obstacles? I tried to follow this series but the "obstacles" array can only have the tilemap collider, not the colliders on the tiles themselves.

kiddo
Автор

How you manage more than one enemy if they should avoid between them? I think a good answer would be flocking or flow field… but I would like to see what you think. Great content :)
Thanks!

peche_gameDev
Автор

Hello there, thank your for your awesome tutorial. I just wondering, what is the performance penalty for using 8 (or 5) raycasts instead of navmesh baking and querying A* path in every update if any?

Using raycasts and breadcrumbs is awesome

mehdikovic
Автор

Seems good in theory but in practise has flaws. For example if the target is east and east is blocked by a small NPC in front of the target, just large enough to block only one ray, the best directions will be diagonal NE and SE to take you around the object. But if you take the average of those it's obviously east...which moves you into the NPC...

loot
Автор

oh after i saw this vid i recognize that i am not suitable for game development

DungHoang-ffwh