Difference between revisions of "Cell Reset"

758 bytes removed ,  08:07, 14 July 2016
Re-wrote the section with new findings
imported>QQuix
(A few adjustments)
imported>QQuix
(Re-wrote the section with new findings)
Line 29: Line 29:


==How ?==
==How ?==
When the player leaves a cell, the game saves the game date and time (called Cell Detach Time) and sets the Cell Reset Hours to 72. Every hour, on the hour, the Cell Reset Hours count is reduced by 1. When the count goes from 0 to -1, the information about changes made to that cell are deleted from wherever the engine keeps it. ([[GetCellDetachTime]] and [[GetCellResetHours]] return those values).
For each cell, the game keeps two important values to control Cell Reset:


At the beginning of the game, all cells have the Cell Detach Time and the Cell Reset Hours values set to -1. When the player enters a cell, they are set to -1 as well (and will be initialized when the player leaves).
*The Cell Detach Time stores the timestamp of the moment the player last left the cell. This is an integer calculated by: ( [[Special variables|GameDaysPassed]] * 24 ) +  [[Special variables|GameHour]] (rounded down, only the integer part of GameHour is used). The function [[GetCellDetachTime]] returns this value.
*The Cell Reset Hours stores the number of hours left until the cell will be considered for resetting. When the player leaves the cell, it is set to 72 and is reduced by 1 every hour, on the hour. The function [[GetCellResetHours]] returns this value.




Since cell reset is done at round hours, it happens 72 hours after the next round hour after the player leaves the cell. In other words, cell reset happens from 72 to 73 hours after the player leaves the cell, e.g., it the player leaves a cell at 9:23 AM (or 9:01AM or 9:59AM), cell reset will happen 3 days later, at 10:00 AM.
Since control is done at round hours, the cell becomes subject to reset 72 hours after the next round hour after the player leaves the cell. In other words, after 72 to 73 hours after the player leaves the cell, e.g., it the player leaves a cell at 9:23 AM (or 9:01AM or 9:59AM), cell becomes subject to reset 3 days later, at 10:00 AM.




When the count runs out, the next time the game is saved, those changes are not saved.
At the beginning of the game, all cells have the Cell Detach Time and the Cell Reset Hours values set to -1. When the player enters a cell, they are set to -1 as well (and will be initialized when the player leaves).
 
And the next time the cell is loaded into memory, those changes are not applied.
 
 
Note the wording on the previous sentence: it does not say "the next time the player enters the cell". There is a subtle difference here.
 
 
Remember: as the player goes from cell to cell, the engine keeps the most recently visited cells in memory so it does not have to 'rebuild' them if the player goes back, which is wise, as it is not that unusual to go backtrack and because rebuilding a cell does take a while (that is when the engine shows us the load screen . . . from the time we spend looking at load screens, we can guess that loading (rebuilding) a cell is not a trivial task).
 
The number of cells that remain loaded depends on the INI settings "uInterior Cell Buffer" and "uExterior Cell Buffer", but is also limited by available memory. On low memory PCs, it can go as low as no buffer at all (so you will get a load screen even if you go back immediately) .
 
 
If the cell is not loaded when the player goes in, the engine loads it from the game/mod files and applies the known changes. Since after 72 hours those changes are deleted,  there will be no changes to apply, so . . . Bingo! . . Cell Reset!




But if the cell is still in the cell buffer, it is not rebuilt, therefore the changes are not reapplied, therefore the cell is not reset, therefore the changes remain. (but, as you can figure out, this is a rare scenario).
The expiration of the cell reset timer, per se, does not trigger any immediate action, but will be used afterward by the actual Cell Reset mechanism.  




All of the above applies also to [[ResetInterior]]: most likely, it just deletes those change info, as the cell reset process does, so, if the cell is already loaded, it does not 'reset' it.
Considering the term ‘Cell Reset’ as the act of removing references from the game, there are actually two ‘Cell Resets`, which we may call as ‘External’ and ‘Internal’.


*The External Cell Reset (ECR) occurs when the game is saved after the Cell Reset Hours has expired. At this save, certain references are removed from the game and are not saved in the savegame file. It is called ‘external’ because it is done without the player returning to the cell. Vanilla Leveled List Creatures are examples of references removed by ECR.


[[PurgeCellBuffers]], of course, clears the cell buffer and forces all new cells to be loaded (rebuilt).
*The Internal Cell Reset (ICR) occurs when the player reenters the cell after the Cell Reset Hours has expired. At this moment, certain references are removed from the game, are not loaded in the cell and, of course, will not be part of the next savegame file. Dead bodies are examples of references removed by ICR.


====Notes====
*There are many texts (including the OBSE doc) that mention that the cell is reset only when the player reenters it after 72 hours. Maybe there are situations (to be determined) when this is true, but it does not make much sense. If this were true, all of us would carry in our savegames all changes we made to the prison cell and all other cells we ever visited. Since these changes would be deleted the moment we went back, what is the point of keeping then all that time?
*There are texts that mention that the time is counted from the moment the player enters the cell. This is certainly not true. The reset time starts counting the moment the player leaves the cell, as can be tested using [[GetCellDetachTime]] and [[GetCellResetHours]].


Which references are removed in each event depends on the type of object and some of its characteristics (Persistence, Respawn, etc). Actor’s behavior has been mapped and is reported below. Other types still need some research.


====Known exceptions====
*[[FormID#Non-dynamic references|Non-dynamic]] actors are not removed.


[[ResetInterior]] also plays a part in this game: it sets the Cell Reset Hours to zero, forcing it to expire, so the next time one of the Cell Resets occur (ECR or ICR), references will be deleted as if the 72 hours have passed. Besides, if the player enters the cell after [[ResetInterior]] is used (ICR), some additional references are deleted (which would not be deleted if [[ResetInterior]] were not used).


==Cell Reset x Hidden Cells==
==Cell Reset x Hidden Cells==
Anonymous user