Would it be reasonable to allow larger values in `GameEntityCounterTable`?
Is your feature request related to a problem? Please describe.
When using a counter-doubling ability (CountersMultiplyEffect), the game hangs when you reach a certain number of counters--which looks like it's around the maximum size of Integer. There's no solution besides forcing the game closed when this happens.
Describe the solution you'd like
Would there be other undesirable side effects to using a larger number type for the counter values in a GameEntityCounterTable; like Map<CounterType, Long> instead of Map<CounterType, Integer>?
Describe alternatives you've considered
Possibly just setting an arbitrary limit, lower than the Integer limit, to the number of counters on a GameEntityCounterTable.
Additional context GameEntityCounterTable source
It isn't just the CounterTable
because the Limit needs to be updated for all functions around too
Of course, there'll be a bit of a ripple effect in type changes, but my question is whether that might functionally cause issues.
This issue has not been updated in a while and has now been marked as stale. Stale messages will be auto closed.
I think the moment your counters would overflow over Integer values, it probably wouldn't take that long for them to overflow over Long values too
Someday it'd be nice to allow arbitrarily large numbers but the ripple from that would be very far-reaching. It'd at minimum hit player life, mana pools, power and toughness, any other card effects that look at the aforementioned values, and quantity of tokens created (which is already problematic). And yeah, it wouldn't be enough to go to Long values since that's just kicking the can down the road. BigInts can go as high as you want but I suspect simply swapping them in everywhere would have a substantial impact on performance, and would be very awkward to write code around since they don't use the standard operators.
In the short term, capping it to keep it from causing problems might be a more appropriate solution. If the number of counters (or any other of those number values for that matter) would go past a million or some other high bar, just clamp it there. Less accurate, but avoids the instability and works in most cases.
This issue has not been updated in a while and has now been marked as stale. Stale messages will be auto closed.