Daggerfall Mechanics thread: Volunteers welcome

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
User avatar
Interkarma
Posts: 2962
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Mon May 07, 2018 7:02 am

ifkopifko wrote:
Mon May 07, 2018 5:57 am
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.
This is an excellent observation! It will allow me to simplify my setup even further.
ifkopifko wrote:
Mon May 07, 2018 5:57 am
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.
I'd made this observation as well and corrected for it, but I didn't quite make it this elegant. Instead, I calculate the "min cost" of first component then remove from combined costs. I suspect my "min cost" will likely equal offset gold, so I can possibly improve this as well thanks to you.
ifkopifko wrote:
Mon May 07, 2018 5:57 am
So, does the "universal formula" (combining the "duration", "chance" and "magnitude" parts together) make any sense from gamedev standpoint?
I already have a universal setup that can calculate any cost and swizzle all the parts and target multipliers together. All an effect template has to do is specify the component costs and the rest is automatic. A single function call does all the work and spits out the gold and spell point costs.

When I get a bit more time, I'm going to drill into your unified formula a bit more, as I think it's possibly a nice simplification of the current method. But I am more than happy with the current setup. It's fast, simple to use, and most importantly it gives me the results matching classic.

I've set myself the goal of building around 90% of effect scripts by the end of May, so that's going to be my main focus moving forwards for the moment. But I am looking forwards to refining spell costs in future thanks to your latest updates. The nice thing is I can just replace the formulas and compare old vs. new versions to confirm working.

Thank you again. :)

User avatar
Jay_H
Posts: 1306
Joined: Tue Aug 25, 2015 1:54 am

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Jay_H » Mon May 07, 2018 12:59 pm

My testing with resistances was limited to disease only. It seemed like the programming used erroneous number sets somewhere along the way. The short summary is this:

Normal resistance to disease: Disease possible
Critical weakness to disease: Disease impossible
Immunity to disease: Disease impossible

My critical weakness testing was with no other factors present, ie background questions. It makes me think what should've been a 1 or 0 value in Daggerfall was assigned various integers erroneously, which means you either are diseaseable (0 for example) or you don't have the diseaseable value (anything but 0). This was just a theory I put together from about 200 hits under various conditions.
**INDEFINITE HIATUS** Check out the Daggerfall Unity mod page on ModDB.

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Mon May 07, 2018 4:22 pm

Would someone be able to provide a savegame with 100 all-skill character for retesting one spellmaker spell please?

Interkarma> Hey, where did that github link go? I have taken a look at it earlier today and indeed, you have done it in a very elegant way (at least the parts I could understand).
My bad is, that I did not realise that magnitude is the only effect with range/intervals. :D Oh well, I am a Daggerfall noob. Makes the total cost formula even simpler.

My idea was to have the total cost calculated in one go, but I like your approach too. I have no idea which one is more effective.

Good news for future streamlining:
1: I have tested all the spells in the excel file, and indeed, you can safely calculate magicka_cost from the gold_cost, just using the skill_level value. ( magicka_cost = gold_cost * (110 - skill_level) / 400 )
2: As you say, all the spells with two effects applicable do have offset_gold value = 0, then you can just add the partial costs together and discard the "min cost" calucation. There are nine single effect spells which do have nonzero offset_gold, so it has to stay in the formula though.

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Mon May 07, 2018 10:13 pm

Jay_H wrote:
Mon May 07, 2018 12:59 pm
My testing with resistances was limited to disease only. It seemed like the programming used erroneous number sets somewhere along the way. The short summary is this:

Normal resistance to disease: Disease possible
Critical weakness to disease: Disease impossible
Immunity to disease: Disease impossible

My critical weakness testing was with no other factors present, ie background questions. It makes me think what should've been a 1 or 0 value in Daggerfall was assigned various integers erroneously, which means you either are diseaseable (0 for example) or you don't have the diseaseable value (anything but 0). This was just a theory I put together from about 200 hits under various conditions.
Thanks for the extra feedback Jay. :) Daggerfall does seem quite bugged with its handling of resistances, at least as far as diseases go for sure.

Without any hard back-end information to go on at this stage, I'm going to implement this in a way that seems robust and sensible on my end, while allowing for things to be tuned/overhauled later as required. My mantra through this whole project is that it's better to have something working 80% right now and worry about the other 20% later. As they say, perfect is the enemy of good.

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Mon May 07, 2018 10:17 pm

ifkopifko wrote:
Mon May 07, 2018 4:22 pm
Would someone be able to provide a savegame with 100 all-skill character for retesting one spellmaker spell please?

Interkarma> Hey, where did that github link go? I have taken a look at it earlier today and indeed, you have done it in a very elegant way (at least the parts I could understand).
My bad is, that I did not realise that magnitude is the only effect with range/intervals. :D Oh well, I am a Daggerfall noob. Makes the total cost formula even simpler.

My idea was to have the total cost calculated in one go, but I like your approach too. I have no idea which one is more effective.

Good news for future streamlining:
1: I have tested all the spells in the excel file, and indeed, you can safely calculate magicka_cost from the gold_cost, just using the skill_level value. ( magicka_cost = gold_cost * (110 - skill_level) / 400 )
2: As you say, all the spells with two effects applicable do have offset_gold value = 0, then you can just add the partial costs together and discard the "min cost" calucation. There are nine single effect spells which do have nonzero offset_gold, so it has to stay in the formula though.
I'm sorry about the link! I wasn't sure if it contributed, so trimmed down the post a little to keep myself on track. I have a bad habit of going off on a tangent. Here it is again.

I can definitely clean this up even more thanks to your refined approach. It's very exciting to have this kind of back-and-forth with the community to hone in on a good solution to something I didn't understand at all not that long ago. :)

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Wed May 09, 2018 4:43 pm

Actually, I would like to volunteer to tackle this small task myself (streamlining your code and correcting/filling in the correct a, b, and offset values). If you have no objections that is. I am not a coder and could not create anything on my own, but modifying something so well documented as your code should be doable.

The biggest obstacle for me right now is understandig how GitHub and creating pull requests works. I have managed (thanks to your tutorial) to set-up GitHub and download your code, and set-up Unity.
Have found this thread so far: viewtopic.php?f=4&t=150&hilit
If there is some other helfpful tutorial available, I'm all ears...

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Thu May 10, 2018 8:22 am

Hey, I might have made some mistake, did not plan to create a pull request correcting the offsetGold values and getting rid of "factor" until this evening, when I can check the changes are working.
Seems like editing my branch, which has been set for the previous pull request from yesterday automatically translates to open pull request. I did not envisage this to work like that.

Sorry, if there are some errors, I'll fix it today. :oops: Although, I am not aware of any, but I only corrected the values on GitHub via web, so no building...

EDIT: For the sake of completeness, I'll attach the latest excel file for spells, with correct a, b, and offsetGold values. Remember that "factor" is not needed anymore, so in future when adding new spells, remember that in MakeEffectCosts you only need to define (a, b, offsetGold).
Attachments
Spells edited 23.zip
(191.2 KiB) Downloaded 7 times

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Thu May 10, 2018 8:56 am

It's all good mate, you're doing amazing stuff here! :) I think I made a mistake on my end testing anyway, as my subsequent tests all worked OK. Error most likely mine, but another set of eyes always welcome. I'm sorry for the hassle.

If you can, grab a copy of Unity 5.5.0f3, Visual Studio Community, and GitHub Desktop. This will help ensure the check-ins are properly spaced and aligned, and you'll have more control over sending your PRs. And you'll be able to spit out a build for testing things in game after changes as well.

And I'll be a little more patient next time and confirm you're ready. :)

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by ifkopifko » Thu May 10, 2018 3:22 pm

Ok, so just tested some wild combinations and seems to work as intended. Phew, you had me worried a bit. :D And sorry for the formatting issues, will remember not to use tabulators in the future.

About the "premature merging": I just wanted to correct the spell constants during my free time in work (and test it for errors/warnings later at home), so there was no option to install stuff on my PC. At home, I used GitHub Desktop and for editing the code I used something that came with unity... MonoDevelop. Will try Visual Studio Community.

Now I think I understand how GitHub and pull requests work. :)

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

Re: Daggerfall Mechanics thread: Volunteers welcome

Post by Interkarma » Fri May 11, 2018 7:33 am

ifkopifko wrote:
Thu May 10, 2018 3:22 pm
Ok, so just tested some wild combinations and seems to work as intended. Phew, you had me worried a bit. :D And sorry for the formatting issues, will remember not to use tabulators in the future.
I'm Sorry about that ifkopifko. I was just about at the end of my rope last night. No problems on the other stuff, it's all great work! :)

Post Reply