CS4444: Programming & Problem Solving, Fall 2004
[Project 1: Organisms II Revisited]
Game Design, Interfaces, Player Guide & Class Notes




The Life of an Amoeba
while(1) {
	fork();
}	



Group Assignments
The following is the group assignment for this project:
1RMSOVPJ-REDnew Color(1.0f,0.0f,0.0f)
2JRCMAM-GREENnew Color(0.0f,1.0f,0.0f)
3AVKHKMAM-BLUEnew Color(0.0f,0.0f,1.0f)
4EGPOAR-YELLOWnew Color(1.0f,1.0f,0.0f)
5RGBCMIM-CYANnew Color(0.5f,1.0f,1.0f)
6AGBBJC-PURPLEnew Color(1.0f,0.5f,1.0f)
7LWZZVB-ORANGEnew Color(1.0f,0.8f,0.3f)
8BPSUVPVMSSPINKnew Color(1.0f,0.67f,0.67f)
9JCRDJRTADORCHIDnew Color(0.855f, 0.438f, 0.855f)


Project Reports



Tournament Results

Game Design

Exposed Game Engine Methods
The following methods are exposed by the game engine and are available to the player:

public int s() throws Exception;

public int v() throws Exception;

public int u() throws Exception;

public int M() throws Exception;

public int K() throws Exception;

Method Description
s() Energy consumed for staying put.
v() Energy consumed for moving or reproducing.
u() Energy per unit of food.
M() Maximum energy per organism
K() Maximum food units per cell

Player Interface
Players are required to implement the following interface:

public interface IFCPlayer extends IFCConstants, Serializable {

public void register(Organisms2 __fortytwo) throws Exception;
public String name() throws Exception;
public Color color() throws Exception;
public boolean interactive() throws Exception;
public Move move(boolean[] foodpresent, int[] enemypresent, int foodleft, int energyleft) throws Exception;
public int externalState() throws Exception;
}
Method Description
register(Organisms2 __fortytwo) Gives the Player a chance to get Game configuration parameters by calling the exposed methods of the Organisms2 object __fortytwo.
name() Returns the name of the Player.
color() Color of Player's organisms.
interactive() HumanPlayer returns true, everyone else returns false.
move(boolean[] foodpresent, int[] enemypresent, int foodleft, int energyleft)
  • There are 5 directions to move in. 0) _CSTAYPUT 1) _CWEST 2) _CEAST 3) _CNORTH 4) _CSOUTH.
  • foodpresent is an array of length 5 to specify whether there is any food present in the 5 directions as specified above. foodpresent[i] is true if there is food present in the neighbouring cell in direction i.
  • enemypresent is an array of length 5 to specify whether there is any other organism present in the 5 directions as specified above. If an organism is present in direction i, enemypresent[i] has a value equal to the external state of that organism. A value of -1 signifies that the cell is empty.
  • foodleft is the food available on the cell on which the organism currently resides.
  • energyleft is the energy currently possesed by the player's organism.
  • A Move object can be instantiated as:
    • new Move(direction)
    • new Move(_CREPRODUCE, direction, key).
    For case 1) the direction will be one of _CSTAYPUT, _CWEST, _CEAST, _CNORTH, _CSOUTH. For case 2) direction should be one of _CWEST, _CEAST, _CNORTH, _CSOUTH and signifies where the offspring is to be placed. key is the secret key passed from parent to child. This would be -1 for the first organism created on the board.
  • See DumbPlayer for an example of how to specify your moves.
  • All Invalid moves result in a Stay Put outcome.
externalState() This method is called in every round just before move(). So organisms can change their external state every round.


Software
The full software source tree and class files are available from:

http://www.cs.columbia.edu/~kamra/CS4444/Project1/Software

In addition, a targzipped version of the directory is also available in that directory. You can access the targzipped file directly at:

http://www.cs.columbia.edu/~kamra/CS4444/Project1/Software/software.tar.gz



Class Notes
13th September, 2004

15th September, 2004

20th September, 2004

22nd September, 2004

27th September, 2004


kamra-at-cs.columbia.edu