This devlog brings warmth to my cold and bitter heart.
I aim to defrost and inspire.
---
Little update since I've been quiet for a bit.
The familiarity stuff isn't done yet but I've got it hooked up better and the beginnings of dog/dog associations are in. Right now dogs get mad at other dogs for barking when they're trying to sleep. Additionally, dogs are now less likely to interact with things they're afraid of. This is easy to translate to other emotions, but there's a lot of balancing that needs to go into it.
My current energy, however, is going back into dog pattern generation. I had started to get into it a while back but it wasn't super straightforward so I had put it on the backburner. I'm back at it now though, and I've got a strategy that's working pretty well!
There's a decent amount of info here even though I'm not done yet, so gather 'round...
My initial pipe dream was to evolve the patterns similarly to how they might generate in nature. I did a little research into this but my dreams were slowly crushed under the pressing weight of Math.
I landed on this page (
http://www.theshapeofmath.com/princeton/dynsys/pattern) and although it was super interesting, it was also a little above my mathematical skill level and getting this working and controllable to the level I need wouldn't be the best use of my time.
Thankfully, I came up with another way of making this stuff work. This is probably really obvious to anyone who's tried to do this sort of thing before, but I was pretty pleased when I came up with it. It's basically just image compositing. I pre-draw some simple shapes and combine them into a single image according to a dog's genes and some special rules for each type of pattern. The result looks pretty good and is super easy to control and extend, so I'm really happy with it.
My pool of example textures is pretty small right now so you can notice some repeating patterns, but it's super easy to add more so I'm not too worried.
Spots are real easy. They have pools of different sizes to choose from, and the resultant images can be flipped in any direction and placed at any location.
Stripes are a little more complex but still not that bad. They're built from connecting segments (6 types of base segments and currently only 2 variations of each type) so they can be any size, and they can change horizontal placement, shorten themselves, or flip upside down right now.
Obviously I plan on having more types of patterns and per-pattern variations than just these, but this is where I am so far and even just this basic set of stuff is giving me a nice variety of dog looks.
The other aspect to this that took up a decent amount of my time was figuring out how to seamlessly and dynamically set up textures for these guys. I drew out lots of complex diagrams to try and figure out how best to set up UVs and generate textures that would seamlessly loop in all directions, but in the end I decided to simplify things and avoid having any patterns generate on the front and back faces. I might still revisit in the future, but for now I'm pretty ok with how things are looking, especially since their faces cover the front body face and they might eventually have tails in the way of the back one.
ALSO, it's worth noting that not all dogs will have patterned bodies; it's a gene thing just like everything else. The basic dog, for example, is still the same as ever.