Create a Character in Programming
|
Hi , today i am going to talk about how i implemented an NPC (non-player character) into our Game Planet Suburbia. First i am going to tell you a little bit about our NPC. Commander Victoria Brevitt. In Planet Suburbia the player will be contacted by Commander Victoria Brevitt through a comm radio. She will appear over a chat bar, which displays her lines of dialogue. Her purpose is to give orders to the player. She can also provide the player with useful tips on how to defeat the enemy in a more efficient way. Or how to use certain game play elements such as power ups. So first i had to implement her inside of the game. I thought about how i wanted to do it and what kind of properties she could inherit. In conclusion i copy how me made our HUD and than in our engine there is a function called lerp which stands for Linear interpolation. What does it do ? This function is used for alpha blending (the parameter ‘t’ is the ‘alpha value’), and the formula may be extended to blend multiple components of a vector (such as spatial x,y,z axes, or r,g,b color components) in parallel. Easily said i used it for moving it from point a to point b and back again. I set speed and time parameters so it knows when to show up the Commander and when it has to fade it out again. We are using a wave system for our enemies in our Game. So depending on which wave you give the funktion in that wave is she going to appear. We also want to have something like a chat bar so the player can read what he/she has to do or stuff like that. To do this i simply implemented the chat bar under our commander. It looks good in our game and it makes it easy for the player to get the message. We are still in the alpha phase but later in the game the Commander is going to have a voice and talk with the player over the radio. I thought it would be a good Sound feedback for the player. We want that the player feel that the game is kind of a narrative driven game. If he don’t like narrative driven games and just want to play the game without being interrupted so am i going to make a skip button where he/she just can skip the scenes with the Commander.
|
