<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Krish Grover on Medium]]></title>
        <description><![CDATA[Stories by Krish Grover on Medium]]></description>
        <link>https://medium.com/@gkrish088?source=rss-d9f82fbe0f86------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Krish Grover on Medium</title>
            <link>https://medium.com/@gkrish088?source=rss-d9f82fbe0f86------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:23:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gkrish088/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Evolving Creatures in Unity: What rtNEAT Gave Us and Where HyperNEAT Failed]]></title>
            <link>https://medium.com/@gkrish088/evolving-creatures-in-unity-what-rtneat-gave-us-and-where-hyperneat-failed-392669a89d1c?source=rss-d9f82fbe0f86------2</link>
            <guid isPermaLink="false">https://medium.com/p/392669a89d1c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[evolutionary-algorithms]]></category>
            <category><![CDATA[simulation]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[genetic-algorithm]]></category>
            <dc:creator><![CDATA[Krish Grover]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 22:08:34 GMT</pubDate>
            <atom:updated>2026-10-06T22:08:34.619Z</atom:updated>
            <content:encoded><![CDATA[<h3>The idea: a world that changes its creatures</h3><p>The idea for <em>Evolution</em> started with a question: what if we could make something like a Minecraft 2.0, where the creatures could adapt to the world around them?</p><p>I wanted to make something like Minecraft, but where the creatures change along with the world. Not behavior someone scripted, but change that builds up over generations.</p><p>Here’s the picture I had in my head. A wolf that’s good on land. Then the world shifts, and food gets easier to find in water. Most wolves ignore it. A few wander in anyway, eat, and have more kids. A few generations later, you have wolves that swim. Nobody wrote a swimming rule. The pressure did that.</p><p>That was the whole game: creatures that reproduce and pass things on, and a world the player can change underneath them. Build a farm and herbivores move in. Change the terrain and the population shifts with it.</p><p>My first plan was small. I thought the neural network would only tweak a few numbers, like speed or energy use. Then a teammate showed me Karl Sims’ virtual creatures, and I realized that wasn’t nearly enough.</p><h3>Discovering Karl Sims’ Virtual Creatures</h3><p>Once we had the basic idea of building a game around evolving creatures, the next question was obvious: <strong>had someone already tried to do something like this?</strong></p><p>The closest prior work to our idea is Karl Sims’ 1994 paper “<a href="https://www.karlsims.com/papers/siggraph94.pdf">Evolving Virtual Creatures</a>”, where body, movement and neural controller are all evolved. Two ideas from it shaped our design.</p><p>The first important concept we took from the paper was the distinction between <strong>genotype and phenotype</strong>.</p><figure><img alt="Designed examples of genotype graphs and corresponding creature morphologies." src="https://cdn-images-1.medium.com/proxy/1*mlC4JkGdPe77hRKmQ1M5lg.png" /></figure><p>The genotype is the encoded description that evolution actually modifies. It contains the information required to construct the creature. The phenotype is the creature produced from that information: its body, its structure, and ultimately the behavior that emerges when that body is controlled by its neural system.</p><p>We initially tended to think of evolution as something that should directly modify the creature itself. But that is not really how biological evolution works. Evolution does not directly edit an organism’s body and behavior. It modifies an inherited representation, and that representation is then expressed as an organism.</p><p>That gave us a much more interesting way to think about our game:</p><figure><img alt="The cycle of effects between brain, body and world" src="https://cdn-images-1.medium.com/proxy/1*mbQGmhlE2EbTAPxs2edD4w.png" /></figure><p><strong>Genome → Development → Creature → Behavior → Fitness</strong></p><p>A mutation happens to the genome. The genome produces a different creature. That creature behaves differently in the environment, and its performance determines whether that genetic variation is useful.</p><p>This meant that the genome could potentially encode much more than just the parameters of a neural network. It could describe the structure of the creature itself.</p><p>For example, changing the genotype could result in a creature with a different number of body segments, different connections between those segments, different proportions, or a completely different body structure. The neural controller could then produce different behavior on top of that morphology.</p><p>This was one of the first points where the idea of our game became much more interesting. We were no longer thinking only about <strong>evolving an AI that controls a creature</strong>. We were thinking about <strong>evolving the creature and its brain together</strong>.</p><p>Sims’ work also made it clear that the representation chosen for the genome is extremely important. If the genome is capable of describing only a very limited set of structures, evolution can explore only that limited space. If the representation is expressive enough to describe many different bodies and controllers, evolution has a much larger space to search.</p><p>But there was another part of Sims’ approach that became important for us.</p><p>The neural networks used to control the creatures were not restricted to a single type of neuron performing the same simple operation. Different nodes could have different functions ( e.g. sin() , exp() , ln() ….) , and those functions could have their own parameters. In other words, evolution was not merely deciding <strong>which neurons were connected to which other neurons</strong> or <strong>what weights those connections had</strong>. It could also influence the kind of computation performed by a node.</p><p>Conceptually, a neural controller could therefore contain different kinds of computational elements. One node might perform one mathematical function, while another could perform a completely different one. The parameters of those functions could also become part of the evolutionary search.</p><p>This is powerful because it makes the resulting networks much more expressive.</p><p>But for us, it also revealed a problem.</p><p>Every additional degree of freedom expands the search space.</p><p>Instead of evolution having to discover only things like:</p><ul><li>which nodes should exist,</li><li>which nodes should connect,</li><li>and what the connection weights should be,</li></ul><p>it could potentially also have to discover:</p><ul><li>what function each node should perform,</li><li>the parameters of that function,</li><li>and how all of those different functions interact.</li></ul><p>That is a much larger evolutionary search problem.</p><p>For Sims’ experiments, this expressive representation made sense because the goal was to investigate how evolution could produce interesting virtual creatures. But our goal was slightly different. We wanted to build an actual game system in which creatures could evolve continuously and remain computationally manageable.</p><p>We therefore started asking a different question:</p><p><strong>How much of this complexity do we actually need?</strong></p><p>We wanted evolution to be able to produce interesting brains, but we did not necessarily need every possible kind of neural computation to be encoded in the genome. Perhaps we could restrict the space of possible neural networks and still give evolution enough freedom to discover useful behavior.</p><p>So Karl Sims did not give us the final architecture for our creatures. More importantly, his work gave us the conceptual foundation for the direction we were taking:</p><p><strong>the creature should not be completely designed beforehand; its inherited representation should be capable of producing variation in both its body and its behavior.</strong></p><p>The next challenge was figuring out how to represent and evolve the brain without making the search space unnecessarily enormous.</p><p>That was the problem NEAT seemed to solve.</p><h3>Why NEAT instead of Sims’ approach</h3><p>Karl Sims’ approach was powerful, but it also made the evolutionary search much larger than what we needed. We did not really need evolution to choose a different mathematical function for every neuron. What we wanted was simpler: keep the neuron itself fixed and let evolution discover <strong>which neurons should exist, how they should connect, and what weights those connections should have</strong>. This is where NEAT became interesting. It separates the problem into evolving the <strong>weights</strong> of a network and evolving its <strong>topology</strong>, while keeping the activation function fixed. For our implementation, we used tanh.</p><h3>How NEAT works</h3><p>NEAT uses a <strong>direct encoding</strong>. The genome explicitly describes the neural network that will be expressed in the phenotype. Node genes represent the nodes, while connection genes represent the connections between them. Each connection gene stores the input node, output node, connection weight, whether the connection is expressed, and its innovation number.</p><figure><img alt="1*xUQuEf7XwuJW84O4bvq9ig.png" src="https://cdn-images-1.medium.com/proxy/1*xUQuEf7XwuJW84O4bvq9ig.png" /></figure><h4>Mutating the network</h4><p>Mutation in NEAT can change both the <strong>weights</strong> and the <strong>structure</strong> of the network.</p><p><strong>1. Weight mutations</strong></p><p>A connection weight can be perturbed during mutation while leaving the topology unchanged. For example, if two nodes are connected by a weight w, mutation changes the value of w without changing the connection itself.</p><p><strong>2. Structural mutations</strong></p><p>NEAT has two structural mutations: <strong>adding a connection</strong> and <strong>adding a node</strong>.</p><p>When a new connection is added, two previously unconnected nodes are connected and the new connection is assigned a random weight.</p><p>For example:</p><p>A ─────────→ B</p><p>can become:</p><p>A ──→ C ──→ B</p><p>When a new node is added, NEAT splits an existing connection. The old connection is disabled, a new node is placed between the two nodes, and two new connections are created. The connection going into the new node receives a weight of 1, while the connection coming out of it receives the old connection’s weight. This allows the new structure to be introduced without completely disrupting the behaviour of the existing network.</p><h4>The competing conventions problem</h4><p>Once networks can have different structures, crossover becomes difficult. Two genomes can represent similar solutions while storing their genes in different arrangements. This creates the <strong>competing conventions problem</strong>: crossover based only on gene position can combine unrelated genes and destroy useful structures.</p><p>NEAT solves this using <strong>historical markings</strong>. Every new gene created through structural mutation receives an global innovation number. whenever a new mutation happens it gets a new innovation number , but if that same mutation happens in other genome after some time , it will also get that same innovation number not a new one . Genes with the same innovation number are considered to have the same historical origin and can therefore be aligned during crossover. Matching genes can be inherited from either parent, while disjoint and excess genes are inherited from the more fit parent.</p><h4>Protecting innovation through speciation</h4><p>A new structural mutation will often initially reduce fitness. A newly added connection may have a poor weight, or a new node may need time before the new structure becomes useful. Without protection, these innovations could disappear before they have a chance to improve.</p><p>NEAT therefore groups similar genomes into <strong>species</strong>, allowing new structures to compete mainly within their own species. The compatibility distance between two genomes is:</p><p><strong>δ = c₁E/N + c₂D/N + c₃W̄</strong></p><p>where E is the number of excess genes, D is the number of disjoint genes, W̄ is the average weight difference of matching genes, and N is the number of genes in the larger genome. Genomes whose compatibility distance is below the compatibility threshold are placed in the same species.</p><h4>Starting from minimal structure</h4><p>NEAT starts with <strong>zero hidden nodes</strong>, with inputs connected directly to outputs, and introduces new structure only through mutation. This keeps the initial search space small and allows complexity to emerge incrementally when it proves useful.</p><p>This was the part of NEAT that made the approach particularly attractive to us: <strong>the brain starts simple, and evolution decides when it needs to become more complex.</strong></p><h3>Why generational NEAT didn’t fit a live world</h3><p>There was, however, a problem that had nothing to do with the representation itself.</p><p>NEAT is naturally organized around generations. A population is evaluated, individuals are selected, offspring are produced, and a new generation begins.</p><p>Our world was supposed to be continuous.</p><p>Creatures were supposed to move, eat, reproduce, and die while the simulation was running. We did not want to stop the entire world every time one evolutionary generation ended.</p><p>So although NEAT gave us the representation we wanted, its <strong>generational evolutionary process did not fit the kind of world we were trying to build</strong>.</p><p>We needed evolution to happen continuously inside the simulation.</p><p>That was the reason we moved to <strong>RTNEAT</strong>.</p><p>The generation-based approach we first considered would evaluate a whole population, stop the simulation, create a new generation, and then start the simulation again. I imagined all the creatures freezing for a moment and then behaving very differently when the next generation appeared. A new generation would not necessarily preserve the same behaviors as the previous one.</p><p>That was why rtNEAT caught our attention. It replaces individuals incrementally while the rest of the simulation continues. A newly introduced creature might behave strangely at first, but the other creatures are still there, moving and interacting with the world. That felt much closer to the continuous sandbox I wanted to make.</p><h3>How RTNEAT works</h3><p>The main change from NEAT is the reproduction cycle.</p><p>Instead of waiting for an entire generation to finish, each organism is given an artificial lifetime. During that lifetime, its behaviour is evaluated and its fitness is accumulated. Once an organism’s lifetime ends, it becomes eligible for replacement.</p><p>The basic process is:</p><ol><li>Evaluate the population continuously.</li><li>When an organism’s evaluation period ends, compare its fitness with the rest of the population.</li><li>Remove a poorly performing organism that has reached the required evaluation age.</li><li>Select parents from the better-performing organisms, while respecting NEAT’s species</li><li>Produce a new offspring using NEAT’s crossover and mutation mechanisms.</li><li>Put the new organism into the simulation and give it its own evaluation lifetime.</li></ol><p>Then the process repeats.</p><p>The important difference is that only a small part of the population is replaced at a time. The rest of the creatures continue behaving normally while evolution happens in the background.</p><p>This means that evolution becomes part of the simulation itself:</p><p>fitness → selection → reproduction → replacement → evaluation → …</p><p>There is no longer a clear boundary between one generation and the next.</p><p>This was exactly what we needed. Our creatures could continue moving and interacting with the environment while better brains gradually replaced worse ones, rather than having the entire population change at once.</p><p>RTNEAT was therefore not a replacement for the NEAT representation we had just built. It was the missing evolutionary mechanism that allowed us to use NEAT inside a continuously running game.</p><h3>The first Unity experiment</h3><h4>What we actually built</h4><p>After understanding NEAT and RTNEAT, we finally started building our own system.</p><p>We decided to keep the first version relatively constrained. The brain would evolve using rtNEAT, while the creature would be built from a predefined template. This gave us a fixed set of sensors and possible effectors, while still allowing evolution to change the neural topology and the active parts of the body.</p><p>The genome</p><p>Our genome is a direct representation of both the neural network and a small amount of the creature’s morphology.</p><p>It contains three main types of genes:</p><p>Node genes<br> Connection genes<br> Limb-slot genes</p><p>A node gene stores the node ID, its type, and, when applicable, the limb slot it belongs to. A connection gene stores its innovation ID, input node, output node, weight, and whether the connection is enabled. The limb-slot gene controls whether a particular limb slot is active, along with its limb variant and segment count.</p><p>For our current creature template, there are six possible limb slots, with three segments per limb. The neural network has five core sensors, two sensors for every limb segment, and two effectors for every segment.</p><p>This gives the initial genome 78 nodes: one bias node, 41 input nodes, and 36 output nodes. There are no hidden nodes initially. Every input, including the bias, is directly connected to every output, giving 1,512 initial connections.</p><p>The initial weights are randomly sampled between -0.2 and 0.2.</p><p>We deliberately kept the input and output structure preallocated. Even when a limb slot is inactive, its corresponding sensor and effector nodes remain in the genome. This prevents the input/output dimensions themselves from changing as the creature’s morphology changes.</p><p>From genome to creature</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQHRzF9wob1GqLYxEX5l6w.png" /><figcaption>a) pink colored ones are the creatures b) white balls are the food</figcaption></figure><p>The genome by itself is not the creature.</p><p>When the simulation starts, each genome is used to build a physical creature. The creature builder creates the torso and the active limb segments described by the genome. Its neural network is then constructed from the same genome.</p><p>This gives us a simple pipeline:</p><p>Genome → Neural Network + Body → Behavior → Fitness</p><p>The body is built using Unity’s Articulation Body system. The creature can also interact with water through buoyancy and drag, so the physical simulation becomes part of the environment in which evolution takes place.</p><p>The brain</p><p>Every physics update, the creature first gathers information from its environment.</p><p>The current core sensors provide:</p><p>Torso pitch<br> Torso roll<br> Nearest-food direction<br> Torso submersion</p><p>Each active limb segment also provides joint position and joint velocity.</p><p>These values are written into the corresponding input nodes of the neural network. The network then evaluates its enabled connections using tanh activation.</p><p>Instead of evaluating the network only once, our implementation performs three relaxation iterations per physics step. Node values also persist between steps, and because our mutation system does not prevent cycles, the resulting network can behave recurrently.</p><p>The network produces outputs that control the creature’s joints. In the current implementation, the first effector output is used to set the target of each joint’s x-drive.</p><p>So the loop inside the creature is essentially:</p><p>Sense → Think → Move → Sense again</p><p>Fitness</p><p>We wanted the first version of the evolutionary problem to be extremely simple.</p><p>The creature’s objective is to eat food.</p><p>Whenever the torso comes within 1.2 units of a food item, that food is consumed and the creature receives one fitness point.</p><p>There is no separate reward for surviving, moving, swimming, or approaching food. The only thing that matters is how much food the creature manages to eat.</p><p>This gives us a very simple fitness function:</p><p>fitness = total food consumed</p><p>The interesting part is that we never explicitly tell the creature how to reach the food. We only provide information about the direction of the nearest food. Evolution has to discover how the creature should use that information to control its body.</p><p>Mutation</p><p>Once a child is created, we apply mutations to its genome.</p><p>Weight mutation happens most frequently. Each connection has a chance of being perturbed by Gaussian noise, or its weight can occasionally be replaced by a completely new random value.</p><p>We also allow structural mutations.</p><p>A new connection can be added between two previously unconnected nodes. The new connection receives a random weight and an innovation number.</p><p>A new node can also be introduced by splitting an existing connection. The old connection is disabled, a new hidden node is inserted, and two new connections are created. The first receives a weight of 1, while the second inherits the old connection’s weight.</p><p>This allows the network to gradually grow from the simple initial topology.</p><p>We also added one mutation that is specific to our creature rather than to NEAT itself: every limb slot has a small probability of switching between active and inactive.</p><p>So evolution is changing two things at the same time:</p><p>the neural controller<br> and the active morphology</p><p>Real-time evolution</p><p>This is where RTNEAT becomes important.</p><p>We did not want the simulation to stop after every generation. All the creatures should continue moving and interacting with the environment while evolution happens in the background.</p><p>Each genome therefore receives a birth time. Once it has existed for at least 15 simulated seconds, it becomes eligible for replacement.</p><p>At a population tick, the system looks for the lowest-fitness genome that is old enough to be replaced. Instead of replacing the whole population, we replace only that one creature.</p><p>Two parents are selected from the population using fitness-based tournaments. Their genomes are crossed over, mutations are applied, and the resulting child replaces the old genome in the same population slot.</p><p>The physical creature is then rebuilt from the new genome and its neural controller is initialized again.</p><p>The rest of the population never stops.</p><p>This means that the evolutionary process becomes continuous:</p><p>evaluate → select → reproduce → mutate → replace → evaluate again</p><p>There is no point where the entire population disappears and a new generation suddenly appears.</p><h4>What worked and what didn’t</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fx_b5Yo7G_4c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dx_b5Yo7G_4c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fx_b5Yo7G_4c%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b8930fdcb504543807a1ab72eb9f8c1/href">https://medium.com/media/7b8930fdcb504543807a1ab72eb9f8c1/href</a></iframe><p>The result was a continuously running population of creatures whose brains could evolve while they were interacting with the environment.</p><p>Each creature had its own genome, its own neural network, its own body, and its own fitness.</p><p>The population started with relatively simple brains and fixed input/output dimensions. Evolution could then modify connection weights, introduce new connections and hidden nodes, and change which limb slots were active.</p><p>However, this was not yet the fully open-ended evolutionary system we had originally imagined.</p><p>The body was still strongly constrained by the predefined creature template. We could change which limb slots were active, but we could not freely invent new body structures. Segment counts were not being mutated, and some of the morphological information stored in the genome was not yet used by the body builder.</p><p>There were also simplifications in our RTNEAT implementation. Although we created species and calculated compatibility distance, parent selection and replacement were still performed using raw fitness across the whole population rather than species-adjusted fitness.</p><p>So we had achieved the core thing we wanted: evolution was happening inside the running simulation.</p><p>But the system also exposed a much deeper problem.</p><p>We had a way to evolve the brain.</p><p>We had a limited way to evolve the body.</p><p>But the relationship between the two was still largely predefined.</p><p>And that became the next problem we had to solve.</p><h3>Trying HyperNEAT</h3><p>RTNEAT gave us a way to evolve the creatures continuously, but there was still a limitation in our representation. The neural network was being evolved directly as a graph. We started wondering whether we could separate the evolution of the brain from the actual structure of the brain.</p><p>This led us to HyperNEAT.</p><p>The key idea behind HyperNEAT is that evolution does not directly encode every connection in the final neural network. Instead, it evolves a smaller network called a Compositional Pattern Producing Network, or CPPN. The CPPN is then queried using the coordinates of two neurons, and its output determines whether a connection should exist and what its weight should be.</p><p>So instead of evolving this:</p><p>Neuron A → weight → Neuron B</p><p>we evolve a function that answers:</p><p>(position A, position B) → connection weight</p><p>This seemed particularly interesting for our creatures because the neurons already had a physical interpretation. Sensors belonged to different parts of the body, and effectors controlled different joints. Their positions could therefore become part of the input to the CPPN.</p><h3>Our HyperNEAT implementation</h3><p>We kept almost everything else unchanged.</p><p>The same creatures were used. The same sensors were used. The same food-based fitness function was used. The same RTNEAT population loop handled reproduction and replacement.</p><p>The major change was what the genome represented.</p><p>In the direct NEAT implementation, the genome represented the controller itself.</p><p>In HyperNEAT, the genome represented the CPPN.</p><p>Our initial CPPN contained 9 coordinate-query inputs and 3 outputs:</p><p>Connection weight<br> Link expression<br> Hidden-node expression</p><p>The CPPN was initially fully connected from its inputs to these outputs and contained no hidden nodes.</p><p>When a creature’s controller was created, we constructed a fixed substrate containing the possible sensor, hidden, and effector locations. For every possible connection, the decoder queried the CPPN using the coordinates and roles of the source and destination nodes.</p><p>The CPPN therefore answered three questions:</p><p>Should this node exist?</p><p>Should this connection exist?</p><p>If it exists, what should its weight be?</p><p>An expressed connection then became part of the creature’s actual controller network.</p><p>This gave us a two-stage process:</p><p>CPPN genome → Substrate → Creature&#39;s neural controller</p><p>The important difference from direct NEAT was that the substrate itself was not evolved. It was predefined.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9qdPj2XI_Ho%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9qdPj2XI_Ho&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9qdPj2XI_Ho%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff039b74c808376915869d7c1f048565/href">https://medium.com/media/ff039b74c808376915869d7c1f048565/href</a></iframe><h3>Where it started breaking</h3><p>This is where HyperNEAT became much less useful for our particular problem.</p><p>Our creatures did not have a single fixed brain whose neurons could be naturally mapped onto a geometric substrate. The body could change, and therefore the set of possible sensors and effectors could change with it.</p><p>We tried to solve this by defining a fixed substrate from our creature template. The current substrate had 42 inputs, 36 possible hidden nodes, and 36 possible outputs.</p><p>But this meant that we had already made a major decision before evolution even started:</p><p><strong>we had decided what the brain’s possible structure was.</strong></p><p>The CPPN could decide which of those predefined nodes and connections were expressed, but it could not invent a completely new location for a neuron.</p><p>The problem became even more obvious with morphology.</p><p>Although our genome still contained limb-slot genes, the morphology was not actually generated by the CPPN. The limb slots were handled separately, while the CPPN only generated the neural controller.</p><p>So we had two evolutionary representations sitting beside each other:</p><p>Limb-slot genes → Body</p><p>CPPN → Brain</p><p>The two systems were not really evolving together.</p><p>A change in morphology could therefore change which physical sensors and effectors existed, while the CPPN was still operating over a predefined substrate designed around the original creature template.</p><p>This defeated one of the reasons we had become interested in HyperNEAT in the first place.</p><p>We wanted the genome to describe a process capable of producing the brain, rather than storing the entire brain directly. But the moment we predefined the substrate, we had also predefined a large part of what the brain was allowed to become.</p><h3>Why the results were so poor</h3><p>There was another practical problem.</p><p>For every possible connection in the substrate, we had to query the CPPN to decide whether that connection should exist and what its weight should be. With our current template, this produced up to 2,808 possible decoded links.</p><p>The CPPN therefore had a relatively small genome, but it was being asked to control a much larger predefined network.</p><p>More importantly, the CPPN had to discover useful mappings from spatial coordinates to neural connectivity. A small change in the CPPN could therefore affect many connections in the substrate at once.</p><p>That is one of HyperNEAT’s strengths when the problem actually contains useful geometric regularities.</p><p>Our problem did not give evolution an obvious geometric pattern to exploit.</p><p>The fact that two joints were physically close to each other did not necessarily mean that their neurons should have similar connections. What mattered was the creature’s task, its current morphology, and the interactions between its sensors and actuators.</p><p>As a result, the CPPN was trying to discover a useful global pattern over a structure that we had largely predefined, while direct NEAT could simply modify the connections that mattered.</p><p>HyperNEAT therefore introduced another layer of indirection without solving the fundamental problem we were facing.</p><p>We had gone from:</p><p>Genome → Brain</p><p>to:</p><p>Genome → CPPN → Substrate → Brain</p><p>but the substrate was still fixed.</p><p>And this led us to a much deeper question:</p><p><strong>If the substrate itself is predefined, how can evolution ever evolve a completely new brain?</strong></p><p>That question became the real problem behind our next experiment.</p><h3>The question the substrate raised</h3><p>HyperNEAT left us with a problem. The CPPN can describe patterns compactly, but the substrate it queries is fixed. It can only express neurons at positions we defined in advance, so it can’t grow a new hidden node or invent a new connection pathway.</p><p>The obvious fix is to give the substrate NEAT-style structural mutations. But then every new node and connection has to be recorded in the genome, and every one needs a historical marking so crossover can line genes up, which is exactly the competing conventions problem from earlier. Once we do that, we are encoding the network explicitly again, and the compactness that made the CPPN attractive is gone.</p><p>That left a bigger question: <strong>can a compact, generative genome build a neural substrate, grow it, and rewire it, while its changes can still be inherited and combined across generations?</strong></p><p>Biology suggests it’s possible. DNA doesn’t store a finished brain neuron by neuron. It stores information that takes part in development, and development builds the organism. So maybe a creature’s genome should work the same way: a set of rules that grows a brain, not a blueprint of one. That would also fit our original goal, because the body and brain could come out of the same developmental process instead of two separate representations sitting side by side.</p><p>I haven’t solved this, and I haven’t built an experiment for it yet. I also know the idea isn’t new. Work like ES-HyperNEAT and the older developmental and artificial embryogeny encodings goes after the same problem, so reading those is where I’ll start. For now it’s a research direction I want to explore, not a result.</p><h3>Where I want to go next</h3><p>For now, we’re staying with rtNEAT and focusing on turning what we’ve learned into a game.</p><p>The current system works, but it has gaps I know about. The body is still limited by a fixed template. Segment counts don’t mutate. Some morphology data in the genome isn’t used by the body builder. And parent selection and replacement use raw fitness instead of species-adjusted fitness, so speciation isn’t protecting new structures the way NEAT intended. Fixing these is the most direct way to get closer to creatures that really adapt.</p><p>Then there’s the original idea: a world the player can change, and creatures that respond over generations. A farm should attract herbivores. Changing the terrain should shift the population. Food moving into water should eventually produce something that swims, with no one writing a swimming rule. We’re not there yet, but this is what the rest of the system is for.</p><p>I’d also like to hear from you. What should this game become? What roles could the creatures play, and what mechanics or story would make the world more interesting? Tell me in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=392669a89d1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>