Custom Parallaxes

Discussion in 'Guides' started by Pinkbat5, Aug 6, 2019.

  1. Pinkbat5

    Pinkbat5 pocl v3.6.3 Staff Member Moderator Diamond Donator

    Joined:
    Jun 26, 2017
    Messages:
    211
    Likes Received:
    122
    As far as I can tell, there are only a handful of people in GC who know how to make custom parallaxes. In fact, I can only name two– me and Wowgain. I intend to change that. For the first time ever on GC, here's a big ol' guide that lists everything I know about making custom parallaxes. It's not an easy process so I'm going to try to explain it the best I can. Wowgain knows more than me on the subject, so if there's something I don't mention here (custom planets in the sky, for example), he or someone in modding citizen might know more.
    But first, I'm going to flex a little: here's a few parallaxes that I've created with what I currently know.

    [​IMG]
    Iona. Modified midnight biome.

    [​IMG]
    Sanctus fields. Modified garden biome.

    [​IMG]
    Sanctus forests. Modified forest biome.

    [​IMG]
    Vedoxis. Modified moon biome.

    Setup
    Before you can make any parallaxes you're going to have to create your own mod first, which will be the thing that causes your game to generate custom biomes in the first place. This is pretty easy, because all you'll need to do is unpack your assets. Guide to doing that here.
    Once you have your assets unpacked, make a new, empty folder in your mods folder and name it whatever you want. Then, copy and paste two folders from your unpacked assets into this new mod folder: biomes and parallax.
    [​IMG]
    It's here that you'll find files that you can modify to create custom biomes. They're located at biomes/surface and parallax/surface respectively.
    To create a custom biome, all you have to do is find an existing biome type (midnight, garden, forest, etc), modify the .biome and .parallax files for that biome (ex. midnight.biome and midnight.parallax), and then pilot your ship in singleplayer to a planet of that biome type and beam down. If you've already been to that planet before you made the modifications to your mod, you will need to beam up, delete the .world file for that planet (found in your game's universe folder), then beam back down again.
    If you are modifying the skyOptions, weather, ambientNoises(?), musicTrack(?) or grassMod in your .biome file, you'll also need to delete your universe.dat and universe.chunks files, and restart your game, before beaming down. Otherwise your game will ignore the changes for whatever reason. Everything else shouldn't require a game restart– just you beaming up, deleting the worldfile, and beaming down again.
    If you want to apply your parallax to a preexisting build without deleting any worldfiles, and don't want to worldedit your structure onto a new planet, you can use a terraformer for the appropriate biome type on the world and it will apply. Just make sure the planet is terraformed at least halfway, because that's the point where the parallax applies.
    If the biome type you're trying to apply doesn't have a terraformer, you can create a custom terraformer by using this command.

    /spawnitem terraformerforest 1 '{"terraformBiome":"biometypehere","terraformPlanetType":"biometypehere"}'
    Thank you terraformers, very cool.

    Now, to see what each file does to your world.



    The .biome file

    [​IMG]

    What it controls: The lighting of the world / the colour of the sky during sunrise, sunset, midnight and midday / the weather / the ambient noises heard during day and night / the music / the "grass" or ash that is on the surface of most blocks

    Okay, this part doesn't control the actual background of the world, unless you count the sky colour. But it's still pretty important if you care about ambience, lighting and the weather. If none of this matters to you, skip to the .parallax section.

    skyOptions: Lighting and sky colour.

    [​IMG]
    skyOptions controls the colour of your planet's sky (Colors) and how lit up players are during different times of day (LightColor). The values shown here are in RGB. If you see multiple sets of Colors and LightColors, such as in the default for Forest and Garden biome types, you can safely delete all except for one, unless you want your game to randomly pick between the multiple options. Make sure you don't mess up the .json code.
    You can see in the example here that the sunrise values are [ 252, 120, 0 ], [255, 230, 176] and [140, 71, 0] for light. The result is a world that looks like this at sunrise:

    [​IMG]
    The effect lighting alone can have on a world is pretty extreme. A midnight world with a dayLightColor of [255, 0, 0] (pure red) looks like this at midday.
    [​IMG]
    weather: The weather of your world.
    [​IMG]
    This section lets you change what weather patterns your world gets. To see what options you have, go to your unpacked assets and find weather.config. Open it and it will display options like "clear," "moon," "garden" and "arctic." Try to avoid options that have a chance of "spacedust," I tried and it crashed my game.
    The image above shows what the weather section looks like with "garden" weather for your world. That includes rain, storms, glowing rain, drizzle and no weather at all.

    ambientNoises: Controls the ambience of day and night. You can find all available sound effects in the form of .ogg files in your unpacked folder, under sfx/environmental/. Players with music turned off will still hear ambience unless they have starbound muted entirely.

    musicTrack: Lists all songs that the world will play at random. Players with music turned off won't hear any tracks. You can find all available songs under music in your unpacked folder.

    grassMod: Controls what kind of "grass" your world generates with. You can find options for this in tiles/mods/.


    The .parallax file

    [​IMG]

    What it controls:
    The actual PARALLAX part of the world. This is what you came here for, and it's probably the most time consuming part of making a parallax. Thankfully, you don't have to delete your universe.dat and .chunks files to regenerate your world.

    Every parallax comes in layers. You can find the .png files for each possible kind of layer in parallax/images of your unpacked folder or mod folder. You'll be needing these if you want to manually recolour each hex code in the parallax of your world. This is something I almost always have to do when I'm making a custom parallax: every example I gave in the first part of this post had manual hex recolours. In Sanctus, it makes the grass/trees blue-green and the normally black Midnight biome mountains a light blue. In Vedoxis it makes the normally monochrome moon surface a orange gradient. Iona has the least manual recolouring; only one band of clouds was changed, made to be slightly more purple than the rest. You can barely see it but Lloyd liked it so I kept it that way.
    If you don't know what the fuck I'm talking about or what a hex-code recolour is you can see it in action here. Anybody who's recoloured clothing using SOS has done it before.
    To manually recolour a single layer (you'll need to do it layer-by-layer), add a comma to the end of the "parallax" line (or whatever the last line is) and add a "directives" line like this.

    {
    "kind" : "stem/forestsmalltree",
    "offset" : [0, 90],
    "parallax" : 1.3,
    "directives" : "?replace;1d301b=1B3028;314629=294539;3e5d3d=3D5C4F"
    },

    Here, I've taken the green of the leaves (#1d301b, #314629, #3e5d3d) and replaced it with a green that has a blue tint. I could recolour the bark the same way if I wanted to, but I didn't feel like I needed to.
    forestsmalltree.png looks like this, by the way.

    [​IMG]
    As for offset and parallax, offset determines how high up the layer is and parallax determines what the layer is in front of and what it's behind. You can tell because the number grows higher as you scroll down and go further back in the parallax.
    There are other modifiers you can add. "timeOfDayCorrelation" : "nightVisible" means it's only visible during the night (good for auroras and clouds). "unlit" : true means that the layer will always be at full brightness- also good for auroras, which glow. "fadePercent" : 0.2 causes the layer to fade a little (2% in this case). Increasing the value makes it fade more. There are others, but I think these are the only relevant ones. Do some digging in different parallax files and see what you can discover.

    That's basically all. To make this a little easier, I've attached slightly outdated versions of the files I used to make the Sanctus forest here. Try to compare them to the default forest files to see what I changed. I hope they're helpful and provide a good example. If you try to use them without modifying them to make your own hub, though, I'll kill you. Clearly, forests with slightly bluish leaves are my sole intellectual property.
    Enjoy!
     
    Khaos, TrIpTiCuS, WowGain and 5 others like this.