Fishwars: Population Dynamics

The QBasic program is relatively simple as far as the rules of the fish-world go. Fish can be one of a dozen or so colors, and the torpedoes they fire at each other only destroy fish which are differently-colored. When a fish swims off screen or is destroyed it is replaced by a random size and color of fish swimming in from the sides of the screen. When the fish swim from side to side they tend to swim toward other fish with the same color. These simple rules lead to a power struggle among fish colors. Certain colors of fish can come to dominate the population and eventually fall from power as other colors score lucky hits.

I want something much more sophisticated now. I want genetics. I want survival of the fittest rather than purely survival of the lucky. To make things interesting the fish must have many more characteristics than simple scale and color, and those characteristics must have fine precision and subtle consequences. For example, fish and weapon colors should be expressed as a real value representing hue. This means that the simple friendly fire rules in the original program won’t work any more. The damage done by a particular color of weapon to a particular color of fish should be scaled depending on exactly how dissimilar those hues are. Weapons that are more or less discriminating should also be possible, so the color of weapon that a given fish weilds needs to be defined by two values which are effectively mean and variance as in a normal distribution.

Fish must also bear offspring which are slightly mutated, as in nature. What this all means is that the Gaussian function will play a very big part. Sampling a normal distribution is a very common method of mutating real values in an evolutionary algorithm: most mutations are very slight, but large changes are still possible.

The real trick to introducing evolution into this fish combat simulation is maintaining diversity. Obviously the whole point of this thing is to be looked at, and a wide variety of fish is best for that. I expect convergent evolution to cause problems. If there is a single best design and strategy for survival in the fishwars universe, then the entire population will tend toward it, making the ecosystem homogeneous and uninteresting.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.