Jump to content

How to add new space sectors and overmap content


Recommended Posts

Posted

INTRODUCTION:

For some reason, you want to add a new space sector, exoplanet, away site, or any overmap content. This guide will help you with that. How the Horizon and the overmap work allows us to do some wonderful things. However, it is a system with a lot of moving parts. I will use the stuff I made for the Cold Dawn as an example when possible.

BEFORE EVERYTHING:

This guide assumes that you know how to code. If you don't, check this and work on something simpler to get more experience:

These other guides are also useful for overmap content:

SPACE SECTORS

This is the foundation. Space sectors are areas of space (like the Badlands, Valley Hale, Corporate Reconstruction Zone) and star systems (Tau Ceti, S'rand'marr). They define the exoplanets, away sites, exoplanet random dungeons, third party ships, merchant traders, skybox icon, skybox light, cargo price, time a cargo shipment takes to arrive, the icon of the stargazer, the color of the stargazer light, the lobby art, the lobby buttons, the lobby welcome sound, the types of meteor used in events, and probably way more.

Space sectors are meant to represent where the ship is currently.

Before anything, it needs a name and a define string. You can find these at code/__defines/space_sectors.dm

Where is an example and what do you need to do to create one:

Spoiler

#define SECTOR_SRANDMARR "S'rand'marr"

The define string should follow the format of SECTOR_(simplified sector name) followed by the full name of the sector

After this, you should probably add the sector to one of the defines that are lists grouping the sectors into big areas.

Spoiler

#define ALL_BADLAND_SECTORS list(SECTOR_VALLEY_HALE, SECTOR_BADLANDS, SECTOR_NEW_ANKARA, SECTOR_AEMAQ, SECTOR_SRANDMARR, SECTOR_NRRAHRAHUL, SECTOR_GAKAL, SECTOR_UUEOAESA)

If you use ALL_BADLAND_SECTORS, the game should consider all of the sectors included here

After this is set, you need to create the sector datum. Here is the basis with an explanation of what each vars does:

Spoiler

/datum/space_sector 

var/name (the name of the sector, it should just use the define string you already have)

var/description (the lore description of the sector)

var/starlight_color (this define the color of the light that space will emit, should be a hex value. Check code/__defines/color.dm for a list of colors we already have, but you can add your own)

var/starlight_power (this define how strong the starlight is)

var/starlight_range (this define how far the starlight will reach)

var/list/possible_erts (this define what erts can spawn here if it is a random one)

var/list/possible_exoplanets /defines what exoplanets can spawn

var/list/cargo_price_coef  (how much the space sector afffects how expensive is ordering from that cargo supplier)

var/skybox_icon (this defines the skybox icon)

var/list/sector_lobby_art (if this is set, it will override the map lobby icons)

var/sector_lobby_transitions (if this is set, it will override the map lobby transition interval)

var/sector_welcome_message (if this is set, it will override welcome audio message)

var/sector_hud_menu (if this is set, it will override the hud menu icons)

var/sector_hud_menu_sound (if this is set, it will override the hud menu click sound)

var/sector_hud_arrow = (if this is set, it will use an overlay instead of the animation that makes the button bigger)

var/list/meteors_minor (defines what meteors will be used in the minor meteor event storm)

var/list/meteors_moderate (defines what meteors will be used in the moderate meteor event storm)

var/list/meteors_major (defines what meteors will be used in the major meteor event storm)

var/list/downed_ship_meteors (defines what meteors will be used in the downed ship event )

(the rest of the meteor vars are for the meteor game mode)

var/list/meteors_dust

var/list/meteors_threatening 

var/list/meteors_catastrophic

var/list/meteors_armageddon

var/list/meteors_cataclysm

Useful procs and what they do:

Spoiler

get_port_travel_time

It is used in the paper created at round start, it is fluff to show how long it would take to travel to the nearest port

generate_system_name

It is used in the paper created at round start, it is fluff to show where the ship can jump to next

After this is done, you need to add the system to the trader datums so they can spawn for the merchant job.

Traders:

Spoiler

The trader datum has a var named allowed_space_sectors, which is a list that lets you chose what sector these traders will show up for the merchants to buy from.

After that, you probably want to test your system. So you go to the config, look for CURRENT_SPACE_SECTOR and put the system name (NOT THE DEFINE) as the value. Here is how:

Spoiler

CURRENT_SPACE_SECTOR S'rand'marr

Now we can move to exoplanets.

  • Thanks 1
Posted

EXOPLANETS

Exoplanets are randomly generated planets that people can land on. There are some differences between them and regular away sites. Where is what you need to know about their code:

Spoiler

name (the name of the exoplanet, should be the type of planet, snow exoplanet for example, if it is not a lore planet)

var/area/planetary_area (this defines what area the exoplanet uses)

var/lightlevel (you can change this to have planets be lit by default or not)

var/color (you can give the planet a color if you don't want to use the randomly generated one)

var/icon_state (you can set this to give the planet a consistent icon on the overmap, but you need to make sure the update_icon() proc is empty)

var/list/rock_colors (this is used to paint the mineral walls)

var/list/plant_colors (this is used to paint the randomly generated plants)

var/grass_color (this is used to paint the randomly generated plants)

var/surface_color (this is used in the exoplanet icon creation)

var/water_color (this defines the color of the water turfs)

var/list/possible_themes (this defines things like mountains and ruins that are randomly generated)

var/ruin_tags_whitelist (these flags can help define what can spawn or not, a bit pointless when we consider we have a list that defines directly what can spawn)

var/ruin_tags_blacklist these flags can help define what can spawn or not, a bit pointless when we consider we have a list that defines directly what can spawn)

var/features_budget (how many points there are to pick the random ruins)

var/map_generators (defines the map generators that will be used to create the meat/content of the exoplanet)

var/habitability_class (defines the atmosphere composition of the planet. Choices are HABITABILITY_IDEAL, HABITABILITY_OKAY, HABITABILITY_BAD)

var/generated_name (set to true if you want a random name or false if you don't)

var/ring_chance (the chance of this exoplanet spawning with a ring on its sprite)

var/list/possible_random_ruins (this is a list of all random ruins that can spawn in this exoplanet)

place_near_main (this defines how close you want this to spawn to the horizon, useful if you want people to interact more with the exoplanet)

Useful procs

pre_ruin_preparation()

Spoiler

This proc lets you do stuff before the random genetion kicks in. I used them in Adhomai to change what random ruins can spawn based on a random faction pick.

generate_planet_image()

Spoiler

This lets you define how the planet looks like on the skybox. Adhomai has an unique sprite code that you can copy from.

generate_atmosphere()

Spoiler

This lets you change the composition of the planet atmosphere. You can change the temperature and the gas composition. There are plently of examples to check.

map_generators

This is what adds the turfs, animals, and the rest of the stuff to the exoplanet

Spoiler

descriptor (the name)

flora_prob (chance of the flora spawning)

fauna_prob (chance of the fauna spawning)

water_level_min (how much of the water turfs you want at minimum)

water_level_max (how much of the water turfs you want at maximum)

land_type (what type of turf will be the land)

water_type (what type of turf will be the water)

fauna_types (types of mobs that can spawn)

Useful procs

generate_flora()
 

Spoiler

This one lets you set what seeds you want to spawn. Adhomai uses the one that already exists instead of random ones.

get_additional_spawns()

Spoiler

This one lets you do anything else after the generation is done. Adhomai and other exoplanet uses it to place trees, rocks, and etc around.

As you can see, exoplanets are suitable to create randomly generated places with some hand-crafted elements. If you want something 100% consistent, you probably should use away sites.

  • Thanks 2
Guest
This topic is now closed to further replies.
×
×
  • Create New...