So, as before, work continues on the Body system and progress continues to be made. Goldie, who is now on the forums here, has been working extremely hard along with Crimson on it and I think it’s safe to say the system is now functioning. It still needs testing as well as more capability and part logic added, but the underlying framework is coming together.
In the most recent Dev Diary I asked Goldie to talk a bit about the Body system, as she’s much better equipped to get into the nitty-gritty of it.
“Let’s start from the hard requirements – we need some way of being able to interface with the Body as part of a PlayerCharacter, and we’ve already constructed a Facet GetProperty system which is being used by the UI and the battle mechanics to get and set properties already, and is a good place to hook in the Director and Producer functions. So it would be ideal if we didn’t have to make a second interface for the Body parts – those should really be able to be communicated with via the same API.
Next, as we’re looking for a complex body, the only way to reasonably represent this is as some kind of tree structure. It doesn’t have to be a tree – it could be a list, but each BodyPart has to be able to maintain parent-child relations to be able to logically connect, for instance, a Knot with its Penis.
Cutting a long story short, it just so happens that Unity uses this very same structure (a tree) to represent its GameObjects, and can provide us with a method of automatically handling parent-child connections, and allowing us to easily observe the state of a Body in the Inspector at any point. It’s also automatically Serialisable, meaning it can be saved into scene data, and (IIRC) saved properly at a later point.
The complex depth of the Body system means that the classic GetProperty tagging method (using Attributes) isn’t going to work, so it does need a custom BodyFacet to translate the tree structure into a flat list of methods that can be called to get and set each variable.
Eventually this BodyFacet should also handle exposing the Add and Remove methods so they can be programmatically performed as needed, though right now that’s a little over the horizon (How to do this without requiring refreshing the entire FacetProperty structure in memory for the newly available functions is a possible concern).
There’s still some work to go on this topic, though – it’s very fresh, but has easily the cleanest and simplest implementation I’ve come across on this so far.”
Above you’ll also see a screenshot – this is taken directly from Unity and is a custom-made interface made specifically so we can inspect, edit, and debug bodies in the game. A lot of work has gone into getting it functioning and it’s going to be a real boon to us going forward. It also serves as a little preview to you guys, as you can see a lot of the parts that have already been implemented. It’s by no means finished, but it’s getting pretty far along now.
As of writing, Goldie and I have just finished a long call in which more questions were answered and more plans for progress were made, specifically on how to best gather and calculate total volumes and best calculate relative sizes of attached parts.
In other news, I played my first game of D&D last week. It was pretty feckin’ awesome. Shout out to my DM for running a great game.
Until next time!