Tutorial Create your own ships - Photoshop template & modding guide

Discussion in 'Starbound Modding' started by Xuhybrid, Dec 8, 2013.

  1. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Want to create your own ship but don't know where to start? I'll provide you with a Photoshop template which includes a scaled up bitmap, image of the ships, grid overlay and a screenshot underlay so you can concentrate on the important stuff! Every ship and their bitmap is included and organised in its own folder too.

    http://www.mediafire.com/download/3kk5368dap9hbdd/ship-layouts-template.zip

    [​IMG]

    Instructions

    The first step you'll want to take is to lay out a ship design using the bitmap. This allows you to loosely form an idea for what your ship is going to look like. When you're done, now you have a framework for where to put your ship graphics! You will need to reduce your bitmap back to 1 pixel per block. The game uses 8 pixels per block which is what i inflated the bitmap to in order to get a good comparison. When resizing in Photoshop, be sure to set the sampling to "Nearest Neighbour". Next you want to output your new ship design to a new file! You definitely don't want to save the file in 1080p. Make sure the background is transparent.

    IMPORTANT - Be sure to look at the original ship files so you understand how to format these files.

    \Steam\SteamApps\common\Starbound\assets\ships\

    Other Information

    The colours are linked via RGBA values and can be set to background or foreground tiles, objects and a combination of these. I'll assume you know jSON notation and move on to some other less complicated things to explain.
    Code:
      "backgroundOverlays" : [
        {
          "image" : "shipship.png",
          "position" : [9, 12]
        }
      ],
      "blockImage" : "dropshipblocks.png"
    
    You will want to create new image files and reference the new filenames here. Another important thing to note here is that the position property is based from the bottom left of your bitmap. Make sure this is aligned properly and you are ready to proceed. How do we proceed you ask? Well, after looking for a few solutions i realised that there are two scenarios most people will encounter.
    1. Scenario 1 is a player just wanting to update their current character with this new ship.
    2. Scenario 2 is a modder, like you or i, who wants to quickly check updates to their ship.
    Both of these are handled in a similar fashion but they're based around this folder/file.

    \Steam\SteamApps\common\Starbound\player\[playerid].shipworld
    1. Scenario 1 - Create a new character. Delete (and backup) the .shipworld for your main character and rename the .shipworld from the new character to match your main characters playerid.
    2. Scenario 2 - Create a new character. Delete the .shipworld for this new character.
    Reloading the game and loading the appropriate character will show the updated changes.

    Credits go to SickBoy (read his post further down) for explaining the settings for blocks.

    Code:
    {
      "value" : [<red>, <green>, <blue>, <alpha?>],
      "comment" : "<info for your own reference>,"
      "foregroundBlock" : <true/false>,
      "backgroundBlock" : <true/false>,
      "backgroundMat" : "<material name>",
      "foregroundMat" : "<material name>",
      "object" : "<object name>",
      "objectDirection" : "<left/right/?>",
      "objectParameters" : {
        "treasurePools" : [ "<loot table name>" ],
        "level" : <level?>,
        "unbreakable" : <true/false>
      }
    }
    The only one i was unaware of was foregroundMat.
     
    Last edited: Dec 19, 2013
  2. Divinux

    Divinux Scruffy Nerf-Herder

    10 years of hobby Photoshop experience, I didn't know you can set colors for layers or about nearest neighbor sampling. Jesus Christ. Thanks for that. Seems really helpful for creating pixelperfect backgrounds though.

    Also, what is there to know about the structure file? So far I know you need to rename backgrounds as to not break the vanilla ships, and align the background in the position line. There was also a way to edit it to work with already made characters, but I haven't found out how to yet. Maybe we should edit your opening post or this one with an explanation or at least a link to someone else's guide.
     
  3. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    The colours are linked via RGB values and can be set to background tiles, objects or a combination of the two. Yeah im not sure how to apply it to existing characters but i'll look into all of this more when i have a ship of my own to do it for. More fun that way :)
     
  4. Conir

    Conir Void-Bound Voyager

    thank you!
     
  5. Divinux

    Divinux Scruffy Nerf-Herder

    Yeah true, each block is represented by a color. But you can just infer those by looking at the default image, so you don't really need to look at the structure file. Before I realized that, I actually made myself an annotated version of the structure file, so here it is in case someone does feel like he needs it:

    Code:
    {
      "config" : {
      maximum amount of fuel
        "fuelMax" : 1000
      },
    
      "backgroundOverlays" : [
        {
        name of the background image
          "image" : "shipship.png",
          position relative to the tilemap for aligning
          "position" : [7, 11]
        }
      ],
    
      "blockKey" : [
        {
        white - not used
          "value" : [255, 255, 255, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : false
        },
    
        {blue - windows and thrusters background
          "value" : [0, 0, 255, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true
        },
    
        {red - non-walkable space
          "value" : [255, 0, 0, 255],
          "foregroundBlock" : true,
          "backgroundBlock" : true
        },
    
        {green - ship storage
          "value" : [0, 255, 0, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipwall",
          "object" : "apexshiplocker",
          "objectParameters" : {
            "treasurePools" : [ "avianStarterTreasure" ],
            "level" : 1,
            "unbreakable" : true
          }
        },
    
        {limegreen - tech station
          "value" : [142, 255, 142, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipwall",
          "object" : "techstation",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {mud red - fuelhatch
          "value" : [255, 87, 81, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "apexfuelhatch",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {yellow - shiplight
          "value" : [255, 255, 0, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipdetails",
          "object" : "apexshiplight"
        },
    
        {orange - door
          "value" : [255, 102, 0, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "apexshipdoor"
        },
    
        {brown - engine? not in use
          "value" : [174, 137, 81, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "shipengine",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {purple - teleporter
          "value" : [156, 0, 255, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipdetails",
          "object" : "teleporter",
          "flags" : [ "playerSpawn" ],
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {light violet - engine light back
          "value" : [167, 167, 255, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "boosterflame",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {gray - engine light bottom
          "value" : [168, 168, 168, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "smallboosterflame",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {turquoise - captain chair
          "value" : [0, 255, 255, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "apexcaptainschair",
          "objectDirection" : "left",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {grey - light emitting block
          "value" : [122, 122, 122, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "object" : "invisiblelight",
          "objectParameters" : {
            "unbreakable" : true
          }
        },
    
        {light yellow - background wall
          "value" : [255, 255, 144],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipwall"
        },
    
        {skin - horizontal background block (walkable)
          "value" : [255, 117, 144],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipdetails"
        },
    
        {light violet - vertical background block (walkable)
          "value" : [255, 117, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "apexshipsupport"
        }
      ],
      the name of the block image
      "blockImage" : "dropshipblocks.png"
    }
    
    And regarding using ships on premade characters, one guy was doing it by generating a new character, which compiles the image files into a character specific .shipworld file, and then renaming that shipworld file to the name of your initial character. Seems like a good enough solution.
     
  6. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Thanks for the input. Ive updated the main post with my discoveries.
     
    Last edited: Dec 8, 2013
  7. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Seems like we have a more organised and dedicated forum to post things in now :D nice!
     
  8. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Shameless bump
     
  9. PirateFromVoid

    PirateFromVoid Orbital Explorer

    how can i make a long ship from two jpg files? i want to make a REALY long ship
     
  10. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    You should just be able to make the image as large as you require. I haven't tested the maximum files size or resolution but im assuming at some point it'll break lol. In any case, you just want to create one image file, not two.
     
  11. DoeJersey

    DoeJersey Space Hobo

    I've been experimenting in ship design as well but I keep running into problems with positioning. I am able to get the ship into the game after i have edited all the files but I am trying to make a ship longer than 2048 ( which is the max size in any direction in pixels). You can do this in the .structure file but I don't even know how the positioning works have you figured it out at all yet?
     
  12. SickBoy

    SickBoy Guest

    Has anyone figured out if there is a way to pre-paint blocks, do basic wiring setups, etc. within the .structure? Right now everything just uses its default version, but it'd be incredibly useful if we could set the paint color/etc. initially. I realize I could do this in-game, then share the .shipworld save, but that isn't ideal for keeping the mod up to date with each patch.

    *EDIT* I should mention this is when doing purely sandbox ships, not ones with detailed background art. Currently looking for info that could help with my Firefly/Serenity WIP (here). The ship is all pre-configured with the .structure and block .png files, the only thing I've yet to figure out is painting+wiring (assuming it's possible to do this way).
     
    Last edited by a moderator: Dec 18, 2013
  13. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    You can list multiple backgroundOverlays and set the positioning of each. Look at the Human ship folder.

    There's no way to add basic items like platforms so i strongly doubt there's anything as complex as wiring.
     
  14. SickBoy

    SickBoy Guest

    I have no problems adding platforms and whatnot. It's just a matter of using "object" : "namehere" in the config for each pixel. It also has a few other parameters, like for the loot table it should use, direction it should face, whether it's breakable, its level, etc.

    And I don't use ANY overlays, as I'm not fond of them (edit: just realized you were probably responding to the other person, whoops). The ship I am making using the block PNG and .structure for is the human default dropship, and it's 100% based in that (my most recent picture in the thread I linked shows some of that off). This is also how micro-dungeons work. Those are all real blocks, not placed in-game but rather 100% via code and a pixel color (I use my own custom-made dropshipblocks.png for that). You can do a background block, foreground block, and (if not using a foreground block) an object all in a single pixel, you just have to configure it that way (takes forever manually, but someone is working on a tool to just "paint" it that way). And since it can do that, I would assume it can also do painting. Wiring is kinda iffy, but I'd think you could at least reference/name another entity, and for basic on/off wiring that's really all you need... plus whatever state it is in. I mean isn't how all this stuff saved in the save (or at least how micro-dungeon/ship stuff is initially generated by the engine) as it is?

    What we really need is a list of possible variables for all the various moddable stuff, because right now I think we're all just using guesswork or the default files as examples to figure out what works.


    Here's a couple working examples:

    Example of an unbreakable container, with a background block at the placement location (for that block only, some objects are larger than a single block!), with a certain loot table:
    Code:
        {
          "value" : [0, 255, 0, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "darkwood",
          "object" : "apexshiplocker",
          "objectParameters" : {
            "treasurePools" : [ "humanStarterTreasure" ],
            "level" : 1,
            "unbreakable" : true
          }
        },
    
    Example of a breakable usable object, faced a certain direction, with a background block:
    Code:
        {
          "value" : [0, 193, 192, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "pressurizedbeam",
          "object" : "apexwoodenchair",
          "objectDirection" : "right",
          "objectParameters" : {
            "unbreakable" : false
          }
        },
    
    Example of a physical object (in this case a platform), a comment (for your referencing), and a background block:
    Code:
      {
      "value" : [188, 188, 188, 255],
        "comment" : "all platforms",
      "foregroundBlock" : true,
      "backgroundBlock" : true,
      "backgroundMat" : "rustymetal",
      "foregroundMat" : "wreckplatform"
      },
    
    Example of a light-emitting object, a comment and a background block:
    Code:
      {
      "value" : [113, 124, 33],
        "comment" : "quarters lighting",
      "foregroundBlock" : false,
      "backgroundBlock" : true,
      "backgroundMat" : "glass",
        "object" : "classiclight"
      },
    
    Example of a foreground block only:
    Code:
      {
      "value" : [73, 5, 9],
      "foregroundBlock" : true,
      "backgroundBlock" : false,
      "foregroundMat" : "rustymetal"
      },
    
    Example of a background block only:
    Code:
      {
      "value" : [78, 20, 5],
      "foregroundBlock" : false,
      "backgroundBlock" : true,
      "backgroundMat" : "rustymetal"
      },
    
    Now, I'm not sure on all the potential options for each pixel, and I've searched forever and nobody else seems to know either. That is just stuff that I figured out from looking at the /assets/ships/human/ folder. If someone could dump a full list of potential variables, we could at least start playing with stuff properly.

    I am working on a write-up of what I do know so far, along with doing some dedicated testing to the unknown stuff. I'll post it later.
     
    Last edited by a moderator: Dec 18, 2013
  15. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Yeah ive tried foregroundBlock and it doesn't work :p The object property only refers to items in the objects folder unfortunately. And yes, foregroundBlock refers to whether you can walks on it or occupy that space.
     
  16. SickBoy

    SickBoy Guest

    Okay here's my details on what works. All of this I've done plenty of myself and it works just fine.

    Here is an example (from my Firefly/Serenity mod WIP):


    My dropshipblocks.png

    [​IMG]


    In-game
    [​IMG]


    Nothing in that screenshot is placed or changed in-game. It's all from the PNG and the .structure file (which I'm not posting up just yet since it's a mess and my mod is still a WIP).

    This is the basic structure of each pixel. You wouldn't use all of this in a single pixel config, otherwise you'll get errors. Read the detail explanation to understand how it works and cherry pick what you need (always have "foregroundBlock" and "backgroundBlock" set at the very least).

    Code:
    {
       "value" : [<red>, <green>, <blue>, <alpha?>],
       "comment" : "<info for your own reference>,"
       "foregroundBlock" : <true/false>,
       "backgroundBlock" : <true/false>,
       "backgroundMat" : "<material name>",
       "foregroundMat" : "<material name>",
       "object" : "<object name>",
       "objectDirection" : "<left/right/?>",
       "objectParameters" : {
         "treasurePools" : [ "<loot table name>" ],
         "level" : <level?>,
         "unbreakable" : <true/false>
       }
    }
    
    "value" corresponds to RGB values for the first 3, and I assume alpha for the last (I still need to test that part). This color corresponds to pixels used in the image defined by "blockImage" (for ships the default is "dropshipblocks.png", found in /assets/ships/<race>/).

    "comment" is just for internal commenting. Highly suggest you use it, otherwise you'll forget what is what.

    "foregroundBlock" and "backgroundBlock" are basically asking whether any building/etc. is allowed on that layer (including whether it will allow the corresponding "****groundMat" material if one is set). No "object" should be set if this is in use.

    Example: rustymetal background, plate foreground. Both layers are buildable.
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : true,
      "backgroundBlock" : true,
      "backgroundMat" : "rustymetal",
      "foregroundMat" : "plate"
      }
    
    Example: no background, plate foreground. Both layers are buildable.
    Code:
      {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : true,
      "backgroundBlock" : false,
      "foregroundMat" : "plate"
      }
    
    Example: rustymetal background, no foreground. Both layers are buildable.
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : false,
      "backgroundBlock" : true,
      "backgroundMat" : "rustymetal"
      }
    
    Example: "invisible wall" background, plate foreground. Only foreground is buildable.
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : true,
      "backgroundBlock" : true,
      "foregroundMat" : "plate"
      }
    
    Example: rustymetal background, "invisible wall" foreground. Only background is buildable (player can't pass through).
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : true,
      "backgroundBlock" : true,
      "backgroundMat" : "rustymetal"
      }
    
    Example: both layers are "invisible walls". None are buildable (player can't pass through, this is your "nobody allowed!" setting).
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : true,
      "backgroundBlock" : true
      }
    
    Example: both layers are "blank". Both are buildable (this is your "sky" setting).
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : false,
      "backgroundBlock" : false
      }
    
    Example: "invisible wall" background, "blank" foreground. Only foreground is buildable.
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : false,
      "backgroundBlock" : true
      }
    
    Example: "blank" background, "invisible wall" foreground. Only background is buildable (player can't pass through).
    Code:
       {
      "value" : [188, 188, 188, 255],
      "foregroundBlock" : true,
      "backgroundBlock" : false
      }
    
    Other combos exist, but I think you get my point.


    "foregroundMat" and "backgroundMat" are what material should be used. Make sure you have the corresponding "****groundBlock" set to "true" if you use these.

    "object" is the name of an object to place on the foreground layer. You must have "foregroundBlock" set to 'false' and no "foregroundMat" set for this to work. Non-object items will cause a connection error when loading and should be used as a "foregroundMat" instead (and vice versa). When you place an object, you're only placing one pixel (even if the object takes up more). You can check in-game where an object's spawn point is by holding the object as if you're placing it and find where your cursor will be when you place it (for many it is the bottom right). Objects must be able to attach to something as well as have enough room to exist, the same way as when placed in-game!

    "objectDirection" decides the direction the "object" should be facing. Values I've used are "left" and "right". Not sure if up/down/etc. would work, needs testing.

    "objectParameters" is a whole different set of config options for the "object" used.

    For use in "objectParameters" only:
    "treasurePools" sets the loot tables the container should use. Haven't messed with it yet.
    "level" sets the object to a certain level (tier maybe?). Haven't messed with it yet.
    "unbreakable" sets whether an object can be destroyed. Used to prevent people from removing stuff you don't want them to remove.


    And that's all I know so far! There is still plenty of stuff to play with, not to mention tons of variables I'm sure we just don't know about yet.
     
    Last edited by a moderator: Dec 18, 2013
    Noizon, BallPtPenTheif and DK_Pooter like this.
  17. PirateFromVoid

    PirateFromVoid Orbital Explorer

    I found that many objects have different color variations, what i must write in dropship.structure to choose color?
     

    Attached Files:

  18. SickBoy

    SickBoy Guest

    That's the one thing I was trying to figure out as well (well, that and wiring, if that's possible without scripting). I figure there has to be a way to set it, but we just don't know the variable name yet. A dev could really help out by dumping at least the potential variables for us (or if someone could find it... I've looked, but with no luck).
     
  19. PirateFromVoid

    PirateFromVoid Orbital Explorer

    well, let me know it you find it
     
  20. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Thanks for all the info! When i tried foregroundMat, the game still loaded but it did nothing :rofl: Perhaps i should have spent more time trying to get that working.
     

Share This Page