-
Notifications
You must be signed in to change notification settings - Fork 28
Creating exoplanet ruins
This guide will assume you have a working knowledge of the DreamMaker program and mapping in general.
Exoplanet ruins randomly spawn on exoplanets to make exploration a little or a lot more exciting, depending on the ruins spawned. This system is much faster and, in my opinion, easier than the overmap site system.
Each ruin only needs two files: A .dm file defining the map_template (and likely an area), and a .dmm file holding the map itself.
- Move to the maps/random_ruins/exoplanet_ruins folder in DreamMaker
- Create a .dm file in a new directory by modifying the path in the pop-up window
- Navigate to the new folder and open guide.dm, then create a .dmm file in the same directory. Pick an appropriate size for the ruin you're making. The maximum acceptable size is 80x80, but most ruins should be much smaller.
- Include the .dm file by clicking the box on the list, but don't include the .dmm.
Now, let's take a look at the define. Mostly self-explanatory:
/datum/map_template/ruin/exoplanet/guide
name = "example ruin"
id = "example_ruin"
description = "This is an example define for the exoplanet ruin system."
suffixes = list("guide/guide.dmm")
cost = 1
template_flags = TEMPLATE_FLAG_CLEAR_CONTENTS | TEMPLATE_FLAG_NO_RUINS
- You probably want
id
to be unique. If it's shared between several ruins, only one of them will be picked each round. -
suffixes
assigns the provided .dmm file to the map_template -
cost
determines how much of the ruin loader's budget is spent on the ruin, if it's picked. Large ruins, or ruins that hold powerful items or enemies should cost more. Default of 1. -
template_flags
is used to modify how the template is placed. The default value is 0, no flags. You can specify flags to use as in the example, separating them by the | bitwise OR operator. The possible flags are:
- TEMPLATE_FLAG_ALLOW_DUPLICATES will allow multiple copies of the template to spawn. Make sure to set a reasonable cost if using this flag.
- TEMPLATE_FLAG_SPAWN_GUARANTEED is used for away map generation, and is currently not supported for ruins (it will have no effect).
- TEMPLATE_FLAG_CLEAR_CONTENTS will clear the area of any objects before it places it. Useful for things indoors, so you don't get any plants in your rebel base.
- TEMPLATE_FLAG_NO_RUINS will prevent other templates from spawning over yours, and will try to prevent shuttles from landing on the ruin. You will likely want to select this. An alternative method for avoiding other ruins spawning over yours is to specify an area for everything in your template (other than the default area).
Once you've created the define, you may want to create an area in the same file. This is especially true of indoor ruins or templates which don't want to use TEMPLATE_FLAG_NO_RUINS. The two vars you need are self-explanatory.
To save some trouble, you can use an icon_state from the base areas file - 'red', 'green', 'blue', 'yellow', etc.
/area/map_template/example
name = "example ruin"
icon_state = "red"
With the defines set up, it's time to create the template. Move back to your .dmm file and start creating your map. There are a few special atoms you'll need to make use of:
When you start, you should replace (Ctrl-Click) all of the space areas and turfs with template_noop.
- /area/template_noop - This area replaces itself with the area of the exoplanet it gets spawned on. Every tile that isn't explicitly of the ruin should have this area. (ex. you build a house. Inside, the walls and the garden outside may be area/map_template/example; everything else should be /area/template_noop)
- /turf/template_noop - Much like the area, this turf doesn't overwrite the host turf when it gets spawned. You can use this to genericise ruins across different planet types.
An example of a completed template
Now that your defines and map are both finished, you need to tell the exoplanet defines that your template exists. Go to code/modules/overmap/exoplanets and you'll see desert.dm, garbage.dm, grass.dm and a few other planet types. Pick the ones that seem sensible for your new ruin and add your map template path (/datum/map_template/ruin/exoplanet/guide
) to their possible_features
list.
Now compile, load up your map and test! You may need to load the game multiple times to get the planet type you need. For testing purposes, you can set your cost to 0.1 to basically guarantee that it will spawn.
Once you're happy with the results, it's time to make Travis happy with the results, too. You'll need to provide exemptions for any area you created, because it doesn't conform to the standards and rules established. This is unfortunately a rather fiddly process, but take a look at this PR for an example of what you might need to do. As a rule of thumb:
- All areas need to be exempted from the area usage test, as they might not be spawned.
- Areas should be exempted from the area coherency test if and only if the template is using the TEMPLATE_FLAG_ALLOW_DUPLICATES flag. This test makes sure that areas are connected, rather than in several disjoint pieces.
- Areas with APCS, vents or scrubbers will need to not exempt themselves from those tests. Outdoor areas or ones without these objects (intentionally) will need to be exempted.
The test exemptions are located in these files:
- maps/overmap_example/overmap_unit_testing.dm
- maps/torch/torch_unit_testing.dm
- maps/~mapsystem/maps_unit_testing.dm
- maps/away_sites_testing/away_sites_testing_unit_testing.dm
Now you're ready to open your pull request and do battle with Travis! As always, ask in #coding if you need any assistance.
Documentation regarding setting up and using Git.
Making heads or tails of specific GitHub pages, for the uninitiated.
Documentation regarding tools external to DM and Git.
Standards and guidelines regarding commenting, contributor conduct and coding standards.