Genetic Evolution (Behavioral Traits) Simulation using Unity3D

Genetic Evolution (Behavioral Traits) Simulation using Unity3D


This is a simulation of Genetic Evolution with a focus on Behavioral traits passed between generation, In this simulation, survival is for those who remain on the ground and walk a lot.

Every character has a DNA

DNA consists of two genes:

Gene 1: store the Action when the ground is visible

Gene 2: store the Action when the ground is not visible

(Choice of the gene is dependent on the eyesight whether the character sees the ground or not)

Every character has a Brain Script, where the eyesight result (Ground is visible or not) decide which Gene will take place.

Eyesight is implemented using Debug.DrawRay along with a Physics.Raycast check for the hit position, represented by the yellow sphere on the ground.

No alt text provided for this image


Every Gene will have one of the three action options

Action options:

Action 1: Turn Right

Action 2: Turn Left

Action 3: Move Forward


Breeding Logic dependent on :

(Time walking + Time on the ground)


The source code is on my Github, It took place as a Challenge in my AI courses.


#unity #machinelearningalgorithms

To view or add a comment, sign in

More articles by Ahmed Schrute

  • Vertex Fragment Shader Structure

    This article is a continuum of shader coding articles using Shader lab in Unity, I highly recommend you visit my two…

  • Rendering Queues in Unity

    A lot of times, we need to render certain objects(Player, Gem …etc) to the front even there is an object overlaying our…

  • Normal Mapping

    If you have read the Lighting in Unity 1 and Lighting in Unity2, you have seen how important normal vectors are for…

    2 Comments
  • Light in Unity 2

    Intro to Blinn Phong Lighting model In the previous article, We have been through Lambert Lighting Model and how it…

  • Light in Unity 1

    Introduction to Lighting in Unity and Lambert Lighting Lighting in Computer Graphics is all about calculating the Pixel…

  • Shader Variables Data Types in Unity

    Why we use different variable types when writing shaders? Shader code is for every pixel(or vertex), therefor efficient…

  • Understanding Mesh Anatomy in Unity

    In order to shade a model we need to understand its geometric structure Let’s take a cube as an example of a mesh model…

  • Rendering Pipeline In Unity

    Introduction to Rendering Pipeline in Unity Rendering Rendering is the process of drawing a scene on the computer…

  • Unity CPU Profiling

    Enhancing unity CPU performance I usually have a routine before I start inspecting the CPU usage tap which is opening…

Explore content categories