Posted in MA Indie Game Development

GDD720 Week 5

A short detour to dwell on some details of the graphic aspect of the project, including animation and pixel art.

 

 

 

 

A little about art and animation

At the very beginning I imagine to populate the space facility with  at least two types of characters that will also have different behaviours:

  • Civilians who will wander through the rooms and who will react by running away from the monster on seeing it (and may die in the attempt if it chases them or touches them voluntarily or involuntarily).
  • Soldiers who would approach the monster at a safe distance to avoid dying during contact with it and who would try to attack and reduce it.

After testing this characters I feel like adding the existence of a pet, a puppy to be exact, which also wanders innocently around the base and provokes the player’s empathy so that he tries by all means to prevent the creature from assimilating it or that when opening the airlocks the canine is expelled into the void, and thus a collateral victim who will no longer be able to wag his tail.

I have also devised a series of rather grotesque deaths for the inhabitants of the complex, very much inspired by the famous scene in the movie Total Recall, when the martians are at the mercy of the inclemencies of the red planet. I will probably have to evaluate a censored version of these scenes, which can be activated or deactivated from the main menu as they can be slightly gore for some public!

The lighting of the base could become an important point in the development, especially when it comes to providing a more interesting atmosphere and guiding the player. 

I trusted my amazing pixel art friend, Emilio Almiron, to help me developing the art based upon on my descriptions and sketches. After getting the first examples from him and eventually I retouched or mead some modifications to suits better my needs.

So basically ended up with a set of tiles to create the space compound from a grid of 160 x 176 pixels, like this one:

Fig 1 - Basic tile set for the moon base (Art by Emilio Almiron and Patricio Land)
Fig 1 – Basic tile set for the moon base

 

And some cool pixel art animations on several sprite sheets too:

Fig 2 - Some sprite animations for the game characters including the space creature
Fig 2 – Some sprite animations for the game characters including the space creature

 

From ideas to algorithms 

As we stablished, the creature will have to wander through the rooms of the moon base in search of ‘food’ and eventually the nuclear reactor that is always at the end of the maze.

To try out some ideas translated into algorithms, I will try to progress using the following strategy;

  1. First, create the creature as if it were a character that I can control at will using the keyboard. This is not the original or definitive idea – remember that the monster must explore the different zones automatically – but doing it ‘by hand’ at the beginning will give me the possibility to implement and test the different behaviors of the inhabitants of the base in a more direct and simple way.
  1. Once I have verified that the AI algorithms of the space station’s inhabitants work correctly according to the criteria explained above, I will take care of creating the necessary programming so that the creature can also do its part without human or tester intervention.
  1. Once I get the monster to behave properly inside a room (reacting to the elements it encounters and the humans around it), I will implement the necessary actions so that the human player – this time – can open or close the doors that communicate one room with the other, at will.

Under those circumstances the red monster and the characters should react accordingly.

I will also have to evaluate later if I will need to implement a pathfinding algorithm to make my way through the base. I think that, if I provide the character with some simple AI routines to detect energy sources, enemies, and doors, no further fine-tuning would be necessary. We’ll see what happens.

It should be noted that humans appear from the four corners of the room, when in fact they should already be in the room or enter through the doors (whose functionality has not yet been implemented).

I also anticipate some more serious problems: that the monster does not find the doors in a ‘credible way’, or, on the contrary, that it finds them so fast that it is not funny to try to stop it, and especially to make it do it during the change of room, where the doors change places randomly.

However, for now I’m going to concentrate on the characters’ behaviors. After having created a red monster that I can move around the room at will, I have incorporated a couple of simple lines of code that include the two basic models of inhabitants: those who approach the invader and those who flee from it.

I can generate them in any number I want and with different types of characteristics such as speed, distance they will approach or move away from the monster, etc. as we can see in these screenshots of the action.

Fig 3 - Testing behaviours for the monster and the base inhabitants in a random room. Male civilians will follow the creature until a safe distance, female civilians will run from it and the soldiers will try to catch the monster no matter what.
Fig 3 – Testing behaviours for the monster and the base inhabitants in a random room. Male civilians will follow the creature until a safe distance, female civilians will run from it and the soldiers will try to catch the monster no matter what.

The next step was to give the monster the ability to kill or absorb the poor humans, something that I have implemented by adding a simple ‘energy field’ that surrounds the monster and when in contact makes other living beings disappear. At this point the ‘energy field’ is just a capsule collider, later to be replaced by a particle effect or some sprite animation.

Finally, the characters will have to show an animation according to this situation, disintegrating or burning until they are just ashes.

It sounds simple enough, but to implement it correctly I must be able to identify the object that has collided with the energy field of the invader, which presents some additional difficulties, which has taken me a good part of the day to solve.

Basically, all the characters have a set of animations that is controlled by the Animator component of each one of them. This component also has a series of conditions or parameters that indicate which animation to use from the list of possible drawn sequences.

The script that is in charge of eliminating the objects that encounter the enemy must tell the Animator component to stop showing the character walking and to select from the list the animation corresponding to the character’s death, all of which is achieved by modifying the value of a variable at the appropriate moment.

This is a work in progress, more to come soon!

List of figures

Fig 1 – 2 pixel provided art by Emilio Almiron

References