51
14
The contest is now over. Coward is the winner. You can watch the last match here.
Suddenly zombies appear! OH NOES!
In this king-of-the-hill challenge, you must create a bot to survive the zombie apocalypse. Or at least, hold out for as long as possible.
At the start of the game, 50 instances of each entry will be placed randomly in a large toroidal play area - that is, it appears to be square, but wraps around. The size of the play area will vary depending on the number of entries, but initially 6% of squares will be occupied. Each competitor starts with 3 bullets.
At the beginning of each turn, a zombie will rise from the ground at a random location, destroying whatever was above it. Any player who is next to a zombie at the start of their turn will become a zombie.
For each living player, their code will then be called. It will receive a PlayerContext object, containing information on their current status, and their surroundings. Each player can see for 8 squares in any direction.
The player must choose to either move (staying still is a valid movement), by returning a Move
, or shoot a nearby person or zombie, by returning a Shoot
. Your gun has a maximum range of 5 squares. Since you are within your gun's range you can shoot yourself, provided you have bullets left. If two players shoot each other, they both die.
If two players attempt to move onto the same square, they will fail, and will both return to the square they started from. If there are still conflicts, this will be repeated until there are no conflicts, which may mean everyone is back where they started.
If a player dies from a gunshot, their dead body will remain, and forms a permanent barrier. Any bullets they were carrying remain on their person, and can be scavenged by players in adjacent squares. If there are multiple players occupying the squares adjacent to a dead body, then the bullets will be shared between them, but any remainder will be lost.
If a player becomes a zombie, then their bullets are lost. Zombies will mindlessly walk towards the nearest living player.
Entries are scored on how long their longest-surviving player survives.
Entries
A control program is available at https://github.com/jamespic/zombies. Simply clone it, and run mvn compile exec:java
.
To be eligible, entries must be written in a JVM language, must be portable, and must be possible to build from Maven with no special set-up. This is to ensure that competitors do not need to install multiple run-time environments to test their bots against competitors.
Sample entries are currently available in the following languages:
- Java 7 - see also a more complex example, and the code for zombies
- Scala 2.11.1
- Javascript (via Rhino)
- Python (via Jython 2.7 beta 2)
- Ruby (via JRuby 1.7.13)
- Clojure 1.5.1
- Frege (a bit like Haskell - here's another example)
If you would like to compete in a language that is not listed, you can post a comment requesting it, and I will investigate the possibility of integrating your chosen language into the control program. Or, if you are impatient, you can submit a pull request to the control program.
Only one instance (in the Java sense of the word) will be created for each entry. This Java instance will be called multiple times per turn - once for each surviving player.
API
package zombie
// You implement this. Your entry should be in package `player`
interface Player {
Action doTurn(PlayerContext context)
}
// These already exist
class PlayerContext {
// A square array, showing the area around you, with you at the centre
// playFields is indexed by x from West to East, then y from North to South
PlayerId[][] getPlayField()
int getBullets() // Current bullets available
int getGameClock() // Current turn number
PlayerId getId() // Id of the current player instance
int getX() // Your current x co-ordinate
int getY() // Your current y co-ordinate
int getBoardSize() // The size of the current playing field
Set<PlayerId> shootablePlayers() // A helper function that identifies players in range.
}
class PlayerId {
String getName() // The name of the entrant that owns this player
int getNumber() // A unique number, assigned to this player
}
// Don't implement this. Use either `Move` or `Shoot`
interface Action {}
enum Move implements Action {
NORTHWEST, NORTH, NORTHEAST,
EAST, STAY, WEST,
SOUTHEAST, SOUTH, SOUTHWEST;
static move randomMove();
}
class Shoot implements Action {
Shoot(PlayerId target);
}
Additional Rules
Each entry must have a unique name, in order to work correctly with the control program.
Entries should not attempt to tamper with other entrants, or with the control program, or otherwise take advantage of the run-time environment to "break the fourth wall", and gain an advantage that would not be available in a "real" zombie apocalypse.
Communication between players is allowed.
The winner is the entrant whose bot has the highest score in a test I will run on the 3rd of August 2014.
Final Results
The final results are in! Coward is the winner!
On 2nd August, I ran 19 rounds of the control program, and ranked each player according to their median score. The results were as follows:
Coward: 4298
Fox: 3214
Shotguneer: 2471
Cocoon: 1834
JohnNash: 1240
HuddleWolf: 1112
Sokie: 1090
SOS: 859
GordonFreeman: 657
Jack: 657
Waller: 366
SuperCoward: 269
MoveRandomly: 259
StandStill: 230
Vortigaunt: 226
ThePriest: 223
Bee: 61
HideyTwitchy: 52
ZombieHater: 31
Gunner: 20
ZombieRightsActivist: 16
SunTzu: 11
EmoWolfWithAGun: 0
The last round is available to watch here.
Run-by-run results
The individual results of each of the 19 runs were:
#Run at 03-Aug-2014 14:45:35#
Bee: 21
Cocoon: 899
Coward: 4608
EmoWolfWithAGun: 0
Fox: 3993
GordonFreeman: 582
Gunner: 18
HideyTwitchy: 37
HuddleWolf: 2836
Jack: 839
JohnNash: 956
MoveRandomly: 310
SOS: 842
Shotguneer: 2943
Sokie: 937
StandStill: 250
SunTzu: 3
SuperCoward: 318
ThePriest: 224
Vortigaunt: 226
Waller: 258
ZombieHater: 41
ZombieRightsActivist: 10
#Run at 03-Aug-2014 14:56:48#
Bee: 97
Cocoon: 3073
Coward: 5699
EmoWolfWithAGun: 0
Fox: 4305
GordonFreeman: 1252
Gunner: 24
HideyTwitchy: 25
HuddleWolf: 3192
Jack: 83
JohnNash: 1195
MoveRandomly: 219
SOS: 884
Shotguneer: 3751
Sokie: 1234
StandStill: 194
SunTzu: 69
SuperCoward: 277
ThePriest: 884
Vortigaunt: 564
Waller: 1281
ZombieHater: 10
ZombieRightsActivist: 2
#Run at 03-Aug-2014 15:01:37#
Bee: 39
Cocoon: 2512
Coward: 2526
EmoWolfWithAGun: 0
Fox: 2687
GordonFreeman: 852
Gunner: 21
HideyTwitchy: 91
HuddleWolf: 1112
Jack: 1657
JohnNash: 944
MoveRandomly: 312
SOS: 660
Shotguneer: 1067
Sokie: 1356
StandStill: 169
SunTzu: 8
SuperCoward: 351
ThePriest: 223
Vortigaunt: 341
Waller: 166
ZombieHater: 25
ZombieRightsActivist: 47
#Run at 03-Aug-2014 15:08:27#
Bee: 27
Cocoon: 2026
Coward: 3278
EmoWolfWithAGun: 0
Fox: 2677
GordonFreeman: 611
Gunner: 16
HideyTwitchy: 11
HuddleWolf: 1694
Jack: 600
JohnNash: 1194
MoveRandomly: 48
SOS: 751
Shotguneer: 5907
Sokie: 1233
StandStill: 62
SunTzu: 9
SuperCoward: 252
ThePriest: 173
Vortigaunt: 107
Waller: 276
ZombieHater: 53
ZombieRightsActivist: 38
#Run at 03-Aug-2014 15:14:01#
Bee: 26
Cocoon: 1371
Coward: 5121
EmoWolfWithAGun: 0
Fox: 3878
GordonFreeman: 464
Gunner: 29
HideyTwitchy: 130
HuddleWolf: 955
Jack: 101
JohnNash: 698
MoveRandomly: 269
SOS: 1314
Shotguneer: 2444
Sokie: 3217
StandStill: 233
SunTzu: 10
SuperCoward: 269
ThePriest: 318
Vortigaunt: 266
Waller: 494
ZombieHater: 49
ZombieRightsActivist: 9
#Run at 03-Aug-2014 15:19:43#
Bee: 25
Cocoon: 2098
Coward: 4855
EmoWolfWithAGun: 0
Fox: 4081
GordonFreeman: 227
Gunner: 43
HideyTwitchy: 28
HuddleWolf: 2149
Jack: 1887
JohnNash: 1457
MoveRandomly: 117
SOS: 1068
Shotguneer: 4272
Sokie: 636
StandStill: 53
SunTzu: 9
SuperCoward: 209
ThePriest: 220
Vortigaunt: 227
Waller: 366
ZombieHater: 19
ZombieRightsActivist: 49
#Run at 03-Aug-2014 15:24:03#
Bee: 46
Cocoon: 682
Coward: 3588
EmoWolfWithAGun: 0
Fox: 4169
GordonFreeman: 764
Gunner: 13
HideyTwitchy: 21
HuddleWolf: 842
Jack: 1720
JohnNash: 1260
MoveRandomly: 259
SOS: 636
Shotguneer: 777
Sokie: 586
StandStill: 75
SunTzu: 6
SuperCoward: 390
ThePriest: 189
Vortigaunt: 208
Waller: 334
ZombieHater: 61
ZombieRightsActivist: 20
#Run at 03-Aug-2014 15:29:49#
Bee: 90
Cocoon: 516
Coward: 4298
EmoWolfWithAGun: 0
Fox: 1076
GordonFreeman: 581
Gunner: 8
HideyTwitchy: 87
HuddleWolf: 4298
Jack: 4715
JohnNash: 727
MoveRandomly: 102
SOS: 859
Shotguneer: 2471
Sokie: 2471
StandStill: 427
SunTzu: 24
SuperCoward: 159
ThePriest: 359
Vortigaunt: 94
Waller: 398
ZombieHater: 54
ZombieRightsActivist: 21
#Run at 03-Aug-2014 15:36:50#
Bee: 18
Cocoon: 3127
Coward: 3124
EmoWolfWithAGun: 0
Fox: 5094
GordonFreeman: 255
Gunner: 43
HideyTwitchy: 17
HuddleWolf: 1078
Jack: 272
JohnNash: 1270
MoveRandomly: 55
SOS: 723
Shotguneer: 3126
Sokie: 1388
StandStill: 179
SunTzu: 7
SuperCoward: 45
ThePriest: 519
Vortigaunt: 172
Waller: 200
ZombieHater: 45
ZombieRightsActivist: 8
#Run at 03-Aug-2014 15:40:59#
Bee: 78
Cocoon: 1834
Coward: 4521
EmoWolfWithAGun: 0
Fox: 1852
GordonFreeman: 657
Gunner: 7
HideyTwitchy: 2
HuddleWolf: 969
Jack: 895
JohnNash: 1596
MoveRandomly: 277
SOS: 694
Shotguneer: 1397
Sokie: 844
StandStill: 325
SunTzu: 7
SuperCoward: 192
ThePriest: 148
Vortigaunt: 369
Waller: 232
ZombieHater: 16
ZombieRightsActivist: 17
#Run at 03-Aug-2014 15:44:22#
Bee: 23
Cocoon: 2638
Coward: 2269
EmoWolfWithAGun: 0
Fox: 2067
GordonFreeman: 730
Gunner: 21
HideyTwitchy: 60
HuddleWolf: 763
Jack: 1469
JohnNash: 1494
MoveRandomly: 273
SOS: 3181
Shotguneer: 3181
Sokie: 653
StandStill: 450
SunTzu: 19
SuperCoward: 272
ThePriest: 215
Vortigaunt: 299
Waller: 510
ZombieHater: 62
ZombieRightsActivist: 16
#Run at 03-Aug-2014 15:48:03#
Bee: 97
Cocoon: 2009
Coward: 2798
EmoWolfWithAGun: 0
Fox: 1907
GordonFreeman: 958
Gunner: 22
HideyTwitchy: 93
HuddleWolf: 925
Jack: 288
JohnNash: 476
MoveRandomly: 422
SOS: 3723
Shotguneer: 2076
Sokie: 1090
StandStill: 134
SunTzu: 92
SuperCoward: 141
ThePriest: 470
Vortigaunt: 216
Waller: 340
ZombieHater: 32
ZombieRightsActivist: 20
#Run at 03-Aug-2014 16:03:38#
Bee: 121
Cocoon: 501
Coward: 9704
EmoWolfWithAGun: 0
Fox: 3592
GordonFreeman: 588
Gunner: 20
HideyTwitchy: 54
HuddleWolf: 749
Jack: 1245
JohnNash: 1345
MoveRandomly: 451
SOS: 835
Shotguneer: 1548
Sokie: 589
StandStill: 166
SunTzu: 11
SuperCoward: 158
ThePriest: 93
Vortigaunt: 246
Waller: 1350
ZombieHater: 18
ZombieRightsActivist: 11
#Run at 03-Aug-2014 16:10:24#
Bee: 66
Cocoon: 1809
Coward: 3295
EmoWolfWithAGun: 0
Fox: 3214
GordonFreeman: 1182
Gunner: 15
HideyTwitchy: 52
HuddleWolf: 1514
Jack: 101
JohnNash: 745
MoveRandomly: 211
SOS: 862
Shotguneer: 6335
Sokie: 1504
StandStill: 384
SunTzu: 14
SuperCoward: 259
ThePriest: 244
Vortigaunt: 262
Waller: 1356
ZombieHater: 24
ZombieRightsActivist: 20
#Run at 03-Aug-2014 16:28:05#
Bee: 61
Cocoon: 692
Coward: 11141
EmoWolfWithAGun: 0
Fox: 1955
GordonFreeman: 1234
Gunner: 42
HideyTwitchy: 24
HuddleWolf: 1862
Jack: 609
JohnNash: 1579
MoveRandomly: 167
SOS: 958
Shotguneer: 11141
Sokie: 284
StandStill: 422
SunTzu: 66
SuperCoward: 121
ThePriest: 207
Vortigaunt: 128
Waller: 259
ZombieHater: 22
ZombieRightsActivist: 7
#Run at 03-Aug-2014 16:32:10#
Bee: 207
Cocoon: 4414
Coward: 2670
EmoWolfWithAGun: 0
Fox: 978
GordonFreeman: 620
Gunner: 19
HideyTwitchy: 135
HuddleWolf: 962
Jack: 657
JohnNash: 1200
MoveRandomly: 147
SOS: 687
Shotguneer: 2258
Sokie: 2433
StandStill: 249
SunTzu: 49
SuperCoward: 1056
ThePriest: 602
Vortigaunt: 326
Waller: 593
ZombieHater: 31
ZombieRightsActivist: 10
#Run at 03-Aug-2014 16:38:56#
Bee: 265
Cocoon: 2231
Coward: 4228
EmoWolfWithAGun: 0
Fox: 4737
GordonFreeman: 532
Gunner: 9
HideyTwitchy: 75
HuddleWolf: 2375
Jack: 1237
JohnNash: 1249
MoveRandomly: 109
SOS: 860
Shotguneer: 6470
Sokie: 1096
StandStill: 126
SunTzu: 15
SuperCoward: 393
ThePriest: 133
Vortigaunt: 184
Waller: 257
ZombieHater: 32
ZombieRightsActivist: 12
#Run at 03-Aug-2014 16:52:16#
Bee: 67
Cocoon: 1534
Coward: 9324
EmoWolfWithAGun: 0
Fox: 2458
GordonFreeman: 1019
Gunner: 24
HideyTwitchy: 72
HuddleWolf: 601
Jack: 399
JohnNash: 1366
MoveRandomly: 275
SOS: 506
Shotguneer: 1007
Sokie: 475
StandStill: 230
SunTzu: 135
SuperCoward: 361
ThePriest: 61
Vortigaunt: 112
Waller: 4106
ZombieHater: 12
ZombieRightsActivist: 22
#Run at 03-Aug-2014 17:03:04#
Bee: 26
Cocoon: 1159
Coward: 7796
EmoWolfWithAGun: 0
Fox: 3948
GordonFreeman: 878
Gunner: 3
HideyTwitchy: 17
HuddleWolf: 1490
Jack: 513
JohnNash: 1240
MoveRandomly: 487
SOS: 1460
Shotguneer: 1481
Sokie: 832
StandStill: 457
SunTzu: 8
SuperCoward: 480
ThePriest: 527
Vortigaunt: 171
Waller: 3729
ZombieHater: 30
ZombieRightsActivist: 10
As far as scavenging bullets goes: if you just move next to the body, you automatically do it (as opposed to needing to do it as an action), correct? – Foon – 2014-07-21T21:08:34.763
@Foon That is correct. You don't need to do anything special. You'll have them automatically on the next turn. – James_pic – 2014-07-21T21:17:06.813
I can't clone the repo or find the frege adapter package online. Could someone direct me? – Pureferret – 2014-07-25T10:25:18.850
1
@Pureferret The frege code consist of a Frege file containing bindings at https://github.com/jamespic/zombies/blob/master/src/main/frege-bindings/zombie.fr, and a Java helper class that calls into Frege at https://github.com/jamespic/zombies/blob/master/src/main/java/zombie/FregeAdapter.java. If you can clone the repo (or download it as a zip from https://github.com/jamespic/zombies/archive/master.zip) then Maven will handle the build for you.
– James_pic – 2014-07-25T11:16:17.983@Pureferret If you're implementing an entry in Frege, then you'll need to create a module within the package
player
containing adoTurn
function, that takes aPlayerContext
and returns either anAction
, anIO Action
, or aContinue
(Continue
is a type defined in the frege bindings, that contains a result and a continuation). – James_pic – 2014-07-25T11:26:40.907@James_pic I dont care if I get much rep on this site (i'm re-learning java so am trying to get practice). I finished signing up though so I can put a bounty on this to get it more attention for the Aug 3 results. Any objections? – kaine – 2014-07-25T18:30:23.103
@kaine I don't mind if you want to start a bounty (I was going to start one myself), but bear in mind that bounties can only run for 7 days, so if the bounty is for the winner, then there's no sense in starting it before the 27th. I've also been considering a bounty for the best entry in a language other than Java, but a plain bounty for the winner also makes sense. – James_pic – 2014-07-25T18:35:15.990
@James_pic I agree, I'll post one on Monday for the max rep I can. IF I win (likely by posting one other than Shotguneer) I will give it to 2nd place (don't think I can give bounty to myself and no point not awarding it). – kaine – 2014-07-25T18:38:17.787
When you say "Communication between players is allowed" does that mean I can add my own public methods to my player class that I can access? i.e.
PlayerId player; player.dontMove()
– Moop – 2014-07-25T21:12:04.470@Moop You can add whatever you like to your player class (I.e, your implementation of
Player
), but you can't modify classes that are part of the runtime environment – James_pic – 2014-07-25T21:16:42.783Is there a way to tell if the player got killed, and if so how? – Moop – 2014-07-25T21:21:25.937
@Moop not directly, but since
PlayerContext
includes the turn number, you could keep track of when you last heard from each player, and if you haven't heard from them in a couple of turns, they must have been killed or turned. – James_pic – 2014-07-25T22:13:12.197@James I've not got maven to work in the past so I'm just manually trying to set up the project. I'll add those too the build party next. By "Can't modify classes that are part of the run time environment" I guess that means no reflection? – Pureferret – 2014-07-25T23:47:01.497
1@Pureferret Trying to set up the project manually will be painful. No-one's really used them yet, but there are compilers and interpreters for half a dozen languages. Reflection's allowed (indeed, some of the dynamic languages can't work without it), so long as it's not used to tamper with the game or your competitors. Look at Coward's loot tracking for an example of "communication". – James_pic – 2014-07-26T07:38:12.427
@James it's mostly set up. I was wondering if checking for enemies number of bullets is OK? – Pureferret – 2014-07-26T08:11:11.510
@Pureferret No, I'm afraid checking enemies for bullets wouldn't be OK. I'm also not even sure how you'd do it - I don't think the player ever receives anything that even holds a private reference that leads to that information. – James_pic – 2014-07-26T08:40:18.197
Hey I was wondering something about "PLayers can communicate" Can I have something like: public static Map<Point,MyPlayer> myPack = new HashMap<>(); That I set on every turn? I think that breaks the 4th wall? – sokie – 2014-07-28T15:38:02.570
1@sokie That sounds OK - some entries already do something like this, and I figured when I set the challenge that some entrants would want their bots to rendez-vous somewhere, or exchange information about their surroundings. We'll say that the players have got walkie talkies. – James_pic – 2014-07-28T15:43:24.060
Could you clear the game_ouput folder of .html every time you run the program? – Moop – 2014-07-28T17:42:47.450
@Moop Maybe. I suspect it's a job for Maven, as Java's file APIs tend to make things harder than they should be, but I'll look into it. Or, feel free to submit a pull request on the control program. – James_pic – 2014-07-28T18:04:46.720
@Moop I've merged your changes. Cheers for the help – James_pic – 2014-07-28T19:27:00.983
Scavenging bullets: what if there are 3 bullets and 4 adjacent players; who gets left out? – JoshDM – 2014-07-29T20:07:26.823
@JoshDM if there's a remainder when dividing the number of bullets by the number of players, then the remainder is lost (presumably due to the players fighting over them). So in your case, nobody would get any bullets. – James_pic – 2014-07-29T20:14:26.460
@James_pic - ah, right. That makes sense. I was thinking a remainder if 3 bullets over 2 players. – JoshDM – 2014-07-29T20:20:40.953
It seems like shootablePlayers shouldn't include the player itself by default. Maybe add
if(x == CENTRE_OF_VISION && y == CENTRE_OF_VISION) continue;
? – Moop – 2014-07-29T22:35:22.210Also, are we allow to know the board size so we can optimize movement over the torus? – Moop – 2014-07-29T23:30:51.017
@Moop
shootablePlayers
was originally added for internal use - to check whether the player you're trying to shoot is actually in range. I left it in the public API more for convenience than anything else. Changing the implementation to exclude the current player would break this use case. – James_pic – 2014-07-30T06:15:52.780@Moop It seems reasonable to want to know the board size (it just didn't occur to me to add it to the API), so I'll add that in when I get chance. However, I probably won't get chance until at least 20:00 UTC, so if you're in a hurry, I'm happy if you want to make the change yourself and pull-request it in. – James_pic – 2014-07-30T06:20:06.420
I've updated it so you can now access
boardSize
fromPlayerContext
– James_pic – 2014-07-30T11:28:19.957@James_pic Thanks James for the quick update! – Moop – 2014-07-30T13:30:32.410
2
@James_pic I added this code to my local copy (http://pastebin.com/PutPn9ff) in Game.java so I could use the arrow keys to go forward and backwards in the game. Thought it might be useful for you to add
– Moop – 2014-07-30T19:39:07.110@Moop Neat! I'll include it in the next test run, which should be coming up shortly – James_pic – 2014-07-30T20:39:11.137
I am always surprised how well StandStill does. I made a local player that just randomly moves each turn and it does horrible. – Moop – 2014-07-30T21:32:10.883
@Moop Part of the reason may be that some players are aggressive towards players they don't know, until they figure out if they can trust them - other non-aggressive players like Priest and Vortigaunt also seem to benefit from this. StandStill may also sometimes benefit from the "three stooge effect" that you can get when multiple zombies are approaching side-by-side. – James_pic – 2014-07-30T22:20:04.523
@James_pic You can save a lot of space in the html output by using css to style. Try adding this to the game.java: http://pastebin.com/KnaZxqkS
– Moop – 2014-08-01T14:28:17.400I would be awesome if somebody could create a video of the final result! – Martin Thoma – 2014-08-01T21:33:19.333
Here is a list of resources: Where can I find free sprites and images?
– Martin Thoma – 2014-08-01T21:35:53.733Is there a way to see who shot my character (within the rules?) – Tyzoid – 2014-08-01T23:05:17.727
@Tyzoid No, there isn't. This information isn't currently tracked anywhere, or exposed in any API. Or, in-universe, dead men don't tell tales. – James_pic – 2014-08-01T23:08:20.893
@Moop Messing with the CSS got the size down by about 70%, which puts the last run at around 400MB. That should be small enough to host on GitHub pages, but I'm struggling to get it to work. I might just stick it in an S3 bucket. – James_pic – 2014-08-01T23:09:54.557
@James_pic also: how slow can my algorithm be? It's slowing it down noticeably, but it's not terrible. – Tyzoid – 2014-08-01T23:53:30.753
1
@moose http://opengameart.org/content/characters-zombies-and-weapons-oh-my looks like it could be a good asset set to use. But I'm not sure I'll have time to put something like this together.
– James_pic – 2014-08-02T00:13:52.437@Tyzoid I'm already regretting some of the slower entries (some of the slowest were mine - I had to be stubborn and implement them in Frege and Javascript), as it currently takes around 10 minutes to run a round on my laptop. I'd say that "not terrible" is probably just about reasonable. But I'm probably not going to wait an hour to run a single round, if it comes to that. – James_pic – 2014-08-02T00:18:31.503
@James_pic An hour? I can get a round down in under a minute. Do you have a SSD? – Moop – 2014-08-02T03:15:49.397
Would anyone mind if I got a code review on my entry, I don't think it's working 'right'? I'm also struggling to debug it, is there a way to compile the code and then just run it in debug mode without having to compile it each time? I also find as the Compile and execute is separat, debugging and tweaking with 'hot insert' (right term?) is impossible :(
– Pureferret – 2014-08-02T07:05:38.807@Moop My laptop's a two or three year old Core i3. I expect it'd run faster on newer hardware (a minute sounds about right), since profiling shows most of that time is either running entries (last time I checked, Cocoon was the slowest, since it uses a slow algorithm in a slow language), or assembling the PlayerContext before a competitor's turn. I expect a fast CPU would make more difference than an SSD, as this is all CPU time. – James_pic – 2014-08-02T10:25:05.530
@Pureferret Posting it for code review sounds fine to me. The easiest way to debug your code is probably to run it in an IDE. The better IDEs have Maven integration, so they should be able to build the control program without any help. They also support hot-swapping, so it's possible to debug the program and edit the code on-the-fly (google "hot swap <the name of your IDE>" for help on how to do that in your IDE). These days, I'd recommend IntelliJ IDEA, or else NetBeans, or else Eclipse. – James_pic – 2014-08-02T10:35:53.503
@James_pic I did run it in the IDE, I have eclipse set up nicely at home (but not work) and I run it as
compile exec:java
like you suggest, but that means (AFAICT) that it's fully compiled before runtime so I can't hotswap. I'll look up hot swapping with maven specifically though. – Pureferret – 2014-08-02T14:32:17.240@Pureferret There is a plugin for eclipse that provides Maven integration (the fact that it doesn't come as standard is one of the reasons Eclipse is at the bottom of my list). In any case, all
mvn exec:java
does is executeplayer.Game
as a main class, which you can do directly in Eclipse. I reckon there's a reasonable chance hot-swapping will work when run in this way. – James_pic – 2014-08-02T15:00:10.0471@James_pic Thanks for the post and game, I enjoyed it. – Moop – 2014-08-03T18:15:37.053
2Slight disappointment that the winner let itself suffer certain zombification rather than committing suicide. – Sparr – 2014-08-04T03:06:09.387
1@Sparr The best entries generally got themselves into a "fort", so they could only be killed if a zombie spawned right beneath their feet. In that case, there's no warning that zombies are approaching. – James_pic – 2014-08-04T09:25:22.860
1@James_pic the actual winner ended up in a "big" fort, with two copies of himself, so he had warning of zombies spawning nearby in his fort, and he had one turn of warning on the very last turn when he knew he would die and he chose to shoot one of the two zombies instead of shooting himself. Very contrary to the title of the contest :| – Sparr – 2014-08-04T14:16:32.847
@sparr youre right, i didnt plan for this. its really unusual to have this chance at all (since an adjacent zombie kills you at the start of your turn, except that zombie is another player that got zombified in the same turn). In game, coward Steve shot his friend coward Allen who got zombified before his very eyes and spared him that horrific afterlife. But unfortunately for Steve ... – Thaylon – 2014-08-04T22:18:53.657
If somebody made a video, we could put it on http://www.twitch.tv/
– Martin Thoma – 2014-08-08T03:08:20.580