0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
User avatar
Posts: 307
Joined: Wed Jul 19, 2017 7:54 pm

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by jayhova » Sat Jan 19, 2019 11:31 pm

My $.02. Safe spaces in arena in the first dungeon were very much intentional and commented on in the tutorial. Specifically the elevated platforms. It is not beyond the realm of possibility that they replicated this somewhat in Arena 2.
Remember always 'What would Julian Do?'.
Windows 10 Pro 64 bit. DFU Ver. 0.7.91

Posts: 3
Joined: Sat Jan 19, 2019 5:22 am

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by QueuedJar » Sun Jan 20, 2019 2:33 am

Interkarma wrote:
Sat Jan 19, 2019 6:41 am
Welcome the forums. :)

As far as I'm aware, random spawns and health recovery are coded based on formulas extracted directly from classic. But something to keep in mind is that classic has very loose timing management that is CPU bound, so the speed of a CPU or number of DOSBox cycles will yield different results on different systems. And randomness can be highly variable anyway. There's no one correct answer here.

Allofich/R.D. has tried to tune the end result to be reasonably equivalent to classic outcomes if running on the original 486 target platform, but there's obviously some interpretation required. It's more subjective a process than you might think.

I might move this one to General as it's more of a discussion around balancing and tuning than a bug directly. If Allofich feels something is actually amiss, I'll shift it back until addressed.

Edit: Regarding enemy interruption while resting, I remember raising this with Allofich a while back. I felt it was a bit high as well. But after testing in identical locations in classic vs. DFU, the interruption rates were very similar. Once exception was a spot in Privateer's Hold (centre of open area at bottom of throne room stairs) where nothing would spawn in classic. It's unknown why this would happen, but seems to be more of an issue in classic than intentional as far as we can tell. There's no evidence of "safe zones" or the like in the game data or decompiled code. I've been trying to dig out my test results in github comments but haven't been able to put my hands on it yet.

Edit2: For resting health regen rates, the Medical skill and Endurance are most involved, and Rapid Healing special plays a part too. You can see the full formula here.
This time I compiled a video where I run tests on the resting regen and interruption, this time with completely identical characters with more controlled conditions.

Video: https://www.youtube.com/watch?v=t6vaLgq ... e=youtu.be

Consulting the Daggerfall Chronicles under the "Safe havens-Camping/Sleeping/Resting" section, it reads "The PC recovers one-eighth of his wounds, spell points, and fatigue when resting per hour" which appears to be the case in all the tests I've run for Stamina and Magicka, yet it often takes longer on both classic and Unity for health to regen depending the character's skills and stats. Either way, I finally concluded that the regen rate is the same, since I reduced both character's health to 1/33 hp and took 14 hours to completely heal across both versions. I must have maybe been percieving that the regen was slower on Unity mostly because of the more frequent interruptions. I've also discovered that interruptions are kind of broken in Classic, as sleeping "For a While" doesn't seem to trigger any interruptions. It's also really rare to be interrupted even when just resting until healed, as during this entire test in Classic, I was only interrupted 3 times. Unity seems to have the same interruption chance both in the wilderness and in dungeons as Classic does only outside, which is still pretty frequent.

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

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by Jay_H » Sun Jan 20, 2019 2:41 am

Health is definitely not intended to regen at 12.5% per hour; that must've been beta text. I ran the tests awhile ago in another thread:

Healing Rate = ((Medical/10)+6)% of max health +- endurance modifier. Endurance modifier appears to be (modifier + 1) when endurance is <50. Rapid Healing adds 4% of max health per hour rested. Regeneration adds 15 health per hour.
Try the first Daggerfall Unity Quest Pack with roughly 210 all-new quests.
I write quests but have no technical knowledge.

User avatar
Posts: 311
Joined: Sun Feb 19, 2017 6:49 pm

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by mikeprichard » Sun Jan 20, 2019 2:42 am

Unfortunately, the info in the Daggerfall Chronicles is often inconsistent with how classic Daggerfall actually plays, so take that info with a large grain of salt.

Posts: 269
Joined: Fri Oct 23, 2015 8:19 pm

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by BansheeXYZ » Sun Jan 20, 2019 4:28 am

QueuedJar wrote:
Sun Jan 20, 2019 2:33 am
Unity seems to have the same interruption chance both in the wilderness and in dungeons as Classic does only outside, which is still pretty frequent.
Which is a good indicator that it's a bug in the classic code that's responsible for finding valid spawn points for interrupting monsters. It's more complicated to spawn a monster indoors because the space is all broken up by walls and there's close but disconnected areas all around you.

User avatar
King of Worms
Posts: 1270
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by King of Worms » Sun Jan 20, 2019 12:03 pm

Speaking about safe areas, I indeed used to take advantage of them, I tryed to rest behind a closed doors, or far away from enemies and its seemed to work.

Narf the Mouse
Posts: 741
Joined: Mon Nov 30, 2015 6:32 pm

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by Narf the Mouse » Mon Jan 21, 2019 3:48 am

I don't have any factual data. However, at this point, find hiding spot->close door->rest is a pretty instinctual behaviour for me in Daggerfall.
Previous experience tells me it's very easy to misunderstand the tone, intent, or meaning of what I've posted. If you have questions, ask.

Posts: 9
Joined: Tue Nov 27, 2018 2:15 pm

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by chantling » Thu Jan 24, 2019 12:12 am

I also feel like the resting interruption chance is way higher than classic. Just as a test, I just loaded DF Unity and tried resting a while in the wilderness. Here's the aftermath:

<tried to post a screenshot but was unable to get it to show up inline for some reason. just imagine a field full of bodies>

There are probably another 8-12 that are off screen where they weren't considerate enough to spawn in a screenshot-convenient boundary and wouldn't come towards me. Stupid archers. Basically every time I rested, I was interrupted. I had one 17 hour stretch before I was interrupted, which seems reasonable enough, but the next longest stretch was 7 hours. I think out of about fifteen resting attempts, 2 lasted 7 hours before interruption, and the rest were less than that. I don't have classic working on this computer to compare, but that's waaaay more interruptions than I remember from classic. I do recall being able to occasionally get 8 hours' rest. :roll:

So this is only tangentially related, but when I read "resting enemy interruption chance" I initially assumed OP was talking about an issue I've been having, and I'm curious if it's a one-off or what. I've been noticing an insane amount of random encounters. I remember them being relatively uncommon in classic; not a rare and wondrous experience, but not every couple of minutes.

I'm playing an imported character; brought it in on a version of DF Unity from about 4 or 5 months ago. Might have been the build that introduced diseases. I had the initial import save with my character outside a dungeon, and I kept it just as a starting point for playing around with the features (I was playing a custom class).

I can't remember if I was having this issue on that older version or not, but on 0.7.2, about 30-40% of the time when I loaded that save, an enemy would spawn on load and attack. There was no enemy present in classic, and on going back and loading the game repeatedly in classic, I never had an enemy spawn. And again, slightly more than half the time nothing would spawn on load. I got the same results on 0.7.32. It could be that classic occasionally spawned enemies upon loading a save, and I just don't remember it ever happening, but it definitely never happened when I was testing it.

Like I said, I also get more or less constant random encounters. Fast travel? Probably 75% chance of having a couple of battlemages or spellswords attacking me when I get to my destination. Haven't tested thoroughly to see if there's a significant difference between cautious or reckless, but I have been attacked repeatedly upon arriving after cautious travel. I get attacked commonly when exiting buildings. I fast travelled to Gothway Garden a couple of days ago. I think I got attacked upon arrival, but I can't remember for sure. Ran straight to the Mage's Guild, turned in a quest, and stepped outside to an arrow to the face. "You've been ambushed by thieves," or some message along those lines. Killed them, ran down to the rusty general store to sell some loots, and was attacked by some knights upon leaving. Killed them, ran over to the other general store to look for arrows, stepped back outside and got a message that my skill in streetsmarts had pacified a battlemage.

I'm also getting interrupted when resting at inns, which I don't recall ever happening in classic, although that wasn't something I did all the time so I may just be wrong about that. I had a room at the inn next to the bank in Gothway Garden a couple of days ago, for example. I had it rented for 10 days because I had purchased a Levitate spell with a duration of 1+5 rounds per character level and that apparently lasts close to a week on a level 20 character? Are the spell timers not correctly implemented yet? I definitely don't remember that from classic. Anyway, I was trying to wait out the spell timer by sleeping repeatedly and constantly was interrupted by enemies.
The attachment DaggerfallUnity 2019-01-21 23-07-08-61.jpg is no longer available
This is looking into my room; the floor in the rest of the inn is literally carpeted with bodies, all down the hallway and into the main room. Trying to rest for a week while having to stop every 2-5 hours to kill two idiots kinda sucks.

At first I thought maybe it was possibly the DF Unity Quest Pack #1, but I read through that entire thread and don't see anything about random encounters with no associated text or messages. Thought maybe it was some quest running in the background that was spawning enemies, but I've only got 3 in my log: the main quest, the "met with Lady Brisien" quest, and a quest from the quest pack about some rando who lost his memory and is tagging along with me until he regains it. I didn't reinstall the quest pack when I upgraded to 0.7.32, and it continues to happen. I notice the amnesiac hitchhiker's face still shows on my screen and the quest is still active in my log, though, so maybe simply removing the quest pack isn't enough to stop the quests from running? I can't imagine the actual quest scripts are baked into the save file, though; it's gotta be just the notebook entry and for some reason it stores that it should be displaying that face without an actual quest. Anyway, I don't think this is quest related because while sometimes enemies just attack, I sometimes get different messages like "You've been ambushed by thieves" or something unrelated. I never did any quests for any faction other than the Mage's Guild in classic in this savegame, so I don't think I've made any enemies. Plus it's a mix of enemy types; it's not like the Thieves Guild is mad at me and keeps sending thieves to pick me off.

Is this something others are experiencing, is it classic behavior that I'm just mis-remembering, or is it just my save? I need to roll another character and see if it happens with him as well.
DaggerfallUnity 2019-01-21 23-07-08-61.jpg
DaggerfallUnity 2019-01-21 23-07-08-61.jpg (321.55 KiB) Viewed 217 times

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

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by Interkarma » Thu Jan 24, 2019 12:31 am

Random encounters don't happen at inns. This is most likely one of your active quests. Use LeftShift+Tab to open quest debugger and see what quests you have running.

If you're finding excessive random spawns after fast travelling, make sure you're running latest 0.7.32 version as it contains a fix for this specific issue (provided it's not also related to quest spawns in this case).

I've run extensive tests myself and resting spawn rates in DFU are almost identical to classic DF, except in dungeons where classic will inexplicably not interrupt rest at all in some cases. Uncertain whether this is a bug or intended behaviour. Allofich has not seen any intentional handling of "safe zones" in Daggerfall's decompiled sources, so it seems likely this is a bug specific to how classic handles spawn placement. Whether this behaviour should even be replicated or not is open for debate.

One actual difference in DFU vs classic is that DFU allows random spawns when loitering in cities at night. Allofich considered this a bug in classic, so loitering in DFU does allow for random spawns in cities at night.

Generally speaking, DFU uses the same chance rolls as classic for the purpose of random spawns. The best method of testing is to rest outside of dungeon entrances where classic has no problems placing enemies, and you'll find the interruption rate is very close. You'll be interrupted about once every 7 hours, give or take. That seems to be the intended interruption rate in dangerous places.

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

Re: 0.7.32 Win 10 x64: Resting enemy interruption chance and regen rates not classic parity

Post by Interkarma » Thu Jan 24, 2019 1:23 am

I decided to repeat one of my earlier tests as I can't find my earlier conversation with Allofich.

Testing Method
  • Placed a classic character directly outside of entrance to Privateer's Hold and created a save.
  • Using "rest for a while" attempted to rest 10 hours 10 times in a row. Perfect uninterrupted rest is 100 hours.
  • On each attempt, noted the number of hours actually rested before interruption by a random spawn.
  • Killed enemy spawn and returned to starting position before starting next rest attempt.
  • Imported same classic character into unmodded DFU and repeated testing process.

Classic Daggerfall

Code: Select all

Hours Rested	Interrupted
 7		1
10		0
10		1
 3		1
 1		1
 2		1
 2		1
10		0
 5		1
 1		1
Outcome: Rested total of 51 hours and interrupted 8 times (1 interruption every 6.3 hours)

Daggerfall Unity

Code: Select all

Hours Rested	Interrupted
 4		1
 2		1
 4		1
10		0
 6		1
 7		1
 2		1
10		0
10		0
10		0
Outcome: Rested total of 65 hours and interrupted 6 times (1 interruption every 10.8 hours)


This is obviously a small data set with only 100 hours of attempted rest. You'll note that Daggerfall Unity actually allowed more total rest in this case than classic Daggerfall. But the more times these tests are run, the closer they should converge around the 6-8 hour mark for every interruption. So let's say every 7 hours, give or take.

Resting in and around dungeons should be dangerous. Subjectivity aside, random spawn chances in DFU have been tuned to be as close as possible to classic DF. Where they generally diverge is that classic will allow for uninterrupted rest in dungeons under unknown conditions. This "safe zone" effect could be intentional or just a side-effect of classic not being able to free-spawn an enemy based on surrounding geometry. I've personally experienced perfectly safe rest in both enclosed areas and wide open areas in dungeons.

For me, the jury is still out on this one. If someone like Allofich can't find code for intentional safe rest in Daggerfall's dungeons, then I lean more towards this being a bug in classic for now.

Post Reply