Hi, I’ve been working hard the past week trying to program a 3D version of the game of life: http://www.bitstorm.org/gameoflife/ . So far, my results haven’t been good because of my lack of knowledge in python programming.
What I’ve done successfully is set up two object types, cubes and empties. The empties make up the grid in which the Game of Life will take place. The empty uses a near sensor to detect if 3 or more cubes has spawned beside it. If this is true that empty will spawn a cube and delete itself, becoming “alive”. If an empty detects less than 3 cubes nearby, it does nothing. In turn, if a cube detects less than 2 cubes, it deletes itself and spawns an empty in its place. If the cube detects 2 or more cubes beside it it will do nothing. Thus the game of life can be played in 3D.
Unfortunately as you may have already guessed, the game engine has a rough time spawning all those objects with near sensors, and eventually slows to a dead stop on some setups.
My solution would be to simplify everything by simply having cubes that turn their visibility on and off accruing to the same rules above. This would eliminate the need for constant spawning and the use of empties.
I can’t figure out how to program the cubes to detect a nearby cube’s visibility then adjust its own according to the Game of Life rules. Any help on this would be most appreciated.
Any other ideas on how to make this more efficient, or how I can do this would be awesome. Thanks a ton.