54
17
4-Man Standoff
Description
You've somehow found yourself into a four-way standoff. A loaded gun rests in your hands, and some grenades are hooked on your belt.
The objective is to have the most health at the end of a standoff. A standoff is over when at most one person has a positive amount of health.
Each player has 5
health, and dies when their health drops to/below 0
. The turn a player dies is the last turn that player can take damage.
If there is a live player at the end of a standoff, that player wins. Otherwise, the player with the least negative health wins.
Actions
Shoot: Take a shot at someone.
2
damage if shooting a live enemy0
damage if shooting a dead enemyhealth_at_start_of_turn+2
damage if shooting yourself. (Note that this will leave you with at MOST-2
health.)- If one enemy shoots at you on the same turn you shoot yourself, you will end the standoff with -4 health (you still take damage from other players the turn you kill yourself).
- Your action the following turn will be ignored (and assumed to be
Nothing
).
Dodge: Try to dodge a single opponent's shot.
Prepare: Unhook your grenade and prepare to throw it.
- You only have three turns to throw it, before you get blown up (
6
damage to yourself,3
damage to all live enemies) - Dying with an unthrown grenade is equivalent to not throwing the grenade for three turns.
- You only have three turns to throw it, before you get blown up (
Throw: Chuck the grenade towards someone and hope for the best.
- Target receives
8
damage if alive - Everyone else (including yourself) receives
3
damage if alive
- Target receives
Nothing: Stand idly for a turn and watch everyone die.
Input
Your program will be passed the following information:
- The health of each player
A list of actions taken by that player since the start of the standoff Below is the format for the information passed per player:
[Health],[Action 1],[Action 2],[Action 3],...
Actions will be given in the format specified in the Output section.
You will recieve 4 such strings, separated by a space, and passed as a single argument. The order of these strings is:
[Player Info] [Opponent 1 Info] [Opponent 2 Info] [Opponent 3 Info]
The strings are passed as the second argument. The first argument contains an integer that uniquely identifies the standoff being enacted. Standoffs between the same set of players are guaranteed not to be simultaneous. However, multiple standoffs will occur at the same time.
For example:
$./Player.bash 5 "3,S2,N 5,P,N 3,S0,N -2,S3,N"
Currently, the player and the second opponent have 3 health, the first opponent has 5 health, and the third opponent has -2 health and is dead.
On the first turn:
- Player 1 shot enemy 2
- Enemy 1 prepared a grenade
- Enemy 2 shot player
- Enemy 3 shot himself
On the second turn:
- All players did nothing. (Player and enemy 2 can not do anything since they shot on the previous turn. Enemy 3 is dead: he will do
Nothing
for the rest of the standoff.)
The second argument at the start of a standoff is: 5 5 5 5
.
Output
A command should be outputted in the below listed format. An invalid output is interpreted as 'Nothing'. A command requiring a target should be followed by an integer (0-3
, with 0
representing the player, and 1-3
representing enemies 1-3).
S[target]
: Shoots [target].D[target]
: Tries to dodge [target].P
: Prepare a grenade.T[target]
: Throw the grenade at [target].N
: Do nothing.
A command that needs a target, but is fed a target not between 0
and 3
or not fed a target entirely will be assumed to target 0
(the player).
Scoring
At the end of each standoff, players receive a score calculated by the following formula:
35 + health at end of standoff
In the case that a player ends a standoff with negative health, they will receive a score below 35. The following points are also rewarded as a bonus:
- Most health: +4 points
- Second most health: +2 points
- Third most health: +1 point.
In case of a tie, the lower bonus is granted (if two people tie with most health, both are granted +2; if there are 3 people with the most health, +1, and if everyone ends equally, +0).
The final score is determined by calculating the mean of all individual scores.
Rules/Details
- Order of events within a turn are as follows:
- All players do their actions.
- Players who have 0 or less health die.
- Unthrown grenades that need to explode, will explode (players who just died are still hurt, as this is still the turn they died).
- No collaboration between entries.
- Three* standoffs will occur between each set of 4 players. (Order of players may vary with each standoff).
- Entries consuming excessive amounts of memory of disk space will be disqualified.
- Reading from or modifying files other than your entry's will disqualify your entry.
- A truck, driven by a drunkard, will run over all living players after the
50th
turn, if the standoff is not yet over at the end of the50th
turn.- This truck deals 20 damage to all live players.
- Standoffs happen quickly. Programs are cut off after 1 second.
- Your program will be called every turn, even after you have died.
- You may read or write files to your directory only (if your entry is named JohnDoe, you may save files in the directory players/JohnDoe/); however, this will NOT be the current directory while your script is running.
- The standoffs will take place on a machine running Arch Linux (Release 2014.08.01).
The controller is available on GitHub.
Please include the following in your post:
- A name for your bot
- A shell command to run the bot (ex.
java Doe.java
) Input will be passed through the command line as a single argument (java Doe.java 5 "-2,S0 -2,S1 -2,S2 5,N"
) - Code of your bot
- How the bot should be compiled (if applicable)
- Language (and version if applicable, especially for python)
*Controller is taking way too long for six.
Scoreboard
Observer 43.280570409982
MuhammadAli 43.134861217214
Osama 43.031983702572
LateBoomer 42.560275019099
SimpleShooter 42.412885154062
LessSimpleShooter 42.3772
Neo 42.3738
Scared 42.3678
Richochet 42.3263
Equivocator 42.2833
TwentyFourthsAndAHalfCentury 42.2640
Darwin 42.1584
HanSolo 42.1025
Coward 42.0458
ManipulativeBastard 41.8948
Sadist 41.7232
Aggressor 41.7058
CourageTheDog 41.5629
Grenadier 40.9889
Bomberman 40.8840
Spock 40.8713
Sniper 40.6346
DONTNUKEMEBRO 39.8151
PriorityTargets 39.6126
Hippolyta 39.2480
EmoCowboy 39.2069
Zaenille 39.1971
AntiGrenadier 39.1919
PoliticallyCorrectGunman 39.1689
InputAnalyzer 39.1517
Rule0Bot 39.1000
BiasedOne 39.0664
Pacifist 39.0481
StraightShooter 39.0292
Ninja 38.7801
MAD 38.2543
Monkey 37.7089
Label1Goto1 36.2131
Generated: 2014/08/22 03:56:13.470264860 UTC
Logs: on GitHub
I wonder if a neural net could be built now that would slaughter the current submissions, converging on an optimal strategy – Cruncher – 2018-10-12T15:25:11.573
If shot/killed while throwing a grenade, it's still thrown, correct? – Geobits – 2014-08-09T21:15:54.490
@Geobits yes; your action on the turn you get killed always happens. – es1024 – 2014-08-09T21:18:33.703
Seems like a cool challenge! Might have a go at this. — Finally a KOTH challenge where the OP's language isn't Java but C++! Kudos :D – tomsmeding – 2014-08-09T21:21:58.370
After starting up a JVM, how much time will a program have left before being cut off? – comperendinous – 2014-08-09T21:37:45.177
@comperendinous at least 7/8ths of a second will be left after the JVM starts up before the cutoff – es1024 – 2014-08-09T22:20:37.520
@es1024 That's all right then. The wait for the JVM often feels interminable on my ageing computer, and I was concerned about the load of parallel standoffs; but that doesn't seem to overly disadvantage Java competitors who try something complex. – comperendinous – 2014-08-09T22:33:14.907
I'm a bit unclear about dying with a grenade. If I prepare one on the first turn and I'm also shot by all three enemies, taking me down to -1 health (dead), how does the grenade explosion affect me? Does it do a further 6 damage since I was alive at the start of the turn? Does it do no further damage since it only explodes once I'm dead? Does it explode on that first turn, or on the second when I'm definitely dead? – comperendinous – 2014-08-09T22:43:13.593
@comperendinous All player's actions (including your preparing a grenade) occur before players die. Therefore, the grenade will explode if you die on the turn you prepare it, and you will take 6 more damage (because it is still the turn that you died). – es1024 – 2014-08-09T22:44:51.437
@es1024 Good. That should prevent P,S0 from being a winning strategy by virtue of being the least-dead player. Thank you for your clarifications. – comperendinous – 2014-08-09T22:48:40.947
1Do you have exactly one grenade, or do you have many? Can you have multiple grenades being prepared at a time? – isaacg – 2014-08-09T23:52:29.907
@isaacg multiple grenades, but can only prepare one at a time; multiple prepares without throwing is the same as doing nothing – es1024 – 2014-08-10T00:50:25.757
Do files stored in our directory persist between standoffs? – Davis Yoshida – 2014-08-10T21:37:28.280
@DavisYoshida Yes. – es1024 – 2014-08-10T22:04:00.857
You've stated that players may "try to dodge [target]". What is the success rate? Can players only dodge bullets, or grenades too? – comperendinous – 2014-08-11T00:29:12.843
@comperendinous Only dodges bullets from the target, with a 100% success rate. – es1024 – 2014-08-11T00:36:43.547
I really expected an EmoWolf submission by now :( – Bob – 2014-08-11T00:58:55.267
A curiosity though. How come the DONTNUKEMEBRO bot suddenly fell to last place? – Doktoro Reichard – 2014-08-11T01:28:04.243
@DoktoroReichard From the logs, it seems that DONTNUKEMEBRO got hit by the truck ~35 times. – es1024 – 2014-08-11T01:42:17.300
2
@Bob Pretty sure EmoWolf got added to Standard Loopholes which are no longer funny. Though a suicidal entry might not actually do so terribly.
– es1024 – 2014-08-11T01:48:38.5903Lesson to everyone : Don't drink and drive. – Zaenille – 2014-08-11T01:56:46.200
8@es1024 Where suicide is actually a viable strategy, an EmoWolf-type submission really should be allowed. Especially when the available actions explicitly include suiciding! Not so much a "loophole" now, is it? And not really an unfair advantage, which most of those loopholes really are. But that's just my opinion. – Bob – 2014-08-11T02:20:44.323
@DoktoroReichard Yeah, that's kinda painful to see. My little guy get punished because he lasts so long. But I've made some changes to him that will hopefully set that right. – AndoDaan – 2014-08-11T04:28:14.290
Is this thing still on the road? – AndoDaan – 2014-08-11T22:11:43.970
1@AndoDaan I'm running the controller again once I get the entries updated. – es1024 – 2014-08-11T22:43:46.137
3Based on running the controller a couple times it seems pretty noisy. If this contest ever gets closed you should probably up the number of runs to smooth it out a bit. – Davis Yoshida – 2014-08-12T04:47:53.793
I posted just as this one ran... T^T – Josef E. – 2014-08-12T21:04:56.857
In all your logs, my bot just gives N...so I m assuming it didn't work (since it's not supposed to ever give a N)? – plannapus – 2014-08-13T06:01:52.010
@plannapus Seems that some of the extra text Rscript outputted might have interfered; I fixed the controller and Bomberman seems to be responding appropriately. – es1024 – 2014-08-13T07:48:03.203
Could I suggest to add an alternative scoring method where you get a point for every life you have less than the winner at the end of a fight and where more points is worse? This would make grenades more of an option. – overactor – 2014-08-13T08:46:21.420
@es1024 thanks for the feedback! – plannapus – 2014-08-13T08:58:40.063
1@overactor Bonuses for getting 1st/2nd/3rd were added (as originally intended, but it seems I forgot to add them in earlier), and the main post has been updated. This should make grenades more of an option. – es1024 – 2014-08-14T07:37:10.360