How does the behaviour handle holes in the colliders?
Does the speed of the boid matter?
What direction is the force generated?
WHat alternatives are there to this?
How does the behaviour avoid certain obstacles while ignoring others?
How often are the feelers calculated and why?
How does the behaviour take priority over other behaviours?
How would you improve the behaviour?
How does it improve on Craig Reynolds avoidance behaviours?
Have a look at the PureECSScene in this repo and answer the following questions:
What are Entities, Components, Systems and Jobs?
What is the purpose of the class BoidBootstrap?
In the previous examples, we explored two approaches to creating Entities. Describe them. Which approach was used in the PureECSScene Scene?
How many systems are there running in PureECSScene? What are they and what do they do?
In the previous examples we looked at two different types of jobs. What were they and what were they for?
BoidSystem schedules IJobEntityBatch jobs. What are these and how does this approach differ from using Entities.ForEach?
How do these jobs selects Entities to iterate over? How are the Components on these Entities accessed?
What is a Native Container? Give some examples. What Native Containers does the BoidSystem create and what is their purpose?
What Jobs does the BoidSystem schedule and in what order. Is this order significant?
PartitionSpaceJob uses an algorithm called Cell Space Partitioning. How can this algorithm reduce the computational complexity the Flocking?
What is the limitation of this algorithm?
How are Boids assigned cells?
PartitionSpaceJob uses a NativeMultiHashMap. What is the purpose of this data structure? What is the computational complexity of retrieving a value from a key in this data structure?
How do Boids access the positions and rtotations of other Boids?
In CountNeighboursJob, how does the algorithm determine how many cells are surrounding a boid that it needs to check for neighbours?
What is the design pattern for retrieving all the values that match a given key in a NativeMultiHashMapIterator?
Where does the algorithm store the neighbours for each Boid?
What happens if a Boid has too many neighbours?
In SeperationJob, what can cause the force to be NAN? How does the code check for this?
How does Cohesion work?
In AlignmentJob how are the forward vectors for each boid calculated?
How is the desired forward vector calculated?
How is the force generated?
What algorithm does BoidJob use to combine the forces from the various behaviours together?
How is the Boids rotation evaluated?
In SpineSystem, what is the purpose of the WithNativeDisableParallelForRestriction annotation on the Entities.ForEach lambda?
What jobs does SpineSystem schedule and what do they do?
What parameters control the damping on the spine and what effect will changing these parameters have on the spines?
What Native Containers does this job create?
In HeadAndtailsSystem, what controls the speed of the procedural animation?
How does the Head Animation work? Draw a diagram. What Unity API call is this system similar to?
You could use the lab class to work on your assignment - get 3D models imported and flying around or here is an exercise you can do that uses the pursue behaviour we worked on last week:
Update your fork of the course repo to get the Pursue code we wrote in the class last week.
Detect if the pursuer catches the target and also if the target goes out of range and print appropriate messages to the console. Use colliders for this. Try changing the maxSpeed for both boids and see what effect this has on the ability for the pursuer to reach the target boid.
Update your fork of the repo with the latest code from the master branch of this repo. To do this, cd to the folder where you have your fork cloned and type:
git checkout master
git pull upstream master
This will get the code we wrote last week. Open the Seek scene and you will see a boid that implements seek in the BigBoid.cs class. Today you can implement a path following behaviour for the boid.
Check out this video:
The scene contains a game object object with a script called Path attached. The path script implements the method OnDrawGizmos to draw lines between the waypoints on the path and to draw a sphere at each of the waypoints. The blue box is following the path. Today you can try and program this behaviour.
Implement the Path script that contains a public List<Vector3> waypoints containing the waypoints. The 0th waypoint should be the position of the path gameobject itself and the positions of the attached children should be used to set the subsequent waypoints. You can populate this list in Awake.
Add a bool flag on the Path class called IsLooped to indicate whether the path should loop back to the 0th waypoint when the Boid reaches the last waypoint. If this flag is set to be false, then don't draw a line gizmo back to the 0th waypoint.
In the scene, create a path using the Path script you made.
Add a a public field to the BigBoid class for the Path and drag the Path you made onto this in the Unity editor.
Now write code for a behaviour in BigBoid called FollowPath to get the Boid to move from waypoint to waypoint on the path using Seek and Arrive. If the IsLooped flag is true on the path, then the Boid should Seek the 0th waypoint again when it reaches the last waypoint. If this flag is set to be false, then the Boid should Arrive at the last waypoint. You will need to add a method called FollowPath and a boolean flag to indicate that the FollowPath behaviour is enabled.
Week 1 - Introduction to the course. Introduction to steering behaviours
请发表评论