You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

209 lines
12 KiB

<!DOCTYPE html>
<title>Exochemistry Cookbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="og:title" property="og:title" content="Exophysics">
<meta name="description" content='Explore the physics of other universes'>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="shortcut icon" type="image/png" href="favicon.png">
<a href="index.html">Home</a>
<a href="exhibition.html">Exhibition</a>
<a href="manual.html">Manual</a>
<a href="cookbook.html" class="active">Cookbook</a>
<a href="">Code</a>
<h1><span id="e">E</span><span id="x">x</span><span id="o">o</span>chemistry Cookbook</h1>
<div id="toc"></div>
<i>Click <a href="">here</a> to improve this text.</i>
On the home planet of the author, the word "<i>Chemistry</i>"
describes the study of emergent properties of atoms.
"<i>Exochemistry</i>" is, on the other hand, the study of
emergent properties of particles in other universes, obeying
different laws of physics.
Let this document be your guide to the emerging field of
<a href="">Emergence</a>
occurs in a complex system when objects (like exophysics
particles) interact in ways that gives rise to phenomena that
are not found within the individual objects themselves.
One proton, neutron or electron alone will never have any
properties like temperature, pressure, shape, color, taste, or
intelligence. But if you take a very very big pile of them,
apply the laws of physics, and let them interact for about
14,000,000,000 years, a smooth-skinned, smelly, intelligent
creature emerges, staring at a screen and reading this text.
There are various resources on the topic of emergence on the
human-era "internet". If you happen to be within the realms of
the humans, with access to this "internet", you could benefit
from the following hyperlinks:
<li>YouTube/Kurzgesagt: <a href="">Emergence - How Stupid Things Become Smart Together</a></li>
<li>YouTube/PBS Space Time: <a href="">Could Life Evolve Inside Stars?</a></li>
<li>Wikipedia: <a href="">Emergence</a></li>
Not every universe is a host to emergence and exochemistry. In
fact, creating one with beautiful emergent properties is the
ultimate art form. But how do you even start?
There are two necessary ingredients for emergence:
<li><a href="#Diversity">Diversity</a> in the types of objects</li>
<li>Balanced <a href="#Interactions">interactions</a> between those objects</li>
Diversity among particles unlocks new kinds of interactions.
Let's take the simple exophysics universe
<a href="exhibition.html#dorilia">[EPILEPSY WARNING]: Dorilia</a>
as an example. It's home to the following exochemical
<li>Red and blue particles can join each other to combine a sort of stationary "atom"</li>
<li>Two atoms can join each other to form a chemical bond. A peculiar molecule emerges, that moves along perpendicular to the axis of the chemical bond.</li>
<li>Three particles of non-identical colors can form a stable, fast-moving atom under rare conditions</li>
<li>Under high pressure (when too many particles occupy the same space), a chaotic plasma cloud forms, destroys molecules, and moves at even higher speed. When it reaches a space with less density, it recombines into individual particles, atoms or molecules.</li>
<li>And more...</li>
<br />
<span class="warning-wrapper">
<a href="exhibit/dorilia.html" class="exhibitlink"><img src="exhibit/dorilia.png" /></a>
Here, each particle has the following properties that differentiates them from each other:
<li><code>state.x</code>: The location along the first spatial dimension</li>
<li><code>state.y</code>: The location along the second spatial dimension</li>
<li><code>state.z</code>: The "health" of a particle. If it drops to zero, the particle decays.</li>
<li>When the particle is in the top half of the screen, it gains energy, and in the bottom half it slowly loses energy.</li>
<li>This is just a little thing to make things more interesting, but doesn't contribute much to emergence.</li>
<li><code>state.w</code>: The "flavor" or "charge" of the particle. This is similar to <a href="">"positive" and "negative" electric charge</a> in the home universe of the author.</li>
<li>state.w is randomly assigned to be between 0.0 and 1.0.</li>
<li>If the value is below 0.5, the flavor is defined to be 1, and the particle becomes red.</li>
<li>If the value is above or equal to 0.5, the flavor is defined to be -1, and the particle becomes blue.</li>
<li><code>oldV.x</code>: The velocity of the particle along the first spatial dimension</li>
<li><code>oldV.y</code>: The velocity of the particle along the second spatial dimension</li>
These properties contribute in different ways towards emergence:
<li><code>state.x/y</code>, <code>oldV.x/y</code>: Helpful, but not sufficient for emergence</li>
<li><code>state.w</code>: Allows discriminatory forces (see below) to produce emergence</li>
<li><code>state.z</code>: Doesn't contribute to emergence yet, but we if we add a new force that acts based on this property, some new, interesting phenomena might emerge.</li>
<h4>Non-discriminatory forces</h4>
Non-discriminatory forces act the same way on every particle,
similarly to the
<a href="">gravitational force</a>
in the author's home universe. The distance between particles
typically still plays a role, so in a strict sense, even this
type of force is discriminatory between close and far
particles, but I will conveniently neglect this fact.
A gravitation-like non-discriminatory force could attract every
particle towards each other, making them orbit the center of
mass. This does not lead to the emergence of exochemistry.
There may be configurations of non-discriminatory forces that
lead to exochemistry, though at this spacetime, the author
knows of none. The creation of such is left as an exercise to
the reader.
<h4>Discriminatory forces</h4>
Discriminatory forces act differently depending on certain
properties of the interacting particles. Similarly to the
<a href="">electromagnetic force</a>
in the author's home universe, where objects with the same
charge repel each other, while objects with an opposite charge
attract each other.
In the example above, a discriminatory force is responsible for
the emergence of exochemical properties. This is the
(simplified) relevant code:
<pre><code>int myCharge = (state.w &lt; 0.5) ? 1 : -1;
for (int i = 0; i &lt; particleLimit; i++) {
if (i == currentIndex) { continue; } // don't interact with yourself
otherState = allStates[i];
otherCharge = (otherState.w &lt; 0.5) ? 1 : -1;
distance = otherState.xy - state.xy;
direction = float(myCharge * otherCharge);
acceleration = -0.0001 * distance.xy / pow(length(distance.xy), 4.0);
velocity.xy += acceleration * direction;
This is just one of many ways to write a non-discriminatory
force, but the key part is that there's a direction which
depends on the "charge" of the particles. There's also various
constants, like the <code>-0.0001</code>, which mediates the
strength of this force. The <code>4.0</code> within the
"<code>pow()</code>" function takes the distance to the power
of 4, resulting in a non-linear relationship between distance
and acceleration.
There is a lot to explore here, which is left as an exercise to
the reader.
<h4>Limiting the velocity</h4>
A universal speed limit may contribute to the emergence of
emergence by creating an environment where particles stay close
together long enough for the forces to be able to act.
This is especially important in limited-precision simulations
like Exophysics, where the time steps between each moment are
relatively large, with only about 60 simulated moments per
human second. As a result, for example, particles may fly past
one another even though they should, in theory, collide and
bounce off each other. This further results in a violation of
a conservation of energy, with a tendency towards an energy
explosion, and progressive heating of the universe.
Countermeasures are also left as an exercise for the reader.
On the flip side, this evades the
<a href="">heat death of the universe</a>
and let's you build
<a href="">perpetual motion machines</a>.
<script src="toc.js"></script>