Slay the Spire

Slay the Spire

Hubris
Aphid 17 Feb, 2019 @ 4:14pm
Breaking the game with Zylophone.
I'm not sure whether this is a 'bug' per se...
I've been thinking a bit about this, and I think zylophone is actually the main enabler of broken things with any card that doubles things.

See my post at:

https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/1610056683/3203652426717107638/

The gist of this is that: Zylophone can break the game if you can get over 30 energy worth of X cost played (not that hard with chemical X and echo form effects), minus 1 energy for every power-of-two of the doubled resource present. For the basic "catalyst+" card even less is required as each catalyst triples.

N.l. ceil(3log(2^31-1)) energy. ( This ends up being 20 energy, or 10 energy with an echo potion. Even easier to get.).

It turns out most of the effects and things are stored as integers. Which cap at 2147483647. Unfortunately the game doesn't check for integer overflow when it does math, but it simply does UndefinedBehaviour instead. (Which, on x86, ends up being "ignore the higher order bits, and interpret the 32nd bit as a sign bit")

I wonder if you could trigger this in the base game with nightmare/catalyst against the heart. It seems possible, if a little contrived; you would have to go out of your way to do it.

Not sure how to exactly fix it, this seems like a tricky problem. Maybe the base game spire devs should enable variable promotion for big numbers, or check for overflow?

< >
Showing 1-3 of 3 comments
bigfuzzymonster 24 Feb, 2019 @ 8:46am 
Haven't experimented a lot with this, but I encountered something similar. Necromancer mod has a skill that doubles all of an enemies debuffs, and I xylophoned that. Negative strength seemed to cap at -999. Poison I could get really high (did not track the values), and I wasn't surprised when I got it to go negative via a sign bit. As I also had Catalyst+ in my deck, I played one the next turn, and it returned the poison to a positive number (I think of a smaller magnitude, but still large). I didn't really care to experiment too much with it.
Romain672 7 Sep, 2019 @ 4:47am 
I wonder if putting a limit of use at like 10 would be good or not.
It cancel some otk combo, but perhaps it limit some bugs like that.
And the limit isn't a problem without ice cream (and perhaps double energy card).
noel.set 14 Mar, 2021 @ 10:20am 
Even without an absurd amount of energy, Zylophone seems super strong. Zylophone on After Image+ has more or less trivialized my current run. I think it should be limited to Attacks and Skills.
< >
Showing 1-3 of 3 comments
Per page: 1530 50