Interkarma wrote: ↑Mon May 07, 2018 1:14 amThis does sound interesting! I am also interested in how you managed to automatically calculate the "factor" from other inputs. I'll try to split this out of the existing formulas, unless you can isolate more quickly for me.
Looking at all the spells I have noticed, that the "factor" in all cases (all documented spells) corelates with the value of "a". (factor=a/20) So it was not needed to begin with.
Short story long, looking at my old formula I realised how overly complicated it is and that even though it replicates the vanilla results accurately, it surely is not what any developer would use in his game... especially in the computer stone age. And when trying to combine the effects ("duration", "chance" and "magnitude") parts, the small sporadic deviations from vanilla annoyed me quite a lot.
Also, I could not explain to myself why in my old formula the magicka_cost should be essentially equal to gold_cost divided by "a", since "a" obviously serves another purpose already. So that was the starting impulse to investigate it. The revelation of factor being redundant finally made it to click together seamlessly.
One other thing is, that when combining multiple effects of a spell, the "offset gold" also becomes zero (did not try all the spells yet), but there are a few single effect spells with nonzero offset, so it is still needed regardless.
So, does the "universal formula" (combining the "duration", "chance" and "magnitude" parts together) make any sense from gamedev standpoint?
Or do you have to code every spell separately, inculuding the calculation part? That would give need to have 5 different formulas:
- single effect (e.g. duration) with no range,
- single effect with range,
- two effects with range,
- two effects without range,
- two effects, only one of them with range.
I have not noticed a spell with all three effects, but who knows what future mods could bring... not being very creative myself, I can not even imagine.
And cheers, I'm happy to be helpful, reverse engineering is fun in and of itself.