Sunday, 10 January 2016

NES style game in Unity - Part 7 - Fixing and upgrading some basic stuffs / reinventing the wheel

Hello everyone!

It was a long time ago I posted any updates on my NES style game. I have a post about the palette editor which was a good idea back then to create, but I made a mistake with it and I had to fix it. Let's see what's new about it and what are my plans with it!
So I realised a mistake. The palette editor uses a Texture2D as an information of the colours. So basically an uncompressed image file that contains the colours. But if you wanted to change the palette, you had to reassign all the colours of the 3 colour palettes which is not how it supposed to work. So instead of storing the colours for all palettes I store the indices of them so all the time I want different palette, the colours also change on all the palettes.

NES palette editor in Unity
Palette editor's current version in work.


Also I am planning to make a more global system for the whole palette problem. I'll use four materials for backgrounds and four materials for sprites. There will be a scene manager that tells the materials which colour palette to use. I created a special shader for that so it can easily replace colours. I doesn't just allow me to limit myself to the NES's capabilities, but it'll be possible to change palette runtime for creating nice transition effects too by cycling multiple predefined palettes. Day to night transitions will be kinda possible (within the limitations of NES's very basic color palette).