Having completed the controls and a (rudimentary) system for weapons, in this edition, we’ll talk about monsters, those poor bastards we’re going to shoot. We’ll talk about them hurting the player tomorrow. Today we focus on their movement and senses.Needless to day, not all monsters are created equal. Aliens don’t shuffle around mindlessly moaning “brains… brains…” and werewolves don’t generally carry ray guns that make that *woobawoobawooba* sound when fired.Even so, we can distil what they all have in common to create a generic monster template that can be customized for different types of monsters.
Monster senses are something that though different from ghoul to tentacled polyp, works the same way. The eyesight is a field of view, a cone if you will, expressed in angles. For regular humanoid baddies it will probably 120 degrees. The strength of their eyesight can be expressed as the length of the cone. The longer the cone, the further they can see.
But as monster movie buff everywhere will attest, eyesight is just not good enough. How do you model that vampire that can smell your blood? If we increase its field of view to 360 degrees we’ve practically achieved the same thing. This would cause the vampire to zero in to you location no matter where you are.
This seems ok, but we can do better. Here’s the scenario: You are in a room with a vampire and you’ve been far enough away that it has not noticed you. You try to reach that shotgun in the middle of the room (who keeps shotguns in the middle of rooms anyway? *cough*Doom3*cough*) and get close enough that the vampire can now smell your blood so it starts to slowly advance in your general direction — it doesn’t yet see you, it just know that fresh blood is closeby. Crap, you think to yourself, I can still reach the shotgun before it sees me. However, before you can reach the shotgun, the vampire sees you! This time it comes running at you fangs first! Good thing you reach the shotgun before it get to you and make it eat holy buckshot.
This would be a lot cooler, I think. We can implement this by defining a radius for the sense, and a precision factor. The precision factor is a radius around the player. When the monster uses this sense, it’s not given back an exact position, but one that’s a small circle around the player. The more imprecise the sense, the larger the circle. This way it’s coming toward your general direction and not homing into you like a fat kid at a pastry shop.
Ok, let’s compile a list of things we need to keep track of for our monsters:
- FOV (field of view)
- Length of FOV
- Radius for secondary sense
- Precision of seconday sense
- Base movement
- Running Rate (this is a factor that we multiply the base movement by. It’s adjustable since some things are just faster than others)
Now that we have a rough idea, lets apply it to some critters!
Zombies
- FOV: 90 (smaller than normal, maybe their missing an eye?)/li>
- Length of FOV: 70 pixels (we play at 800×600)
- Radius of secondary sense: 0 (no, they can’t smell your brains)
- Precision of secondary sense: 0
- Base movement: 20pixels per second
- Running rate: 1.5x
Vampires
- FOV: 120
- Length of FOV: 100 pixels (better than zombies)
- Radius of secondary sense: 300
- Precision of secondary sense: 30 (it’s not perfect)
- Base movement: 30pixels per second
- Running rate: 1.5x
Werewolves
- FOV: 120
- Length of FOV: 70 pixels (they are colorblind after all)
- Radius of secondary sense: 500
- Precision of secondary sense: 10 (beware their nose)
- Base movement: 30pixels per second
- Running rate: 2.0x
And there you have it!
I’ll try to have this in by this weekend. Tune in tomorow as we talk about damage models and how both the player and monster can bite it.