Closed: Overriding additional Daggerfall formulas

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Closed: Overriding additional Daggerfall formulas

Post by Uncanny_Valley »

I would like to be able to override some additional formulas in FormulaHelper. Specifically CalculateSuccessfullHit and CalculateAttackDamage. It's for a mod that would increase the chances to hit a target in combat, with skills having a larger effect on damage instead.

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

Re: Overriding additional Daggerfall formulas

Post by Interkarma »

The original vision for formulas was to create a FormulaProvider that modders could override (i.e. inject their own formulas just like the TerrainSampler can for heightmaps).

This is something I'd like to work as a stretch goal, but at this time I'm feeling (substantially) beyond the point of already having too much to do. The game is quickly approaching a feature complete state and I need to start locking down on creep and just finish all the game systems.

If you can wait for the future, this is something that can become possible. But I can't give a time frame on this right now. I expect the game will have a very long tail once all the base gameplay features are done. The best years of modding are definitely ahead. But I need to focus. :)

User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Re: Overriding additional Daggerfall formulas

Post by Uncanny_Valley »

But I want it now! ... kidding :lol:

Of course I understand. Focusing on reaching a feature complete state is definitely the right call. And take all the time that you need, no worries. ;)

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

Re: Overriding additional Daggerfall formulas

Post by Interkarma »

Thank you UV. If I can catch a break, I'll be able to do it sooner. I didn't want it to sound like a "no" at all. :)

I'm just started to feel incredibly overwhelmed at the moment with all the plates I have spinning at once.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Overriding additional Daggerfall formulas

Post by Hazelnut »

Interkarma, you don't have to do everything yourself you know! ;)

In fact I'd rather you left this one to me since I implemented the mechanism for overriding DFU formulas if you recall... for my Arch guild mod. Currently the mechanism doesn't use a FormulaProvider or any interface (mainly because formula are constantly being added and adjusted as we work though the re-implementation - or were anyway, maybe this is slowing down now) I created a registry system based on common signatures where you can register individual formula overrides so that it is easy to encompass new formulas and changes and the project develops. I did do some light refactoring to minimise the number of signature variants. Anyway, unless you want to scrap what I've done and use a different approach, I consider this my domain and will take responsibility for UVs request.

UV, that's possible. The reason they are not already overridable is that the method signatures are very specific to these formula and I didn't want to do any refactoring to attempt to normalise the signatures at that time. I decided to leave it until someone requested to be able to override them - i.e. now. :) I'm quite busy at present, but I will try to take a look at this in the next few days - it's not a very big job, and I'm keen to do little bits here and there as I can while I'm so busy to keep my hand in.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Overriding additional Daggerfall formulas

Post by Interkarma »

Thank you Hazelnut. I appreciate the assist. :)

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Overriding additional Daggerfall formulas

Post by Hazelnut »

Great, I'm glad you don't mind me considering this my turf so to speak! :) Oh, and I now recall the main reason for a mechanism that overrides individual formula methods.. so that mods will only conflict if they modify the same formula.

UV you say you want it "now" which is tongue in cheek I assume, but is there a point where not having it will stop your progress? Also any high level context around what you want to achieve may assist refactoring, PM if you want to keep it a surprise to the community. Specifically thinking if you need access to parts of these formula, since they are quite big and convoluted at present.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Overriding additional Daggerfall formulas

Post by Hazelnut »

I have some time, and more important, energy so I'm going to look at this now.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Re: Overriding additional Daggerfall formulas

Post by Uncanny_Valley »

The whole joke about "I want it now!", was more about my very blunt and direct way of asking in the first post. Where my intention was to keep it short and to the point, but I later feared it might have come across as a bit to demanding. :)

The concept of what I wish to achieve is this.

When speaking to friends or when reading comments online, one of the main reason why people do not want to play, or re-play Daggerfall (same as Morrowind), is because of the combat. More specifically the hidden dice %-to hit , that people find rather annoying and un-immersive.

In the future, I would like to do a big combat re-balancing mod, that make combat more action based, like Oblivion and Skyrim. But that is a huge and complicated mod that isn't really feasible to do right now, not without all base systems in place. But... I figured I could start by doing something a smaller, not "fixing it" but instead alleviate the problem that people feel with the combat.

I wish to increase the chance for the player/enemy to hit their target, but keep the balance of the game. With all skills, weapons and attacks being just as balances as before, and combat shouldn't be more difficult or easier, nor faster than before either. I'm not sure what I would change to achieve this (since the formulas are a bit... complicated) , but I do know that I need to override those formulas to do so.

But I can take some time, figure out exactly what I wish to change to create the effect I want and get back to you. And thank you Hazelnut for taking the time to help. :)

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Overriding additional Daggerfall formulas

Post by Hazelnut »

Ha, no problem. It fired me up to do some DFU development, mostly have no time or energy with workload at the moment but is nice to do some small bits. As I said, I left this until someone requested and it's really great that you have and I can go back to it with purpose. :)

So, been hacking on this for past couple of hours and now have added the following overridable formula. I'm hoping that this will provide the modding facilities you need but I was guessing and simply doing what made sense as I broke down and refactored the calc attack dmg function.
  • CalculateAttackDamage
  • CalculateSuccessfulHit
  • CalculateStruckBodyPart
  • CalculateBackstabChance
  • CalculateBackstabDamage
Will post a PR later on, but need to do some testing first. Please review the hell out of my changes, since there's no unit tests to flag up any mistakes made when I refactored the method. I tried to keep it to a minumum and not get carried away.

If I need to do more work once you have figured out what exactly you need, then we can come back to it but this should be enough for you to get going and start to feel out your path forward.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply