This is my first package. Wish me good luck. This package was awkwardly developed and is really cursed internally. Hopefully it’s still usable.
Please star it if you like it.
This is my first package. Wish me good luck. This package was awkwardly developed and is really cursed internally. Hopefully it’s still usable.
Please star it if you like it.
What does it do? What’s an arcane entity management system?
It stores up to 64 traits efficiently (Using a single Uint64), then, it efficiently evaluates statement
effectiveness =1.0
if (electro)
effectiveness *= 2.0
end
if (laser)
effectiveness *= 2.0
end
#etc…
And turn it into a single lookup
arr[((Value&mask)*magic)>>shift]
Example use includes efficiently Calculating job weight and other attributes from species trait in Stellaris.
For example, the politician job weight modifier is as following.
Modifiers
We can turn this into a single mask, multiply, shift, lookup calculation.
Another example is… imagine if Pokémon can have more than 2 types, we can calculate the attack’s effectiveness by this principle as well.
Update: Fixed random dependency.