Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
69c526b
Update published battle
Jan 10, 2016
d2e219d
Update published battle
Jan 10, 2016
6f15d2b
Revert "Update published battle" (accidental damage) [ci skip]
jacobsims Jan 10, 2016
99ab69c
Fix the issue with changing branches
jacobsims Jan 10, 2016
b1af884
This should actually fix that issue
jacobsims Jan 10, 2016
8b77b56
Update README to reflect changes in recording access [ci skip]
jacobsims Jan 10, 2016
06b374b
Consistency in file paths
enzanki-ars Jan 10, 2016
b820417
Add my name to robot [ci skip]
enzanki-ars Jan 10, 2016
9065da0
Fix an issue with my robot
jacobsims Jan 10, 2016
d7d9daa
Put commands on one line to speed up Circle
jacobsims Jan 10, 2016
6a99026
Remove old result printing to speed up builds
enzanki-ars Jan 10, 2016
2686820
Improve and rename bot [ci skip]
enzanki-ars Jan 10, 2016
3b0fb9e
Rename bot in battle file
enzanki-ars Jan 10, 2016
f80c2d0
No paying much attention to what that line was...
enzanki-ars Jan 10, 2016
3860357
Add a header to the leaderboard
jacobsims Jan 10, 2016
2f3c124
Oops yaml comments
jacobsims Jan 10, 2016
c564021
git pull before updating gh-pages
jacobsims Jan 10, 2016
6501863
Force re-run of bots
enzanki-ars Jan 10, 2016
da28747
Add imagemaker.py to Circle
jacobsims Jan 11, 2016
d5d986c
Add the graphic to the README
jacobsims Jan 11, 2016
289fdd3
Try to get the SVG links working [ci skip]
jacobsims Jan 11, 2016
c591eca
Add links where you can click them
jacobsims Jan 11, 2016
84f3faa
Put the links onto the next line [ci skip]
jacobsims Jan 11, 2016
1584694
Make the summary graphic a link to the leaderboard
jacobsims Jan 11, 2016
14b0233
Line break [ci skip]
jacobsims Jan 11, 2016
0179650
Update circle.yml
enzanki-ars Jan 11, 2016
4548dde
pip install cairosvg
enzanki-ars Jan 11, 2016
548c700
Update circle.yml
enzanki-ars Jan 11, 2016
1cb6c65
Missing a character
enzanki-ars Jan 11, 2016
d93244c
Update circle.yml
enzanki-ars Jan 11, 2016
07ad7cc
Separate and add more battles
enzanki-ars Jan 11, 2016
a4f0e1b
Organize
enzanki-ars Jan 11, 2016
6121bce
GitIgnore [ci skip]
enzanki-ars Jan 11, 2016
545dada
Update geninfo.sh
enzanki-ars Jan 11, 2016
16d73b1
Update geninfo.sh
enzanki-ars Jan 11, 2016
70069c2
Update published battle
Jan 11, 2016
2f8601d
Delete epl-v10.html
enzanki-ars Jan 11, 2016
9d61172
Delete roborumble.properties
enzanki-ars Jan 11, 2016
aa55036
Update .gitignore
enzanki-ars Jan 11, 2016
d943230
fix stupidity
enzanki-ars Jan 11, 2016
3fd1554
Correct directory name
enzanki-ars Jan 11, 2016
6274e6c
Stabilize battles [ci skip]
enzanki-ars Jan 11, 2016
86e835e
Add a glob of magic...
enzanki-ars Jan 11, 2016
4dafae8
Relink results [ci skip]
enzanki-ars Jan 11, 2016
7dd46f5
Relink to results [ci skip]
enzanki-ars Jan 11, 2016
b20a000
Relink results [ci skip]
enzanki-ars Jan 11, 2016
e817e9b
Improve release cycle so forks dont triger updates to site
enzanki-ars Jan 11, 2016
6a0f52f
Rename owner
enzanki-ars Jan 11, 2016
44ef4ba
Start of python runner
enzanki-ars Jan 12, 2016
fedc968
Add full runner
enzanki-ars Jan 12, 2016
e74972e
Fix geninfo
enzanki-ars Jan 12, 2016
094dc5c
Fix typo
enzanki-ars Jan 12, 2016
401aab2
Correct implementation
enzanki-ars Jan 12, 2016
a422ec6
Corrent int conversion
enzanki-ars Jan 12, 2016
9cfe90e
Merge branch 'pythonrunner' of https://github.com/DarbyComputerClub/d…
enzanki-ars Jan 12, 2016
5b0da34
Fix split code
enzanki-ars Jan 12, 2016
b91a77b
Use a list instead of generator so indexing works
jacobsims Jan 12, 2016
0870b0d
Convert env vars to ints at the top
jacobsims Jan 12, 2016
b0e9aab
Merge branch 'pythonrunner' of https://github.com/DarbyComputerClub/d…
enzanki-ars Jan 12, 2016
0b3f9f8
Merge branch 'pythonrunner' of https://github.com/DarbyComputerClub/d…
enzanki-ars Jan 12, 2016
d32cc3a
Correct var name
enzanki-ars Jan 12, 2016
855f04e
Correct circle index
enzanki-ars Jan 12, 2016
8e44562
Correct syntax
enzanki-ars Jan 12, 2016
4095381
Make directories
enzanki-ars Jan 12, 2016
e39a9f7
Correct syntax
enzanki-ars Jan 12, 2016
3a736d0
Use bash for thing
jacobsims Jan 12, 2016
06c710a
Correct home expansion
enzanki-ars Jan 12, 2016
c42aeac
Update circle.yml
enzanki-ars Jan 12, 2016
2295823
Syntax error
enzanki-ars Jan 12, 2016
5ac58fa
Correct links
enzanki-ars Jan 12, 2016
0bcd6da
Merge pull request #3 from DarbyComputerClub/pythonrunner
enzanki-ars Jan 12, 2016
5bb4df1
One link to screw them all [ci skip]
enzanki-ars Jan 12, 2016
ed0a276
Another one bites the dust [ci skip]
enzanki-ars Jan 12, 2016
81e221e
Attempt to fix issues with multiple battle uploads
enzanki-ars Jan 12, 2016
dcac2af
Update gh-pages in the testing phase to avoid losing results
jacobsims Jan 12, 2016
9453536
Merge branch 'master' into pythonrunner
jacobsims Jan 12, 2016
057899b
Merge pull request #5 from DarbyComputerClub/pythonrunner
jacobsims Jan 12, 2016
fbb5f12
More informative commit messages
jacobsims Jan 12, 2016
8b09ba0
Add new battles.
enzanki-ars Jan 12, 2016
0d5bc17
Move running scripts to ~/run/
jacobsims Jan 12, 2016
5eb2149
Expand the tilde to fix running geninfo.sh
jacobsims Jan 12, 2016
7105fc0
Don't compile twice
jacobsims Jan 12, 2016
68e242f
Split image maker into separate file
jacobsims Jan 12, 2016
8d59f38
Fix forgetting to change variable name
jacobsims Jan 12, 2016
ab9113b
remove useless line
jacobsims Jan 12, 2016
f22e1b7
Don't depend on bash, and exit if a battle fails
jacobsims Jan 12, 2016
5f39661
Merge branch 'master' of https://github.com/DarbyComputerClub/darbyro…
jacobsims Jan 12, 2016
60da070
Fix stupid comma error
jacobsims Jan 12, 2016
78e877c
Debug testing
jacobsims Jan 12, 2016
ff367c8
Correct compile script.
enzanki-ars Jan 12, 2016
efe21ed
WIP move to csv parse [ci skip]
enzanki-ars Jan 13, 2016
b28ccce
correct indents
enzanki-ars Jan 13, 2016
fd6922a
Fix winner extraction errors
jacobsims Jan 13, 2016
4abc9f7
Get the data we want
jacobsims Jan 13, 2016
421f6b3
Don't hardcode the listings
jacobsims Jan 13, 2016
85d338e
Use safer version of leaderboard, without extra information
jacobsims Jan 13, 2016
5e4eb27
Forgot these start at 1
jacobsims Jan 13, 2016
084c0ba
Allow any amount of listings (up to 5 for now)
jacobsims Jan 13, 2016
d94ff9c
Dynamic height
jacobsims Jan 13, 2016
24d1cc4
Forgot enumerate
jacobsims Jan 13, 2016
457da19
change svg y position for different heights
jacobsims Jan 13, 2016
801cfdb
Move the text to the right y pos
jacobsims Jan 13, 2016
58271c0
Add the percentages back
jacobsims Jan 13, 2016
2e048b7
Try new look
jacobsims Jan 13, 2016
be111fd
Use the position prefix straight from the leaderboard
jacobsims Jan 13, 2016
79620bf
Don't remove the ':'
jacobsims Jan 13, 2016
53416bd
Include the battle name in the graphic
jacobsims Jan 13, 2016
344ac74
Merge pull request #8 from DarbyComputerClub/fixgraphicdesign
enzanki-ars Jan 13, 2016
b99096b
Separate score from name and put it on the right
jacobsims Jan 14, 2016
dc4d87b
Color names
jacobsims Jan 14, 2016
d680339
Merge branch 'fixgraphicdesign'
jacobsims Jan 14, 2016
d6dd2a2
Use better-looking font
jacobsims Jan 14, 2016
d07dd2f
Use PNG instead of SVG in the readme [ci skip]
jacobsims Jan 14, 2016
720c0fa
Use --user to install pip items
enzanki-ars Jan 14, 2016
53d029d
Move upload code (1/3) [ci skip]
enzanki-ars Jan 14, 2016
d15e548
Move upload code (2/3) [ci skip]
enzanki-ars Jan 14, 2016
dedf633
Move upload code (3/4) [ci skip]
enzanki-ars Jan 14, 2016
3a30a28
Move upload script (4/4) [ci skip]
enzanki-ars Jan 14, 2016
b91e002
Correct publish script [ci skip]
enzanki-ars Jan 14, 2016
beb9df0
Remove extra info sent to script.
enzanki-ars Jan 14, 2016
38d956d
Fix permissions and typo
enzanki-ars Jan 14, 2016
9ce6d94
Correct typos
enzanki-ars Jan 14, 2016
452b699
Correct command [ci skip]
enzanki-ars Jan 14, 2016
df9252a
Missing statement.
enzanki-ars Jan 14, 2016
32bc875
Missing import
enzanki-ars Jan 14, 2016
6b2a575
Update runner.py
enzanki-ars Jan 14, 2016
c0b66ea
SCP was in wrong order
enzanki-ars Jan 14, 2016
1903cda
Fix directory location
enzanki-ars Jan 14, 2016
5996d2d
Kill me.
enzanki-ars Jan 14, 2016
4674a9e
First try at making tournament skeleton
jacobsims Jan 14, 2016
c8eb41d
Install pyjavaproperties
jacobsims Jan 14, 2016
78eda6d
Add an actual tournament
jacobsims Jan 14, 2016
3a161ea
Move robocode runner to new file
jacobsims Jan 14, 2016
da4861e
Add a tournament to the list
jacobsims Jan 14, 2016
b8d3175
Fix global error to tournament
jacobsims Jan 14, 2016
50bb314
dont use globals
jacobsims Jan 15, 2016
7186911
Disable copying for now
jacobsims Jan 15, 2016
91b9d10
Fix recursive call for use without global
jacobsims Jan 15, 2016
fa4e32e
No need to make that last directory
jacobsims Jan 15, 2016
e7e152f
Have tournaments actually run robocode
jacobsims Jan 15, 2016
06a48a3
Push some changes for later [ci skip]
jacobsims Jan 15, 2016
631b370
Save results
jacobsims Jan 16, 2016
e7933a5
Imports important
jacobsims Jan 16, 2016
9591deb
More tournaments
jacobsims Jan 16, 2016
99c0d60
Fix alex bot name
jacobsims Jan 16, 2016
6beb153
Merge branch 'master' into tournament
enzanki-ars Mar 8, 2016
079b4b4
Fix the merge artifact...
enzanki-ars Mar 8, 2016
ea66440
Merge pull request #16 from DarbyComputerClub/tournament-merge
enzanki-ars Mar 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Summary graphic for the latest battle](https://darbycomputerclub.github.io/robocode-results/results/melee/darbygraphic.png)](https://darbycomputerclub.github.io/robocode-results/results/melee/darby-col.txt)<br>
[view leaderboard](https://darbycomputerclub.github.io/robocode-results/results/melee/darby-col.txt) | [download battle record](https://darbycomputerclub.github.io/robocode-results/results/melee/darby.br)

[![Circle CI](https://circleci.com/gh/DarbyComputerClub/darbyrobocode/tree/master.svg?style=svg)](https://circleci.com/gh/DarbyComputerClub/darbyrobocode/tree/master)

This version of robocode is for the Darby Computer Club.
Expand Down
10 changes: 10 additions & 0 deletions battles/tournament/t2.tournament
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Battle Properties
robocode.battleField.width=800
robocode.battleField.height=600
robocode.battle.numRounds=5
robocode.battle.gunCoolingRate=0.1
robocode.battle.rules.inactivityTime=450
robocode.battle.hideEnemyNames=true
# ADD YOUR ROBOT HERE IN THE FORM lastname.firstname.RobotName*
# star is important ^
darby.tournament.selectedRobots=sample.Corners,sample.MyFirstBot,io.github.jacobsims.AimingBot*
10 changes: 10 additions & 0 deletions battles/tournament/t3.tournament
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Battle Properties
robocode.battleField.width=800
robocode.battleField.height=600
robocode.battle.numRounds=7
robocode.battle.gunCoolingRate=0.1
robocode.battle.rules.inactivityTime=450
robocode.battle.hideEnemyNames=true
# ADD YOUR ROBOT HERE IN THE FORM lastname.firstname.RobotName*
# star is important ^
darby.tournament.selectedRobots=sample.Corners,sample.Crazy,sample.Fire,sample.MyFirstJuniorRobot,sample.MyFirstRobot,sample.PaintingRobot,sample.RamFire,sample.SittingDuck,sample.SpinBot,sample.Target,sample.Tracker,sample.TrackFire,sample.VelociRobot,sample.Walls,io.github.jacobsims.AimingBot*,io.github.enzanki_ars.AlexSimpleBot*
10 changes: 10 additions & 0 deletions battles/tournament/withsample.tournament
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Battle Properties
robocode.battleField.width=800
robocode.battleField.height=600
robocode.battle.numRounds=5
robocode.battle.gunCoolingRate=0.1
robocode.battle.rules.inactivityTime=450
robocode.battle.hideEnemyNames=true
# ADD YOUR ROBOT HERE IN THE FORM lastname.firstname.RobotName*
# star is important ^
darby.tournament.selectedRobots=sample.Corners,sample.Fire,sample.MyFirstRobot,sample.RamFire,sample.Target,sample.TrackFire,sample.Walls,sample.Crazy,io.github.enzanki_ars.AlexSimpleBot*,io.github.jacobsims.AimingBot*
8 changes: 4 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ general:

dependencies:
pre:
- cp -R run ~/run
- pip install --user cairosvg
- ~/run/pull_results.sh
- pip install --user cairosvg pyjavaproperties
override:
- unzip -n ~/run/robocode-1.9.2.5-setup.jar -d .
- cp -R run ~/run
- unzip ~/run/robocode-1.9.2.5-setup.jar -d .
- mkdir ~/battles
- ~/run/pull_results.sh
cache_directories:
- ~/gh-results

Expand Down
11 changes: 11 additions & 0 deletions run/robocoderun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import subprocess

def robocoderun(battlefile, resultsfile, recordfile):
code = subprocess.call(['java', '-Xmx512M', '-Dsun.io.useCanonCaches=false', '-cp', 'libs/robocode.jar',
'robocode.Robocode',
'-battle', battlefile,
'-nodisplay',
'-results', resultsfile,
'-nosound',
'-record', recordfile])
return code
23 changes: 12 additions & 11 deletions run/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import pip
import subprocess
import robosvgmake
import tournament
from robocoderun import robocoderun

battles = ["melee/darby", "melee/officers", "melee/all", "melee/withsample","1v1/enz_v_jac","1v1/jac_v_wall","1v1/enz_v_wall"]
battles = ["tournament/withsample","tournament/t2","tournament/t3","melee/darby","melee/withsample","1v1/enz_v_jac","1v1/jac_v_wall","1v1/enz_v_wall"]


run = [battles[i::int(os.environ['CIRCLE_NODE_TOTAL'])] for i in range(int(os.environ['CIRCLE_NODE_TOTAL']))]
Expand All @@ -21,16 +23,15 @@
print(battleList)

for battle in battleList:
os.makedirs(os.path.expanduser('~/battles/results/' + battle))
exitcode = subprocess.call(['java', '-Xmx512M', '-Dsun.io.useCanonCaches=false', '-cp', 'libs/robocode.jar',
'robocode.Robocode',
'-battle', 'battles/' + battle + '.battle',
'-nodisplay',
'-results', os.path.expanduser('~/battles/results/' + battle + '.txt'),
'-nosound',
'-record', os.path.expanduser('~/battles/results/' + battle + ".br")])
if exitcode != 0:
exit(exitcode)
os.makedirs(os.path.expanduser('~/battles/results/' + os.path.dirname(battle)))
if os.path.isfile('battles/' + battle + '.battle'):
code = robocoderun('battles/' + battle + '.battle',
os.path.expanduser('~/battles/results/' + battle + '.txt'),
os.path.expanduser('~/battles/results/' + battle + '.br'))
if code != 0:
exit(code)
elif os.path.isfile('battles/' + battle + '.tournament'):
print tournament.runTournamentCalled(battle)

with open(os.path.expanduser('~/battles/results/' + battle + '-col.txt'), 'w') as w:
w.write('Darby Robocode Battle\n')
Expand Down
95 changes: 95 additions & 0 deletions run/tournament.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/env python
import pyjavaproperties
from robocoderun import robocoderun
import tempfile
import shutil
import random
import copy
import csv
import os

def loadFile(fpath):
p = pyjavaproperties.Properties()
with open(fpath, 'r') as f:
p.load(f)
return p

def saveFile(p, fpath):
with open(fpath, 'w') as f:
p.store(f)

def makeTempBattle(p):
tempdir = tempfile.mkdtemp('', 'darbyrobocode_')
saveFile(p, tempdir + '/a.battle')
return tempdir

def separateProps(p):
d = p.getPropertyDict()
newp = pyjavaproperties.Properties()
darbyopts = {}
for key in d:
if key.startswith('darby.'):
darbykey = key.split('.', 1)[1]
darbyopts[darbykey] = d[key]
else:
# Allow other options to go through to the battle file
newp[key] = d[key]

return newp, darbyopts

def getWinnerOfBattle(bot1, bot2, battletemplate):
print battletemplate
battle = battletemplate
battle['robocode.battle.selectedRobots'] = ','.join([bot1, bot2])
tempdir = makeTempBattle(battle)
robocoderun(tempdir + '/a.battle', tempdir + '/results.txt', tempdir + '/results.br')
with open(tempdir + '/results.txt', 'r') as r:
lines = csv.reader(r, delimiter='\t')
for line in lines:
if len(line) > 0 and line[0].startswith('1st:'):
return line[0][5:], tempdir

def getWinnerAndDiscard(bot1, bot2, battletemplate):
winner, tempdir = getWinnerOfBattle(bot1, bot2, battletemplate)
shutil.rmtree(tempdir)
return winner


def splitList(l):
split = []
for i in range(int(len(l)/2)):
split.append([l[2*i], l[2*i + 1]])
if len(l) % 2 != 0:
split.append(l[-1])
return split

def retrieveWinners(botList, battletemplate):
winnerList = []
for pair in splitList(botList):
if type(pair) == type([]):
winnerList.append(getWinnerAndDiscard(pair[0], pair[1], battletemplate))
else:
winnerList.append(pair)
return winnerList

def runTournament(botList, battletemplate):
if len(botList) == 2:
winner, tempdir = getWinnerOfBattle(botList[0], botList[1], battletemplate)
loser = [l for l in botList if l != winner][0]
return (winner, loser, tempdir,)
else:
winners = retrieveWinners(botList, battletemplate)
return runTournament(winners, battletemplate)

def runTournamentCalled(name):
p = loadFile('battles/' + name + '.tournament')
battletemplate, darbyopts = separateProps(p)

botsincluded = ['sample.Fire', 'sample.Crazy']
for k in darbyopts:
if k == 'tournament.selectedRobots':
botsincluded = darbyopts[k].split(',')

winner, loser, tempdir = runTournament(botsincluded, battletemplate)
shutil.copyfile(tempdir + '/results.txt', os.path.expanduser('~/battles/results/' + name + '.txt'))
shutil.copyfile(tempdir + '/results.br', os.path.expanduser('~/battles/results/' + name + '.br'))