14
Scriptbot Warz!
The results are in and Assassin is our champion, winning 2 of 3 matches! Thanks to everyone who submitted their Scriptbots! Special thanks to horns for BestOpportunityBot which displayed excellent pathing and made full use of all action options.
Map 1
Assassin took out BestOpportunityBot early on, and the rest of the match was pretty boring. Detailed play-by-play here.
- Assassin: 10 HP, 10 Damage Dealt, 3 Damage Taken
- The Avoider v3: 10 HP, 0 Damage Dealt, 0 Damage Taken
- Gotta Finish Eating: 10 HP, 0 Damage Dealt, 0 Damage Taken
- BestOpportunityBot: 0 HP, 3 Damage Dealt, 10 Damage Taken
Map 2
BestOpportunityBot did most of the work on this match, but Assassin was able to take him out in the end. Detailed play-by-play here.
- Assassin: 2 HP, 10 Damage Dealt, 9 Damage Taken
- BestOpportunityBot: 0 HP, 32 Damage Dealt, 10 Damage Taken
- The Avoider v3: 0 HP, 0 Damage Dealt, 12 Damage Taken
- Gotta Finish Eating: 0 HP, 0 Damage Dealt, 11 Damage Taken
Map 3
BestOpportunityBot pushed everyone into traps on this match. Very cool. Detailed play-by-play here.
- BestOpportunityBot: 10 HP, 30 Damage Dealt, 0 Damage Taken
- Assassin: 0 HP, 0 Damage Dealt, 0 Damage Taken
- Gotta Finish Eating: 0 HP, 0 Damage Dealt, 0 Damage Taken
- The Avoider v3: 0 HP, 0 Damage Dealt, 0 Damage Taken
Thanks for your answers! Since there are just 4 Scriptbots, we are abandoning the tournament plans for three free-for-all matches, one on each of the maps below. The scriptbot with the highest win record wins. In the event of a tie, we will enter into sudden death wherein the scriptbot who breaks the tie first wins.
Your task, should you choose to accept it, is to code a Scriptbot which can traverse an ASCII map and destroy its opponents. Each battle will take the form of a random-starting-order turn-based game where each Scriptbot has a chance to spend their energy points (EP) to take actions. The GameMaster script will feed input to, and interpret output from each Scriptbot.
Environment
Each Scriptbot is contained within its own directory where it can read from the map
and stats
files and read/write to the data
file. The data
file can be used to store any persistent information you might find useful.
The stats File
The stats
file contains information about your opponents and is formatted as follows. Each player is represented on a separate row. The first column is a player ID (@
means you). The second column is the health of that player.
1,9HP
@,10HP
3,9HP
4,2HP
The map File
The map
file might look something like this...
####################
# # # #
# 1 # # 2 #
# #
### ###
# #
# # #
# # ! #
# # #
# !#### #
# ####! #
# # #
# ! # #
# # #
# #
### ###
# #
# 3 # # @ #
# # # #
####################
... or this...
######################################
# # 1 # @ #
# # # #! #
# # # #### #
# # # # # !#! #
# # # # # ##### #
# ### # #### # # #
# # #! ### # #
# ###### # # # ##### #
# #! # ###### # !# #
# ### # # # #
# # 2 # # 4 # #
######################################
... or this...
###################
###!!!!!!#!!!!!!###
##! !##
#! 1 ! 2 !#
#! ! !#
#! !#
#! !#
#! !!! !#
## !! !!! !! ##
#! !!! !#
#! !#
#! !#
#! ! !#
#! 3 ! @ !#
##! !##
###!!!!!!#!!!!!!###
###################
... or it might look totally different. Either way, the characters used and their meaning will remain the same:
#
A wall, impassable and impenetrable.1
,2
,3
... A number representing an enemy player. These numbers correspond to the player ID in thestats
file.!
A trap. Scriptbots who move onto these locations will die immediately.@
Your Scriptbot's location.Open space which you are free to move around in.
Gameplay
The GameMaster script will assign a random starting order to the Scriptbots. The Scriptbots are then invoked in this order while they are still alive. Scriptbots have 10 Health Points (HP), and start with 10 Energy Points (EP) each turn, which they may use to move or attack. At the start of each turn, a Scriptbot will heal for one HP, or be granted one additional EP if already at 10 HP (thus running may be a viable strategy at times).
The battle ends when only one Scriptbot survives or when 100 turns have passed. If multiple Scriptbots are alive at the end of a battle, their place is determined based on the following criteria:
- Most health.
- Most damage dealt.
- Most damage taken.
Scriptbot Input
The GameMaster will print the battle map to a file named map
which the Scriptbot will have access to read from. The map might take any form, so it is important that the Scriptbot be able to interpret it. Your Scriptbot will be invoked with one parameter indicating EP. For example...
:> example_scriptbot.py 3
The Scriptbot will be invoked until it spends all of its EP or a maximum of 10 11 times. The map and stats files are updated before each invocation.
Scriptbot Output
Scriptbots should output their actions to stout. A list of possible actions are as follows:
MOVE <DIRECTION> <DISTANCE>
Costs 1 EP per
DISTANCE
. TheMOVE
command moves your Scriptbot around the map. If there is something in the way such as a wall or another Scriptbot, the GameMaster will move your Scriptbot as far as possible. If aDISTANCE
greater than the Scriptbot's remaining EP is given, the GameMaster will move the Scriptbot until its EP runs out.DIRECTION
may be any compass direction ofN
,E
,S
, orW
.PUSH <DIRECTION> <DISTANCE>
Costs 1 EP per
DISTANCE
. ThePUSH
command enables a Scriptbot to move another Scriptbot. The Scriptbot issuing the command must be directly next to the Scriptbot being pushed. Both Scriptbots will move in the direction indicated if there is not an object blocking the Scriptbot being pushed.DIRECTION
andDISTANCE
are the same as for theMOVE
command.ATTACK <DIRECTION>
Costs one EP. The
ATTACK
command deals 1 damage to any Scriptbot directly next to the issuing Scriptbot and in the direction specified.DIRECTION
is the same as for theMOVE
command.PASS
Ends your turn.
Supported Languages
To keep this reasonable for me, I will accept the following languages:
- Java
- Node.js
- Python
- PHP
You are limited to libraries which are commonly packaged with your languages out of the box. Please do not make me locate obscure libraries to make your code work.
Submission and Judging
Post your Scriptbot source code below and give it a cool name! Please also list the version of the language you used. All Scriptbots will be reviewed for tomfoolery so please comment well and do not obfuscate your code.
You may submit more than one entry, but please make them totally unique entries, and not versions of the same entry. For instance, you may want to code a Zerg Rush bot and a Gorilla Warfare bot. That's fine. Do not post Zerg Rush v1, Zerg Rush v2, etc.
On November 7th I will collect all answers and those which pass the initial review will be added to a tournament bracket. The champion gets the accepted answer. The ideal bracket is shown below. Since there will likely not be exactly 16 entries, some brackets may end up being only three or even two bots. I will try to make the bracket as fair as possible. Any necessary favoritism (in the event that a bye week is needed for instance) will be given to the bots which were submitted first.
BOT01_
BOT02_|
BOT03_|____
BOT04_| |
|
BOT05_ |
BOT06_|___ |
BOT07_| | |
BOT08_| | |_BOT ?_
|___BOT ?_|
BOT09_ ___BOT ?_|___CHAMPION!
BOT10_| | _BOT ?_|
BOT11_|__| |
BOT12_| |
|
BOT13_ |
BOT14_|____|
BOT15_|
BOT16_|
Q&A
I'm sure I've missed some details, so feel free to ask questions!
May we trust that a map file is always surrounded by # symbols? If not, what happens in the event that a bot attempts to walk off the map? - BrainSteel
Yes the map will always be bounded by # and your Scriptbot will start inside of these bounds.
If there is no bot present in the direction specified in a PUSH command, how does the command function? - BrainSteel
The GameMaster will do nothing, zero EP will be spent, and the Scriptbot will be called again.
Do unused EP accumulate? - feersum
No. Each Scriptbot will start the round/turn with 10 EP. Any EP not spent will go to waste.
I think I've got it, but just to clarify: with bots A and B, is the order of events A@10EP->MOVE MAP_UPDATE B@10EP->PUSH MAP_UPDATE A@9EP->ATTACK MAP_UPDATE B@9EP->ATTACK ..., or A@10EP->MOVE A@9EP->ATTACK ... MAP_UPDATE B@10EP->PUSH B@9EP->ATTACK ... MAP_UPDATE? In other words, is all action in one controller-bot query loop atomic? If so, why the loop? Why not return a single file with all the actions to be completed? Otherwise bots will have to write out their own state files to keep track of multi-action sequences. The map/stats file will only be valid prior to the first action. - COTO
Your second example is close, but not quite right. During a turn, the Scriptbot is invoked repeatedly until their EP is spent, or a maximum of 11 times. The map and stats files are updated before each invocation. The loop is useful in the event that a bot gives invalid output. The GameMaster will deal with the invalid output and involke the bot again, giving the bot a chance to correct for it's mistake.
will you release the GameMaster script for testing? - IchBinKeinBaum
The GameMaster script will not be released. I would encourage you to create a map and stats file to test your bot's behavior.
If robotA pushes robotB into a trap, is robotA credited with "damage dealt" points equal to the current health of robotB? - Mike Sweeney
Yes, that is a good idea. A bot will be granted damage points equal to the health of a any bot that it pushes into a trap.
May we trust that a
map
file is always surrounded by#
symbols? If not, what happens in the event that a bot attempts to walk off the map? – BrainSteel – 2014-10-30T20:49:25.983@BrainSteel Yes the map will always be bounded by
#
and your Scriptbot will start inside of these bounds. – Rip Leeb – 2014-10-30T20:50:39.9733
If you're sure you've missed something, why not post it in the sandbox?
– Martin Ender – 2014-10-30T20:53:02.140If there is no bot present in the direction specified in a
PUSH
command, how does the command function? – BrainSteel – 2014-10-30T20:53:29.5002@MartinBüttner I've thought this through quite thoroughly. I was just trying to be friendly and make it clear that questions are welcome. – Rip Leeb – 2014-10-30T20:57:57.417
@BrainSteel If the
PUSH
is invalid, the GameMaster script will do nothing, zero EP will be spent, and the Scriptbot will be called again. – Rip Leeb – 2014-10-30T21:07:26.303I assume EP is 1 per DISTANCE for MOVE/PUSH, but what's the EP cost for ATTACK? You say the program will be invoked a maximum of 10 times, but what if I start the turn with 11 EP (from being at 10 HP)? – Geobits – 2014-10-30T23:02:16.310
>
The map might take any form
?Will a PASS option be added, or must I use all my EP each turn on real actions? – Geobits – 2014-10-30T23:32:53.307
@Geobits
ATTACK
is 1 EP. I have clarified this in the list of actions. I have also changed the max calls to 11. I have addedPASS
as an option. I also tried to add a visual bracket for clarification for the tournament style. Thank you! @ferrsum No EP does not accumulate. I have added that to the Q&A. – Rip Leeb – 2014-10-30T23:44:26.697@Geobits As in a typical bracket, a Scriptbot will get one entry into the tournament and when they're out, they're out. – Rip Leeb – 2014-10-30T23:54:13.647
I guess the only question I have left about the bracket is: Assuming the number of entries isn't a perfect power of 4, how are the blanks handled? Will you add a dummy bot to fill them, use a bye system, or something else? – Geobits – 2014-10-31T00:02:44.513
@Geobits There will be no dummy bots. I will try to make the bracket as fair as possible with the submissions that I am given. I have updated the Submission and Judging section with more info. Thanks! – Rip Leeb – 2014-10-31T12:26:15.830
I think I've got it, but just to clarify: with bots
A
andB
, is the order of eventsA@10EP->MOVE MAP_UPDATE B@10EP->PUSH MAP_UPDATE A@9EP->ATTACK MAP_UPDATE B@9EP->ATTACK ...
, orA@10EP->MOVE A@9EP->ATTACK ... MAP_UPDATE B@10EP->PUSH B@9EP->ATTACK ... MAP_UPDATE
? In other words, is all action in one controller-bot query loop atomic? If so, why the loop? Why not return a single file with all the actions to be completed? Otherwise bots will have to write out their own state files to keep track of multi-action sequences. The map/state file will only be valid prior to the first action. – COTO – 2014-10-31T14:01:56.817Shouldn't the ranking be most HP, most damage dealt, least damage taken? Surely a bot that takes less damage is better than one that takes more.
Also will you release the GameMaster script for testing? – IchBinKeinBaum – 2014-10-31T14:53:39.350
@COTO I've answered in the Q&A section and also clarified the main document. – Rip Leeb – 2014-10-31T15:19:00.043
@IchBinKeinBaum I think that point can be argued. I would say that taking more damage indicates that your battle was tougher and so you deserve to win. I hope that it will not come to that level of detail. If you can think of a better third rank criteria, I am willing to replace damage taken. The GameMaster script will not be released. I would encourage you to create a map and stats file to test your bot's behavior. – Rip Leeb – 2014-10-31T15:19:44.570
Does the rule above
During a turn, the Scriptbot is invoked repeatedly until their EP is spent, or a maximum of 11 times
mean that if robotA is next to robotB, it can attack 10 (or 11) times and kill robotB? Put another way, if I have 5 health points left and I leave my robot within 5 spaces of another robot, that robot can move and kill my robot in one turn, before I could act? – Logic Knight – 2014-10-31T16:07:11.017@Mike yes, that's right. – Rip Leeb – 2014-10-31T16:46:38.303
For our own testing in movement and such, will you/could you provide a handful of maps that may be used in the simulation? – BrainSteel – 2014-10-31T16:50:39.273
1If robotA pushes robotB into a trap, is robotA credited with "damage dealt" points equal to the current health of robotB? – Logic Knight – 2014-10-31T17:34:07.043
@BrainSteel Sure, I will work on a few maps. Look for them in the main document soon. – Rip Leeb – 2014-10-31T17:36:54.963
@MikeSweeney; I think you have the same idea I do, lol. I was going to code "It's a tarp" bot (or maybe, a homage to Soul Asylum "I want somebody to shove"), and just push everyone into traps, lol. – DreamWarrior – 2014-10-31T17:37:09.323
@MikeSweeney Yes, that is a good idea. A bot will be granted damage points equal to the health of a any bot that it pushes into a trap. – Rip Leeb – 2014-10-31T17:38:32.867
Also, I think you should ensure your random starting points are at least subject to a criteria that no bot is within immediate death distance of other bot(s). In other words, it's not really fair if bot A starts close enough to a set of bots (B, C, etc) who can move close to it and attack it to death before bot A even has a chance to execute. Or, at the very least, configure the bracket system in such a way that all bots execute at least once before they are eliminated.... – DreamWarrior – 2014-10-31T17:42:16.850
@DreamWarrior I should clarify. The order is random. The starting position will be predefined so that no one bot can kill another bot on their first turn. – Rip Leeb – 2014-10-31T17:49:27.293