Monday, 5 November 2012

Scripting


Why use a scripting language instead of hard coding it in to the engine?
Well most game logic can be scripted keeping the game code and the engine code separate. This way its easier to find stuff and modify plus you can re-use the engine code for another game. There are other pluses too. In the industry it can take quite a while to see your changes in the game because you would have to recompile the entire game each time (heavy rain had 4 million lines of code). But if you use scripting you can see the effects in game immediately. Even more efficient is the possibility to teach non programming roles how to modify bits of code so they can tweak it themselves without having to involve a programmer.

Making realistic actors
In a film or book you have no control over the content and so there is no agent. You watch the characters make decisions and stick to their roles which gives the illusion of personality. However in a game you have more control due to the interactive nature of the gameplay. This means your the agent, you make all the decisions which is why, even though the characters history might be known, you do not have any attachment to the character your playing. In the Sims a mother is playing with her baby. You tell the mother to feed the baby. The mother then puts the baby on the floor (to end the last animation) and then picks the baby up to feed him (beginning the next animation). This is very unbelievable!

So how can we make believable actors if they don't make any decisions?
The key to this is believability. Although it must be understood that there is a difference between realism and belief. Bugs Bunny is a believable character but he certainly isn't realistic. The idea is if you can imagen what that character could be doing now then it must have a believable personality. However if you can only think of the character as a empty husk then the believability has obviously failed. Again if you have made all the decisions for the character than you have nothing to latch onto about the characters personality. You have to be able to create characters that feel like they have a responsibility over their own actions and yet allow us to also be responsible.
One way to fix this is by using procedural movement and behavior. Combine multiple movements by overlapping the animations to produce a more believable action. A good example would be to walking and reaching for something in a cupboard rather r than walking to the cupboard, stopping, then reaching for the door. You can also use pseudo-random movement to create a continuous presence. Such as shifting weight or blinking. The point is use more non linear animations.