In this series of Unity tutorials, we’ll demonstrate how to setup our waypoints in order to allow our enemies to seek and destroy the player. We’ll also discuss how to create a basic AI for our enemies. Having a computer understand our level is one of the most pertinent problems facing any game developer. Waypoints are a quick and powerful way to create a simple model of a level that an AI can understand. Once we have our waypoints set-up and working, we’ll create an enemy AI that can find and attack the player.
فیلم آموزشی Unity Mobile Game Development Enemy AI and Waypoints ، قسمت هجدهم از سری مجموعه آموزش توسعه بازی با یونیتی می باشد که توسط شرکت Digital Tutors تهیه و در اختیار علامندان این مبحث قرار گرفته است . در این فیلم آموزشی شما با چگونگی طراحی و راه اندازی ایستگاه ها و موانع بین راه شخصیت اصلی و دشمان آشنا خواهید شد . Chris Glick ، مدرس فیلم آموزشی Unity Mobile Game Development Enemy AI and Waypoints ، کار خود را با معرفی ابزار های مورد نیاز برای این مبحث شروع می کند و ادامه روش های استفاده آنها را برای این مبحث بیان خواهد کرد . وی همچنین درباره چگونگی ایجاد یک AI اساسی برای دشمنان ، مشخصات یک سیستم خوب برای توسعه دهندگان ، روش way point و طریقه مسیر یابی شخصیت ها برای حمله به یکدیگر صحبت خواهد نمود تا شما را با این مباحث و روش ها آشنا نماید . شما نیز می توانید با استفاده از پروژه ی تمرینی موجود در این آموزش تمامی مباحث را بصورت عملی نیز انجام دهید .
Topics:
۰۱. Introduction and project overview
۰۲. Mapping out the problem of entities moving around our level
۰۳. Waypoint ideas, concepts and our implementation
۰۴. Creating an initial Waypoint prefab and setting it up
۰۵. Filtering nearby objects to other waypoints with a layer mask
۰۶. Coding a variable distance with a while loop
۰۷. Building in line-of-sight with layer masks
۰۸. Relaying information to neighbors without infinite loops
۰۹. Initializing a Generic List of waypoints to get to the player
۱۰. Creating an initialize function and removing the countdown
۱۱. Using conditionals to check if we want to update the list
۱۲. Creating a controller script that gathers all the waypoints
۱۳. Locating the closest waypoint to any point in space
۱۴. Coding a function to return a random waypoint
۱۵. Using a While True Yield loop to update every few seconds
۱۶. Creating a Spawner script to create new enemies
۱۷. Using a Spawn Controller to randomly spawn enemies
۱۸. Controlling the number of enemies spawned
۱۹. Creating a basic enemy script to use our waypoints
۲۰. Moving with the Smooth Damp method
۲۱. Deciding when to go to the next waypoint1
۲۲. Using Rotate Towards and Look Rotation to rotate the enemy
۲۳. Refactoring our code into a new function
۲۴. Updating the Player Location list so the enemies don’t stop
۲۵. Refactoring into an infinite loop function to update waypoints
۲۶. Creating a basic Finite State Machine to run our enemy AI
۲۷. Using a Switch statement to run code based on the enemy state
۲۸. Creating a function to check for transitions
۲۹. Adding a distance check before the enemy starts following
۳۰. Transforming the enemy forward in the start state
۳۱. Importing our final geometry and splitting animations
۳۲. Updating our enemy prefab with the new geometry
۳۳. Changing our enemy animation in code with animation play
۳۴. Coding an attack decision into our transition function
۳۵. Telling our Spawn Controller when an enemy has died
۳۶. Changing our movement speed based on the current state
۳۷. Refactoring our code to be more readable and user friendly
۳۸. Playtesting our enemy AI and hunting down bugs
۳۹. Using random values to create more realistic movement
۴۰. Adding a collider to our prefab for hit testing
۴۱. Testing if we have been attacked or hit
۴۲. Coding for other notifications to work in our game
۴۳. Stopping the animations from playing while paused
۴۴. Stopping the logic from running when the game is over