I wrote a comprehensive post in DoN’s WIP thread on the Unreal Engine forums so that I’d add rehash that content here too while I was at it. Having all your content in one place is ideal but sometimes it can pay to add that extra bit of effort in developer forums especially for a technically complex game like DoN where there’s features that are sure to interest other game developers as well.
I’m also preparing a video for DoN’s first comprehensive gameplay demo! Not some fancy cinematic eye-candy backed by another astute selection of Vivaldi’s fabulous music, but the actual game with detailed commentary for many features I’ve never shown to date! (and there’s many of those for sure).
For now though, here are some massive DoN updates from last month:
1) DoN’s Voxel/3D AI Navigation for Unreal (as free plugin soon!)
Nearly all my time has been consumed by work on DoN’s voxel-esque 3D AI navigation. The good news is that by redesigning the system from ground up I’ve managed to pull off tremendous performance gains all across the board – generating 3D voxels is now faster (meaning players need to wait less for the game to load), high collision accuracy that was once considered unfeasible is now blazingly fast – to the extent that DoN’s butterflies now exclusively rely on this 3D / Flying AI package to travel from flower to flower amid some pretty dense foliage! The level of voxel accuracy needed for this was beyond reach with some of the previous techniques that I discussed last year on DoN’s youtube channel (or indeed, even the recent approach the game was using in December 2015).
It gets even better -fully dynamic obstacles are now supported! Blooming flowers accurately tag the chunks of voxels around them as unnavigable and even a blade of grass growing on the ground now can dynamically update the navigation voxels so that DoN’s tiny creatures don’t bump into these grassy walls! I’m also working on creating a separate plugin for this system; this involves decoupling my own game’s classes from the system (a fair chunk of refactoring) and learning about how Unreal’s plugin system so I can bundle it up into a nice tidy package. Why, you ask? I plan to release this plugin for free soon!
Here are some screenshots of dynamic collision (red voxels amid green) “blooming” around flowers including a pic I didn’t post on the Unreal forums (some fresh content for those visiting DoN’s website eh :))
2) Species Deisgner!
Simultaneously, I also worked on developing a scalable architecture for DoN’s Species Designer; this design is capable of rapidly onboarding new species of plants/animals/etc… not just species designed by the developer (i.e. me), but also (and especially) species designed by players themselves!
I had to throw away and rewrite vast amounts of existing code as usual. It’s quite a leap going from “this creature is a butterfly, all butterflies have x, y, z traits” to “this is a winged creature designed by the player that has traits x, y, z and therefore may interact with a hypothetical Species “S” with traits a, b, c under specific constraints defined as k, l, m, etc). It was a difficult a process to be sure, throwing away code that I’d painstakingly built over several months and trying to fit things back in – like pieces of a jigsaw puzzle, into this new, generic, species designer friendly framework. Painful, but absolutely worth it. Having strong, robust architecture as the backbone of your game (or indeed, software) provides an immense sense of relief and confidence, knowing that when the time is right, this thing can grow unimpeded into a large scale ecological simulation. Obviously the technical demands for a complex ecological simulation are pretty unforgiving (AI navigation and behavior across a huge variety of terrains, myriad species with highly bespoke locomotion and behavior, huge performance concerns for eusocial insect colonies, etc, etc) so any amount of time spent in perfecting the core classes and frameworks early on in the game is time well spent in my opinion.
Back to the Species Designer – this thing allows an unprecedented degree of customization for DoN by enabling players to design new species for the game, eventually controlling morphology of any species (the most difficult part), behavioral traits (almost there) and complex lifecycle events with intuitive event dependency chains that players themselves can add (should they desire to do so). The game itself will be released with a decent selection of developer created species, not to fear. Initial versions will probably have only a limited selection of insects, plants and hopefully some reptiles and amphibians. Birds are probably do-able, mammals are admittedly a distant dream. I’d rather have a small selection of species whose lifecycles (and lives) are well portrayed than a motley collection of creatures. If I’m able to develop a rich Morphology Editor for DoN’s Species Designer maybe even players can help with the process but that is a stupendously difficult technical exercise – several orders of magnitude more challenging than even DoN’s Voxel Navigation when animation solutions for custom morphology are taken into account.
Morphology aside, a Species Designer UI for designing roles, traits, lifecycles, etc hasn’t been developed yet either. I do have a developer version of it backed by Unreal’s native editor widgets but the actual player interface (backed by Unreal’s UMG or even raw Slate UI technology) is a crazy amount of work to do. I’m optimistic though, as architecture level support is there and data structures for the persistence layer are more or less locked in. And that’s what’s important for now.
Here’s a simple ASCII diagram – a brain dump of my thought process around modeling a generic species defined by player driven roles and constraints. Read the following sections more a more detailed take on how this actually works.
3) Writing AI for a creature you don’t know at compile-time
The creators of Spore wrote an interesting paper entitled How to animate a character you’ve never seen before. I haven’t decided if I want to tackle that problem yet, but I do face a similar quandary myself – How do you write AI for a character designed by the player after the game is released?
To solve this I came up with a “Species planner” system. Each species (plant or animal) has a “Roles Plan”, “Lifecycle Plan” and “Locomotion Plan”. “Actionable roles” operate in a dual subject v/s doer modality. Players will assign appropriate roles to each species and enjoy full control through exposed metadata. A role itself is implemented fully in code.
Here’s a screenshot straight from my forum post with some practical examples of how species roles would work:
There’s more to it obviously, but this post is already getting long so just let me know if there’s interest and I’ll do a video on it when the system is ready for show time.
4) Camouflage System
A basic camouflage system is now ready! Both players and AI are governed by “Visual Trails” which react to the kind of surface a creature is sitting on, the speed at which it moves, etc. Bonus points for creatures with naturally disruptive patterns or pre-camouflaged morphological features (eg: Lichen Huntsman Spiders, Spiny Leaf Insects/etc).
Can you spot the butterflies in this pic? Jumping Spiders have superb vision though, so they sure can!
5) IKinema IK for foot, biting, etc
I purchased an IKinema Indie license recently and have started using it for Foot IK, biting etc. I’m going to do a complete video on it when I get some spare time (lol ) but here’s a screenshot for now. Foot IK for our eight-legged Jumping Spider was setup very quickly using their Foot Placement node. This is what ensures that the feet are grounded to an adjoining surface (even the underside of a petal) as opposed to having feet hanging in mid-air or poking through the upper side of the petal breaking immersion completely (this is what was happening before I setup IK).
UPDATE For the sake of completeness:
IKinema was replaced with FABRIK IK for Drunk On Nectar before it released on Steam. This was a mandatory move to allow for Linux support (IKinema initially hinted at Linux support for the Indie license but this never happened) but there were other compelling reasons too. Between IKinema’s issues with building UE4 from source and IKinema’s 4.12 plugin which had so many fundamental changes that the IK setup had to be practically remade, it was just easier to ship Drunk On Nectar using FABRIK IK.
I read that subsequent versions of IKinema plugin simply did not work with source-build UE4 versions at all (unlike the previous versions which had some kludgy workarounds to get this to work) so in the long run using FABRIK appears to have been a good move. IKinema is probably still not a bad idea if you’re only targeting Windows, it just wasn’t the right solution for me.
End of Update
You’ll also notice DoN’s custom Spider-Walk solution here. It works past 90 degrees, handles gimbal lock and every other complication that others who’ve gone down the same road will immediately recognize.
6) DoN’s Procedural Generation
Just a reminder that every single thing you see in these images has been procedurally generated at run-time from a totally empty map! Every single leaf, stem, flower and blade of grass is procedurally grown (trees aren’t fully procedural yet, but they are fully dynamic and affected by seasons). I’m not sure if I’ve emphasized this point strongly enough before.
Here’s anther image below of a proceduraly generated floral paradise on a rainy night!
7) Alpha/Demo download
In short – there’s a jaw dropping amount of work to be done but I’m getting there.
The good news is the the floral simulation (seasonal changes, seed dispersal, germination, pollination, etc) is in a very strong place already. We’ll see!
To quote my impassioned verbiage that concluded my post in the Unreal Forums:
“I’m absolutely convinced that a proper nature game is the only unexploited genre in gaming – it’s the only source that hasn’t been fully (or even partially) tapped – not as a game where animals are anthropomorphized as part of some larger human story but as a game where Nature is the storyteller and every single creature be it insect, reptile, bird or mammal is the protagonist and their lives are the stories being told.
I will not rest until I make this game come alive!”
Most certainly won’t!