Dinosaur Behaviors
Hi, I'm Eric and I'm a programmer on this project. I have worked on the dinosaur behaviors for the past two weeks. There's a total of three dinosaurs, T-Rex, Raptors, and Triceratops. T-Rex is the most complete since it has animations go to with it.
T-Rex
For the T-Rex, there are 3 major states, Patrolling, Chasing, and attacking. When the player is not within range of the player, they will patrol around. The patrol is handled by getting a random point on the NavMesh near its current position. After a while, the dinosaur will head back to its starting point so that they don't wander to far from its starting point. The T-Rex plays a walking animation when patrolling.
To check for the player, the dinosaurs have a vision cone that checks for the player within a certain angle. It uses an overlap sphere to check for a player layer mask. The max radius and angle can be set so that each dinosaur has its own values.
When the player is detected, the dinosaur will chase the player. If the T-Rex gets close enough to the player and if they are in the T-Rex's field of view, it will play an attack animation. The attack so far does not deal damage to the player.
Raptor
The raptor are dinosaurs that will either patrol alone or in groups. The patrol is pretty much the same as the T-Rex as well as the chase. They also have the same overlap sphere but with different values to as the field of view. What sets the Raptors apart from the T-Rex is how they act when encountering a player.
If the player encounters a raptor by himself, they will go to the nearest raptor to get help. They will then go to the last place the player was in and if the player is nearby, they will chase the player.
Triceratops
Triceratops is not yet finished and still has some work to do. The patrolling and the overlap sphere acts the same at the rest of the dinosaurs, but the difference is that they run away from the player instead of attacking. They only attack the player if they get to close while they are running away.
The Triceratops still has some bugs, but this is the behavior I'm aiming for. I had trouble at first when making the dinosaurs since I just now started to use inheritance more recently. I look forward to continuing working on this project and hope I put my best work till the end.
One More Game
Status | In development |
Authors | Seven, wcnelson, SniderOwen37, Ethicaze, wevaer, Eric.delgado |
More posts
- Week 02 - Flynn4 days ago
Leave a comment
Log in with itch.io to leave a comment.