Data-driven game stat modeling framework for .Net
Drape is C# data-driven modeling framework for game stats/attributes.
It is being developed for Unity but is not Unity dependent, thus can be used without it.
Important
It is work in progress and current API is subject to change.
Drape has been started as a side project facilitating management of numeric game stats.
Main requirement was ability to create and register stats that then could be dynamically modified with stat modifier objects.
Stat components
---------------
B - base value
R - raw modifier
F - final modifier
Modifier types
---------------
f - flat
m - multiplier
Raw value formula
-----------------
R = (B + Rf) * Rm
Rf = Rf(a) + Rf(l) + Rf(g) + … + Rf(x)
Rm = Rm(a) + Rm(l) + Rm(g) + … + Rm(y)
Final value formula
-------------------
F = (R + Ff) * Fm
Ff = Ff(a) + Ff(l) + Ff(g) + …. + Ff(x)
Fm = 1 + Fm(a) + Ff(l) + Ff(g) + … + Ff(x)
JSON serialization supported with SaladLab fork of Newtonsoft Json.NET. You can get latest DLL file from here.
Private setter serialization supported with custom contract resolver method as described in Daniel’s blog.
Yaml serialization supported with YamlDotNet. Get latest release dll from here.
BaseStatData.ToJSON()
method only serializes public properties and doesn’t allow to serialize members.BaseStatData
needed? Can Stat
be serialized directly?.dll
..sln
solution file and open it from Visual Studio./Drape.Source/Drape.Source.csproj
(existing project) to the solutionDrape.Source
project.