Sensible way of making a list of stats that can be easily added on to?

So I’m working on a monster taming RPG and I’m putting down the groundwork for an attributes system.

I want each monster to have a List of attributes, and I want to be able to add a new attribute to the game when designing with as much ease as possible.

Here is what I’ve come up with so far:

AttributeData is just an empty Scriptable Object. I can make them in the Unity Editor easily, name them and then they’re done.

Modifiers is a class that just holds an int value

Attribute is a class that holds 1 AttributeData, an int baseValue, and a List<Modifiers>

Finally my Monster class has a List<Attribute> that I can sift through to get the different values.

The only issue I have with this is that I find matching up via SO harder than something like an enum.

So if I want to find the Attack Power Attribute, I have to have a reference to that one to identify it.

Not a huge deal, but I guess I’m just wondering if anyone has any better ideas on how a system like this could be implemented. Thoughts or feedback on this would be really great :smile:

This is a lot like my approach for my Datasacks package, which is a general purpose bags-o-data scriptable object thing.

On startup it jams them all into a Dictionary for fast access by name.

It also supports code-generating so you can transact against your Datasacks by compiler-checked code, not just string names.

It’s intended to interoperate with UI mostly, but it can really interoperate with anything, or be coopted into anything else, as it’s all just software, right? :slight_smile: This is the system overview:

8687265--1171653--20180724_datasacks_overview.png

Datasacks is presently hosted at these locations:

https://bitbucket.org/kurtdekker/datasacks