DayTrippers Planet Generation System

Apr 17, 2025

The interstellar destination below was created using the DayTrippers Planet Generation rules (now in beta testing). Click here to generate another one.

0) {
$planetCount += rand(1,6);
$planetCountDice–;
}
return $planetCount;
}

function planetSize($planetMod) {
$planetSizeArray = array(“”, “”, “Small Rock Planet”, “Small Rock Planet”, “Asteroid”, “Moon”, “Artificial Satellite”, “Medium Rock Planet”, “Large Rock Planet”, “Gas Giant”, “Gas Giant”, “Gas Giant”, “Rogue Planet”);
$gravityModArray = array(0, 0, -3, -3, -3, -5, -2, -1, 0, 5, 5, 5, -3);
$planetSizeRoll = rand(1,6) + rand(1,6) + $planetMod;
if($planetSizeRoll < 2) { $planetSizeRoll = 2; } if($planetSizeRoll > 12) {
$planetSizeRoll = 12;
}
$planetSize = $planetSizeArray[$planetSizeRoll];
$gravityMod = $gravityModArray[$planetSizeRoll];
return array($planetSize, $gravityMod);
}

function gravity($gravityMod) {
$gravityBase = 0;
$divide = 0;
$gravityArray = array(“”, “”, “12”, “12”, “12”, “11”, “11”, “1”, “2”, “2”, “2”, “4”, “4”, “4”, “6”);
$atmoModArray = array(0, 0, -2, -2, -2, -1, -1, 0, 3, 3, 3, 5, 5, 5, 6);
$gravityRoll = rand(1,6) + rand(1,6) + $gravityMod;
if($gravityRoll < 2) { $gravityRoll = 2; } if($gravityRoll > 14) {
$gravityRoll = 14;
}
$gravityVal = $gravityArray[$gravityRoll];
if($gravityVal > 10) {
$gravityVal -= 10;
$divide = 1;
}
while($gravityVal > 0) {
$gravityBase += rand(1,6);
$gravityVal–;
}
if($divide) {
$gravity = number_format(1 / $gravityBase, 2);
} else {
$gravity = $gravityBase;
}
$atmoMod = $atmoModArray[$gravityRoll];
return array($gravity, $atmoMod);
}

function atmosphere($atmoMod, $gravity = 1) {
$atmoArray = array(“”, “”, “Atmosphere is escaping the planet”, “Atmosphere is escaping the planet”, “Atmosphere is escaping the planet”, “Extremely thin, no Oxygen”, “Chlorine”, “Carbon Dioxide”, “Nitrogen/Oxygen with heavy gases, Propane, Butane”, “Dense Air (Nitrogen/Oxygen)”, “Nitrogen/Oxygen with Ozone in Stratosphere”, “Nitrogen/Oxygen with trace toxins”, “Ammonia & Methane”, “Hydrogen & Helium”, “Exotic toxic gases”);
$waterModArray = array(0, 0, -6, -6, -6, -6, -4, -3, -2, -1, 1, 0, -4, -5, -6);
$atmosphereRoll = rand(1,6) + rand(1,6) + $atmoMod;
if($atmosphereRoll < 2) { $atmosphereRoll = 2; } if($atmosphereRoll > 14) {
$atmosphereRoll = 14;
}
$atmosphere = $atmoArray[$atmosphereRoll];
$waterMod = $waterModArray[$atmosphereRoll];
$pressure = $atmosphereRoll * $gravity;
return array($atmosphere, $waterMod, $pressure);
}

function water($waterMod) {
$waterArray = array(“”, “”, “No standing water”, “Arid rock/desert world, very little standing water”, “Arid rock/desert world, very little standing water”, “Arid rock/desert world, very little standing water”, “Semi-Arid world, water frozen or beneath surface”, “land”, “land”, “Ocean world”, “Water vapor makes up most of the atmosphere”);
$waterRoll = rand(1,6) + rand(1,6) + $waterMod;
if($waterRoll < 2) { $waterRoll = 2; } if($waterRoll > 10) {
$waterRoll = 10;
}
$water = $waterArray[$waterRoll];
return $water;
}

function climate() {
$climateArray = array(“”, “”, “Frozen solid; ice & rock”, “Frozen solid; ice & rock”, “Arctic conditions”, “Arctic conditions”, “Cold”, “Temperate”, “Hot”, “Greenhouse conditions”, “Greenhouse conditions”, “Wildly variable”, “Hellish”);
$precipDLArray = array(0, 0, 0, 0, 5, 5, 6, 7, 9, 8, 8, 5, 10);
$climateRoll = rand(1,6) + rand(1,6);
if($climateRoll < 2) { $climateRoll = 2; } if($climateRoll > 12) {
$climateRoll = 12;
}
$climate = $climateArray[$climateRoll];
$precipDL = $precipDLArray[$climateRoll];
return array($climate, $precipDL);
}

function biosphere() {
$biosphereArray = array(“”, “”, “Biotoxins in atmosphere”, “Biotoxins in atmosphere”, “No life”, “No life”, “Proto-organisms in suspension”, “Proto-organisms and non-mobile lifeforms”, “Non-sentient lower lifeforms”, “Sentient lifeforms”, “Sentient lifeforms”, “Highly evolved lifeforms”, “Highly evolved lifeforms”);
$biosphereRoll = rand(1,6) + rand(1,6);
$biosphere = $biosphereArray[$biosphereRoll];
return $biosphere;
}

/* BIDNEZ */

$starIndex = 0;
$starType = ‘Star’;
$stars = array();
$planetName = planetName();

$starSizeData = starSize();
/*
$stars[0][‘starSize’] = $starSizeData[0];
$stars[0][‘colorMod’] = $starSizeData[1];
$stars[0][‘planetMod’] = $starSizeData[2];
*/
$starSize = $starSizeData[0];
$colorMod = $starSizeData[1];
$planetMod = $starSizeData[2];

$starColorData = starColor($colorMod, 0); // 1=forcespecial 0=dont
$starColor = $starColorData[0];
$planetCountDice = $starColorData[1];
if($starColor == ‘Special’) {
$starSpecial = specialStar();
$starType = $starSpecial;
switch($starSpecial) {
case ‘Dwarf’ :
$starSize = ‘less than 0.1 times ‘;
$starType = ‘Dwarf Star’;
$starColorData = starColor(0);
$starColor = $starColorData[0];
if($starColor == ‘Special’) {
$starColor = ‘Black’;
}
break;
case ‘Cluster’ :
$starType = ‘Star’;
$starIndex++;
$starColorData = starColor(0);
$starColor = $starColorData[0];
if($starColor == ‘Special’) {
$starSize = ‘- tiny compared to ‘;
$starType = ‘Neutron Star’;
$starColor = ”;
}
break;
case ‘Nova’ :
$starSize = (rand(1,6) * rand(1,6) * 10) . ‘ light-years across’;
$starColor = ”;
break;
case ‘Brown Dwarf Star’ :
case ‘Pulsar’ :
case ‘Quasar’ :
case ‘Black Hole’ :
$starSize = ‘- tiny compared to ‘;
$starColor = ”;
break;
default :
$starType = ‘Star’;
break;
}
}
$stars[0][‘starSize’] = $starSize;
$stars[0][‘starType’] = $starType;
$stars[0][‘starColor’] = $starColor;

if($starIndex) {
while($starIndex > 0) {
$starSizeData = starSize();
$starSize = $starSizeData[0];
$colorMod = $starSizeData[1];
$planetMod = $starSizeData[2];
$starColorData = starColor($colorMod);
$starColor = $starColorData[0];
// $planetCountDice = $starColorData[1];
if($starColor == ‘Special’) {
$starSpecial = specialStar();
$starType = $starSpecial;
switch($starSpecial) {
case ‘Dwarf’ :
$starSize = ‘less than 0.1 times ‘;
$starType = ‘Dwarf Star’;
$starColorData = starColor(0);
$starColor = $starColorData[0];
if($starColor == ‘Special’) {
$starColor = ‘Black’;
}
break;
case ‘Cluster’ :
$starType = ‘Star’;
$starIndex++;
$starColorData = starColor(0);
$starColor = $starColorData[0];
if($starColor == ‘Special’) {
$starSize = ‘- tiny compared to ‘;
$starType = ‘Neutron Star’;
$starColor = ”;
}
break;
case ‘Nova’ :
$starSize = (rand(1,6) * rand(1,6) * 10) . ‘ light-years across’;
$starColor = ”;
break;
case ‘Brown Dwarf Star’ :
case ‘Pulsar’ :
case ‘Quasar’ :
case ‘Black Hole’ :
$starSize = ‘- tiny compared to ‘;
$starColor = ”;
break;
default :
$starType = ‘Star’;
break;
}
}
$stars[$starIndex][‘starSize’] = $starSize;
$stars[$starIndex][‘starType’] = $starType;
$stars[$starIndex][‘starColor’] = $starColor;
$starIndex–;
}
}

$planetCount = planetCount($planetCountDice);
$romanArray = array(”, ‘I’, ‘II’, ‘III’, ‘IV’, ‘V’, ‘VI’, ‘VII’, ‘VIII’, ‘IX’, ‘X’, ‘XI’, ‘XII’, ‘XIII’, ‘XIV’, ‘XV’, ‘XVI’, ‘XVII’, ‘XVIII’);
$planetNumber = rand(1,$planetCount);
$romanNumber = $romanArray[$planetNumber];

$planetSizeData = planetSize($planetMod);
$planetSize = $planetSizeData[0];
$gravityMod = $planetSizeData[1];

$gravityData = gravity($gravityMod);
$gravity = $gravityData[0];
$atmoMod = $gravityData[1];

$atmosphereData = atmosphere($atmoMod, $gravity);
$atmosphere = $atmosphereData[0];
$waterMod = $atmosphereData[1];
$pressure = $atmosphereData[2];

$water = water($waterMod);
if($water == ‘land’) {
$watercover = (rand(1,6)+3)*10;
$landcover = 100 – $watercover;
$water = $landcover . ‘% land, ‘ . $watercover . ‘% water’;
}

$climateData = climate();
$climate = $climateData[0];
$precipDL = $climateData[1];

$biosphere = biosphere();

/* DISPLAY */

echo ‘STELLAR SYSTEM ‘ . strtoupper($planetName) . ‘
‘;
$i = 1;
switch(count($stars)) {
case 5 :
echo ‘Pentary System:’;
break;
case 4 :
echo ‘Quadrary System:’;
break;
case 3 :
echo ‘Trinary System:’;
break;
case 2 :
echo ‘Binary System:’;
break;
default :
break;
}
foreach($stars AS $thing) {
if(count($stars) > 1) {
echo ‘
‘ . $i . ‘. ‘;
}
if($thing[‘starColor’] AND $thing[‘starColor’] == ‘Orange’) {
echo ‘An ‘;
} else {
echo ‘A ‘;
}
if($thing[‘starColor’]) {
echo $thing[‘starColor’] . ‘ ‘;
}
echo $thing[‘starType’] . ‘ ‘;
echo $thing[‘starSize’];
if($thing[‘starType’] != ‘Nova’) {
echo ‘the size of Sol’;
}
$i++;
}
echo ‘
‘;
echo ‘with ‘ . $planetCount;
if($planetCount == 1) {
echo ‘ planet in orbit.
‘;
} else {
echo ‘ planets in orbit.
‘;
}
echo ‘
‘ . strtoupper($planetName) . ‘ ‘ . $romanNumber . ‘
‘;
echo ‘TYPE: ‘ . $planetSize . ‘
‘;
echo ‘GRAVITY: ‘ . $gravity . ‘ G
‘;
echo ‘ATMOSPHERE: ‘ . $atmosphere . ‘
‘;
echo ‘PRESSURE: ‘ . $pressure . ‘ Earth atmospheres
‘;
if($planetSize != ‘Gas Giant’) {
echo ‘WATER: ‘ . $water . ‘
‘;
}
echo ‘CLIMATE: ‘ . $climate . ‘
‘;
echo ‘PRECIP DL: ‘ . $precipDL . ‘
‘;
echo ‘BIOSPHERE: ‘ . $biosphere . ‘
‘;

?>


‘;
?>

DayTrippers is a Surreal Science Fiction Reality-Hopping OSR RPG. Now available at RPGnow.com.

Explore More Insights

The Henry and June Lingerie Browser

Way back in 1999, this alluring interactive app, stocked with products from Henry & June Lingerie, was built using Flash content backed by a MySQL database and a neat set of original PHP pages for navigation. It was the first interactive viral catalog designed by...

read more

The South Park Character Creator

Come on down to South Park, and be some friends of ours!Now you can create your own wacky original South Park character to wear as an avatar! Just enter any character traits you like in the form below. If you want to randomize a trait, check the Randomize box for...

read more