Project Mendel

Genetics has always been a big fascination for me, but especially the ways it can be simulated and used as a game mechanic. I first explored this concept in Chimera by using genes that contained images of creature parts. To create offspring, I had a fairly simple function that randomly selected which parent each gene would be inherited from. I also had no form of mutation, because each part was a set size and shape.

I recently decided to try a new experiment in genetic simulation that would allow me to prototype different concepts of genetics and crossbreeding. Over a few nights I put together a processing sketch using the Recursive Tree script as a starting point. Because plants are much more simple than creature, they can easily be drawn by a computer program, given a set of parameters, and produce a wide variety of forms.

I turned the values used to define the structure of the tree, such as branch angle and size, into numbers stored in each plant as gene objects. As I made the plant drawing process more complex, adding branch width and a possible random deviation every time it draws a branch, I simply added a gene to the plants’ genome to define its individual expression of this value. I then select two plants and put then through a process of one point crossover. This takes the values of one parent’s genes up to a specific, randomly selected point and then “crosses over” and takes the rest of the genes from the other parent.

I’m not sure where this project might lead, but right now I am using it as a platform for testing various methods for gene organization, mutation and crossover which can then be applied to plants or animals. I do think there is interesting potential for a small (mobile or online) game involving the cultivation and crossbreeding of plants which allows the user to create new and interesting looking plants in a virtual garden.


Chimera Update

Play Chimera

I recently fixed up the Chimera prototype I started in college with embedded fonts and tutorial boxes to explain how to play the game. It’s still a very rough prototype, particularly in the combat which I find extremely boring. I have plans for an improved combat system, but I’m not sure when I will get to actually implementing it. Right now I’ve begun to redirect my focus to the genetics simulation.

I have begun a new prototype to test and tweak new methods of organizing and crossing genetic information that are closer to the way real genetics combine when reproducing. While working on Chimera, it has always been in the back of my mind that the same genetic breeding system could be used to define the appearance of plants as well as creatures. With that in mind I began to code what I am currently calling Project Mendel. More on this soon.

Prototype 02


Play Prototype02

So I apologize, dear readers, for not posting more of my prototypes thus far. To summarize my efforts, I’ve gotten a basic, random crossover function that generates random offspring from both parents. Each part holds the potential to modify the attributes of the creature, which include: Strength, Stamina, Constitution, Intelligence and Speed. Eventually (for the next prototype) parts will also hold ability objects which are the creature’s attacks in combat. Parts like claws would have a slash attack, horns have a headbutt attack, third eyes have a psychic attack, etc.

This current prototype had 41 part sets, and I will be adding more as I go. This prototype can create roughly 972000 different combinations.

In the next prototype I will make a rough combat system and attempt to add a system for skin color that is inherited and mixed between parents. Technically (on the schedule I drafted) these are two different prototypes, but I’m planning on working on both features interchangeably and I’ll demo which ever I finish first.

On Heredity and Gene Dominance

I spent my night with Wikipedia last night reading up on genetics and heredity. Aside from being excellent¬† research for this project, I find the machinery of DNA incredibly fascinating. It’s literally natural technology and to learn about all its intricate details is phenomenal. I now have the task of attempting to simplify this system into a cute, fun flash game in a matter of 7 to 8 weeks, and I’m entirely up to the challenge.

One of the major aspects of heredity is trait dominance. DNA essentially has 2 copies of each gene (pardon me if I confuse terminology anywhere in this explanation). One from each parent. One of these traits will be dominant to the other, causing that trait to be expressed in the individual. The DNA for that individual still contains the recessive trait which can potentially be passed on to its offspring.

Now comes the question of how to abstract this into my own virtual DNA (or VNA) system. I hesitate to simply declare certain genes dominant and others recessive, because it would seem like that would end up with all creatures eventually looking the same. The other question I found myself faced with was weither to replicate the two sets of traits for the possibility of recessive traits emerging in successive generations or if I should simplify it to one set and simply pick which traits are passed to the offspring at the time of (virtual) chromosomal crossover. One thing that’s clear: the crossover function will be the keystone to this whole VNA system. More on that as it develops.