Wilden

Movement logic

By Wilden · 1 years ago

Movement in the evolution simulation is governed by a priority-based decision system that balances multiple competing needs. Each organism evaluates its current individual situation and chooses movement based on what it needs most urgently.

Since every individual organism s different, but exists in the same context, their movement naturally forms into loosely governed groups, creating an emergent herd movement, similar to bird murmurings.

Fear

Organisms act on fear of threats, violence, and being away from others of their own species. This happens when they're outnumbered by other species or when they encounter potential predators. Fear influences movement decisions, ensuring survival takes precedence.

Fear-based movement creates natural herding behaviors where organisms of the same species cluster together for protection. Threatened organisms move toward known safe locations where their species congregates, creating defensive formations and territorial boundaries. Organisms prefer to venture out away from a larger group if someone else is with them.

Survival

When organisms are in danger, they flee toward safety, often seeking out others of their own kind for protection. This creates natural herding behaviors where similar organisms cluster together. The fleeing behavior overrides all other movement decisions, ensuring survival takes precedence.

Energy seeking

Organisms become strategic foragers when they need energy. They remember where they've found food before and return to those locations. If they're at a known food source, they stay put. If not, they move toward remembered feeding grounds. Only when they have no memory of good locations do they explore randomly.

Social

Reproduction creates complex movement patterns. When ready to reproduce, organisms first look for compatible partners nearby. If none are available locally, they travel to areas where their species congregates, creating natural mating grounds.

Organisms also prefer to rest among their own kind. If they find themselves surrounded by different species, they'll move toward areas where their species is more common. This creates natural territorial boundaries and species segregation.

Knowledge

Organisms have memory - they remember where they've found food, where they've encountered others of their species, and where they've been safe. This knowledge guides their movement decisions, creating efficient foraging patterns and social networks.

Energy constraints

Every movement has consequences. Moving requires energy, so organisms must balance the benefits of reaching a goal against the cost of getting there. This creates realistic patterns where organisms don't move constantly but instead make strategic decisions about when and where to go.

The energy cost of movement also creates natural selection pressure. Organisms that move efficiently have an advantage over those that waste energy on unnecessary movement. This drives the evolution of more sophisticated movement strategies over time.

Emergent behaviors

From these simple movement rules emerge complex, lifelike behaviors. Organisms naturally form territories, establish migration routes, and create social networks. They develop foraging strategies that balance exploration with exploitation. They exhibit predator-prey dynamics where some organisms flee while others pursue.

The movement system creates a dynamic, ever-changing world where the distribution of organisms constantly shifts in response to changing conditions. Food sources become depleted and new ones are discovered. Populations grow and disperse. Species compete for space and resources.

This emergent complexity makes the simulation fascinating to watch. Simple rules about where to move create rich, realistic behaviors that mirror what we see in natural ecosystems.

Movement

By Rosedo Devs · 1 years ago

I made the organisms move around randomly as well as staying close to their own species, looking for opportunities to reproduce and to find sources of energy to stay alive.

After giving organisms an understanding of their surroundings outside of their exact location, I allowed them to use this understanding in picking a direction to move to next.

Because the preferred directions were looked up in a x and y axis manner, starting top left, organisms turned out to have an affinity to move northwest, since that direction was technically evaluated first in the grid.

Once a supposed direction was found, no more directions were evaluated, as a way to not waste precious processing time.

The way to solve the north west drift was simply to shuffle the set of of directions first before evaluating them.

Since I am iterating over each organism over and over, all precise and evaluations must be as fast as possible. I implemented the Fisher-Yates shuffle to shuffle positions for directions, as it appears to have slightly better performance over the built in shuffle. If anyone has a more performant shuffle, let me know.

What is life?

By Robin Dowling · 2 years ago

So how are the organisms going to live their life? Live any life at all? What even is life? And how can any sort of representation of life be simulated?

Questions I asked myself.

Goals

In life, all organisms have goals. Without these goals we would all die and leave nothing. No next generation. A flash-in-the-pan organism, long forgotten in the history of... life.

The organisms needed some basic goals to promote an evolution to even take place.

In evolution, the single goal of any organism can be reduced to: produce offspring that eventually also produces offspring.

Everything else is fluff from an evolutionary perspective.

Keep in mind that evolution itself is not even something organized by nature, or an intrinsic attribute of the world. It just happens to be the natural progression of events, given certain criteria. Such as organisms being able to produce offspring that eventually also produces offspring.

I gave the organisms two basic goals

  • Stay alive
  • Reproduce

In addition to these goals, I gave them behavioral goals that promoted the two basic goals. You can't just run around in circles in your own corner if you want to eat and/or reproduce, right?

Basic elements

By Robin Dowling · 2 years ago

I have also added basic elements, eg oxygen, sulphur, carbon, chlorine, iron etc, as elements in the world.

These elements were then added randomly to each organism, as a chemical composition, which together with the other genetic attributes make the organisms' definitions even more complex and varied.

Each element has an assigned amount of energy, based on which element it is. The sum of all element energies is used to calculate the organism's energy.

They're all organisms

By Robin Dowling · 2 years ago

I didn't want to have separate definitions for plants and animals. Or for there to even be a notion of that. I wanted the evolution to come up with that on its own, if that was what were to be randomly evolved over time.

Instead I added an attribute for whether the organism was motile or not. Motile, as in able to move around on purpose. What really is the difference from a Venus flytrap and a "walking stick" Phasmid? In terms of genetics.

A lot, I'm sure. But in the end, there is no natural genetic flag for plant or animal. These are just interpretations made by us humans.

Either way, I made all organisms be the same, but with different genetics, the motile genetic marker carrying heavily in the taxonomy classification, effectively dividing motile (animals) and sessile (plants) organisms into two different taxonomy domains.

Genetics in code

By Robin Dowling · 2 years ago

So, how do you assign genetics to an organism in code? That's what I asked myself at first.

I created an Organism class, and added a few attributes that I believed the organisms in my world ought to have. Things that define them and propagate naturally to offspring.

Fuzzy values for max possible age, values for how likely the organism is to want to reproduce, given the right circumstances, the maximum number of offspring, its max theoretical mass and density.

Stuff like that.

Taxonomy summary

By Robin Dowling · 2 years ago

The taxonomy functionality organizes and classifies organisms into categories based entirely on their genetic composition.

  1. No pre-made assumptions. The system does not rely on any predefined species or groups. It doesn't assume anything about what an organism is or where it belongs in the biological hierarchy. Instead, it uses only the genetic information provided to determine the classification.
  2. Completely deterministic. The process is entirely predictable and consistent. If you give the same genetic composition to the system multiple times, it will always produce the same classification and associated traits. There is no randomness or subjective interpretation involved.
  3. Grouping by genetic patterns. The system analyzes the organism's genetic makeup and sorts it into the classic taxonomy levels of categories, from very broad groups (like domain) to highly specific ones (like species). These groupings are determined by patterns and variations found in the genetic data.
  4. No external definitions. The system doesn't rely on existing species or taxonomies, and classifies organisms purely based on the input genetic data.

In summary, the taxonomy classification classifies organisms objectively and deterministically, driven entirely by their genetic composition without relying on predefined categories or external assumptions.

Deterministic taxonomy based on genetics

By Robin Dowling · 2 years ago

Each simulated evolution begins with a random initial seed. I wanted to avoid any preconceived model of the world and its evolutionary processes. For this approach to succeed, the taxonomy classification needed to be a deterministic generalization of an organism's genetics across all taxonomic levels, from Domain to Species.

I began by constructing a new Taxonomy class that accepts an array of numbers, with each value representing a component of an organism's genetic makeup. This genetic array is then transformed and reduced at varying levels of precision corresponding to each taxonomic level.

Through extensive experimentation with precision settings and transformation methods, I tried to find the ideal balance, a sweet spot that would yield a reasonable distribution of species based on the diversity of randomly assigned genetics across all organisms.

This reduction process organized organisms not only into species groups but also into progressively fewer clusters of genus, family, order, class, phylum, kingdom, and domain, each level encompassing larger populations within its hierarchy. Importantly, all groupings remained deterministically derived from the randomly assigned genetic foundations.

Finding an equilibrium that effectively sorted the vast array of organisms with their uniquely individual genetic profiles into coherent groups turned out to be more challenging than expected.

I was committed to avoiding manual classifications or special cases. The solution needed to be universally applicable across all possible initial random seeds, relying only on the input genetics and the varying precision thresholds for each taxonomic level.

Ultimately, the solution emerged with elegant simplicity: just a few lines of mathematical expressions and carefully balanced weights.

A single Taxonomy algorithm capable of sorting and classifying any collection of organisms with randomly assigned compositions of genetics.

Emergence of new species

By Robin Dowling · 2 years ago

All species have the potential to evolve into new species. This isn't due to some inherent function designed for species evolution, but rather through random mutations in the genetic makeup of each newly born organism.

What we recognize as a species is essentially a generalization of individual genetic profiles, a shared abstraction among organisms whose genetics are sufficiently similar.

Mutations, in their role of creating new species, cause an organism's genetic profile to diverge enough that it no longer aligns with any previously classified species.

The organism naturally differs from others because of its distinct genetic composition. These differences manifest based on which genetic markers have mutated and to what degree.

Species, as a concept, is merely a label we as observers apply to organisms to categorize them and establish a framework for predicting their appearance and behavior. In the fundamental view of physics, we are all simply organisms with an extensive spectrum of genetic compositions.

This principle also forms the foundation of our evolution simulation.

More on this in the next post.

Genetics

By Robin Dowling · 2 years ago

As pretty and modularized and extendable as my species taxonomy code was, it was all backwards.

I was wrong in assigning taxonomy willy nilly. Taxonomy is not given to an organism in nature. It should instead be deterministically interpreted based on the organisms' genetics.

Given a set of genetics, an organism should inherently be classified as a given species.

An organism's species is not assigned somewhere in a natural database, it is deduced, based on something else. Species, and the full taxonomy of an organism, is not given to it at birth. It is simply a way of grouping organisms based on a shared, but extremely varied, chemical setup - genetics.

There is no notion of different species in nature. To nature, all organisms are simply organisms with different genetics. Different chemical compositions.

Although no two organisms will ever have an identical chemical composition, groups of organisms have a similar composition. Similar enough for them to look alike, and behave alike. For them to be able to produce viable offspring. For them to even be attracted to each other to be able to attempt reproduction in the first place.