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.
map
file is always surrounded by#
symbols? If not, what happens in the event that a bot attempts to walk off the map? \$\endgroup\$#
and your Scriptbot will start inside of these bounds. \$\endgroup\$