Project

General

Profile

Bug #1875

Actors in inactive cells don't heal from resting

Added by scrawl . about 3 years ago. Updated 1 day ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
Game Mechanics
Target version:
Start date:
09/06/2014
% Done:

0%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

In vanilla MW, when the player rests, all actors in the world regain health as well (https://wiki.openmw.org/index.php?title=Research:Stats_and_Levelling#Resting). In OpenMW this is currently done for actors in active cells only.

This has a big impact on gameplay because it allows to exit a dungeon mid-fight, rest, come back and continue fighting with no penalty.


Related issues

Duplicated by OpenMW - Bug #3992: Knocked down NPCs don't restore fatigue if you leave their cell Rejected 08/04/2017

History

#1 Updated by Stuart Moore about 3 years ago

They do? Because they've never done that for me. Point in note, fighting Foryn Gilnith. Have fought him, left his shack to recover health/fatigue, went back in to find him at the same level of health he had been before leaving.

#2 Updated by R. D. about 1 year ago

I just tested this, and yes, NPCs including Foryn Gilnith do regain health if you sleep.

I suspect the reason that the other poster here thought this NPC did not regain health is because he only waited, he did not sleep. The area immediately outside Foryn Gilnith's Shack is a no-sleep area. Foryn Gilnith will not regain health if you just wait. This had me confused for a little bit, too.

Foryn Gilnith will regain 5.2 health points per hour of sleep. Another NPC, Tanisie Verethi in Addamasartus, will regain 3 health points per hour of sleep.

I also tested fatigue regeneration with Foryn Gilnith. He would regenerate fatigue gradually while I was in the cell with him, but once I left, the fatigue value stopped changing. If I waited or slept for an hour outside the cell, though, his fatigue refilled to full.

I tested magicka regeneration with Melar Baram in Addamasartus. He would regain 7.5 magicka points every hour I slept while outside the cell. He did not regain magicka if I only waited.

The NPCs regained their health, magicka and fatigue by these same amounts if I slept/waited in the same cell as them. Fatigue was refilled to full even when the NPC had been brought down to around -50 fatigue.

#3 Updated by Marc Zinnschlag 10 months ago

  • Target version changed from openmw-0.41 to openmw-0.42

#4 Updated by scrawl . 7 months ago

  • Target version changed from openmw-0.42 to openmw-future

#5 Updated by scrawl . 7 months ago

  • Target version changed from openmw-future to openmw-1.0

#6 Updated by Andrei Kortunov 2 months ago

Is there a safe way to iterate over all actors in the world?

#7 Updated by scrawl . 2 months ago

Yes, that should be easy. We can skip non-loaded cells since the actors in there will be starting with full HP anyway.

#8 Updated by Andrei Kortunov 2 months ago

We can skip non-loaded cells

Which cells are opposite to non-loaded? Active ones?

In this case we can get active cells:
Scene::getActiveCells()

And iterate over creatures and NPC in these cells:

CellStore::get<ESM::Creature>()
CellStore::get<ESM::NPC>()

Right?

#9 Updated by scrawl . 2 months ago

No, there is a difference between 'loaded' and 'active' cells.
loaded - (State_Loaded in CellStore) means the contents of the cell have been loaded from game files and can be modified. Once loaded, a cell is never unloaded (unless you start a new game or load another saved game). Cells can be loaded as a result of script access, so there may be some cells that are loaded even if you haven't visited them before.
active - cell is in the current scene (cell grid) that surrounds the player. All active cells are also loaded cells.

#10 Updated by Andrei Kortunov about 2 months ago

  • Duplicated by Bug #3992: Knocked down NPCs don't restore fatigue if you leave their cell added

#11 Updated by Andrei Kortunov about 2 months ago

  • Status changed from New to Confirmed
  • Reproducibility changed from Have not tried to Always

#12 Updated by Alexei Dobrohotov 15 days ago

  • Category set to Game Mechanics

#13 Updated by Goody goody Yum yum 5 days ago

The code would be allot similar to #4077's solution.
https://bugs.openmw.org/issues/4077

I can work on this if its alright.

#14 Updated by Goody goody Yum yum 1 day ago

Got a problem Creatures need to have an Unique ID number as well for my changes to work. Where is the code that assigns the Actors mIndex so I can base it off that.

Thanks in advance.

Also available in: Atom PDF