Daggerfall Mechanics thread: Volunteers welcome

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
ifkopifko
Posts: 109
Joined: Thu Apr 02, 2015 9:03 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Fri Apr 27, 2018 4:55 pm

Don't ya even mention it. I am happy to be able to contribute to this project, because you and all the contributors are the ones who ROCK! When I see all the progress made on various fronts, it's just unbelievable.

MrFlibble
Posts: 18
Joined: Sat Jan 27, 2018 10:43 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by MrFlibble » Mon Apr 30, 2018 9:44 am

Interkarma wrote:
Mon Jul 11, 2016 12:36 pm
Daggerfall Chronicles makes mention of this on page 141 against the entry for skeletal warrior: "Edged weapons inflict 1/2 damage". Although I was never really sure if this was actually implemented in game or not.
I remember reading somewhere else, maybe in the UESP WIki, that blunt weapons were more effective against all undead creatures compared to edged weapons (something like edged weapons dealing only half damage while blunt weapons do full damage), and I never doubted that, and the gameplay experience always seemed to confirm this. (The starting Ebony Dagger is still quite effective against all kinds of foes anyway). However I just checked the manual (searcheable copy that is included with the demo), and this information seems to not come from there.

As for seemingly random price fluctuations, could it be some either intentional or broken mechanic? IIRC there are hints in the Chronicles that prices may vary depending on conditions like wars between states or other emergencies, and the in-game world also appears to be tied to some calendar events like special holidays. Maybe the prices are affected by that, either they way they were intended to (e.g. prices go up on weekends for example?) or due to some code bug that makes them vary in an erratic manner instead of by specified conditions?

Regarding official sources apart from the manual and Daggerfall Chronicles, I suppose this may be useful to a certain extent as well:
Daggerfall Chronicles: The Lost Chapters (Wayback Machine snapshot from Bethesda's site, 1996)

ifkopifko
Posts: 109
Joined: Thu Apr 02, 2015 9:03 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Fri May 04, 2018 6:29 pm

Interkarma> Ok, I'm back with something, so if you will find the time, look into this and give me your thoughts please.

I have been laboring with the new universal formula to determine costs of spells, and finally, I have managed to come up with something that seems to fit (tried it on multiple different spell effects). Just combining the inputs for e.g. duration and magnitude with the old formulas resulted in some rounding errors (single spellpoint differences in some cases), so I tried hard to fix it. So I started from scratch (not quite though). The good thing is, that some variables have been rendered obsolete.

I attach the excel file, but please look only at the last spreadsheet (continuous damage spellpoints), only there the changes are final.

I have no idea how you go about coding the calculations into DFU, so tell me if it simplifies things or not at all.
The idea is to have a universal formula for all the spells (duration, chance and magnitude), even if not applicable to the spell. Not applicable part will get zeroed out. Is this a good idea from your point of view?
If you preffer the old method of having only relevant parts in the formula, I can do it like that with the new/simplified calculation formula.


One other thought for everyone reading this:
The original Daggerfall formula for spell costs is a bit flawed I would say.
Spells using range/interval, for example "heal health range" with magnitude:

Code: Select all

<1-1> + <1-1> per 1 levels
costs the same as:

Code: Select all

 <1-2> + <1-2> per 1 levels
That is because of truncation of (min+max)/2.
I was wondering, whether to keep this "flaw", or get rid of it. Results will be a bit different to vanilla, but only slight so. What do you say?
Attachments
Spells edited 18.zip
(189.38 KiB) Downloaded 6 times

User avatar
Interkarma
Posts: 2618
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Fri May 04, 2018 8:47 pm

Thankyou for continuing to work on this. I'll take a look at the new formula and let you know how it rolls in code and if I can simplify the setup.

I'm really happy with how things are working with the current formulas too, you've done amazing work on this all throughout.

Usernamicus
Posts: 8
Joined: Sun Dec 17, 2017 4:28 pm

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Usernamicus » Sat May 05, 2018 1:06 am

As a player I'd rather keep the 1-2 = 1-1 cost flaw. Though I wouldn't be particularly devastated to see it go.

ifkopifko
Posts: 109
Joined: Thu Apr 02, 2015 9:03 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Sat May 05, 2018 7:45 am

Sorry for spamming you with this. You are right, if it ain't broken, don't fix it. It's just that when I have tried to cobine the calcutaions for example for duration and magnitude, I have found some discrepancies for magicka costs when tested on various spells. That's because my old formulas have been needlesly overcomplicated and some truncations and rounding errors probably messed things up a bit. Nothing serious though. It might be that you have found a solution or used a different approach altogether.

One thing I did not mention in the previous excel, you can also calculate the "magicka cost" directly from "gold cost" if that is already calculated. You can see it in this next excel file. But I am not sure how often DFU needs to calculate magicka cost and gold cost. I might be totaly wrong, but my assumptions are as follows:

I suppose that magicka cost has to be recalculated on spell_cast, on open_spellbook and when spellmaker is in use at the least.
Gold_cost could be recalculated on save_load (in case mods should hook in and change the formulas) and when spellmaker is in use.

If the gold_cost for a spell is stored, recalculating magicka_cost from that value would make it very convenient and effective/simple.
Attachments
Spells edited 19.zip
(189.21 KiB) Downloaded 5 times

User avatar
Interkarma
Posts: 2618
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Mon May 07, 2018 1:14 am

ifkopifko wrote:
Sat May 05, 2018 7:45 am
If the gold_cost for a spell is stored, recalculating magicka_cost from that value would make it very convenient and effective/simple.
This 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.

Thanks again for your continued work on this! :)

User avatar
Interkarma
Posts: 2618
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Mon May 07, 2018 1:16 am

Here's a quick question someone might be able to help with. Does anyone know if Spell Absorption only absorbs damage from incoming effects? For example, the incoming spell has to damage either health, fatigue, or spell points? I'm assuming that more utility-based spells (e.g. paralyze, drain strength, etc.) will not be absorbed as they don't technically have a damage component?

This talk page on UESP also has some interesting points. It seems that the player advantage Spell Absorption (chosen during class maker) is a different effect internally to the Spell Absorption provided by spells or magic items. It also seems like the latter will take precedence over the former while active. Does anyone have additional observations around this?

User avatar
Interkarma
Posts: 2618
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Mon May 07, 2018 2:08 am

I'm also doing some work on resistances. This doesn't seem to be well understood by anyone at this time, but I have made the following observations:
  • Resistances appear to stack from various sources onto entity to create a sum "resistance value" of a specific type on that entity.
  • In classic, it's possible to stack lowered resistances (e.g. lower disease resistance from various sources) so far that it becomes a negative number. Classic then (wrongly) interprets this as player having a very high resistance to disease. This is not an exploit that I will attempt to reproduce in Daggerfall Unity.
  • I'm not really clear on how resistances work under hood. The resistance itself appears to be a modifier to the chance component of an incoming effect. For example, an incoming fire spell will have its chance modified down by the player's resistance to fire. If the final chance fails then player is considered to have resisted effect.
  • The similar "resistance", "critical weakness", or "low tolerance" advantages/disadvantages all just appear to be +/- modifiers to the final resistance value. I don't have any numbers to assign to these yet however.
I would be interested in some discussion around resistances if someone is willing. I don't need to get this 100% right first go, but a very close approximation of classic is ideal and we can refine it later.

ifkopifko
Posts: 109
Joined: Thu Apr 02, 2015 9:03 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Mon May 07, 2018 5:57 am

Interkarma wrote:
Mon May 07, 2018 1:14 am
This 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. :D
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. :D
And cheers, I'm happy to be helpful, reverse engineering is fun in and of itself. :D

Post Reply