Just a quick update on some progress from this week. First up is a screenshot below of the prototype walls dreamingofserenity did for us. I’ve reapplied the old UV to this model, so it’s far from ideal right now. At some point in the future we will re-evaluate whether we apply a better hand drawn UV or use a solid colour, either with a bump map as well. For alpha this will suffice though.
On the code side, I’ve put together a functional stat/skill system for our first alpha build. I set out from the start to build something that could hopefully be easily extensible and reusable on other games, and I think I’ve achieved that (mostly).
I have a “stat manager” class (publisher) that acts as the interface between the stats and the rest of the game components (subscribers). From there I can instantiate stats/skills programmatically with a few lines of code for each. Perhaps down the road I’ll change the instantiation to be more configuration file driven, that will be ideal for maximum re-usability.
I’m using Unity Events for intra-system messaging at the moment, so I expose a method for other systems to send messages to the stat system, and of course expect the other systems to expose a similar interface to receive any response message. Internally, between the stat manager and stats I’m using c# delegates & events. I may have over-engineered this part of the solution, but it will be easy to unwind if I find I don’t need the flexibility of delegates.
The messages could be queries for current stat/skill levels, or in the case of skills, a request to “use” a skill. Thus, I have the flexibility to have the subscriber to determine how it interprets/uses the stat/skill data or have the skill/stat do it itself. The manager takes no part in the stat calculations, it simply handles the stats and the messages to and from them.
After talking to a co-worker, I’m probably now going to use more of the subscriber determines “use” model, expecting that the subscribers will cache the stat values they need and then operate on those cached values to determine end result and report back whatever the stat system needs to keep stats up to date or level up. This will keep intra-system messages down to effectively updates when stats/skill levels change or need to be updated. (thanks Felix!)
I have the stat system also linked up to the character generation system, allowing us to have the assets affect the character stats. The beauty of this that it took less than an hour to implement and test, so I’m happy with that result. As an example of assets affecting character stats, different species mouth parts may affect a food consumption stat (e.g. characters with human mouths eat more than bug mouths).
Whatever we do with body parts and stats, it will take careful balancing, as conceivably the procedural generation of characters could end up with some very unbalanced, stat-wise, characters. Whether we do this or not is still up for discussion, or even better, feedback from our readers! (*hint hint*).
That’s it for today. Again if you like what we’re doing, please hit the Like button and if you’re not following us yet, please hit the follow button too! We appreciate the support and feedback.