The rules for Conway’s life are (IIRC) that a cell is born if three of the eight neigbouring cells are occupied, it survives if one, two or three are occupied and dies in all other cases.
I want to create something a little more complex; a bit less ‘boolean’ - I want to assign three byte values to each cell and each of these bytes will describe one of the colour components of the cell (so instead of ‘occupied’ or ‘vacant’ it would be white or black or any shade of colour in between); a cell therefore won’t ‘die’ or ‘be born’, but rather will ‘weaken’ or ‘strengthen’ in one or more of it’s colour components according to some combination of criteria from it’s neighbours.
I’d kind of like to make it so that each colour component in an individual cell is affected adversely by one of the others and positively by another, so that things can cycle a bit (but also so that it doesn’t merely become three independent layers of the same algorithm)
So maybe something like:
Too much red nearby>decrease blue, slightly increase green
Too much blue nearby>decrease green, slightly increase blue
Too much green nearby>decrease red, slightly increase red
Too little red nearby>increase green, slightly decrease blue
Too little blue nearby>increase red, slightly decrease green
Too little green nearby>increase blue, slightly decrease red
Far too little red nearby> decrease red
Far too little blue nearby> decrease blue
Far too little green nearby> decrease green
I’ve got a bit stuck now; does anyone know if this sort of thing has been done before and if not, I’d appreciate any contributions/suggestions in the direction of quantifying/enhancing these sort of rules (I think I can handle the implementation/programming)
I’m pretty sure that a very effective approach is one of “suck it and see”. I’m sure that Conway did this before he settled on “his” rules.
(Speaking as a programmer) the specific “next-generation” rule isn’t going to be an issue when it comes to coding, the hardest part (though nothing here is hard) is the support for the “universe”. I would very much recommend that if you can, code the universe in such a way that the next-generation rules are “soft-coded” (i.e. configurable). This will allow you to suck more and see more (forgive the clumsy idiom).
For particular values of a given parameter you may find that the population converges quickly to a trivial “steady-state” (say all red), but tweaking and fine-tuning will help you find a “sweet spot” where complexities can thrive.
You might also consider letting “remote” cells (i.e. not immediate neighbours) exert some selection pressure.
Good on you, Mangetout! I’ve been really wanting someone to do this- life ain’t digital, on or off; there should be shades of health. I’m not a programmer, though, so I couldn’t do it myself.
One thing though… can you take a look at making the board hexagonal, rather than orthogonal? Grids don’t normally happen in nature.
Thanks for the suggestions so far; I will make it with slider controls so that the threshholds for all the biases can be tweaked.
I had considered the idea of allowing remote cells to affect each other, but I think I’ll shelve that for a later version and faster CPUs; it introduces a far greater calculation overhead (even though it does more closely model a real-world system.
hexagonal would be good, but it will be difficult to implement (it would also prevent the user loading the startup patterns as simple 24 bit bitmaps.
I did think that maybe for any given cell, the adjacent cells in the four cardinal directions should exert more influence than those in diagonal directions, but again, maybe the ability to tweak that is required too.
I did toy briefly with the idea of the cells not being fixed in any kind of grid but being free-floating objects (within a 2D space) that could then have a few more attributes that we could play with (direction, mass and and velocity); some interesting avoidance and herding rules could also be applied, but again, I’ll leave that for later, as it’s a bit of a diversion from true cellular automata.
To keep it simple, let “red” and “blue” correspond to “alive” and “dead” in Conway’s system, and let a two “green” cells count as an “alive” one (so for every two green cells neighboring a given cell, its count of live neighbors goes up by one). Tweak from there based on what would look interesting, and give us a link in the end.
OK, here’s what I have got so far (I’m designing the interface first):
For each cell, there are three sets of three basic rules like this:
Adjust Red:
In response to local Red %
By [A] if >** and <[C]
By [D] if >[E] and <[F]
By [G] if >[H] and <*
In response to local Green %
By [A] if >** and <[C]
By [D] if >[E] and <[F]
By [G] if >[H] and <*
In response to local Blue%
By [A] if >** and <[C]
By [D] if >[E] and <[F]
By [G] if >[H] and <*
Adjust Green:
In response to local Red %
By [A] if >** and <[C]
By [D] if >[E] and <[F]
By [G] if >[H] and <*
And so on
So we might say Adjust red by -3 if local red >10% and <30% (% of maximum possible)
and we can thus define the behaviour of each colour element of the cell in response to three different level ranges for each colour
Then there is a basic decay rate for each colour element (which can be set negative to be a basic growth rate (this applies to all cells regardless of other rules)
Then there is a set of Orthogonal bias parameters for each colour element for each direction for each local colour; I put this in primarily to adjust for the fact that the adjacent cells in the cardinal directions are geometrically closer than those in the diagonal directions, but it can be set to be as specific as that the red element of a cell is more sensitive to the presence of green to the right and more sensitive to the presence of blue above (I thought we might get some interesting ‘growth’ and ‘migration’ patterns if this is possible).
The hard bit comes next; I have to write all the code.
This is interesting. What about letting the different colors be somewhat differentiated? Of course this is much harder to tweak, so it’s more of a future thought. Then instead of a rock-paper-scissors kind of organization, you could have, say, red thrives near other colors but decays quickly, blue is ‘killed off’ quicker by other colors but naturally lives longer, etc.
Oops, on rereading I see now that this is essentially the same idea you had with the migration patterns.
I think the triangular (hex) grid is a good idea too – everything’s equidistant, and it shouldn’t be much harder to implement.
it should be possible, given the rules outlined above to either make each colour ignore the others or make two of them interact, but not the third, or to make them interdependent in different ways.
I’m steering clear of the hex grid simply because it’s an extra level of complexity (in the programming, not the model) that I don’t fancy tackling at this stage. The orthogonal bias parameters should make it possible to have a more realistically natural situation; (in the conventional conway model, each cell effectively percieves it’s eight neigbours as being in a ring, not a square; in the real world, the four diagonally neighbouring cells would have less influence than those which are adjacent in the four cardinal directions.