Open Nesseley opened 3 years ago
Great idea!
I think the concept of class limits could use a bit of a dusting off and a rework, but we don't really have a lot of info to go by in terms of how much they're used and how limited they are - maybe we can add a metrics chart for checking if any arenas have modified class limits.
Perhaps what I think is the biggest drawback of the proposed solution is the ambiguity when the number is greater than 1. What does Healer, Mage: 2
mean? Does it mean that Healer+Healer, Mage+Mage, and Healer+Mage are all allowed? Or is it still only mutual exclusion, so Healer+Mage is not allowed?
I'd like to break the concept open a bit to explore what kind of expressive power we could potentially build here. Mutual exclusion of two classes is just one take. Minimum requirements could be a thing as well. Say an arena has a wave that requires a ranged class for some reason, arena designers could put in a requirement of "minimum 1 archer". To expand upon the idea of mutual exclusion itself, instead of capping at 1, it might be desirable to say "you can't have both healers and mages in your party, but pick one and bring as many as you want". This could open up a "one for all"-style of arena, where everyone has to play a given class.
Here is an idea...
If we think of class limits as a set of individually configurable rules, we can say that a rule is either fulfilled or broken. A broken rule will prevent the session from starting. When all rules are fulfilled, the session can begin. A class limit rule consists of a subject (the classes), and a condition in the form of a value and a comparison operator. A higher-order rule is a grouping of rules that requires either none, any, all, or a configurable number of its sub-rules to be fulfilled.
So, the class limits section becomes a list rather than a map. Let's assume for the sake of brevity that we can use a syntax like <class> <operator> <value>
, so e.g. Knight <= 1
means "at most one Knight", and Knight > 0
means "at least one Knight".
I'll work out a couple of examples...
Mutual exclusion of Healers and Mages (example from the OP). The first two rules work like the current class limits, at most one of each. The higher-order third rule says "at most one of my sub-rules", and the two sub-rules are "at least one Healer" and "at least one Mage". Because the higher-order rule is only fulfilled if at most one (i.e. zero or one) if its sub-rules are fulfilled, it will break if a player picks a Healer if someone else has already picked a Mage, even though the first two rules are okay with it.
class-limits:
- Healer <= 1
- Mage <= 1
- condition: <= 1
rules:
- Healer > 0
- Mage > 0
One for all of Tanks, Knights, and Archers. Same as above, except there is no limit on any of the classes. Only the higher-order mutual exclusion rule applies, and this time it means "exactly one sub-rule must be true". This does become an exercise in keeping the class limits section and the classes section synchronized when new classes are introduced.
class-limilts:
- condition: = 1
rules:
- Tank > 0
- Knight > 0
- Archer > 0
Minimum requirement of two Archers for an arena with a ranged-only wave. No limits on any other classes.
class-limits:
- Archer >= 2
Something complex where we combine rules into something whack. This definition allows at most 2x Oddjob, requires a Healer+Tank combo or exactly two Knights, and Healers and Mages are mutually exclusive but otherwise limitless.
class-limits:
- Oddjob <= 2
- condition: = 1
rules:
- condition: = 2
rules:
- Healer = 1
- Tank = 1
- Knight = 2
- condition: <= 1
rules:
- Healer > 0
- Mage > 0
This is definitely a little more involved than just tacking , Mage
on to an existing definition, but I also think it's a little more explicit what exactly the definitions mean, albeit a bit convoluted. Maybe we can work on something easier to understand than the comparison operators, or perhaps we can change some of the wording.
Feature request
Short description You should be able to set a class-limit for multiple classes. Say, I sell a better healer-class for ingame cash than the default one. I don't want TWO healers in my arena, but technically they can, as you can only limit each class to none or one.
Implementation details The config could look something like this:
or the class-limits could be reworked to this:
This does look worse, and I prefer the first one but I spent some time making it and it is an option so why not include it ¯_(ツ)_/¯