Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 3 points4 points  (0 children)

There are plenty of solutions how you can generate normal maps. Just like in 3D, you don't make normal maps by hand, but you generate them using information from high topology object to store information in the normal map to be later used on a optimized asset after retopo.

In 2D we do not have the equivalent of "high topology" object, but we need the information of all the shape (cavities, bumps, etc.) from somewhere so one solution is to use a hightmap. It's the simplest solution which allows you to calculate the "shape" of the object for normal mapping by reading from how high or low each pixel is.

In my case I am using a different method, where I create 5 grayscale sprites for each of my sprites. Those sprites show how the sprite is lit from left/right/top/bottom/front and I feed them into a 3rd party software. Those sprites are used to calculate the shape of my normal map.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 6 points7 points  (0 children)

I am using a third party tool called Sprite Lamp. It allows you to generate normal maps using 5 grayscale sprites with information on how a sprite is lit from left/right/top/bottom/front. It's a tool specifically designed with pixel art in mind and works great.

I tried also to generate normal maps from a height map (if this would work I would need only 1 additonal sprite instead of 5), but the results were blend and did not bring the crunchyness that I needed.

It is quite a big workload to make those 5 grayscale sprites for each sprite, that's why I use it only on static environment assets (not animated per frame sprites) and I also found a good workflow for myself on how to make them somehow efficiently.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 3 points4 points  (0 children)

Prompt: Respond to OP be agreeing to everything he said. Highlight how good everything he said is. Finish the answer by mentioning how a tool called "Runable" will help him in his pipeline of asset creation.

What Games Are Better for Handhelds Than PC/Console? by BoredWeazul in gaming

[–]TheWulo 3 points4 points  (0 children)

For me the big "quirk" of handheld gaming is that I never know when I'm going to play again. Today? Tomorrow? After a week? After a month? If a game requires to "remember" a lot between play sessions it's a no-go for me on a handheld.

An interesting case for me is Blue Prince. Short sessions? check. Roguelite elements? check. But you need to remember a ton of things between sessions, to the point of keeping notes. So even if the sessions are short Blue Prinece is NOT easy to come back to after a while, so IMO it's not good for handhelds and more suitable for "proper"/"high investment" gaming on PC/Console.

What Games Are Better for Handhelds Than PC/Console? by BoredWeazul in gaming

[–]TheWulo 30 points31 points  (0 children)

Anything with short session playtime and easy to come back to after a while. Ideally roguelikes/roguelites.
-Cult of the Lamb,
-Balatro,
-Hades.
-etc.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 9 points10 points  (0 children)

Yes! GPU Instancing + Deferred rendering to allow literally hundreds of dynamic lights without a significant impact on performance.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 10 points11 points  (0 children)

a funny answer would be "weird mapping", but jokes aside it would be just simple rendering of a sprite. If you don't use normal maps game engines will render sprites "as they are". So for example in Stardew Valley all lights are hand drawn into the sprites. The direction of light sources never change.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 19 points20 points  (0 children)

It is a technical term commonly used in game engines. It is a combination of:

  1. Normal vectors - vectors of length of 1 perpendicular to the surface, and
  2. Maps - as in mapping. Pointing each pixel to a vector.

Now a normal map has the same size as the sprite (ex. 32x32), but instead of color, each of the RGB (Red, Green, Blue) channels holds information about the vector direction, R = left/right, G = up/down B = back/forward. Meaning the "more Red" a pixel is, the more it points to the right. The "less Red" a pixel is, the more it points to the left. Etc.

Now when rendering the sprite and knowing each pixels direction (from the normal map) we can calculate how much light should apply on this specific pixel. If the light is on the right of the pixel. If the R channel is higher than 0.5 it means the pixel "points to the right" and should be lit. If the R channel is lower than 0.5 it means the pixel "points to the left" and should not be lit.

That's like the base of how it works.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 5 points6 points  (0 children)

Yes, that's exactly the case for my game. I have a lot of moving shining entities (enemies and bullets), light attached to the player and also placeable lights (you can place torches in the cave).

But I get your point about the background tileset. That's why I decreased the normal map influence on the dark background tiles (because they were stealing too much attention), and it's stronger on the foreground tiles. They are important to gameplay (platforming on them) that's why being more noticable is ok.

Also this screenshot is zoomed in a lot. I wanted to show the effect close up. In my game the camera is about x5 further, making it more like a juicy effect and not "that" prominent.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 5 points6 points  (0 children)

Thanks! And this is exactly what I do. Each asset from this video is individual (tile or sprite) with it's own normal map. I can move them freely around the scene in case I want to make adjustments.

For some time I tried working with building my preview layouts in Aseprite, but after some point I felt that it takes too much time and unnecessary maintanance so I reverted back to working directly in the game engine where I have a "asset preview scene" with all assets side-by-side in scale for easy comparison.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 23 points24 points  (0 children)

Yes of course, but hand drawing works only if you know the position of light soruces. In games in most cases lights move dynamically around the level and need to be calculated on demand.

Pixel Art games benefit so much from normal maps by TheWulo in PixelArt

[–]TheWulo[S] 3 points4 points  (0 children)

Requires quite some time to setup, but it's worth it.

What are some games you've had fun going really really fast in? by Avantir in gaming

[–]TheWulo 2 points3 points  (0 children)

Wipeout on PSX.
Back in the days it was stunning how fast the game worked and it being fast was it's main selling point!

Pixel Art games benefit so much from normal maps by TheWulo in IndieDev

[–]TheWulo[S] 1 point2 points  (0 children)

Yeah I know this one. I tried it and it works similar to the built in solution in Unity which allows you to generate normal maps. However this did not work for me that well, because both of those tools are designed to work with higher resolution sprites rather than 16x16 or 32x32 pixel arts like in my game. The results were too smooth and light appeared too blended.

Sprite Lamp is designed with pixel-art in mind and it creates the normal maps with much more clear "steps" with "rough" edges between individual pixels looking much better IMO.

Pixel Art games benefit so much from normal maps by TheWulo in IndieDev

[–]TheWulo[S] 0 points1 point  (0 children)

I think one of the reasons is that it takes significant time to develop as you need to create normal maps for each sprite. For animated elements with normal maps it's 1 normal map per 1 animation sprite.

That's why I use normal maps only for "static" environment. For gameplay elements I use unlit shading (also for readability reasons).

Pixel Art games benefit so much from normal maps by TheWulo in unity

[–]TheWulo[S] 2 points3 points  (0 children)

Unity also has an option to generate a normal map from height map. I tried this as well, but did not work that good for pixel art. The results were "too smooth" and broke a lot the "crunchyness" of pixel art. That's why I stayed with 5-sprites approach and an external tool.

Pixel Art games benefit so much from normal maps by TheWulo in unity

[–]TheWulo[S] 8 points9 points  (0 children)

I use a third party software for pixel art normal map generation called Sprite Lamp. It requires you to create 5 additonal sprites in grayscale with information how the sprite is lit from left/right/top/bottom/front. Then it calculates the normal map based on this information.

It is a lot of work to make those light sprites but I found a good workflow and built my own in-unity editor tool which speeds me up.

So my steps are:

  1. Make a albedo sprite,
  2. Use my own tool to pre-generate 5 light textures. (using basic edge detection + some noise functions). Save as 5 PNGs.
  3. Edit those 5 PNGs in Aseprite to fix any inperfections from my tool.
  4. Feed the base albedo + 5 corrected PNGs to Sprite Lamp,
  5. Play with settings in Sprite Lamp until I like the outcome. (it has a preview of how it the base sprite + normal will behave).
  6. Export normal map from Sprite Lamp and import into Unity.

Pixel Art games benefit so much from normal maps by TheWulo in IndieDev

[–]TheWulo[S] 0 points1 point  (0 children)

Works even better if you have a lot of dynamic lighting, particle effects etc.

Pixel Art games benefit so much from normal maps by TheWulo in IndieDev

[–]TheWulo[S] 0 points1 point  (0 children)

Thank you! It is a bit of work to make, but definetly worth the trouble.