• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:28
CEST 15:28
KST 22:28
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro24 Preview Pt1: Runway112v2 & SC: Evo Complete: Weekend Double Feature3Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18Serral wins EWC 202549
Community News
Weekly Cups (Aug 11-17): MaxPax triples again!10Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195Weekly Cups (Jul 28-Aug 3): herO doubles up6LiuLi Cup - August 2025 Tournaments7
StarCraft 2
General
RSL Revival patreon money discussion thread Is it ok to advertise SC EVO Mod streaming here? Maestros of the Game 2v2 & SC: Evo Complete: Weekend Double Feature Playing 1v1 for Cash? (Read before comment)
Tourneys
Master Swan Open (Global Bronze-Master 2) $5,100+ SEL Season 2 Championship (SC: Evo) Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series LiuLi Cup - August 2025 Tournaments
Strategy
Custom Maps
External Content
Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below Mutation # 484 Magnetic Pull
Brood War
General
BW General Discussion Flash Announces (and Retracts) Hiatus From ASL ASL 20 HYPE VIDEO! New season has just come in ladder [ASL20] Ro24 Preview Pt1: Runway
Tourneys
[ASL20] Ro24 Group C [ASL20] Ro24 Group B [Megathread] Daily Proleagues [ASL20] Ro24 Group A
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Beyond All Reason Stormgate/Frost Giant Megathread Nintendo Switch Thread Total Annihilation Server - TAForever [MMORPG] Tree of Savior (Successor of Ragnarok)
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread The Games Industry And ATVI
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
TeamLiquid Team Shirt On Sale The Automated Ban List
Blogs
The Biochemical Cost of Gami…
TrAiDoS
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1873 users

Random numbers in SC

Blogs > BluzMan
Post a Reply
Normal
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 13:17 GMT
#1
Okay, after seeing a discussion on missrates in SC I became very interested to find them out myself. Like everyone before me, I made a simple test.

Test chamber 1:

Two Protoss Photon cannons attacking each other, one on low ground, another on high ground. Powered by invulnerable pylons to avoid improper targeting, controlled by the AI. Cannon stats:

-8000 hp
-1 damage
-0 shields
-0 armor

Now, this has taken awhile, fortunately, when windowed, SC doesn't need focus to run, so I was free to do other stuff. The results were predictable:

3760/8000 hp which means 4240 hits out of 8000 tries. The resulting percentage is actually so close to 53 (missrate is 46,999999999999999) that it made me totally sure that I just repeated a good experiment and got predictable results. After this, my mind is set on the 53/47 hit/miss chances.

But since I love precision, I decided to conduct another test with slightly different initial conditions.

Test chamber 2:

Instead of one pair of very FAT cannons, I made them 100 hp, but made 13 pairs (coincidence, just that many fit on the map =)). I made 3 rounds of testing and got these results (hp left out of 100):

Round 1:
56, 50, 53, 46, 48, 43, 51, 53, 46, 54, 61, 53, 51
averages at 51.15

Round 2:
50, 51, 46, 48, 50, 47, 67, 47, 50, 57, 45, 58, 55
averages at 51.62

Round 3:
50, 58, 55, 44, 48, 56, 56, 45, 51, 52, 43, 57, 48
averages at 51.0

Total average: 51,26
Cool. Not 53%, but 51%. Interesting already, but wait a minute! That's hp left! It means that the actual hitrate is less than 49%! Idk what made the system behave that way, but it's drastically different and actually below 50.

It was hard to believe such results, even though they look pretty reliable, so I remade the test with 1000 hp cannons.

Results:
526, 515, 540, 463, 511, 529, 525, 533, 526, 512, 549, 515, 512
averages at 519

So it's even 48% chance to hit with such experiment initial conditions.

Possible conclusions:

Well, I don't know. I've already ruled out the global 1% missrate because it shouldn't affect averages when there's two of the same unit shooting each other. The thing we don't know is how global miss and highground miss chances stack, but that should be neglible. The thing that worries me is cooldown creep, that, depending on how it's implemented, might be actually visible regardless of sample size, so I'm redoing the over-time test atm.

But in general, the preliminary conclusions are quite funny - SC is non-ergodical in it's random numbers, meaning that averages over an ensemble differ from those over time. No idea why.

Maybe I've done something wrong with the mapping and just fail to see it. I would very much enjoy you to test them out:

DL should start automatically.

*****
You want 20 good men, but you need a bad pussy.
Caller
Profile Blog Joined September 2007
Poland8075 Posts
October 07 2009 13:20 GMT
#2
do a p with expected values = .5
Watch me fail at Paradox: http://www.teamliquid.net/forum/viewmessage.php?topic_id=397564
FirstBorn
Profile Blog Joined March 2007
Romania3955 Posts
October 07 2009 13:20 GMT
#3
This is pretty interesting actually, I'll try to test it myself.

Also, where have you been lately, I love your posts.
SonuvBob: Yes, the majority of TL is college-aged, and thus clearly stupid.
motbob
Profile Blog Joined July 2008
United States12546 Posts
Last Edited: 2009-10-07 13:26:31
October 07 2009 13:24 GMT
#4
On October 07 2009 22:20 Caller wrote:
do a p with expected values = .5

There's no way statistically that the EV of cannon damage on his first test is .5
ModeratorGood content always wins.
Konni
Profile Blog Joined February 2003
Germany3044 Posts
October 07 2009 13:25 GMT
#5
first off, shouldn't the missed shots be more like 3/10 of 8000? So 2400, not 3760?
second, what about the shields? don't they regenerate even if you started at 0?
third, starcraft is deterministic - which means: if you repeat an experiment with the same conditions you will get the same result (otherwise replays wouldn't work)
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 13:31 GMT
#6
Now I have a strong feeling that I fucked up somewhere, that's why I posted this under blogs. But if different people get the same results, it might be very interesting. I'm thinking about increasing the ensemble size to, say, 100, and looking what happens.

The thing is that the jump from 53% to 48% is a 10% decrease in effective DPS which is something you could actually feel in a game.
You want 20 good men, but you need a bad pussy.
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 13:43 GMT
#7
On October 07 2009 22:25 Konni wrote:
first off, shouldn't the missed shots be more like 3/10 of 8000? So 2400, not 3760?
second, what about the shields? don't they regenerate even if you started at 0?
third, starcraft is deterministic - which means: if you repeat an experiment with the same conditions you will get the same result (otherwise replays wouldn't work)


1) Oh no, the whole thing is about a set of test that made it obvious that the hit rate is very very far from 70%.

Read this thread.

2) Max shields were set to 0, so it was 0/0 all the time. Well, yes, to be perfectly precise I should've found that old .dat editor and disabled shields completely, but I figured that 0/0 would do as well.

3) Starcraft is deterministic, but when you start a game, you get a new random number generator seed that makes you receive different random numbers with unchanged user input. Replays work because they also save and load the RNG seed.

Protoss was chosen because zerg buildings regenerate and terran buildings burn. Both disrupt the experiment. Terran units controlled by the AI don't burn or regen, but they sometimes freak out and start wandering around instead of shooting even though they are in range and have a map revealer (possibly because AI doesn't use fog of war and instead tries to emulate high ground invisibility by some other mechanism). Sieged tanks are an exception, their AI is good, but unfortunately their splash deals fractional damage even when it misses.
You want 20 good men, but you need a bad pussy.
arcology
Profile Joined April 2009
United States92 Posts
Last Edited: 2009-10-07 13:49:03
October 07 2009 13:47 GMT
#8
3760/8000 hp which means 4240 hits out of 8000 tries. The resulting percentage is actually so close to 53 (missrate is 46,999999999999999)

rofl, you need an upgrade on whatever calculator you used for that.. obviously its exactly 53/47, not 46.9999999999999, did you really believe that?
As for replays, the randomness is correlated to game time, or remembers a number that is input into the RNG for that game.
Pholon
Profile Blog Joined March 2008
Netherlands6142 Posts
October 07 2009 13:47 GMT
#9
Add to LP please
Moderator@TLPholon // "I need a third hand to facepalm right now"
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 13:56 GMT
#10
On October 07 2009 22:47 arcology wrote:
Show nested quote +
3760/8000 hp which means 4240 hits out of 8000 tries. The resulting percentage is actually so close to 53 (missrate is 46,999999999999999)

rofl, you need an upgrade on whatever calculator you used for that.. obviously its exactly 53/47, not 46.9999999999999, did you really believe that?
As for replays, the randomness is correlated to game time, or remembers a number that is input into the RNG for that game.


I used IEEE floating point. Well, yeah, it's obviosly a floating point precision error, with integers it's exactly 53, my bad.
You want 20 good men, but you need a bad pussy.
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
October 07 2009 13:57 GMT
#11
Could the hit chance be 49%? Blizzard says it is 70%, and if they accidentally checked the hit chance twice instead of once, we'd get 0.7² = 0.49 hit chance.
Black Gun
Profile Blog Joined July 2009
Germany4482 Posts
October 07 2009 13:58 GMT
#12
have u tried it with 2 fat cannons? i could imagine that sc can only handle a limited amount of required random number generations per timeframe.
"What am I supposed to do against this?" - "Lose!" :-]
igotmyown
Profile Blog Joined April 2009
United States4291 Posts
October 07 2009 13:59 GMT
#13
Do they have vision of each other?
RaGe
Profile Blog Joined July 2004
Belgium9947 Posts
October 07 2009 14:02 GMT
#14
Did the lowground cannon have vision of the high ground one with an invulnerable observer or something? I think the sightrange thing might have skewed your results.
Moderatorsometimes I get intimidated by the size of my right testicle
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 14:03 GMT
#15
On October 07 2009 22:57 Scorch wrote:
Could the hit chance be 49%? Blizzard says it is 70%, and if they accidentally checked the hit chance twice instead of once, we'd get 0.7² = 0.49 hit chance.


That's an obvious thing to think, but most people who did single-unit tests reported numbers around 53%, not 49%. It's not the main point of the thread, even though the nature of this percentage is alone an interesting topic. The puzzling thing is why the numbers differ for different numbers of units.
You want 20 good men, but you need a bad pussy.
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
Last Edited: 2009-10-07 14:14:14
October 07 2009 14:06 GMT
#16
On October 07 2009 23:02 RaGe wrote:
Did the lowground cannon have vision of the high ground one with an invulnerable observer or something? I think the sightrange thing might have skewed your results.


Good point. I'll doublecheck.

Yes! I looked at the table and yes the initial cannon that had a map revealer over the cliff posts (apparently I placed the other revealers for the player but forgot them for the AI) stable results of lower hp than the other ones (in all tests cannon number 4). I think you've hit the jackpot, thanks.

Well, there's still a conclusion to make:

1) It's still not 70%, something closer to 53%. Source of such percentage unknown.
2) Even though a unit on cliff reveals itself by firing, you have slightly more effective DPS when you have a spotter.

Point two might actually find some use in games. I think that case is closed for the moment, I'll just rerun a test with revealers to clarify. Thank you RaGe.
You want 20 good men, but you need a bad pussy.
madnessman
Profile Blog Joined May 2009
United States1581 Posts
October 07 2009 14:06 GMT
#17
On October 07 2009 22:24 motbob wrote:
Show nested quote +
On October 07 2009 22:20 Caller wrote:
do a p with expected values = .5

There's no way statistically that the EV of cannon damage on his first test is .5


oh my god stats... give me a while to remember how to the stat functions on my calculator and i'll try to post some tests.
Sadistx
Profile Blog Joined February 2009
Zimbabwe5568 Posts
October 07 2009 14:10 GMT
#18
You realize the cannon on the bottom misses the first shot right? There's your 0.5%, so you're actually at something like 50.76 average hp left, which is well within something like a 99% confidence interval for it to be 50%.

aseq
Profile Joined January 2003
Netherlands3978 Posts
October 07 2009 14:23 GMT
#19
Hmm, i think Blizzard did state at some point that it was 70%. It may have felt like less in some games, but how was I going to doubt something Blizzard said? From these results, i'd think a plain 50% is most likely, I doubt they'd make it 50.5% or 51%, what's the point?
Konni
Profile Blog Joined February 2003
Germany3044 Posts
October 07 2009 14:30 GMT
#20
Thanks for clearing my questions and nice detective work there!
Ota Solgryn
Profile Blog Joined January 2008
Denmark2011 Posts
October 07 2009 14:43 GMT
#21
One thing. Dont buildings have 1 armor? I pretty sure they do when e.g. a ling attacks a building.
ihasaKAROT: "Wish people would stop wasting their lives on finding flaws in others"
Nitrogen
Profile Blog Joined February 2008
United States5345 Posts
October 07 2009 14:50 GMT
#22
i think some buildings have armor, but cannons aren't one of them.
UNFUCK YOURSELF
jello_biafra
Profile Blog Joined September 2004
United Kingdom6635 Posts
Last Edited: 2009-10-07 14:59:32
October 07 2009 14:59 GMT
#23
jtan did this earlier this year: http://www.teamliquid.net/forum/viewmessage.php?topic_id=87658

He got a similar result to you.
The road to hell is paved with good intentions | aka Probert[PaiN] @ iccup / godlikeparagon @ twitch | my BW stream: http://www.teamliquid.net/video/streams/jello_biafra
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 15:06 GMT
#24
You can set armor to 0 in the editor.

Rerun the test for one cannon - ended up with 3720 hp which is exactly 53.5% of hit rate.
You want 20 good men, but you need a bad pussy.
Heyoka
Profile Blog Joined March 2008
Katowice25012 Posts
October 07 2009 15:26 GMT
#25
Good work, this is a cool test
@RealHeyoka | ESL / DreamHack StarCraft Lead
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
October 07 2009 15:38 GMT
#26
Okay, I've rerun the 1000 hp test for 13 cannons, the average hp ended up 469 with map revealers which is a good correlation to the one-cannon test, being a 53,1% chance. Now case definetely closed.
You want 20 good men, but you need a bad pussy.
Leath
Profile Blog Joined July 2006
Canada1724 Posts
October 07 2009 20:31 GMT
#27
There are factors at work that might influece:

Presence of doodads (trees)

Unit firing rate variation: Sometimes two units fight against each other will display different refresh rates for unknown reason. Like, tell two scvs to attack each other, even if the attacks are synchronized initially, they will start taking turn later on, because one scv is attacking faster than the other (yes, weird)

Did you test to see if it is a building issue? Maybe because the building takes several matrices? Try a marine vs a marine with 8000 HP, doing 1 damage. =)

Could you also test if cliff + tress adds up? Cuz Im pretty sure it does.
Can you also test tress alone?
Can you also test several tress stacked?

Thanks ^^
http://www.kongregate.com/?referrer=Sagess
538
Profile Blog Joined November 2008
Hungary3932 Posts
October 13 2009 17:41 GMT
#28
I think all this testing and insecurity could be settled if someone competent (like R1CH?) dug up the game code, and worked out how does the miss chance work, and what is the mathematical/logical reason that its not 70%, as Blizzard claimed.
BW fighting!
Normal
Please log in or register to reply.
Live Events Refresh
WardiTV Summer Champion…
11:00
Group Stage 2 - Group B
Clem vs goblin
ByuN vs SHIN
WardiTV910
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Harstem 336
Rex 154
ProTech39
trigger 12
EnDerr 9
StarCraft: Brood War
Britney 50721
Calm 12025
Bisu 3385
Jaedong 1116
EffOrt 767
firebathero 747
BeSt 486
ggaemo 328
Stork 311
ZerO 254
[ Show more ]
Light 239
Last 214
Soulkey 184
Hyun 114
Barracks 111
Snow 111
Mind 102
hero 96
Rush 80
Nal_rA 60
TY 59
Movie 56
Backho 26
Icarus 25
Sacsri 22
sorry 20
scan(afreeca) 14
JulyZerg 12
JYJ12
Terrorterran 8
IntoTheRainbow 7
ivOry 4
actioN 0
Dota 2
Gorgc7464
qojqva2096
XcaliburYe264
Fuzer 205
League of Legends
Dendi975
Counter-Strike
hiko590
edward57
Super Smash Bros
Mew2King79
Other Games
singsing2000
B2W.Neo1710
DeMusliM474
crisheroes458
XaKoH 155
ToD86
ArmadaUGS67
QueenE37
Trikslyr30
ZerO(Twitch)2
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• davetesta14
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 28
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV526
• C_a_k_e 283
League of Legends
• Nemesis3358
• Jankos1114
Upcoming Events
Online Event
10h 32m
The PondCast
20h 32m
WardiTV Summer Champion…
21h 32m
Zoun vs Bunny
herO vs Solar
Replay Cast
1d 10h
LiuLi Cup
1d 21h
BSL Team Wars
2 days
Team Hawk vs Team Dewalt
Korean StarCraft League
2 days
CranKy Ducklings
2 days
SC Evo League
2 days
WardiTV Summer Champion…
2 days
Classic vs Percival
Spirit vs NightMare
[ Show More ]
CSO Cup
3 days
[BSL 2025] Weekly
3 days
Sparkling Tuna Cup
3 days
SC Evo League
3 days
BSL Team Wars
4 days
Team Bonyth vs Team Sziky
Afreeca Starleague
4 days
Queen vs HyuN
EffOrt vs Calm
Wardi Open
4 days
Replay Cast
5 days
Afreeca Starleague
5 days
Rush vs TBD
Jaedong vs Mong
Afreeca Starleague
6 days
herO vs TBD
Royal vs Barracks
Liquipedia Results

Completed

Jiahua Invitational
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSLAN 3
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.