Game "life", Chaos, "black swan", ethnogenesis and how it all is connected
I for a long time on Habré. Looking through the old ratings noticed that people are not indifferent to the game "life." In this regard, I decided to share my version of this game.
In principle, my version is based only on the classical rules - it was interesting for me to create a dynamic system. Because of this, there are predators and prey in the game, mutations, cannibal animals, dynamic equations and many more stuff. ')
Who cares please under the cat ...
A game
The game mimics the predator-victim relationship.
The life cycle of the victims is based on the rules of the game "life": for reproduction you need a certain number of neighbors, but if the number of neighbors is more than definitely, then the cell-victim dies. Death is final.
The life cycle of a predator cell is based only on the ability to reproduce. Predators can and should eat in order to breed.
All creatures have initial parameters that can mutate (increase, decrease) in the process of reproduction. At the moment there is only:
• life priority (nutrition, safety, isolation = loneliness, reproduction) - the strategy of individual behavior - determines the next move; • force - affects the chance of one creature to defeat another (relevant only for predator cells); • vision - determines the maximum distance a creature can see (field of view); • speed - determines the maximum distance that a creature can cover in one turn; • life - the number of moves; • Whether the cage is a “Black Swan” ( Black Swan ) is a “Black Swan” being, the movement of which is determined by the dynamic formula (“ Chaos Theory ”). All creatures of the same kind, “seeing” “black swan” strive for it (life priorities do not play a role here) - this gives an additional level of randomization; • “cannibalism” (relevant only to predator cells) - the ability to feed on individuals of both species (in order to eat a creature of the same species, the eater cell must first defeat it).
For each creature, the values of the parameters are determined randomly at birth.
All tribes of predators are in a state of war or peace, which is determined randomly. If two individuals of the warring tribes are found on the same cage, then they join the battle, the result of which depends on the value of force. Thus, using the statistics window, you can monitor their development or attenuation.
Legend
The green triangle (the bottom one in the cage) is the victim; The red triangle (top in the cage) - the hunter; The blue triangle (right in the cage) is the heir of the hunter this turn; Black triangle (left / bottom in a cage) - black swan hunter / victim.
I would be glad if readers share their ideas, how can you extend the existing functionality? What else would be interesting to simulate?
Control
To place a tribe of predators: we clamp the right mouse button on the field and lead in any direction - a red halo appears, defining the Gaussian distribution of the tribe. If at the same time you twist the mouse wheel, you can increase / decrease the dispersion of propagation. To accommodate a tribe of victim cells, pinch the left mouse button on the field and lead in any direction - a green halo appears.
Additional information can be found under the "Help" button.
Statistics can be found by clicking on the button "Run Time Info"
The code was written when it just came out with ++ 0x and it was interesting to deal with lambda expressions, and also to see how much their use really improves performance.
Sources and executable file can be downloaded from here: Game Of Life Repo