From 58b0b9da0241ff8623581b2cb837eaf34b8f165d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 24 Aug 2015 18:06:30 +0200 Subject: UI: change behaviour of S key, allow split+W always --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README') diff --git a/README b/README index 57da257..d609439 100644 --- a/README +++ b/README @@ -7,5 +7,5 @@ move mouse = move left click, space = split right click, w = eject some mass r = respawn -s = lock input. cycles through: user lock -> user and bot lock -> bot lock -> no lock +s = lock input. toggle between "user controls" and "bot controls". hold shift for "nobody controls" esc = quit -- cgit v1.2.3 From ccdf1206ee664a15cf9f4082ebc8835deafdffba Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 25 Aug 2015 14:03:37 +0200 Subject: readme, game mechanics --- README | 7 ++++--- game_mechanics.txt | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 game_mechanics.txt (limited to 'README') diff --git a/README b/README index d609439..ad6b58a 100644 --- a/README +++ b/README @@ -3,9 +3,10 @@ prerequisites: python3, pygame and websocket-client git submodule update --init python3 main.py -move mouse = move -left click, space = split -right click, w = eject some mass +space = split +w = eject some mass r = respawn s = lock input. toggle between "user controls" and "bot controls". hold shift for "nobody controls" +move mouse = move +mouse left/mid/right click: set markers (currently unused) esc = quit diff --git a/game_mechanics.txt b/game_mechanics.txt new file mode 100644 index 0000000..1bb5987 --- /dev/null +++ b/game_mechanics.txt @@ -0,0 +1,7 @@ +can eject: if size >= 60 i.e. mass >= 35 +eject makes me lose 16 mass +eject distance is between (600+my.size) and (700+my.size), about 10-15 deg deviation +can eat ejected mass if mass >= 18 i.e. size >= 43 + +cell can eat us, if their size/mass(??) is at least 1.25* our size/mass + -- cgit v1.2.3 From b78d6f097f85aa41f384a0f0922c98c58a22c879 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 25 Aug 2015 23:11:08 +0200 Subject: stats can now be calculated over multiple files. readme. --- README | 3 +++ stats.py | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'README') diff --git a/README b/README index ad6b58a..fa3410e 100644 --- a/README +++ b/README @@ -10,3 +10,6 @@ s = lock input. toggle between "user controls" and "bot controls". hold shift fo move mouse = move mouse left/mid/right click: set markers (currently unused) esc = quit + +the stats.py module automatically creates/overwrites the stats.pickle file (roughly 1MB per 5 minutes currently) +which can be loaded using Stats.load() and analyzed using the Stats.analyze_* functions, or using analyze.py diff --git a/stats.py b/stats.py index be8b547..3856c64 100644 --- a/stats.py +++ b/stats.py @@ -117,6 +117,21 @@ class Stats: def load(filename): return Stats(None, pickle.load(open(filename,"rb"))) + def merge(self, filename): + data2 = pickle.load(open(filename,"rb")) + self.data.min_mass = min(self.data.min_mass, data2.min_mass) + self.data.max_mass = max(self.data.max_mass, data2.max_mass) + + for i in data2.size_vs_visible_window: + self.data.size_vs_visible_window[i] += data2.size_vs_visible_window[i] + for i in data2.mass_vs_visible_window: + self.data.mass_vs_visible_window[i] += data2.mass_vs_visible_window[i] + + for i in data2.size_vs_speed: + for j in data2.size_vs_speed[i]: + self.data.size_vs_speed[i][j] += data2.size_vs_speed[i][j] + + def analyze_speed(self): results=[] @@ -125,7 +140,7 @@ class Stats: average = quantile(values, 0.5) maximum = quantile(values, 0.8) - results += [(size,maximum,average,minimum,False,False,False,len(values))] + results += [(size,maximum,average,minimum,False,False,False,sum(values.values()))] # mark outliers for i in range(1, len(results)-1): @@ -145,8 +160,9 @@ class Stats: coeff_vs_stddev += [(coeff, avg(products), stddev(normalize(products)))] best = min(coeff_vs_stddev, key=lambda v:v[2]) - print("size**"+str(best[0])+" * speed = "+str(best[1]) ) print("size\tcalc\tmax\tavg\tmin\t\tndata") for size, maximum, average, minimum, maxoutlier, avgoutlier, minoutlier, ndata in results: print(str(size) + ":\t" + "%.1f" % (best[1] / size**best[0]) + "\t" + ("*" if maxoutlier else "") + str(maximum) + "\t" + ("*" if avgoutlier else "") + str(average) + "\t" + ("*" if minoutlier else "") + str(minimum) + "\t\t" + str(ndata)) + + print("size**"+str(best[0])+" * speed = "+str(best[1]) ) -- cgit v1.2.3