Our levels are going to split up into zones. Each zone can support being 1 to many of 3 types: A, B or C. When the level is generated, we have to set the level to be only 1 of its supported types. Each level will be set to require a certain amount of zones of each type: Required Constraints.
Example:
Zone 1 - A or C
Zone 2 - A or B or C
Zone 3 - B or C
Zone 4 - B
Required Constraints: 2 x A, 1 x B, 1 x C.
In this example the only solution would be:
Zone 1 - A
Zone 2 - A
Zone 3 - C
Zone 4 - B
How can we determine that constraints are supported within zones? I figure there a way to count the possible combinations/permutations with the given data. If there are any, then its valid data?
How do I ensure that we are dynamically picking the proper type for each zone? For instance, in the example above, if we set Zone 1 to be C, we wouldnt have enough A type zones in the level.
I think that we would chose the type(A/B/C) that is represented in the zones the least and prioritize those requirements first. So in the example above there are: 2 x A, 3 x B and 3 x C. So, we would set one of the zones that can be of type A to type A. Rinse and repeat with whatever the current smallest type left, which in this case would be A again. This is not guaranteed to work for all data sets.
If this is not the proper place to put this kind of question, I apologize. It seems more of a math problem than anything else.
~Thanks