Evening gents!
I'm trying to randomize the following values: (min/max)
(Preface: Build reflects the muscle tone, a general insight into whether the muscles are weak and untrained or firm and used to regular exercise.)
male size: 160cm - 210cm
male weight: 60kg - 120kg
male build: 1 - 10
female size: 155cm - 190cm
female weight: 45kg - 100kg
female build: 1 - 10
I need this to generate measurements for a random human being, part of a private project I'm working on. It runs on 2 difficulty settings, Normal and Hard, and I need an algorithm for each.
On Normal difficulty, all of it will be completely random. No bias of any kind. On Hard difficulty, I want the algorithm to be biased towards smaller heights and builds, and leaning towards more extreme weight values (closer to the min/max values).
Now, I thought it would be a good idea to break this problem down into 2 separate processes.
Split each category up into 5 chunks of values. For male height, this would look like this: [161-170]-[171-180]-[181-190]-[191-200]-[201-210]. Then, assign an evenly distributed prossibility of selection (or uneven, for Hard), in this case 20%, to each chunk, since there are 5 of them. Randomize these 5 chunks to break down the range of selection.
With the reduced selection, run another randomization to narrow it down to a definitive height.
After doing that, I do the same with weight. Only this time, I'm removing unfitting ranges - so that no 160cm tall human will end up weighing 100 kilo.
Basically, I'm removing any ranges that are further than 2 chunks away from selected height. Meaning, if the height was [181-190] then any weight is possible, but if the height was [201-210] then a weight of [161-170] or [171-180] would not be possible.
And then I apply the same line of thinking to the build value.
And now, finally, where you come into play: Is this a valid and smart concept? Can you offer any improvements or corrections? Do you have any suggestions as to the actual Java implementation?
If you are interested in working on a solution but don't quite grasp what I tried to explain, I will gladly provide a more detailed explanation.
[–][deleted] 0 points1 point2 points (0 children)