<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Persistent_level</id>
	<title>Persistent level - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nethackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Persistent_level"/>
	<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Persistent_level&amp;action=history"/>
	<updated>2026-07-21T15:50:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.5</generator>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=173086&amp;oldid=prev</id>
		<title>Furey: Hack 1.0 -&gt; Source:Hack 1.0</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=173086&amp;oldid=prev"/>
		<updated>2024-06-30T02:28:11Z</updated>

		<summary type="html">&lt;p&gt;Hack 1.0 -&amp;gt; Source:Hack 1.0&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 02:28, 30 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot; &gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You may view the implementation in ([[Andries Brouwer]]'s) [[Hack 1.0 source code]]. The code to read a level is in [[Hack 1.0/hack.lev.c|hack.lev.c]]; &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; share the code in [[Hack 1.0/savelev.h|savelev.h]] to save a level. [[Hack 1.0.2]] merges the &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; code into &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt;. The modern implementation for [[NetHack 3.4.3]] is more complex, and lives in [[Source:NetHack 3.4.3/src/restore.c]] and [[Source:NetHack 3.4.3/src/save.c]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You may view the implementation in ([[Andries Brouwer]]'s) [[Hack 1.0 source code]]. The code to read a level is in [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Source:&lt;/ins&gt;Hack 1.0/hack.lev.c|hack.lev.c]]; &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; share the code in [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Source:&lt;/ins&gt;Hack 1.0/savelev.h|savelev.h]] to save a level. [[Hack 1.0.2]] merges the &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; code into &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt;. The modern implementation for [[NetHack 3.4.3]] is more complex, and lives in [[Source:NetHack 3.4.3/src/restore.c]] and [[Source:NetHack 3.4.3/src/save.c]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The first roguelike game, ''[[Rogue (game)|Rogue]]'', coped without persistent levels because it never generated staircases back to previous levels. In Rogue, there are only down staircases, until after you acquire the [[Amulet of Yendor]], when there are only up staircases to a different branch of the dungeon.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The first roguelike game, ''[[Rogue (game)|Rogue]]'', coped without persistent levels because it never generated staircases back to previous levels. In Rogue, there are only down staircases, until after you acquire the [[Amulet of Yendor]], when there are only up staircases to a different branch of the dungeon.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Furey</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=171340&amp;oldid=prev</id>
		<title>Umbire the Phantom: nover</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=171340&amp;oldid=prev"/>
		<updated>2024-06-21T02:00:32Z</updated>

		<summary type="html">&lt;p&gt;nover&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 02:00, 21 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot; &gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Rogue did have a save feature, which did embed the current dungeon level in the save file. Actually, Rogue implemented the save feature by crudely dumping everything in memory from &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;sbrk(0)&amp;lt;/tt&amp;gt;, with no regard to which part of memory contains the current dungeon level. (Carefully read the [http://rogue.rogueforge.net/viewvc/rogue3.6/trunk/save.c?revision=5&amp;amp;view=markup save.c file of Rogue 3.6] for details.) So there was no way to write the current dungeon level to its own temporary file. Now that the [http://rogue.rogueforge.net/ Roguelike Restoration Project] has reformed the save feature, one might be able to ''hack'' a Rogue variant that supports persistent levels.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Rogue did have a save feature, which did embed the current dungeon level in the save file. Actually, Rogue implemented the save feature by crudely dumping everything in memory from &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;sbrk(0)&amp;lt;/tt&amp;gt;, with no regard to which part of memory contains the current dungeon level. (Carefully read the [http://rogue.rogueforge.net/viewvc/rogue3.6/trunk/save.c?revision=5&amp;amp;view=markup save.c file of Rogue 3.6] for details.) So there was no way to write the current dungeon level to its own temporary file. Now that the [http://rogue.rogueforge.net/ Roguelike Restoration Project] has reformed the save feature, one might be able to ''hack'' a Rogue variant that supports persistent levels.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{noversion}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Development]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Development]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Umbire the Phantom</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=170432&amp;oldid=prev</id>
		<title>Furey: Change source file references for 3.4.3 to actually point to 3.4.3 files, not 3.6.1 files.</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=170432&amp;oldid=prev"/>
		<updated>2024-06-16T03:08:16Z</updated>

		<summary type="html">&lt;p&gt;Change source file references for 3.4.3 to actually point to 3.4.3 files, not 3.6.1 files.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 03:08, 16 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot; &gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You may view the implementation in ([[Andries Brouwer]]'s) [[Hack 1.0 source code]]. The code to read a level is in [[Hack 1.0/hack.lev.c|hack.lev.c]]; &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; share the code in [[Hack 1.0/savelev.h|savelev.h]] to save a level. [[Hack 1.0.2]] merges the &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; code into &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt;. The modern implementation for [[NetHack 3.4.3]] is more complex, and lives in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;two source files &lt;/del&gt;[[restore.c]] and [[save.c]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You may view the implementation in ([[Andries Brouwer]]'s) [[Hack 1.0 source code]]. The code to read a level is in [[Hack 1.0/hack.lev.c|hack.lev.c]]; &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; share the code in [[Hack 1.0/savelev.h|savelev.h]] to save a level. [[Hack 1.0.2]] merges the &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; code into &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt;. The modern implementation for [[NetHack 3.4.3]] is more complex, and lives in [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Source:NetHack 3.4.3/src/&lt;/ins&gt;restore.c]] and [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Source:NetHack 3.4.3/src/&lt;/ins&gt;save.c]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The first roguelike game, ''[[Rogue (game)|Rogue]]'', coped without persistent levels because it never generated staircases back to previous levels. In Rogue, there are only down staircases, until after you acquire the [[Amulet of Yendor]], when there are only up staircases to a different branch of the dungeon.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The first roguelike game, ''[[Rogue (game)|Rogue]]'', coped without persistent levels because it never generated staircases back to previous levels. In Rogue, there are only down staircases, until after you acquire the [[Amulet of Yendor]], when there are only up staircases to a different branch of the dungeon.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Furey</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=170427&amp;oldid=prev</id>
		<title>Furey: &quot;Original README file&quot; is gone with no archive captures. I found an alternate source.</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=170427&amp;oldid=prev"/>
		<updated>2024-06-16T02:32:39Z</updated>

		<summary type="html">&lt;p&gt;&amp;quot;Original README file&amp;quot; is gone with no archive captures. I found an alternate source.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 02:32, 16 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot; &gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* ''Because of the peculiar restraints on our system, I make mklev (create a level) a separate procedure execd by hack when needed.  The source for mklev is (Naturaly) mklev.c.  You may want to put mklev back into hack. Good luck.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* ''Because of the peculiar restraints on our system, I make mklev (create a level) a separate procedure execd by hack when needed.  The source for mklev is (Naturaly) mklev.c.  You may want to put mklev back into hack. Good luck.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Jay Fenlason, [&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;http&lt;/del&gt;://&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;www&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;openbsd.org&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cgi&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bin/cvsweb/src&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;games&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;hack&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Original_READ_ME?rev=1.3&amp;amp;content-type=text/x-cvsweb-markup Original_READ_ME&lt;/del&gt;]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Jay Fenlason, [&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;https&lt;/ins&gt;://&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourceforge&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;net/projects&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nethack&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;revived-reloaded&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;files&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;source&lt;/ins&gt;/ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Original README file&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Furey</name></author>
		
	</entry>
	<entry>
		<id>https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=23510&amp;oldid=prev</id>
		<title>Kernigh: New article! &quot;Persistent levels were an innovation in NetHack's predecessor, Hack.&quot; Rogue coped without them.</title>
		<link rel="alternate" type="text/html" href="https://nethackwiki.com/index.php?title=Persistent_level&amp;diff=23510&amp;oldid=prev"/>
		<updated>2007-12-05T02:48:23Z</updated>

		<summary type="html">&lt;p&gt;New article! &amp;quot;Persistent levels were an innovation in NetHack&amp;#039;s predecessor, &lt;a href=&quot;/wiki/Hack&quot; title=&quot;Hack&quot;&gt;Hack&lt;/a&gt;.&amp;quot; Rogue coped without them.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{RogueBasin|Dungeon_persistence}}&lt;br /&gt;
The term &amp;quot;'''persistent level'''&amp;quot; often appears when contrasting [[roguelike]] games. A [[dungeon level]] is persistent if the player may return to the level after leaving it. The game must store the map and contents of any level that the player might revisit in the future.&lt;br /&gt;
&lt;br /&gt;
''[[NetHack]]'' has persistent levels, up until just before you enter the [[Elemental Planes]]. When you leave a level, NetHack writes the level to a temporary file on disk (in the [[playground]]). These temporarily files also provide the basis to [[recover]] a crashed game. When you [[save]] your game, NetHack stores the levels in your save file.&lt;br /&gt;
&lt;br /&gt;
Persistent levels were an innovation in NetHack's predecessor, ''[[Hack]]''. Actually, [[Jay Fenlason]] included the ability to write a dungeon level to disk and read it later in the original design of Hack.&lt;br /&gt;
&lt;br /&gt;
* ''Because of the peculiar restraints on our system, I make mklev (create a level) a separate procedure execd by hack when needed.  The source for mklev is (Naturaly) mklev.c.  You may want to put mklev back into hack. Good luck.''&lt;br /&gt;
** Jay Fenlason, [http://www.openbsd.org/cgi-bin/cvsweb/src/games/hack/Original_READ_ME?rev=1.3&amp;amp;content-type=text/x-cvsweb-markup Original_READ_ME]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; program writes a new level to disk, and the &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; program reads it. To implement persistent levels, after the player leaves each level, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; must write the modified level to disk again. When reading the level again, &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; contains code to regenerate monsters, as if time passes while the player is away (thus Hack implements a &amp;quot;mostly persistent&amp;quot; dungeon.)&lt;br /&gt;
&lt;br /&gt;
You may view the implementation in ([[Andries Brouwer]]'s) [[Hack 1.0 source code]]. The code to read a level is in [[Hack 1.0/hack.lev.c|hack.lev.c]]; &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; share the code in [[Hack 1.0/savelev.h|savelev.h]] to save a level. [[Hack 1.0.2]] merges the &amp;lt;tt&amp;gt;mklev&amp;lt;/tt&amp;gt; code into &amp;lt;tt&amp;gt;hack&amp;lt;/tt&amp;gt;. The modern implementation for [[NetHack 3.4.3]] is more complex, and lives in two source files [[restore.c]] and [[save.c]].&lt;br /&gt;
&lt;br /&gt;
The first roguelike game, ''[[Rogue (game)|Rogue]]'', coped without persistent levels because it never generated staircases back to previous levels. In Rogue, there are only down staircases, until after you acquire the [[Amulet of Yendor]], when there are only up staircases to a different branch of the dungeon.&lt;br /&gt;
&lt;br /&gt;
Rogue did have a save feature, which did embed the current dungeon level in the save file. Actually, Rogue implemented the save feature by crudely dumping everything in memory from &amp;lt;tt&amp;gt;version&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;sbrk(0)&amp;lt;/tt&amp;gt;, with no regard to which part of memory contains the current dungeon level. (Carefully read the [http://rogue.rogueforge.net/viewvc/rogue3.6/trunk/save.c?revision=5&amp;amp;view=markup save.c file of Rogue 3.6] for details.) So there was no way to write the current dungeon level to its own temporary file. Now that the [http://rogue.rogueforge.net/ Roguelike Restoration Project] has reformed the save feature, one might be able to ''hack'' a Rogue variant that supports persistent levels.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Kernigh</name></author>
		
	</entry>
</feed>