(My game called star system generator) Give rarity percentage based on pie chart for orbital spacing of next planets. Semi-major axis of previous planet * Multiplication number range = Semi-major axis of next planet.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
To create a set of rarity percentages for the orbital spacing of planets in your star system generator, you can divide the possible ranges for the multiplication number into segments and assign each segment a probability. This will be visually represented by a pie chart where each segment corresponds to a specific range of multiplication numbers. Here's a step-by-step guide to determine these percentages:
Define the Multiplication Number Ranges: Decide on a logical set of ranges for the multiplication numbers. For example:
Range 1: 1.1 to 1.5
Range 2: 1.6 to 2.0
Range 3: 2.1 to 2.5
Range 4: 2.6 to 3.0
Range 5: 3.1 to 3.5
Assign Rarity Percentages: Assign a rarity percentage to each range based on how probable or rare you want each range to be in terms of orbital spacing. Ensure the total adds up to 100%. An example distribution could be:
Range 1: 1.1 to 1.5 — 40% (Most common)
Range 2: 1.6 to 2.0 — 30%
Range 3: 2.1 to 2.5 — 15%
Range 4: 2.6 to 3.0 — 10%
Range 5: 3.1 to 3.5 — 5% (Rarest)
Validate and Adjust: Make sure the assigned percentages align with the desired frequency distribution in the game. Adjust as necessary to get the right balance.
With these ranges and percentages defined, you can create a pie chart that visually represents the rarity distribution:
code
Pie Chart Representation:
_____________________________
| |
| |
| 40% 30% 15% 10% 5% |
| 🟦 🟩 🟨 🟥 🟪 |
| |
-------------------------------
Pie Chart Key:
Range 1: 1.1 to 1.5 — 40% (🟦)
Range 2: 1.6 to 2.0 — 30% (🟩)
Range 3: 2.1 to 2.5 — 15% (🟨)
Range 4: 2.6 to 3.0 — 10% (🟥)
Range 5: 3.1 to 3.5 — 5% (🟪)
Implementation Example in Pseudocode:
pseudo
function getNextPlanetSemiMajorAxis(previousSemimajorAxis):
ranges = {
{1.1, 1.5} : 40,
{1.6, 2.0} : 30,
{2.1, 2.5} : 15,
{2.6, 3.0} : 10,
{3.1, 3.5} : 5
}
roll = random(1, 100)
sum = 0
for range, weight in ranges:
sum += weight
if roll <= sum:
multiplier = random(range[0], range[1])
return previousSemimajorAxis * multiplier
# fallback in rare case where something goes wrong
return previousSemimajorAxis * 1.5
This pseudocode assumes you have a random number generator utility and a way to randomly select a number within a given range. The function considers the previous semi-major axis, rolls a random number to determine the range based on rarity percentages, and then computes the next planet's semi-major axis.
By using this method, you ensure that your star system generator produces orbital spacing with the desired variety and rarity.