Closed PythooonUser closed 4 years ago
Conversely, what do you think about adding a levelTemplateWeight
float field to the Level
object?
So the array approach is taken from the project, as I saw a lot of it being used. E.g. room
and mainRooms
in the room builders.
Having a levelTemplateWeight
on the Level
object might be confusing? It only serves a purpose in that particular szenario. So maybe a new class LevelTemplate
might be interesting?
How would such a weighting be validated? The user needs to make sure everything adds up to 1f
ideally. If it does not, which template probability gets adjusted? Or should the max/sum weight be taken and then each individual template weight be normalized?
Do you feel controlling the weights using an array is not conrete enough? Do you want to be able to set exact values?
Summary
Refactors the class
SectionDefinition
. Now picks a level template at random which fixes #114. A new propertylevelTemplateDistribution
can be used insection.dat
to alter the spawn probabilities. It refers to the index of a level template of thelevelTemplates
property. IflevelTemplateDistribution
is not given, the probabilities are equal.The following example simulates a possible scenario of common, uncommon and rare level templates.
Could be useful to define an example section with this new feature in #118.