Difference between revisions of "Guide to Spriting"

From Paradise Station Wiki
Jump to navigation Jump to search
(Created page with "{{tgPage}} Other related guides: Understanding SS13 code and SS13 for experienced programmers == Pre-commit checks == - Are all the floors with or without air, as th...")
 
Line 1: Line 1:
{{tgPage}}
This is not a technical guide on how to do sprites in a graphical program, this is a guide intended for people who know how to sprite, but need to know what exactly is needed when people want sprites done for them. Most sprites are 32x32 pixels. They use 32b colors (24b + alpha channel).
Other related guides: [[Understanding SS13 code]] and [[SS13 for experienced programmers]]


== Pre-commit checks ==
== Object overview ==


- Are all the floors with or without air, as they should be? (regular or airless)<br>
- Does the area have an APC?<br>
- Does the area have an Air Alarm?<br>
- Does the area have a Request Console?<br>
- Does the area have lights?<br>
- Does the area have a light switch?<br>
- Does the area have enough intercoms?<br>
- Does the area have enough security cameras? (Use the verbs under Mapping for help)<br>
- Is the area connected to the scrubbers air loop?<br>
- Is the area connected to the vent air loop? (vent pumps)<br>
- Is everything wired properly?<br>
- Does the area have a fire alarm and firedoors?<br>
- Do all pod doors work properly?<br>
- Are accesses set properly on doors, pod buttons, etc.<br>
- Are all items placed properly? (not below vents, scrubbers, tables)<br>
- Does the disposal system work properly from all the disposal units in this room and all the units, the pipes of which pass through this room?<br>
- Check for any misplaced or stacked piece of pipe (air and disposal)<br>
- Check for any misplaced or stacked piece of wire<br>
- Identify how hard it is to break into the area and where the weak points are<br>
- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.<br>


== General Station-wide Mapping Guidelines ==
There are 4 types of objects in the game:
*'''Area''' - we won't be interested in these as you can't see it ingame and wip graphics are sufficient,
*'''Mob''' - humans, monkeys, cyborgs, aliens and other living creatures on the station,
*'''Objects''' - machines, doors, items and anything else in the game,
*'''Turf''' - walls, floors and space


=== Atmospherics ===
== The DMI file format ==
*Each area should have EXACTLY one air alarm (Exceptions are only possible if a room has scrubbers or vent pumps on different frequencies)
*Each ROOM (Walled off space) should have at least one vent pump and scrubber, which is properly connected to it's respective loop
*The air supply loop's pipes should be colored blue
*The scrubbers loop's pipes should be colored red


=== Power ===
Sprites in SS13 are packaged in .dmi files. To make a new dmi file, open up dream maker, select file > new and choose icon file (dmi) from the drop-down menu. Write a file path for it and hit ok.
*Each area (which requires power) should have exactly one APC


== Atmospherics ==
A new window will open with a blank file. in the upper-right are two spaces for sprite dimensions. Most sprites are 32x32 pixels in size. One dmi file cannot hold sprites of different sizes, unfortunately.


=== Pipes and manifolds ===
Now right-click somewhere in the whiteness. There are two types of sprite: pixmap and movie. A pixmap is static while a movie can be animated and face multiple directions, that's all the difference. Let's make a movie sprite. (New movie)


Atmospherics releases it's cocktail of gases into the air supply loop (blue pipes). The station is also equipped with a scrubber loop, which filters unwanted gases and sends them back to atmospherics via the scrubber loop (red pipes).
A window opens with four directional arrows and 3 frames for each of them, all of them gray. Byond understands 8 directions. You can choose how many you wish to use below the sprites themselves: 1, 4 or 8. You can also select how many frames you wish the animation to have. If you're making a multi-directional static sprite, make a movie with 1 frame, so no animation, but with 4 or 8 directions, depending how many you need. If you wish to have the sprite animated it may also interest you that you can set the delay in 1/10 of a second above the particular frame. Okay, hopefully you'll know what to do from here. The built-in sprite editing tool is very primitive and the only thing worth mentioning in it is how to apply the alpha filter. If you double-click any image you'll get to the sprite editor, and at the right of it is a vertical slider, which controls the alpha channel. Also worth mentioning is that copying from the editor can behave a bit strange, by making full backgrounds despite the alpha filter being set. Just 'flood' the background with a color with an alpha value of 0 or use 'import', which works fine.


If you're expanding the air supply loop (blue pipes) use the objects in /obj/machinery/atmospherics/pipe/simple/supply/visible or ../hidden depending on if you want it to show above floors or below them. For manifolds use the objects in /obj/machinery/atmospherics/pipe/manifold/supply/visible and ../hidden.
Now let's assume we've made your sprites sprites, go back to the dmi file (the screen which showed up when you first made the file). Assuming you've made a sprite, you'll see it in the list there. Double-click just below the actual sprite and a rename window should open, alternatively select the sprite and hit F2 on your keyboard. Give a name to your sprite. This name is often referred as an icon_state, as that's the variable name which defines it in code.


If you are expanding the scrubber loop (red pipes) use the objects in /obj/machinery/atmospherics/pipe/simple/scrubbers/visible or ../hidden depending on if you want it to show above floors or below them. For manifolds use the objects in /obj/machinery/atmospherics/pipe/manifold/scrubbers/visible and ../hidden.
Also note that you can import and export image files of different sorts by selecting the files you wish to export in the editor (hold ctrl to select multiple) and right clicking and selecting export, or right clicking anywhere and selecting import to import. DMI is similar to PNG, so if you rename a DMI's extension to PNG it should work in all graphical editing software. It usually works in reverse too. This makes recoloring quicker.


If you are however building a pipe network which has nothing to do with the air supply or scrubbers loop, you should use the objects in /obj/machinery/atmospherics/pipe/simple/general/visible or ../hidden. For manifolds use the objects in /obj/machinery/atmospherics/pipe/manifold/general/visible and ../hidden. To manually set these ones up you will need to set the following parameters (Assuming you are properly using the visible/hidden categories)
Now, hopefully that's all the information you need to sprite and make dmi files.


  color = ""  // select from "" for gray or "red", "blue", "cyan", "green" or "yellow"
== Required sprites by object category ==
  icon_state = "intact" //The color of pipes is set to what the color variable says at round
  start irrespective of this, however to make mapping easier, please set the icon_state variable
  to the correct one here too. Please refer to the table below for icon_states for different colors.


{|
Now to tell you what sprites different types of items need:
!Color
!Visibility
!icon_state (pipe)
!icon_state (manifold)
|-
|Gray
|Visible
|intact
|manifold
|-
|Gray
|Hidden
|intact-f
|manifold-f
|-
|Red
|Visible
|intact-r
|manifold-r
|-
|Red
|Hidden
|intact-r-f
|manifold-r-f
|-
|Blue
|Visible
|intact-b
|manifold-b
|-
|Blue
|Hidden
|intact-b-f
|manifold-b-f
|-
|Cyan
|Visible
|intact-c
|manifold-c
|-
|Cyan
|Hidden
|intact-c-f
|manifold-c-f
|-
|Green
|Visible
|intact-g
|manifold-g
|-
|Green
|Hidden
|intact-g-f
|manifold-g-f
|-
|Yellow
|Visible
|intact-y
|manifold-y-f
|-
|Yellow
|Hidden
|intact-y-f
|manifold-y-f
|}


=== Air Alarm ===
=== Mobs ===


Every single area (with scrubbers and/or vent pumps) should have exactly one air alarm. More than one should be placed if vent pumps or scrubbers use different radio frequencies than the default one (1439).
*Mobs require sprites in 4 directions. If you want them to be able to wear clothes, hold items, wear gloves, glasses, etc. then the part which you'd like to keep needs to be in the same place as on the human sprite in all 4 directions. Yeah, this limits you a lot.


=== Scrubbers (Station air supply) ===
=== Turfs ===


Every room (ie. walled off space) except for maintenance hallways should have at least one scrubber.
*Floors are in icons/turf/floors.dmi - Check the file for examples
*Walls are in icons/turf/walls.dmi - Check the file for examples
*And some other stuff is in other files in icons/turf/
*I think these are pretty self explanatory


The vars you need to set for this one specifically are:
=== Objects ===


  on = 1
*Items, stuff that you can pick up and use generally require an item sprite and an in-hand sprite. The item sprite can be put in icons/obj/items.dmi or other dmi files, while the in-hand sprite needs to be in icons/mob/items_lefthand.dmi and icons/mob/items_righthand.dmi
  scrubbing = 1
*Clothing: Stuff that you can wear: Generally requires an item sprite in the appropriate dmi file in icons/obj/clothing/ , and in-hand sprite in icons/mob/items_lefthand.dmi and items_righthand.dmi as well as the on-mob sprite in the appropriate file in icons/mob/
  scrub_co2 = 1
*Machinery: Usually either just one sprite or separate on-off sprites. It tends to differ from machine to machine
  scrub_toxins = 0
  scrub_n2o = 0
  volume_rate = 120
  panic = 0
  frequency = 1439


And make sure the '''id_tag''' is the default one (null)


Also ensure the scrubber is connected to the scrubber loop!!
== Locating sprites ==


=== Vent Pumps (Station air supply) ===
For most objects if you double-click them in the object tree (on the left side of the dream maker window) you will be taken to their definition in code. In the variables below what is highlighted you will often see:


Every room (ie. walled off space) except for maintenance hallways should have at least one vent pump.
  icon = 'abc.dmi'
  icon_state = "sprite_name"


The vars you need to set for this one specifically are:
The icon variable defines the file which contains the sprites and the icon_state defines the name of the sprite in the specified file.
Sometimes the icon or even icon_state variable will not be set under the definition. This means they're set on a parent level. If you're looking for /obj/item/weapon/storage/belt/full and can't see it, try looking at /obj/item/weapon/storage/belt. If it isn't there try looking for /obj/item/weapon/storage and so on.


  on = 1
Note that sometimes double-clicking an object in the object tree will not bring you to the object definition. You will know this by the highlighted line not being the same as the path to the object you double-clicked in the object browser. Searching for the definition in such cases can be a bit hard, so I've prepared a list of the most commonly used dmi files for certain objects:
  pump_direction = 1
  pressure_checks = 1
  frequency = 1439


And make sure the '''id_tag''' is the default one (null)
'''/obj/machinery'''<br>
icon = 'stationobjs.dmi'<br>
definition in: [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj/machinery.dm code/defines/obj/machinery.dm]


Also ensure the vent pump is connected to the air supply loop!!
'''/obj/item/weapon/storage'''<br>
icon = 'storage.dmi'<br>
definition in: [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]


== Power ==
'''/obj/item/weapon'''<br>
icon = 'weapons.dmi'<br>
defined in: [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj/weapon.dm code/defines/obj/weapon.dm]


=== APC ===
'''/obj/item'''<br>
Each new room needs at least one, this will provide all the power for the room (magically). Any room that is very equipment heavy may need another APC to split the load and prevent early black outs.
icon = 'items.dmi'<br>
definition in: [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]


=== Wiring ===
== Contributing sprites and finding sprite requests ==
Make sure the wires lead from the main power grid, and to the APC(s) of your area. If any equipment in your new area requires a wire under it, line it up, connected to the main power grid, and under the machinery. Wires are also helpful when making electrical grills (just dot wire under a grill), make sure the wires touch the main power grid (or they won't shock people).


== Equipment ==
See here to submit sprite: http://baystation12.net/forums/index.php/board,18.0.html


=== Lights ===
Other useful links
Lights take up a lot of power, don't use too many! Make sure to put in just enough so the room is fully lit, but not so many that the equipment will go out in ten minutes of the round starting.


=== Light switch ===
http://baystation12.net/forums/index.php/topic,3946.0.html - General Sprite Thread
For mood lighting, or to show the room is currently not in use by the primary occupant. These disable the lighting equipment (and power drain associated) in the area, but not desk lamps. Place these on walls, usually by a door.


=== Request Console ===
http://baystation12.net/forums/index.php/topic,4294.0.html - General Sprite Request Thread
If a certain room has no need for materials, or produces no materials, do not give it a Request Console. If it does (for either case or both) make sure it has at least one, that is in a place where some one will see it.
 
=== Intercoms ===
At least every room should have one of these. They should be set to 145.9, and be speaker ON Microphone OFF. This is so radio signals can reach people even without head sets on. Larger room will require more than one at a time.
 
=== Security Cameras ===
Most areas should have these, enough to see the general area from a Human point of view, but, not bunched together for the AI's sake. Larger rooms may require more than one.
 
== Room Structure ==
 
=== Access ===
Here are the various door access.
 
access_security = 1
 
access_brig = 2
 
access_armory = 3
 
access_forensics_lockers= 4
 
access_medical = 5
 
access_morgue = 6
 
access_tox = 7
 
access_tox_storage = 8
 
access_genetics = 9
 
access_engine = 10
 
access_engine_equip= 11
 
access_maint_tunnels = 12
 
access_external_airlocks = 13
 
access_emergency_storage = 14
 
access_change_ids = 15
 
access_ai_upload = 16
 
access_teleporter = 17
 
access_eva = 18
 
access_heads = 19
 
access_captain = 20
 
access_all_personal_lockers = 21
 
access_chapel_office = 22
 
access_tech_storage = 23
 
access_atmospherics = 24
 
access_bar = 25
 
access_janitor = 26
 
access_crematorium = 27
 
access_kitchen = 28
 
access_robotics = 29
 
access_rd = 30
 
access_cargo = 31
 
access_construction = 32
 
access_chemistry = 33
 
access_cargo_bot = 34
 
access_hydroponics = 35
 
access_manufacturing = 36
 
access_library = 37
 
access_lawyer = 38
 
access_virology = 39
 
access_cmo = 40
 
access_qm = 41
 
access_court = 42
 
access_clown = 43
 
access_mime = 44
 
access_surgery = 45
 
access_theatre = 46
 
access_research = 47
 
access_mining = 48
 
access_mining_office = 49 - not in use
 
access_mailsorting = 50
 
access_mint = 51
 
access_mint_vault = 52
 
access_heads_vault = 53
 
access_mining_station = 54
 
access_xenobiology = 55
 
access_ce = 56
 
access_hop = 57
 
access_hos = 58
 
access_RC_announce = 59 - Request console announcements
 
access_keycard_auth = 60 - Used for events which require at least two people to confirm them
 
access_tcomsat = 61 -  has access to the entire telecomms satellite / machinery
 
=== CentCom Access ===
Mostly for admin use.
 
access_cent_general = 101 - General facilities.
 
access_cent_thunder = 102 - Thunderdome.
 
access_cent_specops = 103 - Special Ops.
 
access_cent_medical = 104 - Medical/Research
 
access_cent_living = 105 - Living quarters.
 
access_cent_storage = 106 - Generic storage areas.
 
access_cent_teleporter = 107 - Teleporter.
 
access_cent_creed = 108 - Creed's office.
 
access_cent_captain = 109 - Captain's office/ID comp/AI.
 
=== Misc Access ===
 
access_syndicate = 150 - General Syndicate Access
 
access_crate_cash = 200 - Money Crates?
 
=== Airless Floors ===
 
Ideal for rooms or chambers that mix gas, and for tiles exposed to space. Not ideal for areas that humans will cross in frequency.
 
Use these on external tiles (to prevent lag when the game starts) and chambers that will require gas mixing (toxins mix chamber/ furnace). Double check these to make sure you don't suffocate mobs in the new rooms.
 
=== Fire Alarms and Fire Doors  ===
Make sure to put these INSIDE of the boundary of the area, so there is a lock down. Any spot that gets hot as a normal function should not have a fire Alarm right next to the heat source (toxin mix chamber). Make sure there is a fully sealed area (with the exception of maintenance doors for people to escape fires) that can't be open by normal civilians.
 
=== Weak Points ===
Judge how high security the room will be, if it is high security, reinforced walls and electrified grill windows may be in order. Areas that do not need a lot of security can use basic walls, and windows to your liking (though normal glass windows break very very easy). Each room should have one place that's weaker than the rest (like a back door, side entrance, or a window), just because the main entrance might be out of commission (and realistically, for traitors to break into).
 
=== Item and Machinery Distribution ===
Be smart about what will go in an area, keep a fine balance between the size of the room and amount of equipment. Large rooms may require multiple APCs to prevent power outages early in game. Second, make sure to place equipment that make sense for the area (security computer in a security area/ Medical vendor in a medical area).
 
== Balance ==
 
=== Item contents ===
The harder the room is to enter, the more goodies or sensitive equipment there is inside. Make sure to keep this in mind (and don't make an empty room that's covered in blast doors, electrified grills, reinforced walls, and captain level doors).
 
=== Room security ===
A room is only as secure as its necessity. Public rooms should not have many security functions (other than a fire alarm), but private work space must be more secure (based on job). The bartenders do not need reinforced walls around their storage, but engineers do.
 
The highest security rooms should utilize the highest security measures. The lowest security rooms should utilize the cheapest security measures.
 
== Step_x, step_y and the broken movement syndrome ==
 
So you compiled the map and suddenly whenever you move you no longer get the animation of moving but just 'appear' on the next tile?
 
So a while back step_x and step_y were introduced to allow pixel based movement. SS13 does not utilize this. Step_x and step_y are variables that each atom has. The way they work is that as soon as you set any object on the map to use one of these variables, the game interprets that you overrode all default movement code and wrote your own - but you didn't (The code that makes the animation from tile to tile).
 
To fix this problem you need to close dream maker (save the project first, obviously). Open your map (.dmm) file in a text editor, such as notepad or notepad++. Search (ctrl+f) through the file for step_x and step_y and remove any reference to it. Once no more step_x or step_y -es are found in the file, save it and open it in dream maker once again. Compile the code and movement should work fine once more. Go to [[Community|the development IRC]] if you need more help.


[[Category:Guides]] [[Category:Game Resources]]
[[Category:Guides]] [[Category:Game Resources]]
{{Contribution guides}}

Revision as of 04:55, 3 October 2013

This is not a technical guide on how to do sprites in a graphical program, this is a guide intended for people who know how to sprite, but need to know what exactly is needed when people want sprites done for them. Most sprites are 32x32 pixels. They use 32b colors (24b + alpha channel).

Object overview

There are 4 types of objects in the game:

  • Area - we won't be interested in these as you can't see it ingame and wip graphics are sufficient,
  • Mob - humans, monkeys, cyborgs, aliens and other living creatures on the station,
  • Objects - machines, doors, items and anything else in the game,
  • Turf - walls, floors and space

The DMI file format

Sprites in SS13 are packaged in .dmi files. To make a new dmi file, open up dream maker, select file > new and choose icon file (dmi) from the drop-down menu. Write a file path for it and hit ok.

A new window will open with a blank file. in the upper-right are two spaces for sprite dimensions. Most sprites are 32x32 pixels in size. One dmi file cannot hold sprites of different sizes, unfortunately.

Now right-click somewhere in the whiteness. There are two types of sprite: pixmap and movie. A pixmap is static while a movie can be animated and face multiple directions, that's all the difference. Let's make a movie sprite. (New movie)

A window opens with four directional arrows and 3 frames for each of them, all of them gray. Byond understands 8 directions. You can choose how many you wish to use below the sprites themselves: 1, 4 or 8. You can also select how many frames you wish the animation to have. If you're making a multi-directional static sprite, make a movie with 1 frame, so no animation, but with 4 or 8 directions, depending how many you need. If you wish to have the sprite animated it may also interest you that you can set the delay in 1/10 of a second above the particular frame. Okay, hopefully you'll know what to do from here. The built-in sprite editing tool is very primitive and the only thing worth mentioning in it is how to apply the alpha filter. If you double-click any image you'll get to the sprite editor, and at the right of it is a vertical slider, which controls the alpha channel. Also worth mentioning is that copying from the editor can behave a bit strange, by making full backgrounds despite the alpha filter being set. Just 'flood' the background with a color with an alpha value of 0 or use 'import', which works fine.

Now let's assume we've made your sprites sprites, go back to the dmi file (the screen which showed up when you first made the file). Assuming you've made a sprite, you'll see it in the list there. Double-click just below the actual sprite and a rename window should open, alternatively select the sprite and hit F2 on your keyboard. Give a name to your sprite. This name is often referred as an icon_state, as that's the variable name which defines it in code.

Also note that you can import and export image files of different sorts by selecting the files you wish to export in the editor (hold ctrl to select multiple) and right clicking and selecting export, or right clicking anywhere and selecting import to import. DMI is similar to PNG, so if you rename a DMI's extension to PNG it should work in all graphical editing software. It usually works in reverse too. This makes recoloring quicker.

Now, hopefully that's all the information you need to sprite and make dmi files.

Required sprites by object category

Now to tell you what sprites different types of items need:

Mobs

  • Mobs require sprites in 4 directions. If you want them to be able to wear clothes, hold items, wear gloves, glasses, etc. then the part which you'd like to keep needs to be in the same place as on the human sprite in all 4 directions. Yeah, this limits you a lot.

Turfs

  • Floors are in icons/turf/floors.dmi - Check the file for examples
  • Walls are in icons/turf/walls.dmi - Check the file for examples
  • And some other stuff is in other files in icons/turf/
  • I think these are pretty self explanatory

Objects

  • Items, stuff that you can pick up and use generally require an item sprite and an in-hand sprite. The item sprite can be put in icons/obj/items.dmi or other dmi files, while the in-hand sprite needs to be in icons/mob/items_lefthand.dmi and icons/mob/items_righthand.dmi
  • Clothing: Stuff that you can wear: Generally requires an item sprite in the appropriate dmi file in icons/obj/clothing/ , and in-hand sprite in icons/mob/items_lefthand.dmi and items_righthand.dmi as well as the on-mob sprite in the appropriate file in icons/mob/
  • Machinery: Usually either just one sprite or separate on-off sprites. It tends to differ from machine to machine


Locating sprites

For most objects if you double-click them in the object tree (on the left side of the dream maker window) you will be taken to their definition in code. In the variables below what is highlighted you will often see:

 icon = 'abc.dmi'
 icon_state = "sprite_name"

The icon variable defines the file which contains the sprites and the icon_state defines the name of the sprite in the specified file. Sometimes the icon or even icon_state variable will not be set under the definition. This means they're set on a parent level. If you're looking for /obj/item/weapon/storage/belt/full and can't see it, try looking at /obj/item/weapon/storage/belt. If it isn't there try looking for /obj/item/weapon/storage and so on.

Note that sometimes double-clicking an object in the object tree will not bring you to the object definition. You will know this by the highlighted line not being the same as the path to the object you double-clicked in the object browser. Searching for the definition in such cases can be a bit hard, so I've prepared a list of the most commonly used dmi files for certain objects:

/obj/machinery
icon = 'stationobjs.dmi'
definition in: code/defines/obj/machinery.dm

/obj/item/weapon/storage
icon = 'storage.dmi'
definition in: code/defines/obj.dm

/obj/item/weapon
icon = 'weapons.dmi'
defined in: code/defines/obj/weapon.dm

/obj/item
icon = 'items.dmi'
definition in: code/defines/obj.dm

Contributing sprites and finding sprite requests

See here to submit sprite: http://baystation12.net/forums/index.php/board,18.0.html

Other useful links

http://baystation12.net/forums/index.php/topic,3946.0.html - General Sprite Thread

http://baystation12.net/forums/index.php/topic,4294.0.html - General Sprite Request Thread