Decouple Magic Rounds from Timescale

Discuss coding questions, pull requests, and implementation details.
Post Reply
JaceyLessThan3
Posts: 9
Joined: Fri Nov 08, 2019 9:42 pm

Decouple Magic Rounds from Timescale

Post by JaceyLessThan3 »

Currently in DFU, the duration of magic effects (measured in magic rounds) are dependent on Timescale. To see this in action, cast a self effect with a duration, and measure how long it takes before it ends. Next use the console command 'set_timescale 6' to change the timescale from the default of 12, and measure the spell effect duration again. You should find that it lasts twice as long.

It would be good to base the duration of spell effects on unscaled time instead, like the player's walking speed. This would allow players or mods to change the timescale without drastically effecting the balance of the game. There has been some demand for changing the timescale, though disagreement on whether it "should" be either 1 or 49.

I have been learning C# and the DFU codebase, so I am willing to do the work of implementing this, but I'd like input, and someone to point out which files would need to be changed.

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

Re: Decouple Magic Rounds from Timescale

Post by Interkarma »

Hey there. :)

Timescale is the rate at which game time passes relative to real time. The value is 12 because Daggerfall game time is 12x the speed of real time - i.e. 5 seconds of real time equals 60 seconds of game time. There's no disagreement or debate possible here, that's empirically what the value means.

Magic rounds are coupled to game time - not directly to timescale. The start of each game minute is also the start of a new magic round. Any changes to the flow of game time will also change the rate at which magic rounds pass. There is no chance this is going to be changed. This is fundamentally how Daggerfall magic rounds work.

If mods change the rate at which game time passes, they should expect systems related to game time to run at a different rate also. If that isn't the desired result, then mod should not be changing rate of game time.

User avatar
Kab the Bird Ranger
Posts: 70
Joined: Tue Feb 23, 2021 12:30 am

Re: Decouple Magic Rounds from Timescale

Post by Kab the Bird Ranger »

I think it would be more productive to start a mod where spells don't use magic rounds at all. Changes all durations to 5 unpaused real-life seconds per duration value

The round-based system makes short spells have quite different results depending on timing

Otherwise, I don't think DFU itself should change anything

l3lessed
Posts: 1151
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Decouple Magic Rounds from Timescale

Post by l3lessed »

Exactly, this is not a bug. This is merely a player preference. This could be resolved through a mod that changes the spell duration based on the current timescale setting. Just put an if then update check for time scale change in an update loop, when it detects it changes, run code to compute and update all spells current duration effects based on the new timescale.

As for short spells and rounds, this is just a balance issue, that again, could be resolved through updating the spells base stats so its more balanced at lower levels.

I would worry creating a whole new round system decoupled from the game time system would cause tons of compatibility issues for magic mods down the road that are mostly designed around the original game time round based system.

Both issues you are bringing up are really balance and preference issues and can be resolved without completely decoupling and changing the base system to ensure future function and compatibility with future mods.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

Post Reply