2.147 billion score and 32 bit int overflow possible with the new scoring system

SeanPoeSeanPoe Member, Early Access
edited April 20 in Bugs & Technical Issues
With the new multiplier-based score system it is now theoretically possible to exceed 2.147 billion score through legitimate means (i.e., without using any bugs) which will result in the number exceeding the 32 bit int maximum value and flipping to a negative number (-2.147 billion) before incrementing back up again.  This is most likely only possible in 3-man groups and would only require wave 25 on an endless map with zero deaths and an 'old' score of 63 million (and some 3-man groups were even getting over 150 mil before 2.0, so technically 5.1 bil is even possible in 2.0).  This should probably be looked at and remedied before it's an obvious problem. 

The easiest way to fix this problem would be to reduce the score value of kills (and combo kills) by ~66% but that would require another leaderboard reset.  Since time and coin are no longer part of the score calculation, reducing the score value of minion kills would have no impact on the ratio of score contribution (since the score is 100% based on kills now with an end-of-game multiplier applied to that kill score) other than reducing the overall size of the number.  With a ~66% reduction that would put the theoretical max at ~1.650 bil.


  • TimeMasterTimeMaster Member, Early Access
    I tried warning @ShadeDev about this too :P

    Did myself some theoretical calculations before too:

  • SeanPoeSeanPoe Member, Early Access
    edited April 21
    I actually just realized there's another problem that is making this issue worse and more obvious: the bonus score for each additional endless wave is completely broken.  It's supposed to be an additive 15% increase in score per wave over 5 ((wave number - 5)*0.15+1)  but instead it's a multiplicative bonus that compounds per wave over 5 [1.15^(wave number + 1 - 5)]. So, for example, getting to wave 25 would multiply the total kill score by ~19 (1.15^(25 + 1 - 5)) instead of 4 ((25 - 5)*0.15+1). 

    Even if the endless multiplier worked correctly it would still be possible for a 3-man group to exceed the maximum 32 bit int value by getting to around wave 40 with no deaths and an 'old' (pre-2.0) score of ~200 mil (which was possible).  So there's two distinctively different problems with the scoring system: wrong endless multiplier and the possibility to get an int overflow (even if the multiplier was working as intended). 

    Post edited by SeanPoe on
  • ShadeDevShadeDev Member, Robot Entertainment, Early Access, Apprentice Founder, Featured Developer
    It's not supposed to be additive, it's supposed to be exponential.
    Doug Houserman
    Robot Entertainment | Lead Balance Designer
  • SeanPoeSeanPoe Member, Early Access
    edited April 21
    But what about the integer overflow problem?  Most 3-man groups that seriously try for score will be able to exceed a 2.147 billion score.  With an exponential score bonus you would only need to get to wave 35-42 with very low average combos (only 10-12x) and a good combo group could hit the integer max with as little as 18 waves (with 20x average combo). Even a solo player (and definitely a 2-man group) will run into integer overflow problems on the easier endless maps (the baths and throne room). 
  • nthornnthorn Member
    edited April 21
    probably not an issue. there are a few ways to get around overflow and still use huge numbers.
  • SeanPoeSeanPoe Member, Early Access
    In the past there's been ways to get over 2.147 billion score (as well as 2.147 billion hero or trap damage) and it has always resulted in overflow. 
  • nthornnthorn Member
    okay then there is a problem. i forgot about the people with those high scores a couple patches back
  • JuicyJuicy Member, Master Founder, Early Access
    :). Programatically though, that could have been fixed.
    Wiki Contributor: Juicearific - Got a wiki suggestion? Let me know.
    Welcome to Juicy's Midnight Assassination Service. You grab em, I'll stab em.
  • SeanPoeSeanPoe Member, Early Access
    edited 4:03AM
    Here's proof that it's possible for even a solo player to hit the integer max value.  I could have kept going for at least 1-2 more waves but decided to lose on purpose before getting an integer overflow since my last wave change gave me around 200 mil score; another wave would have put me at around 2.4bil.  This was also only my first try (and only second time ever on Endless Baths), I brought the wrong traps and traits and made a lot of build mistakes, but even with all those problems I could have hit the integer max, which really shows that the current scoring system needs some changes OR there needs to be a change to how overflow is handled.   

    Post edited by SeanPoe at
Sign In or Register to comment.