Starbound

Starbound

Not enough ratings
Custom Blocks Guide [EN]
By BΛBES
Yes, that was kinda of clickbate. BUT! In my defense, I think that somehow in our situation with custom blocks even texture packs are the thing we need. So, here you go! Custom blocks/Texture pack guide.

This method is vanilla-friendly. You can join whatever server you want and be sure, that nothing goes wrong. But only you will see the changes.
   
Award
Favorite
Favorited
Unfavorite
What we are dealing with
The method to create your own texture pack is based upon so called "patching" of .json files. You simply create redirect file, that is used for replacing/adding/deleting already existing content. That's why it's vanilla-friendly: it only modifies already existing file rather than creating new one.

About patching files you can learn from this good guide written by Ceterai, that helped me when I started to write my own.

So, what are we waiting for? Let's start creating some custom blocks!
Material parameters
Well, before we start patching, you need to know, what actually we want to rewrite. For that we start with insides of .material files.

What I shouldn't change?
  • materialId - it's the game's basic id, that game always uses, so you clearly shouldn't change it.
  • materialName - same as previous

Everything else is more acceptable for redacting.

  • particleColor - List of 4 numbers: 3 RGB color numbers and the last number for the alpha (transparency) of color. 255 means fully visible, while 0 it becomes invisible. It is used when the material is damages or is mined.
  • itemDrop - What will drop after you mine this block.
  • description - description of this block that is displayed in interface
  • shortdescription - short name that is displayed in interface.
  • raceDescription - what would your character say after studying of this block.
  • footstepSound - the sound of stepping on a block.
  • health - how much you need to mine this before it is destroyed.
  • category - where this block belongs in inventory.
  • damageTable - path to a config file responsible for how the material is damaged. These tell what and how damages the material. Some materials may burn up and use another one.
  • cascading - if true, will fall and spread to different tiles horizontally, forming a hill. SERVER's
  • falling - if true, tiles will fall and stack on top. SERVER's

  • renderTemplate - how CLIENT would render this block when you see it.
  • renderParameters - group of cool things that we mostly would edit. Every parameter in here is CLIENT's

    When replacing this in the path of patch you should write "/renderParameters/texture" or "/renderParameters/variants" or etc.

  • texture - the sprite of your block.
  • variants - how much variants single sprite has. If this doesn't match base material file, it should be overriden. [int]
  • lightTransparent - could this material block light or not. [true/false]
  • multiColored - could you paint this block with Paint Tool or not. If this doesn't match base material file, it should be overriden. [true/false]
    !!! If you make multicolored block monocolored you can expect the error when trying to render it if in the world there is colored block, because game wouldn't understood why the material that can't be recolored is colored.

  • occludesBelow - hide bg texture when placed. Used for better rendering, so should be true for non-transparent blocks. [true/false]
  • zLevel - number of layer that is used when block is placed next to another. If zLevel of block is higher, it will be positioned higher than another block. [int]
  • radiantLight - if block is placed, it will emit light in rgb. [r,g,b] from 0 to 255.

CLIENT's - mean that changes of this files applies for client.
SERVER's - mean that changes need to be on a server to work (you still can connect, but the priority of physics is influenced by the server)
Rendering
Starbound has several basic types that are used for rendering your blocks. But you can simply write your own and place it in your texture pack, this thing only say to block how it would appear if there's another blocks.


Classic - this render uses nearest neighbors for appearing, but only for beautiful transitions. For example this render file is used by dirt, glass, any other natural blocks.



Column - this render uses top and bottom nearest neighbors. For example: pillar block.


Girder - this render uses the four nearest neighbors in the shape of a plus. For example: girders, outpost beams.


Pipe - this render uses all of the nearest neighbors to form a pipe section. For example: dermis, pipes.


Platform - this render is for platforms.

Rail - this render for rails.

Row - render uses left and right neighbors. For example: wood log.


Screw - this render works like column, dk why they implement it. Used by screws.

Sloped - render used by diagonal blocks like panels.


Patching
After we done with understanding what the parameters are used for, we can actually starting to patch them.

1. First you need to create your texture pack in mods. So open Starbound folder, then click on mods and create your base mod folder. I will go with "Irden Overhaul". Basically, we creating clientside mod.


2. Open your mod folder, create folder "Tiles" and open it. Here you need to create folder for the material you will retexture. I created all of them just for sure everything would be ok. In this folder also there would be every modding confing files of how would your material work. If your material is working like basic render file, you can just specify, which basic render file it uses. More of that would be next. (For some reason, rail render file don't normally works with non-rail materials.)

3. For example, I will create patch for alienrock.material and add new texture in this folder. You can simply rename your texture as you want it to be, but I use base material name for my own convenience (simply it's position is after patch file). The name of the patch and material you want to patch must be the same (except it's extension would be patch).


4. Open it with any of editors. I will use notepad++.

5. Here you need to write the patch itself. If you want to replace already existing parameter (open basic .material file if you aren't sure it's existing) you should use replace.

Example:
[{
"op": "replace",
"path" : "/renderParameters/texture",
"value": "alienrock.png"
}]


It replaces texture of .material files with one in your folder (IT must be in folder).

6. If you want to add new parameter, you should use operation add.

Example: in alienrock there wasn't any RadiantLight parameter, so i'd like to add to make it shine like lava.

[{
"op": "add",
"path" : "/renderParameters/radiantLight",
"value": [229, 200, 79]
}]


7. You should remember, that if your sprite has more or less variants of same block than in base material file, you should replace the value of variants.

[{
"op": "replace",
"path" : "/renderParameters/variants",
"value": 5
}]


Sum of this will look like this.


8. If you want to replace the rendering method of your block with another (even if that isn't exists in game) you should change the path of rendering. If it from mod and/or created by you, you need to place it in "tiles" and then write next code.

[{
"op": "replace",
"path" : "/renderTemplate",
"value": "/tiles/scb-pipetemplate.config"
}]


2 Comments
BΛBES  [author] 8 Jan, 2021 @ 2:10pm 
:DDDD luv uwu
:3 8 Jan, 2021 @ 2:08pm 
This WOMAN was so determinated to solve this out that she nerely had a nap before publishing this guide! Look how you make people suffer, Chucklefish, and be ashamed of yourself.