Git Product home page Git Product logo

empire's Introduction

EMPIRE

This is my own cellular automaton

The rules are as follows:

-The world is made out a grid of cells aka "people"
-Each person holds some numbers:
    -Age
    -Strength
    -Reproduction Value
    -Colony ID

-Each person also holds some booleans
    -Whether they are alive or dead
    -Whether they are diseased or not

-At the start:
    -A few "colonies" are set up. Each colony has their own colour value
    -A few random locations around a map are set up, for each colony to originate from
    -50 people are placed are each of these locations, and are given the respective colony ID

SIMULATTION BEGINS
    -Each step:
        -Each person:
            - Increases in "Age" and "Reproduction Value"
            - Has a 50% chance of being cured of disease, given they have it
            - Tries to move to a random spot around them:
                -If they try move onto water, they will not move
                -If they try move onto land, they will move there

                -If they try move to a place where someone of a DIFFERENT colony is:
                    -They fight:
                        -Person with higher strength value stays fine.
                        -Person with lower strength value dies.

                -If they try move to a place where someone of the SAME colony is:
                    -If the person is diseased, then there is a 50% chance of giving/ catching it

            -If the person's "Reproduction Value" is greater than a "Reproduction Threshold"
                -The person gives birth
                -The child:
                    -Inherits the parent's Colony ID
                    -Inherits the parent's Strength value
                    -Inherits the parent's Disease (if parent is diseased)
                    -Has a chance of mutating:
                        -Slim Chance        -> Gets diseased
                        -Slightly Larger Chance -> Child is born weaker,

Deps:

C++14 and up, SFML 2.4.1 and up

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.