Jump to content

[Code] Breeding system + Color application


Being

Recommended Posts

Hey gang!

In my game, I'm hoping to have Mendelian type genetics (recessive alleles ect) that stretch back to the grandparents of the lineage and also include the potential for species specific mutations and hybrids.

I would like some code that automatically colors the species bases with a set palette, to make creating markings one newer species easier and faster. Like what Flight Rising has?

If anyone has knowledge on how to do either of these things, please post below! It would be great if you can include an estimate for how much this might cost and if you have any active examples of your systems working (IE: already published in a game) to share for me to have a squint at.

Thank you!

Link to comment
Share on other sites

We have this on leporidae.org. I use PHP with Imagemagick and and a MySQL database. Feel free to message me if you need any info on how to implement it. 

When breeding, we get alleles from each parent and give 50/50 chance for offspring to inherit them.

For mutations, maybe add a random chance to mutate.

For displaying the color, we have an include file that orders alleles by dominance, that's where it determines expression. 

Imagemagick is easy to wrk with, so you do something like:

if (A gene expresses as black)

{

change the base layer to black

}

 

Edited by Hare
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...