<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.sotn.fun/wiki_wiki/index.php?action=history&amp;feed=atom&amp;title=RNG</id>
	<title>RNG - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.sotn.fun/wiki_wiki/index.php?action=history&amp;feed=atom&amp;title=RNG"/>
	<link rel="alternate" type="text/html" href="https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;action=history"/>
	<updated>2026-04-16T16:03:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=22&amp;oldid=prev</id>
		<title>Sestren: Minor wording change to avoid saying &quot;we&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=22&amp;oldid=prev"/>
		<updated>2024-10-25T03:40:29Z</updated>

		<summary type="html">&lt;p&gt;Minor wording change to avoid saying &amp;quot;we&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:40, 25 October 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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;In the decompiled code, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;we use &quot;&lt;/del&gt;Random()&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot; &lt;/del&gt;for the Nice RNG, and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;rand()&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot; &lt;/del&gt;for Evil RNG.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;In the decompiled code, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;Random()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&amp;gt; is the function &lt;/ins&gt;for the Nice RNG, and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;rand()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&amp;gt; is the function &lt;/ins&gt;for Evil RNG.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sestren</name></author>
	</entry>
	<entry>
		<id>https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=20&amp;oldid=prev</id>
		<title>Bismurphy: cap rng</title>
		<link rel="alternate" type="text/html" href="https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=20&amp;oldid=prev"/>
		<updated>2024-10-23T23:00:46Z</updated>

		<summary type="html">&lt;p&gt;cap rng&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:00, 23 October 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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;In the decompiled code, we use &quot;Random()&quot; for the Nice &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rng&lt;/del&gt;, and &quot;rand()&quot; for Evil RNG.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;In the decompiled code, we use &quot;Random()&quot; for the Nice &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;RNG&lt;/ins&gt;, and &quot;rand()&quot; for Evil RNG.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bismurphy</name></author>
	</entry>
	<entry>
		<id>https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=19&amp;oldid=prev</id>
		<title>Bismurphy: add decomp rng naming clarification</title>
		<link rel="alternate" type="text/html" href="https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=19&amp;oldid=prev"/>
		<updated>2024-10-23T23:00:33Z</updated>

		<summary type="html">&lt;p&gt;add decomp rng naming clarification&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:00, 23 October 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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In the decompiled code, we use &quot;Random()&quot; for the Nice rng, and &quot;rand()&quot; for Evil RNG.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bismurphy</name></author>
	</entry>
	<entry>
		<id>https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=18&amp;oldid=prev</id>
		<title>Sestren: Create RNG page</title>
		<link rel="alternate" type="text/html" href="https://www.sotn.fun/wiki_wiki/index.php?title=RNG&amp;diff=18&amp;oldid=prev"/>
		<updated>2024-10-23T22:31:05Z</updated>

		<summary type="html">&lt;p&gt;Create RNG page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Symphony of the Night uses [https://en.wikipedia.org/wiki/Pseudorandom_number_generator| Pseudo-Random Number Generators] when randomness is needed in the game. There are two PRNGs that are currently known about (dubbed Nice and Evil), and each is responsible for handling the randomness of different events in the game.&lt;br /&gt;
&lt;br /&gt;
Both RNGs are set to an initial value of 0 on startup (NOTE: On Saturn the initial value for the Evil RNG is actually 1 instead of 0). For the most part, the Evil RNG is advanced once every frame, even if the player isn&amp;#039;t doing anything (hence why it has been dubbed Evil). Different functions within the game&amp;#039;s code will also make specific calls to the Nice and Evil RNG, and so different events will trigger one or the other. A comprehensive list of what events call which RNG is not known, but a few events have been figured out. The Nice RNG is responsible for determining the location of Dracula&amp;#039;s teleports in the Prologue, determining [[Flea Man]] jumps, determining the rotations of the Books in the Library, etc. The Evil RNG is responsible for determining whether or not an item drop occurs after an enemy dies and whether or not an item drop will be rare, uncommon, or common. The Evil RNG is also responsible for determining which Food item will drop from a Meal Ticket.&lt;br /&gt;
&lt;br /&gt;
Some events in the game are the result of calls to both, as in the case of [[Medusa Head]] spawn behavior.&lt;br /&gt;
&lt;br /&gt;
Both RNGs operate in a similar manner, but use different numbers as their multiplier, increment, and shift, as detailed in the code sections at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
== Python implementation of the Nice RNG used in SOTN ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
class NiceRng():&lt;br /&gt;
    def __init__(self, initial_seed: int=0):&lt;br /&gt;
        self.seed = initial_seed&lt;br /&gt;
    &lt;br /&gt;
    def current(self) -&amp;gt; int:&lt;br /&gt;
        result = self.seed &amp;gt;&amp;gt; 0x18&lt;br /&gt;
        return result&lt;br /&gt;
    &lt;br /&gt;
    def next(self) -&amp;gt; int:&lt;br /&gt;
        self.seed = 0xFFFFFFFF &amp;amp; ((self.seed * 0x01010101) + 1)&lt;br /&gt;
        result = self.current()&lt;br /&gt;
        return result&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Python implementation of the Evil RNG used in SOTN ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
class EvilRng():&lt;br /&gt;
    def __init__(self, initial_seed: int=0):&lt;br /&gt;
        self.seed = initial_seed&lt;br /&gt;
    &lt;br /&gt;
    def current(self) -&amp;gt; int:&lt;br /&gt;
        result = 0x7FFF &amp;amp; (self.seed &amp;gt;&amp;gt; 0x10)&lt;br /&gt;
        return result&lt;br /&gt;
    &lt;br /&gt;
    def next(self) -&amp;gt; int:&lt;br /&gt;
        self.seed = 0xFFFFFFFF &amp;amp; ((self.seed * 0x41c64e6d) + 0x3039)&lt;br /&gt;
        result = self.current()&lt;br /&gt;
        return result&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sestren</name></author>
	</entry>
</feed>