96
49
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
How do fights work? That should be extracted from the control program and included here. – Justin – 2014-07-01T17:33:26.793
3@Quincunx added a fight section – CommonGuy – 2014-07-01T18:05:58.277
What about other JVM languages? – Not that Charles – 2014-07-01T18:48:16.800
2@Charles Please no. I don't want to spend my weekend downloading several compilers... Like I said, java isn't that complicated, maybe you can learn some things when try it ;) – CommonGuy – 2014-07-01T18:52:40.090
1To be fair, I don't know jack about Java but I still understood enough to create a bot. – Kyle Kanos – 2014-07-01T19:19:44.553
1@Manu Fair. I know Java. I wanted to learn something :) Anyway, Java's fine. What version? – Not that Charles – 2014-07-01T19:23:20.027
@Charles Please use 1.7 or maybe 1.8 if you want – CommonGuy – 2014-07-01T19:25:01.990
@Manu even if we provide the binary
.class
files ourselves? (Meaning you don't have to compile them.) – AJMansfield – 2014-07-01T20:48:36.507@AJMansfield, you can always write in another language and decompile. – Peter Taylor – 2014-07-01T20:55:10.553
2Are you sure you don't want to upgrade to Java 8? Java 8 has all sorts of fun things you can do. Join the fun! – Justin – 2014-07-01T23:08:56.660
@Quincunx Ok, I join the fun side! – CommonGuy – 2014-07-02T05:01:06.833
1
^^ Come to the Fun side. We have cookies
– Justin – 2014-07-02T06:15:38.83014Three downvotes, what on earth? And I don't see a single negative comment. Are people that passive aggressively annoyed that this is limited to Java? – Martin Ender – 2014-07-02T09:11:56.013
2Just build your own damn compiler from C or whatever to Java if you have a problem with the language choice. – Pierre Arlaud – 2014-07-02T09:40:03.327
You know, I'm conflicted. I see an error with someone's code, and it's pretty funny. Should I point it out to them if this is a competition? – user3334871 – 2014-07-02T12:24:45.287
@user3334871 Yes, just add a comment to their answer :) – CommonGuy – 2014-07-02T12:27:48.220
@Manu alright, but I won't just come out and say the error, but I'll hint at it :) – user3334871 – 2014-07-02T12:32:11.937
6@m.buettner My downvote is for the limitation to the godawfulness that is Java (though if it was limited to the nicest language ever created I'd still downvote it for limiting it to 1 language). I didn't see the point in adding a comment since it was obvious what the downvotes would be for. – Gareth – 2014-07-02T14:41:13.113
1Well, I don't care... What are 3 downvotes against 30 upvotes? :) – CommonGuy – 2014-07-02T14:47:18.233
Just a question, the winner will be decided in a single run? Or how many will be? – BrunoJ – 2014-07-02T14:47:45.600
1@BrunoJ 5 or more runs, then the average of each run. – CommonGuy – 2014-07-02T15:45:11.720
Here's one reason to use Java 8: I changed your
removeDeadSpecies
method to one line:speciesList.removeIf((alien) -> alien.isDead());
– Justin – 2014-07-02T17:34:22.3571@Gareth I think I'll release a KoTH that restricts to C++, then make something to allow other languages (within a list of languages). There are so many KoTH that are restricted to only Java. – Justin – 2014-07-02T17:35:48.853
1@Quincunx Or just use a member reference:
speciesList.removeIf(Alien::isDead);
– Ypnypn – 2014-07-02T20:47:30.223@Ypnypn Except you'd need to do
speciesList.removeIf(Species::isDead);
. I just named italien
because saying that the species is dead makes it look like extinction. – Justin – 2014-07-03T05:16:54.950You know, after testing out my alien with a couple of configurations, some of the abilities are almost downright pointless. The warrior alien, who would be the most generic, has been doing the best in all of my trial runs. At first, my alien had a broad spread of it's abilities set out, but it does better when I just give it a dump stat, and remove things like dodge and cleverness. Maybe a little re-balance of the various abilities is in order? – user3334871 – 2014-07-03T07:01:23.417
How does the cleverness work? So in each turn it blurs all aliens within its vision permanently? – justhalf – 2014-07-03T09:03:08.927
@justhalf it blurs the abilities before fighting (when calling
wantToFight(int[] enemyAbilities)
). – CommonGuy – 2014-07-03T09:04:20.607Oh, so it's increasing its own abilities for each fight, roger that. – justhalf – 2014-07-03T09:07:15.307
Also how does the base point of 1 work? If I set
vision=1
will I have a total vision of 2? – justhalf – 2014-07-03T09:07:58.610@justhalf Not increasing (the abilites of the alien don't change), it is just to confuse the enemy species. Yes, and setting vision to 0 would result in a total of 1 vision. – CommonGuy – 2014-07-03T09:09:30.687
I see, so cleverness is to deceive other aliens, roger that. – justhalf – 2014-07-03T09:12:13.247
6Hmmm, am having mixed feelings here – Mr. Alien – 2014-07-03T09:15:33.573
5@user3334871 I don't think changing any of the rules after 17 answers are in (and potentially a dozen more people working on submissions) is a good idea. Since only the fewest of us here (if any) are professional game designers, pretty much any self-made KotH may have some balancing issues - but if exploring the space of possible strategies is still fun (which apparently it is, judging by answers, upvotes and stars), I don't think it's much of a problem. – Martin Ender – 2014-07-03T09:17:25.477
Is there a leaderboard of the current submissions? – Fractional – 2014-07-03T10:06:47.997
1@RedSirius Soon. – CommonGuy – 2014-07-03T10:11:51.773
What does "Reflection is disallowed" exactly mean?. Sorry my main language is not english :) – Gigala – 2014-07-03T11:01:58.573
@Gigala Don't use the java reflection API (google "java reflection" ;) – CommonGuy – 2014-07-03T11:12:34.903
1
@Manu http://xkcd.com/541/
– Martin Ender – 2014-07-03T11:19:30.257@m.buettner I changed it more than 3 times but this one looks better :D – CommonGuy – 2014-07-03T11:22:45.043
@Manu Alright thanks, im new to Java but will still try to get something together for this contest :P – Gigala – 2014-07-03T12:55:50.257
I think you might want to change damage a bit: Not investing in strength is basically the same as investing 1 point. Perhaps strengthlvl+1 as maximum damage? – Andreas – 2014-07-03T13:39:56.360
@Gareth The control program is written in a certain language so of course only 1 language can be allowed. What's wrong with Java? It's my favorite language and I use it for everything. – stommestack – 2014-07-03T14:31:15.870
@JopVernooij the fact that the controller is in java doesn't imply the contest has to be limited to java. See this contest for instance, this one or even this one.
– plannapus – 2014-07-03T14:38:36.143@m.buettner I'm not saying to modify the rules or anything, just maybe change the way some stats are calculated. As it stands right now, the biggest combat priorities are life and strength. Suppose I have my stats as 3 life and 7 strength. If I put 2 points from strength into defense, I am sacrificing 30% combat strength for 6% chance to dodge. I'm just saying, while limiting dodge to 50% still, maybe increase the % increase for each point? As of right now, the juggernauts are dominating just through strength alone :) – user3334871 – 2014-07-03T14:49:39.463
3@user3334871 I'm not sure how this is not "modifying the rules". I don't even disagree that balancing might be off, and that there may be a dominant strategy. But I don't think any of that warrants any change to the spec as long as the challenge is not completely broken such that it can't be carried out as intended. – Martin Ender – 2014-07-03T14:56:08.990
4First scoreboard is available! – CommonGuy – 2014-07-03T16:54:34.047
Awww, none of mine have lasted.....that's a shame :( – Kyle Kanos – 2014-07-03T18:31:28.757
And now looking at the win condition being
max(sum(abilities))
, it makes total sense that those aliens that favorSTR
andLIFE
will win. – Kyle Kanos – 2014-07-03T18:34:12.437@KyleKanos If you write an alien that successfully dodge other aliens (with enough vision), most of your aliens will survive without fighting ;) – CommonGuy – 2014-07-03T20:30:03.013
@Manu: I doubt that is the case, but could you swap
alien.Coward
's vision & defense (so that vision is 7 and defense is 2) to see if that improves it's chances? – Kyle Kanos – 2014-07-03T20:59:11.5471can someone explain what the additional rule: "Interacting (instancing etc.) with other aliens is disallowed." means? i.e. does it forbid sharing state information amongst aliens of the same species or creating "instances" of other aliens as a brain trust? – Moogie – 2014-07-03T22:12:02.240
@Manu with that strategy, even if you could perfectly avoid all fights, the best score you could hope for is 1000 (100 instances * starting stats). Unfortunately the score board already has a higher score than that. – rdans – 2014-07-03T22:55:20.860
1@Moogie Sharing state within the same alien is allowed, but with other aliens it is disallowed. – CommonGuy – 2014-07-04T05:26:48.200
@Ryan No, sum of all abilities at the start is 1500, which is higher than the current max score in the scoreboard. – CommonGuy – 2014-07-04T05:27:36.963
@Manu Aww man, so i will have my Aliens kill off each other, thought about that they might tell each other their species but yeah that's not allowed... – Gigala – 2014-07-04T07:54:31.867
@Gigala They can talk to each other (for example all of the Manager-aliens can talk to each other), but the manager alien can not talk to the junkie-alien. – CommonGuy – 2014-07-04T08:11:18.890
On the top of my head, I have no idea how to code this, but it would be awesome if you could have all your aliens beat each other up and end up with one humongous alien. :o – Zaenille – 2014-07-04T10:49:47.483
@MarkGabriel I think they would take too much damage in the process... – Gigala – 2014-07-04T13:04:00.967
Hmm. You may be right. But the idea is still unique and awesome. Hahahaha. But it's definitely not a winning alien. – Zaenille – 2014-07-04T13:56:29.630
It's harder to come up with ideas now. – Spedwards – 2014-07-04T13:56:42.693
I think you should clarify the rules to mention that the North/South direction also wraps like the East/West. I got really excited about making a
– Michael - Where's Clay Shirky – 2014-07-04T14:38:31.203Bender
alien who goes to the North Pole and travels west to "kill all humans," but no cigar.@Michael I think it is already pretty clear. – CommonGuy – 2014-07-04T14:50:47.387
@Manu To give my Randomite alien a far chance, I'd appreciate it if to get the average you'd increase the amount of runs. In fairness this could also decrease my chances. – Spedwards – 2014-07-04T15:16:12.060
@Spedwards In the final run, there will be more runs. But for test-scoreboards, 5 runs should be enough. – CommonGuy – 2014-07-04T15:44:51.087
5
@Manu For the mathematically inclined the description of how the board wraps is somewhat misleading. You're saying it's a planet and it wraps east/west. There is nothing that really indicates that it does wrap north/south, too. In fact, if it does, it's technically not a sphere any more, but a torus: http://kotaku.com/classic-jrpg-worlds-are-actually-donuts-1239882216. You can also see that by noticing that when you walk "off" the top of a world map (the north pole), you don't appear at the bottom (the south pole). Hence, Michael's suggestion is definitely valid, I think.
– Martin Ender – 2014-07-04T16:52:08.807@m.buettner oh, my fault. – CommonGuy – 2014-07-04T17:19:29.943
5SUGGESTION :
Everyone loves winning! But there will only be 1 winning species. How about we set some side-quests/side-prizes of some sorts?
Of course the main objective would be to be the dominant species, but maybe we could add some recognition for the others who didn't but succeeded in one specific area. Example :
@MarkGabriel sounds like a good idea... if you are keen you may want to fork the game code and suggest a merge back to Manu – Moogie – 2014-07-05T09:10:28.557
@Moogie I might have time this coming week but I'll wait if Manu approves. :D – Zaenille – 2014-07-05T09:23:30.297
@Manu, are you checking previous submissions that have recent edits? You might not be editing them in your source code. A lot of entries have edits/improvements in them. :D – Zaenille – 2014-07-10T03:38:57.557
@MarkGabriel No, I took the old versions. For the final run I will update every submission. It's hard to see which submissions are updated... – CommonGuy – 2014-07-10T05:27:33.920
I understand. It is hard and would take too much of your time to check each one. Haha. – Zaenille – 2014-07-10T05:32:40.877
@MarkGabriel yes, because they are just test runs. And regarding your suggestion: I won't do it, because in all KOTH-challenges there is only one winner. But maybe I will start a new challenge in the near future... – CommonGuy – 2014-07-10T06:01:29.647
prey.Cow for the win! :D – Timtech – 2014-07-11T19:28:33.350
@Timtech a charging cow is indeed a scary beast! – Moogie – 2014-07-12T00:03:49.843
@Moogie I agree. – Timtech – 2014-07-12T23:37:58.383
When would the results be posted? :D – Zaenille – 2014-07-20T03:31:21.847
1Results are posted! – CommonGuy – 2014-07-20T10:56:32.563
Woooooo! Didn't expect PredicatClaw to win. Cartographer's algorithm is pretty intense and I was hoping to get 3rd place or so. Awesome! – Zaenille – 2014-07-20T11:44:04.880
@MarkGabriel Welldone :) The Cartographer alien is probably too risk adverse which means that it is highly dependant on the first couple of rounds. If it manages to survive the melee with good number of aliens then it is likely to win, otherwise it will never pick enough fights to build back what it lost. Your PredicatClaw is very consistent. Again, Welldone – Moogie – 2014-07-20T21:46:28.020