But for knowing how to manage those NPCs, you must keep something in mind: you are going to abstract a living thing into a bunch of bits. So, if you want your NPCs to "live" inside your map, you should know how pass the behavior of people (a very tiny little fraction of it) into a machine. This is the purpose of this lesson. A "little" introduction ^_-.
...the things you see, the things you hear, everything you sense, is transmitted into your brain. Inside your brain there is some reactions, and you answer to those feelings. We are, very roughly speaking, sensitive machines. So your NPCs must be also sensitive machines.
Now look at the image above. Is the abstraction i have explained. Now imagine that you are making an NPC in a game. This should be, roughly, its main skeleton. Every NPC have actually some kind of behavior. They also "feels" its surroundings. They "see" (there is somebody near, there is a shadow,...), they "hear" (there is a noise near me, it's very loud or not,...), they "touch" (this part of the map is very hot,...), they "taste" (there is a medical pill inside my mouth,...), and they "smell" (the scent of that monster is higher here). Now they get all the information and give to it some interpretation, depending on their old experiences and in their actual situation (that shadow has the form of a man, and here should be no man - that noise, i heard it before from that f******** monster - ...), and they have some types of reactions (go to "hunt" mode - flee! - launch a cinematic scene...), that may change their actual behavior. How to abstract the five senses?
And in the reaction part, NPCs finally do something. They move, they try to aim some enemy, or the try to talk. Or if there is something important involved, they use some scripted code and launch a cinematic scene.
Remember a Final Fantasy, the "old" ones (from 9 to 1). Did NPCs something "intelligent" in the field mode? No. They only had simplistic behaviors (walk, some scripted actions like goofing around...). Some of them had a limited sense ("It's the player near to me or tying to talk to me"), and they had no reacting - just have a certain behavior, like talking or launching a cinematic scene. Only very very few of them (like the soldiers in Shinra Corp) were able of sensing something (seeing you). But in the battle mode, things were a bit different. They had a moe intelligent behavior, since they were able to choose the target of an attack or what weapon they were going to use. They had some learning (this attack hurts the player), and some evaluation (i have very few hit points, better to cure myself). But now remember some western games. Ultima VII, Baldur's gate. Though limited, the deepness of their brain were higher. They saw, they interpretated the signs (friend or foe?), and they were capable of reacting and learning (even if it's not a CRPG, "Black And White" pets are a good example of this).
In next lessons I will give you some explanations about how implementing all of this into a NPC. And how to manage a bunch of them ^_-. This introduction ends here. Hope you liked it ^_-. |