AlienWar
This game takes place in a very crowded planet where aliens are the superior race. Your task is to create your own alien and beat all other.
The Board
It is a 2 dimensional board.
The length of one side of the board is Math.ceil(sqrt(species * 100 * 2.5))
= ~40% of board used.
The board is a planet, so if you walk out of the map in the west, you come back in the east. If you walk out in the north, you will find yourself in the south.
Abilities
Each species on the planet has abilities. Here they are:
Name Benefit life HP = lifeLVL * 5 (reduces with every hit you take, 0 = dead), base HP = 10 strength Your hits do a random int in range [1 to strengthLVL] damage defense Randomly select int in range [0 to (50 / defenseLVL + 1)], if int == 0 then dodge next attack vision Gives you visionLVL/2 fields around you vision cleverness Blurs (increases) every ability randomly in range [0 to clevernessLVL/2] when sending to other aliens
The Game
- There will be 100 instances of each submission.
- After instancing, each alien can set 10 ability points in total. You can set different points for every instance.
- If you set more than 10 points, the instance dies.
- A game consists of 1000 rounds. Each round:
- Every alien has to return a move via
move(char[] fields)
. This includes Move.STAY. - If several aliens are on a field, 2 will be randomly selected:
- If both agree on peace (return false in
wantToFight
) they will stay where they are, else they will fight. - This loops until only one alien stays on a field or all agree on peace.
- If both agree on peace (return false in
- Every alien has to return a move via
If an alien kills something, he gets 1/5 of each of his enemies abilities. The winners HP will be refilled with 2*enemyLifeLVL.
Winner is the one with the most abilities (sum of abilities of living aliens).
Fights
Both aliens will hit each other "at the same time", this means if you kill the other alien, he still can hit you one time.
Dodging: Before you get hit, the game will calculate if you can dodge the attack by using rand.nextInt(50 / defenseLvl + 1) == 0
. defenseLvl will never be greater than 50 when calculating your dodge-skills (hence maximum dodge-chance is 50%).
Hitting: If you don't dodge the attack, you will get hit and your HP will be reduced by rand.nextInt(enemy.getStrengthLvl()) + 1
.
A fight ends when either one or both alien involved are dead. The winner, if one exists, gets the reward.
Gamerules
- Base level for every ability (without giving any ability points) is 1 (base HP is 10).
- The values sent when asked to fight are life (not HP!), strength, defense and vision-levels.
- Cleverness is NOT sent when asked to fight.
- All floating numbers will be ROUNDED to nearest integer when using/sending them, but stored and increased as float.
- Maximum dodge-chance is 50%. Otherwise fights may never terminate.
The Prey
There are 5 species which are already on the field. Since they are prey, they choose not to fight when asked to.
Whale: lvl 10 life Stays Cow: lvl 10 strength Random move Turtle: lvl 10 defense South west Eagle: lvl 10 vision Examines fields, tries to avoid danger Human: lvl 10 cleverness North east
They will be represented with their first letter (i.e. W
for whale) in the map (Aliens with A
, empty fields with a whitespace ' '
).
Additional Rules
- Reflection is disallowed.
- Interacting (instancing etc.) with other aliens is disallowed.
- Writing/Reading external resources like files or databases is also disallowed.
- Only Java (version 1.8) submissions allowed (Java is rather easy, and you don't have to be an expert for this game).
- All submissions must extend the alien-class and will be placed in the alien-package.
- I will accept the best alien on 19th of July. All aliens submitted by 12:00 UTC that day will be tested.
- Maximum 3 submissions per user since there are already very many aliens.
Example of an alien
package alien;
import planet.Move;
public class YourUniqueNameHere extends Alien {
public void setAbilityPoints(float[] abilities) {
abilities[0] = 2; //life
abilities[1] = 2; //strength
abilities[2] = 2; //defense
abilities[3] = 2; //vision
abilities[4] = 2; //cleverness
}
public Move move(char[][] fields) {
//you are in the middle of the fields, say fields[getVisionFieldsCount()][getVisionFieldsCount()]
return Move.STAY;
}
public boolean wantToFight(int[] enemyAbilities) {
//same order of array as in setAbilityPoints, but without cleverness
return true;
}
}
Control program
Source code for the control program can be found here. Now updated with all aliens included in the latest run.
Final scores (20.07.2014, average of 10 games)
alien.PredicatClaw 1635.4 alien.LazyBee 1618.8 alien.CartographerLongVisionAlien 1584.6 alien.ChooseYourBattles 1571.2 alien.Bender 1524.5 alien.HerjanAlien 1507.5 alien.FunkyBob 1473.1 alien.SecretWeapon2 1467.9 alien.PredicatEyes 1457.1 alien.CorporateAlien 1435.9 alien.GentleGiant 1422.4 alien.CropCircleAlien 1321.2 alien.VanPelt 1312.7 alien.NewGuy 1270.4 alien.BananaPeel 1162.6 alien.Rock 1159.2 alien.BullyAlien 1106.3 alien.Geoffrey 778.3 alien.SecretWeapon 754.9 alien.SecretWeapon3 752.9 alien.FunkyJack 550.3 alien.Stone 369.4 alien.Assassin 277.8 alien.Predicoward 170.1 prey.Cow 155.2 alien.Morphling 105.3 alien.Eli 99.6 alien.Warrior 69.7 alien.Hunter 56.3 alien.Manager 37.6 alien.OkinawaLife 14.2 prey.Whale 10.5 alien.Gamer 4.5 alien.Randomite 0 alien.Guard 0 prey.Eagle 0 alien.Rogue 0 alien.WeakestLink 0 alien.Fleer 0 alien.Survivor 0 alien.Sped 0 alien.Junkie 0 alien.Coward 0 alien.CleverAlien 0 prey.Human 0 alien.BlindBully 0 prey.Turtle 0 alien.AimlessWanderer 0