Game
Xenosis: Alien Infection

7 years ago

Devlog #4 - Lighting Tech


Hi everyone, for today’s update I thought it would be good to show some behind the scenes tech from the game, and show the progress over time from one of our early builds.

When designing Xenosis, I knew that I wanted to give a unique take on the top down genre and really use lighting to great affect to create atmosphere in the game. I knew how I wanted it to look in my head, it was just a case of translating that into the game engine.

Traditionally, 2D games are all created on a flat 2D plane, with the sprites “sitting” on top of the background, and that’s how I originally started prototyping the game, but it looked so flat and I spent a long time writing a “fake” 2D lighting system, that could cast shadows, but it just didn’t look right.

In order to get the look I wanted, I needed to leverage Unity’s lighting system, and for that you need to be working in 3D. So I needed to change my approach in order to get this to work, and that meant two things.

  1. Sprites all need to react to realtime lighting.

  2. Sprites need to cast and receive shadows.

In order to achieve the first, that was relatively simple and just meant using normal maps to make the sprites react to light based on data contained in the normal map.

5d09e87394527.png

Then, in order to cast and receive shadows, I changed the game from a 2D layout and started re-constructing in 3D with hidden geometry that can react to light.

5d09e8743a4e7.png
5d09e8754934a.png

Once setup, now I could have lights react to 3D geometry, for example, a crate is simply a hidden 3D cube with a sprite on top, so you only see the cube sprite, but it casts a realistic shadow.

5d09e87649620.png

Now whilst this approach was good, it still felt very flat, and one of the biggest changes I made to the game that had a huge impact was to not display a 2D game using an Orthographic camera, as this projects everything as flat, regardless of how close it is to the camera, instead I swapped to a perspective camera, that allowed me to give height to the game.

5d09e8777e229.gif
5d09e87a5102a.png

Now things were starting to look good, but it still lacked a little, so then it was onto the level details and shader tech. I worked on creating details to adorn the levels with, cracks in the floor, rubble and misc items, things to give more context to the levels. I also worked to create deeper shadow areas, allow light to have more of an impact and overlayed a number of shader effects to bring grit and contrast to the game.

Now it was starting to look as I had intended, and the lighting was constantly being tweaked to get it looking just right.

5d09e87b309ad.png
5d09e87c1236c.png
5d09e87d0a6bc.png

Now with this tech in place, we have super juicy things like volumetric lighting, particles that react to lighting and we can use loads of dynamic lights to make it look super awesome, whilst still maintaining performance and this is something I am very proud of.

So lastly, here is quick peek of it all put together as it is now. This shows you the “flat” 2D sprites inside the game engine, without any of the lighting turned on, and this is viewed directly from above would indeed look like a traditional 2D game.

5d09e87e11f57.png

As you can see, all the in game items such as these crates and the player are flat sprites, but they are hiding the invisible 3D geometry, so lets turn the lights on to see what happens…

Now you can see how the light is reacting to the sprites, and the 3D geometry is casting realistic shadows. The custom shader tech I wrote handles the sprites receiving those shadows and reacting as if they had real texture that responds to light.

5d09e87eecd43.png

Finally, now you can see the same thing, but this time from the game view with all the shader tech enabled.

5d09e880181e9.png

And there you have it, realistic lighting and shadowing in a top down 2D game :)

So, there’s a quick look at our lighting tech, I hope you enjoyed reading and if you want more tech updates like this or behind the scenes info, let me know in the comments!

Kind Regards,

James.

5d09e88121d69.png

Xenosis: Alien Infection is being crowdfunded on Fig, visit the campaign here: http://www.fig.co/Xenosis



0 comments

Loading...

Next up

Update #8 - Development Update & Tier Rewards

117% funded and rising!

Devlog #2 - Gameplay

Update #6 - Music and Audio Design

Update #7 - Story Continued

Devlog # 1 - Inspirations

Devlog #3 - Story

Finished a project I've been working on over the last few days!

Modeled and textured in Blender.

#3dart #lowpoly #npbr #fantasy #hut

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.🛡🗡 Bookmark pre-launch page🔖🔖🔖

https://www.kickstarter.com/projects/rdvindiegame/the-patagonian…

Just a Pico sprite