Experience stats from 250+ replays - Page 1

Experience stats from 250+ replays

Classic game design, maintained to please you...

Moderator: Content Developer

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Experience stats from 250+ replays

Post by knorke »

some graphs have those vertical lines where appearently lots of units die at the same time ie:
http://beherith.eat-peet.net/stuff/unitexp/Avenger.png
http://beherith.eat-peet.net/stuff/unitexp/Reaper.png
http://beherith.eat-peet.net/stuff/unitexp/Spider.png

I guess it is because 250 replays is not that much and so one big assault with one unit type has quite a big impact on the graph. But it also shows a bit how units are used.
ie fighters patroll relatively peacefull doing nothing and then suddendly die.


Also would be good to have a color gradient like this:
Image
Things might look a bit different when dots plotted on top of each other are not lost but make that spot go brighter.

data available here
the odd 0.42341.. numbers are probally XP, what are the others?
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Experience stats from 250+ replays

Post by Gota »

The warrior is a redundant unit.a noob trap and nothing more.
It does not need to be buffed or nerfed it just has absolutely no place in tier 1 fighting...and since T2 is packed with tons of units already it has no place there either.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Experience stats from 250+ replays

Post by Beherith »

unitname teamID experience frame_died

special character is the "Game ended!" line after which the widget dumps all units into the file and quits the game.

Known bug: destroying non fully built units also gets logged.


The widget:

Code: Select all

function widget:GetInfo()
  return {
    name      = "stats-unitkilled",
    desc      = "saves unit xp",
    author    = "beherith",
    date      = "2011 may",
    license   = "PD",
    layer     = 0,
    enabled   = true  --  loaded by default?
  }
end

function widget:Initialize()
	gameid=os.time()
	Spring.Echo(gameid)
	mapname=Game.mapName
	modname=Game.modName
	fname=modname .. "$"..mapname.."$"..gameid .."$stats.txt"
	fd=	io.open("stats/"..fname,"w")
	if fd then 
		fileopened=true
	else 
		Spring.Echo("Error, opening stats/"..fname.." failed!")
		widgetHandler:RemoveWidget()
	end
	Spring.SendCommands("setminspeed 20")
end

function widget:UnitDestroyed(unitID, unitDefID, unitTeamID)
	xp=Spring.GetUnitExperience(unitID)
	unitDefID = Spring.GetUnitDefID(unitID)
	unitDef   = UnitDefs[unitDefID or -1]
	gf=Spring.GetGameFrame()
	fd:write(unitDef.name .. " " .. unitTeamID .. " " .. xp .. " " .. gf .. "\n") 
	--Spring.Echo("Unit "..unitID.." " .. unitDef.name .. " from team "..unitTeamID.." just got destroyed by enemy unit " .. xp)
end

function widget:GameOver()
	allunits=Spring.GetAllUnits()
	fd:write("Game Ended!\n") 
	for i=1, #allunits do
		unitID=allunits[i]
		xp=Spring.GetUnitExperience(unitID)
		unitDefID = Spring.GetUnitDefID(unitID)
		unitDef   = UnitDefs[unitDefID or -1]
		unitTeamID=Spring.GetUnitTeam(unitID)
		fd:write(unitDef.name .. " " .. unitTeamID .. " " .. xp .. "\n") 
	end
	fd:close()
	widgetHandler:RemoveWidget()
	Spring.SendCommands("quitforce")
end
The spring batch launcher: (python)

Code: Select all

import os
import time

time.clock()
i=0
for filename in os.listdir(os.getcwd()+'\\tehdemos\\'):
	cmd='copy .\\tehdemos\\'+filename+' '+filename
	print cmd
	os.system(cmd)
	cmd='spring.exe '+filename
	print cmd
	os.system(cmd)
	cmd='del '+filename
	print cmd
	os.system(cmd)
	i+=1
	print 'Number, total secs', i, int(time.clock())
The plot generator: (python)

Code: Select all

import os
import sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt

names={} #ADD NAMES OF UNITS HERE
d={}
i=0
for filename in os.listdir(os.getcwd()):
	if 'stats' in filename:
		i+=1
		f=open(filename,'r')
		ln=f.readlines()
		f.close()
		ended=0
		for l in ln:
			if 'ended!' in l:
				ended=1
				continue
			l=l.split(' ')
			if len(l)<4:
				continue
			if ended==0 or (ended==1 and float(l[2])>0):
				if l[0] in d:
					d[l[0]].append((float(l[2]),float(l[3])))
				else:
					d[l[0]]=[]
					d[l[0]].append((float(l[2]),float(l[3])))
print 'Processed',i,'files, found',len(d),'unique units'
for k,v in d.iteritems():
	exp=[]
	time=[]
	nonattack=1
	avgexp=0
	for e in v:
		exp.append(e[0])
		avgexp+=e[0]
		time.append(e[1]/(30*60))
		if e[0]>0:
			nonattack=0
	avgexp/=len(exp)
	if nonattack==1 or avgexp<0.0001:
		print names[k] ,'is not an attack unit'
	else:
		print names[k],'is an attack unit'
		fig=plt.figure(1)
		plt.clf()
		plt.plot(time,exp,marker='o',color='b',linestyle='None')
		plt.title(names[k]+' avg exp='+str(avgexp)+' samples='+str(len(time)))
		fig.savefig((names[k]+'.png'),dpi=144)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Experience stats from 250+ replays

Post by knorke »

ah ok.
Known bug: destroying non fully built units also gets logged.
i thought so from all the 0 xp Krogoths ;)
User avatar
Johannes
Posts: 1265
Joined: 17 Sep 2010, 15:49

Re: Experience stats from 250+ replays

Post by Johannes »

1v0ry_k1ng wrote:wow, either the warrior sucks or people suck at the warrior
Maybe, but you can't really tell from these stats. Many units have worse avg xps. If something sucks just judging by these I'd say Maverick, it has low avg xp, and it can't tank damage for other units worth shit either, it's almost purely a damage dealer.


Would be interesting, to also see stats of how long the specific unit lived since it was built instead of since game start.

And note that the way cost is calculated, energy intensive units tend to gain more xp than m based ones compared to how hard they are to build in practice. And units that usually kill mostly those energy intensive units, gain less.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Experience stats from 250+ replays

Post by Neddie »

Not that Mavericks can't be used well, it is just a suboptimal unit choice and frankly a suboptimal factory choice.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Experience stats from 250+ replays

Post by Beherith »

Johannes wrote:And note that the way cost is calculated, energy intensive units tend to gain more xp than m based ones compared to how hard they are to build in practice. And units that usually kill mostly those energy intensive units, gain less.
How so?
User avatar
Johannes
Posts: 1265
Joined: 17 Sep 2010, 15:49

Re: Experience stats from 250+ replays

Post by Johannes »

Beherith wrote:
Johannes wrote:And note that the way cost is calculated, energy intensive units tend to gain more xp than m based ones compared to how hard they are to build in practice. And units that usually kill mostly those energy intensive units, gain less.
How so?
Most of the time 1 metal is less valuable than 60 energy, but in these calculations they're equal. Only if you're running mostly MM based economy it's true.

So if you compare for example, flash (cost 109m/914e -> 124 overall "cost") and peewee (45m/897e -> 60 cost), it's easy to say that flash is still not twice as useful nor twice as hard to build. But flash does gain xp at half the rate of peewee and give twice as much. So when my flashes meet your peewees, it's very likely the peewees will come on top in xp stats in an even battle.
Though in this example, and overall too, it's also a matter of buildtime which isn't calculated into the Cost at all.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Experience stats from 250+ replays

Post by Beherith »

By the time the relatively high E cost units come into play, you have t2 econ.

Also, why buildtime? This graph only (and correctly) measures the success ratio of a player opting for a specific unit, and seeing how much return he got on his resource investment.
User avatar
Johannes
Posts: 1265
Joined: 17 Sep 2010, 15:49

Re: Experience stats from 250+ replays

Post by Johannes »

Because higher buildtime means the player had to invest in more buildpower to build the unit, it's a hidden additional cost that's not included directly on its price tag.

And there aren't many ground units that have higher e/m cost ratio than aks, fleas or pws. Also t1 air units vs most t1 ground.
Or mines even more, though their stats here don't seem to properly include kills gotten after their death.
T2 econ doesn't mean MMs necessarily, if there's enough mexes to upgrade. And with high wind even t1 econ can be quite MM-y.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Experience stats from 250+ replays

Post by Cheesecan »

Good idea, this is a good metric for evaluating balance and finding the flavor of the month.

http://beherith.eat-peet.net/stuff/unitexp/SAM.png
http://beherith.eat-peet.net/stuff/unitexp/Pack0.png

:o
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Experience stats from 250+ replays

Post by Google_Frog »

This is interesting. I don't know exactly how XP works and I doubt many other people know either (if anyone knows and it is simple it would be great if they would post here). I recal something about low reload time units gaining XP faster than high reload time units and I'm pretty sure a units with XP give opponents more XP when they are damaged due to powerScale.

So in short I think you should move away from XP in favour of stat tracking with the unit damaged callin. You would get stats which are easier to understand.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Experience stats from 250+ replays

Post by Beherith »

XP is a great indicator of return on investment: an xp of 0.19 (cause of wierd constants) means a unit has dealt enough damage to kill units of equal cost to itself.
eg: a fatboy killing another fatboy: both get 0.19 xp
A peewee killing a peewee: 0.19 xp
A fatboy killing a fatboy's cost (1600 worth) of peewees: 0.19 xp

So proportional to ( %(of enemy health reduced)*enemy unit cost)/(self cost)
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Experience stats from 250+ replays

Post by SirMaverick »

Nice statistic. More interesting may be X as age of the unit instead of in game time of death in minutes.
BaNa
Posts: 1562
Joined: 09 Sep 2007, 21:05

Re: Experience stats from 250+ replays

Post by BaNa »

interesting comparisons can be made, imo this would be a good base for any balance changes if you want to make them. (for instance sam vs packo -> sam is obv doing much better)
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Experience stats from 250+ replays

Post by Beherith »

Here is the ranking, with nanoframes removed, and only units that actually died tallied (no units left alive after game end were counted in)
Remember 0.19 is break-even
Oddities are the core and arm t2 arty having such a high difference - guess that can be attributed to skill - i may have to rerun and log the ranks of players as well, possibly using only results from veterans.

Code: Select all

Catalyst	0.81183481
Silencer	0.402006402
LLT	0.383447258
Leviathan	0.368404736
LLT	0.354053666
Beamer	0.341532702
HLLT	0.329752323
Pillager	0.314540265
Shiva	0.304821512
Sharpshooter	0.301964109
Buzzsaw	0.295161776
Pit Bull	0.295067922
Gaat Gun	0.294730478
SAM	0.289476295
Sentinel	0.286486193
Defender	0.280817077
Pulverizer	0.279204832
Dragon's Maw	0.278700839
Goliath	0.278219912
Tsunami	0.275327992
Chainsaw	0.267237081
Serpent	0.262688945
Sentry	0.260494336
Rapier	0.259323384
Hurricane	0.257478997
Eradicator	0.256941063
Big Bertha	0.255150545
Doomsday Machine	0.247072756
Luger	0.241180509
Stinger	0.238970237
Fatboy	0.238068067
Sabre	0.236481387
Shredder	0.234009053
Cutlass	0.233704632
Viper	0.233292666
Millennium	0.232390236
Penetrator	0.232304176
Slasher	0.229006377
Guardian	0.227282851
Thunderbolt	0.225612533
Banisher	0.225320354
Samson	0.22424744
Toaster	0.224121851
Pack0	0.221601892
Punisher	0.220430086
Executioner	0.220119557
Storm	0.216355763
Pelican	0.216288451
Urchin	0.214377437
Annihilator	0.211373808
Leveler	0.208657532
Supporter	0.207486227
Juggernaut	0.206751482
Copperhead	0.205497212
Phalanx	0.205252303
Typhoon	0.202036641
Dragon's Claw	0.201696797
Sumo	0.201161389
Nixer	0.200792549
Shark	0.199904902
Poison Arrow	0.197926231
Intimidator	0.197292008
Skimmer	0.193960439
Piranha	0.193591331
Brawler	0.192137152
Decade	0.191724213
Conqueror	0.191533763
Phoenix	0.191279041
Harpoon	0.189284866
Thud	0.188801548
Janus	0.188210449
Enforcer	0.18803482
Screamer	0.187379082
Vulcan	0.186395824
Can	0.186124277
Maelstrom	0.186077609
Crasher	0.185609283
Dominator	0.18512695
Karganeth	0.183879781
Snake	0.183145382
Crusader	0.182214013
Recluse	0.180841915
Shellshocker	0.180732079
Rocko	0.180704688
Wolverine	0.179802902
Jellyfish	0.179296257
Retaliator	0.177546471
Lurker	0.177208501
Archangel	0.175665221
Krogoth	0.174305524
Peewee	0.173857291
Searcher	0.17325151
Jethro	0.173012826
Shadow	0.172709682
Flakker	0.171491058
Thunder	0.171046483
Warlord	0.170688145
Scrubber	0.169943986
Lamprey	0.169774053
Panther	0.168627677
Pyro	0.168065489
Lancet	0.167940337
Stumpy	0.166928285
A.K.	0.166708649
Morty	0.166672195
Catapult	0.166467524
Hawk	0.165516333
Raider	0.164451752
Skeeter	0.163903226
Wombat	0.161171711
Croc	0.160733067
Anemone	0.159890601
Halberd	0.157246255
Zeus	0.156015638
Behemoth	0.155262988
Anaconda	0.154977396
Detonator	0.154427603
Gimp	0.152841711
Vamp	0.152278564
Triton	0.151670061
Fido	0.14853258
Hammer	0.148518628
Messenger	0.148509629
Bulldog	0.147650535
Reaper	0.147643678
Snapper	0.147553927
Razorback	0.146359899
Ambusher	0.145488661
Vanguard	0.143013888
Flash	0.142323599
Merl	0.140453417
Exploiter	0.138557947
Stingray	0.138394128
Moho Exploiter	0.134493919
Avenger	0.134358565
Banshee	0.133139762
Instigator	0.130502653
Freedom Fighter	0.126619579
Warrior	0.125504901
Archer	0.122529475
Liche	0.120898148
Pincer	0.120283217
Slinger	0.119540434
Titan	0.1178728
Garpike	0.116959583
Swatter	0.116511238
Cobra	0.115953916
Maverick	0.11304778
Ranger	0.111702996
Zipper	0.104189689
Tremor	0.103003609
Gremlin	0.102629289
Krow	0.099645685
Voodoo	0.096236315
Mercury	0.095806522
Blade	0.095677868
Diplomat	0.093984143
Weasel	0.086645206
Manticore	0.08474442
Jeffy	0.084606012
Bantha	0.083155778
Moray	0.074818164
Flea	0.074649467
Marauder	0.074289315
Termite	0.074262165
Stiletto	0.062778452
Commander	0.061804483
Commander	0.057698652
Tornado	0.044688118
Bladewing	0.037205689
Spider	0.032825761
Commando	0.025596312
Dragonfly	0.023456459
11	0.013504911
Commander	0.012680355
Kilo	0.006468645
Micro	0.004858742
Mega	0.003386086
110	0.002635396
Commander	0.001417325
1100	0.001265162
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Experience stats from 250+ replays

Post by Cheesecan »

Boy imma make me some more of those 1100's.
User avatar
Johannes
Posts: 1265
Joined: 17 Sep 2010, 15:49

Re: Experience stats from 250+ replays

Post by Johannes »

Cheesecan wrote:Boy imma make me some more of those 1100's.
You should, they're definitely some of the most costefficient, underused units in the game. Even if their kills don't show here properly cause they were dead then.
User avatar
triton
Lobby Moderator
Posts: 330
Joined: 18 Nov 2009, 14:27

Re: Experience stats from 250+ replays

Post by triton »

Eh I'd like to know how many 1vs1s you have on these stats.
Post Reply

Return to “Balanced Annihilation”