"Organisms II" Project Report
September 29, 2004

Eric L. Goldstein
Peter J. Ottomanelli
Anya L. Roberson


Overview
      The "Organisms" problem is an extremely open-ended one with seemingly infinite possible approaches to creating a successful, stable organism population. However, probability plays a large role in increasing the difficulty of sculpting a strong, agile player because any particular organism can choose from at most nine actions, namely sitting still, moving in one of the four cardinal directions, or reproducing in one of those four directions. Therefore, any group attempting to tackle the problem of engineering a good player must implement the maximum number of nondestructive, simultaneously successful strategies in order to increase an organism's probability of a beneficial move. Most games that require probabilistic models to predict their outcomes involve a substantial amount of chance, including Organisms II. However, the more highly populated the game board and/or the harsher the board environment, the more this game becomes based on chance rather than on a successful probabilistic model.
      In a game like Organisms II, however, concrete probabilistic methods are difficult to develop because many variable factors affect what actions are beneficial or detrimental to an organism's survival. Therefore, after each move, one can adapt an organism's behavior to its new surroundings rather than rely on a probabilistic prescription.
      We had two main strategies in light of these observations. One involved the communication between neighboring friends in order to pass information about our organisms' local surroundings and adjust behavior to fit the local conditions. Because gathering information about the conditions on the entire board is incredibly difficult, if not impossible, our communication method would at least give an organism an idea about what the board looked like locally.
      Our other main strategy was modeled after one widely known and utilized in the chess world, wherein a skilled chess player never moves the same piece twice. We took that strategy and adapted it to fit the rules of the game. Generally speaking, an organism's chance of performing a particular action twice consecutively is very low. These "actions" include anything an organism can possibly do including moving, sitting still, or reproducing. One key benefit to this strategy is that it partially prevents overpopulation, thus increasing the chances of a higher average energy level per organism. This strategy also draws out the life-cycle of the game, decreasing the chances of our organism burning out. This and other strategic implementations will be discussed in depth later in this document.


Game Fundamentals
      A sufficient understanding of the game's fundamentals is required before one can truly conceptualize and create a strong, versatile organism able to survive in a maximum number of different conditions. Versatility is a key element in tournament success because its game conditions varied, sometimes considerably, from one game to the next. Overall, the general trend observed during multiplayer games can be divided into four unique phases.

The Game's Four Phases
  1. Initial Expansion

          This stage is analagous to runners' initial sprint from the start line when the start gun goes off. Every organism on the game board makes a mad dash away from its place of origin in search of food. Depending on its strategy, a player's actions when finding food can vary from hoarding the resources and conservatively growing its population to rapidly expanding in hopes of "drowning out" the other players due to lack of sufficient population. However, despite it being arbitrary, the "best" solution will at least include aspects from both ends of the spectrum and perhaps some intermediate ideas as well.
          Listing some key strategies for success will facilitate the explanation of transition from Initial Expansion to Warring States. After locating a sufficient food supply, effectively conserving and stockpiling resources can lead to a higher energy per unit ratio. This ratio, not a particular player's total population, usually determines the success of that player in the future. For instance, a player with population 1,000 and energy-per-unit ratio of 150 will most likely begin rapid extinction in the near future whereas a player with population 100 and energy-per-unit ratio of 450 will most likely remain stable then, when the larger population dies down, expand and grow. Overall, multiplying population by energy-per-unit gives a player's approximate level of success, but there is no specific range of values that a player can aspire to in order to determine success at that instant in time. Rather, that product can merely be used comparatively by an audience watching the GUI redraw for an approximation of an organism's future success or demise. On the other hand, excessive stockpiling causes one to get "swallowed up" by the competition because the product of population and energy-per-unit has grown too low.
          Overall, a player's primary focus should be to attain the highest possible product of population and energy ratio. Achieving that goal lowers one's chances of failure considerably.

  2. Warring States

          This post-growth phase involves surviving the initial onslaught of player expansion. Essentially, the total population of all players has hit its peak and can go nowhere but down from here. However, there is not a sudden drop off in population, but rather a trend towards the next phase wherein a sharp dropoff in available food occurs on the game board. Moreover, this phase is the most crucial because it is essentially the transition period from Initial Expansion to Lull in Resources. Food must be gathered and hoarded as best as possible to sustain the upcoming Lull in Resources phase. Without a marked change in strategy (but without being too sharp of a change), one will most likely die out because expanding and reproducing will not be able to be sustained very soon because food will soon be scarce. Instead, using a strategy wherein every organism initially spreads rapidly, then slowly undergoes various strategic changes to eventually end up having a well sustained society with sufficient stockpiles of food to feed one's soon-to-be-hungry population. Basically, without properly planning for the upcoming lack of food, one will surely suffer severely.

  3. Lull in Resources

          As commented on above, lack of preparation for this phase will result in rapid extinction. The driving factor for this lack of food is the overpopulation that occurred during the Initial Expansion phase. A player cannot actively accomplish much during this phase but instead must protect and harvest its food supply until the weaker organisms die off and the game reaches the Steady State phase (explained in #4). As explained in the two previous sections, strategies must be built around the impending occurrence of the Lull in Resources so that one's population can withstand its harsh conditions. If a player has been successful up until and including this point, it will most likely survive till the end of the alotted number of rounds. Rapid drops in numbers of living organisms occur, so this is clearly the most taxing on a player's organism population.

  4. Steady State

          If an organism population has reached this stage, the probability of survival till the end of the game is very high. Growing one's population is not necessary at this point because, if it has survived up until this point, it will most likely continue to succeed at survival. However, an intermediate step towards one's initial strategy of spreading out and searching for more food may be beneficial due to the now essentially unchanging total game population and resulting higher percentage of available game squares. With a high p, doing so is even more beneficial. Ultimately, if one has reached this point, they are at least comparably strong and agile versus its competitors and thus "good" organisms.


Motivation

Screenshot of our success against Black Plague.

      Our character was initially designed to exist independently. The goal was for the player to survive under the most circumstances possible within the single player game. Once we were satisfied with its performance alone, we introduced Black Plague, a high-performing group from the last year (2003). Our initial results were highly discouraging. Our organism exploded and swarmed well, but Black Plague would take over around turn 2000. This did not bode well, and the initial multi-player tests against the rest of the class had the organism "What are ya, Yella?" (v0.5) dying within 500 turns. The lesson quickly learned was to temper the frequency of movement as well as reproduction. Thus, "Mello Yellow" was born. The initial test results were positive, but the organism was still suffering from a form of "burn-out," where Black Plague had a higher energy to unit ratio than any of our organisms throughout the game. When the game approaches a steady state level, this proved disastrous as Black Plague could continue expanding beyond our steady state and eventually choke out our player. Through a series of fine-tuning tests, additional timers were introduced to work in conjunction with tolerances already in place, leading to our final player. This player performed two important actions. One, it was not the worst player in the multi-player tests. Two, it was defeating Black Plague in two-player games either to extinction or to a point where it could not even exceed a twenty-percent share of the map.


General Findings and Lessons Learned
General
          The general philosophy of our organism is along the lines of cycles. The cycle we followed was birth-adulthood-second childhood. This means that at birth an organism is a little more free-spirited and open to reproduction than an older organism would be. Once an organism had been established for a long time, the thresholds were once again lowered slightly to allow for replenishment of the population. This is important in keeping the total Energy/total Units mark high. This value at any given time determines how "healthy" a given population is. This implementation allows the organism to swarm a map in energy-rich environments, but be conservative enough to survive in harsh conditions.

Communication
          Communication was implemented in the most basic form possible. The highest 4 bits of the 8 bit "state" variable were mapped in a form that 1101xxxx (the last x were variable) was the identifier. Communication let us identify friendly neighbors, and served two main purposes. First, it allowed our organisms to spread out after reproduction, rather than clump together, increasing the visibility of the board and the likelihood of finding food. Second, the lower four bits provided an overview of the organism's current surroundings including energy level, food present, and enemies present, giving each organism an idea of its local board conditions. A history of received messages was kept and averaged each turn to produce a metric representing the recent local board conditions, which was used in part to drive reproduction.

Movement
          The goal was to move with a purpose. In order to allow the organism to conserve energy, a series of thresholds were implemented. Movement tolerance, the first threshold was defined as a percentage of energy left that would have to be met (or exceed) for the organism to move. Through play-testing, the initial threshold value that was observed to be preferable was 36% of energy left. This was a dynamic threshold as well. When the organism moved, the threshold value was increased by a defined amount ( .03 when reproducing, -.01 when sitting on food and eating, +.001 when moving towards a food square, +.013 when moving not onto a piece of food). To ensure organisms did not become stale (movement threshold too high), when an organism reached a percentage >= 100, the threshold would be lowered back to a reasonable amount (80% if the threshold was reached via reproduction or 90% if via moving).
          The next movement threshold was a timer. Our organism was designed to survive in a wide range of conditions. To this end, frequent movement was not beneficial for all values of p and q. To ensure our organism did not move too frequently, the organism has a move "timer" that is set at 5 turns after a move not towards food. This helps to ensure the organism does not move wildly about the board, wasting energy, even if it has high energy.

Reproduction
          The idea of reproduction is to make a new organism that is not wild or too conservative. Each new organism would have a "new organism" flag attached to it where it would move in a solid direction for up to 5 moves away from the parent. A simple algorithm of determining where the parent was and moving in the opposite direction helped to drive this. Also, all new "offspring" had a new player state that would allow them to by-pass certain thresholds. This resulted in a child that was eager to explore/eat, but not likely to kill itself. Examining the quantitative results of our reproduction algorithm revealed our player's ability to reproduce successfully nearly independent of q values.


Number of Organisms (y) vs. p Value (x): shows the unimportance of q with respect to population. This is a key benefit of our organism.


Weaknesses
          A major weakness of our organism was its lack of a end-game strategy versus other organisms. The organism would start out strong and perform competitively throughout the first 3000 turns of competition, but would eventually fall to groups such as "The Net" and "Greedy Couch Potatoes" within 500 turns after the 3000 mark. A possible cause for this steep decline is the less rigid strategy that our organism employed. The adjusting factors of move tolerance, reproduction tolerance and move timers were independent for each organism. This produced an organism that could survive on its own, but did not work as well in a team or against other groups. The other two groups had a more defined strategy. The Net employed a grid-like pattern to try to ensure that their organisms would always stay in a four-diamond format to maximize squares seen. Greedy Couch Potatoes used a simpler method of duplicating nearby organisms' states to trick competitors and moving in one direction only. In an end-game situation this would result in our organism moving with less purpose than the other organisms and eventually burning out. Additional work may have allowed for greater end-game strategies with regards to movement, but was not implemented for this project due to lack of time.


Comments on Tournament Results
      Our organisms produced solid and moderately healthy populations in all of the single player games in the tournament. This reflects the fact that our organism was originally designed to survive in a single player game under a variety of conditions. While the total energy was not always high for our organisms, compared to others with similar populations, our populations were always sizeable and stable.
      In multi-player games our populations usually died off when p was low. This is most likely due to the fact that p is more important than q to our players, since they consume any food they find, rather than waiting for it to grow. The only situations under which our Player1 survived were those with a low movement penalty v. The main difference between our Player1 and Player2 is that Player2 tempers its movement frequency, so with high v and many players on the board, Player1 would move too much and burn its energy before finding enough food to sustain itself. This also accounts for Player2 performing almost uniformly better than Player1. Under extremely harsh conditions (p <= 0.005, q <= 0.02), Player1 performed better (lived longer) than Player2, though both still became extinct. Player1's better performance is perhaps because Player1 is more prone to moving, and therefore increased its chances of finding food on a harsh board.
      Player2 survived in multi-player games, as long as p > 0.005. Again, since our players consumed all food found, we were at a disadvantage under harsh board conditions, as we never allowed the food to grow, nor did we have any food protection mechanisms. Player2 did particularly well under the default board conditions, regardless of board size. This makes sense, as most of our testing was done under the default conditions. Player2 fared better under the default conditions with a larger board size, most likely because this reduced the possibility of overpopulation starving the player.


Conclusion
      Our overall impression was that, despite our particular approach to solving the "Organisms" game problem, any well thought out set of strategies that follow our general guidelines as well as adding and improving to them will result in a successful player. This open-endedness made the project challenging yet extremely rewarding regardless of the fact that we did not win the tournament.





Acknowledgements
      We would like to acknowledge the contributions of the following groups and their organisms towards our work. Black Plague - This organism provided us with an enemy to initially try and defeat. Their strategy of age and waiting allowed us to come up with a counter strategy of initial expansion and then more waiting. The Net - Their idea of using communication between units to keep them from clustering up. This led to our deciding of movement for a unit based on friends present.