Nested prefabs + prefab variants are pretty exciting. It'll be a while before I get round to making things that will really benefit from them (player and enemies, and probably lots more stuff, being variants of an "actor" prefab?) but I'm tempted to upgrade and dive right in.
In the meantime, I've got a point with the palette generation where it's very flexible and can be customised to do a lot of stuff, and I can probably leave it and decide later which stuff I actually need.
I abandoned the after-the-fact palette size reduction in favour of a more top-down approach to achieve roughly the same thing. Now it generates a set of "base hues" (at least as many as there are dungeons), purposely missing out some parts of the hue spectrum so that those colours don't appear. This may or may not be enough to give a feeling of a different colour palette between runs, but it should at least mean certain colours are emphasised and de-emphasised.
Depending on the settings, the other colours it generates may or may not be limited to those base hues. To sum up the other things it does now...
Floors and doors:
- It finds coordinating colours by rotating to the next base hue (analogous) or going to the opposite base hue and rotating from there (split complementary). This way it finds nicely coordinating colours while sticking to the existing base hues.
- It can also be set to just calculate a new coordinating hue as before.
- I settled on making the floors and doors the same colour, although I might later enable both as random options.
Other ramp sets:
- When generating other ramp sets, e.g. for the overworld or the player, it has certain ranges of colours it allows, e.g. the greenery has to be in the valid green range. It finds a colour within that range, and then looks at the base hues and snaps to the nearest matching one. This way it isn't inventing a new green (for example) but taking one from the existing palette.
- If it doesn't find any base hue within that range, the current setting just makes a new colour, i.e. if there's no green for the greenery, it invents one.
- It can be set to snap to the nearest base hue regardless, but this can lead to rather alien colours (e.g. purple leaves, red water).
Note:
all of the snapping-to-base-hues I've mentioned can be turned off if I later decide it's not important =) It can easily be set to a mode where it doesn't care about colours matching up at all.
General:
- I added hue shifting, and also some compensation for perceptually darker/lighter colours. The implementation of both is kind of guessworky and imprecise, but it'll do for now.
- I made it possible for one colour swap texture to draw from multiple ramp sets, e.g. skin colour and the player's outfit are stored separately. This way, it's possible for (say) 3 skin colours to be generated for the whole run, and each NPC uses one of those, while their outfits are calculated and stored separately.
Anyway, here is an example:
A few more here:
https://imgur.com/a/WbRwNUK
I don't have any art for the overworld yet (and won't for a while) so that palette is purely theoretical. It's mostly just nice that it's so easy to add new ramp sets and make them match (or not).
For the player's palette, there are details I'm unsure of (it might actually be better to forcibly make sure she
doesn't use any of the dungeon colours...) but this is best looked at later, when I have actual gameplay.
To respond to a couple of specific points
Weltall Zero made:
Personally I feel quantizing to a palette bigger than, say, 8 is not going to be restrictive enough that the player notices a different palette is used each run. 32 already seems impossible to notice, and any higher makes it even more so.
I'm no longer aiming for a fixed number of colours, but from my experimentation with the current version, I think there's a degree to which it's possible to shift the overall colour balance of the run in a way that it's perceptibly different.
Or not! If nothing else, the green in the overworld being different should be noticeable, I think.
Not really. There's nothing preventing you from conflating the enemy's palette and the current dungeon's. In other words, there's nothing preventing you from having the enemy have slightly different palettes in different dungeons.
This is something it can't do yet (the current system would keep enemy the same for the whole run), but I can always implement it if it starts looking beneficial down the line.
EDIT: Seconds after posting this I realised it's actually already possible with the current system. I made it more flexible than I realised!
I think I might have done all I can on the palette system for now... I should probably get back to art :'(
Incidentally: In all of this palette nonsense, the thing I'm most grateful to myself for is that I spent an hour writing a script to make taking perfect screenshots
incredibly easy to the point that it now involves zero Photoshop work whatsoever. I can just do it in seconds from within Unity, and it outputs exactly what I need (stitched, cropped, zoomed, border added). Huge timesaver compared to a couple of weeks ago!