Animations and Map Generation

Animations and Map Generation

Since our last post we have been working on two main areas:

  • Character Animation.
  • Map Generation.

Character Animation

We are using Unity’s Anima2D asset to animate all of the characters in Light Years. Anima2D is a 2D skeletal asset which implements sprite to mesh conversion and Inverse Kinematics to result in smooth and natural movements. Understanding how to animate sprite meshes has come with it’s difficulties, but we feel that our results so far have been an improvement upon our previous work made using standard sprite sheet animation.

Character Orientation

One major change we have made is the orientation of the character. We originally wanted to have north, south, east, and west facing animations, but due to the difficulty of making the north and south animations look natural we have decided to stick to just two orientations: south-west and south-east. So as the character moves up or down on the screen the character will always be either facing left or right respectively. It is very common for 2D games to have this “angled” orientation, and we can see why now, as it offers the player almost as much of a view of the character, but uses less sprites. Plus we found it adds a nice 3-D depth to the character. This may be subject to change in the future.

Below is an example of the character orientation change:

 

Animations

Character animations take a lot of trial and error, and there are going to be a lot of animations in Light Years. Luckily, we can reuse skeletons made for previous characters, and modify them accordingly. It has taken a couple of goes to get the core walking animation looking the way it does now, but we really like the result. Of course nothing is final, and we’ll keep tweaking this, and all other animations, as the project progresses and we improve on our process.

This is what we have so far:

(Male Character Walk Animation)

 

Colour Customisation Temporarily Randomised

All character colour customisation options will now be randomised until after a playable demo is released. Future colour customisation will include hair, eyes, skin, and suit colour. We originally planned for the first characters on board the ship to be fully customisable by the player, but we have now temporarily delayed this feature to narrow the scope of the project for demo release.

 

Dynamic Lighting

The lighting on all sprites will be completely dynamic within the game engine. This means that any character or object will be illuminated by any environmental/external light source that surrounds it in real time. We are using normal maps to produce this effect, which are generated through Sprite Illuminator. This is a great tool for creating really nice looking normal maps fast. This gives you an idea on what some of the characters will look like up close in game:

 

 

Map Generation and Planet Discovery

The planet exploration maps in Light Years will be procedurally generated. This gives the environment of each planet variety and reduces the chance of a player visiting the same place twice, even when saving before exploring the planet.

While you are managing your crew on the ship there will be a “Planet Discovery” event which will trigger at random. A dialogue message will display explaining that the ship’s AI has discovered a planet. It will then ask you whether or not you want to explore it in the hunt for more resources, or move on by ignoring the discovery. Information will be given to you to influence your decision such as the planets radiation levels, estimated gravity, possibility of life, and resources. Since there will be a permanent death system, and possible hostile threats on the planet, it is vital that you make the right decision – risk the life of your crew to explore an uncharted planet and gain more resources, or play it safe and possibly give up the opportunity to advance in your future journey.

So far we are still working on the core algorithm generating random tile maps in Unity, with help from Sebastian Lague’s tutorial on Cellular Automata. After the core tiles have been generated (walkable and non-walkable areas) the algorithm will then add “places of interest”, which will be common things found throughout all planets, including some but not all: caves, monoliths, alien remains, and more. The navigation mesh will be based on the current layout of the environment. Since Unity doesn’t have a 2D navigation mesh system we are using the asset PolyNav2D for all path finding within Light Years.

The gif below showcases an algorithm finding the circumference of the walkable area of the map. At the moment the algorithm is still in a testing state and bugs need to be ironed out, but here is what it looks like so far:

(Place holder tile set sourced from Unity’s 2d-extras)

The next step is to add our own tile map sprites to the map generation and apply the polygon collider to the walkable circumference path. Then PolyNav2D will work!