Difference between revisions of "Guide to Spriting"

From Paradise Station Wiki
Jump to navigation Jump to search
m
(adds github sidebar)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
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).
{{SidebarGithub}}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 colours (24b + alpha channel).


== Object overview ==
== Object overview ==
Line 18: Line 18:
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)
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.
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 colour 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.
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.
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 recolouring quicker.


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


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:
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'''<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]
'''/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]
'''/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]
'''/obj/item'''<br>
icon = 'items.dmi'<br>
definition in: [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]


== Contributing sprites and finding sprite requests ==
== Contributing sprites and finding sprite requests ==


There's supposed to be a link right in this spot.
https://github.com/ParadiseSS13/Paradise - Server Code Github


https://nanotrasen.se/forum/65-graphics-section/ - Graphics Section
https://www.paradisestation.org/forum/60-suggestions/ - General Suggestion Thread


{{Template:Contribution Guides}}
{{Contribution Guides}}


[[Category:Guides]]
[[Category:Guides]] [[Category:Game Resources]]

Latest revision as of 02:02, 4 December 2023

Github

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 colours (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 colour 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 recolouring 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:

Contributing sprites and finding sprite requests

https://github.com/ParadiseSS13/Paradise - Server Code Github

https://www.paradisestation.org/forum/60-suggestions/ - General Suggestion Thread

Contribution Guides
General Guide to Contributing, Game Resources category, Github Glossary
Setting up a server Setting up the Database, Creating your own paracode server
Coding Understanding SS13 Code, SS13 for experienced programmers, Text Formatting
Mapping Guide to Mapping,
Spriting Guide to Spriting,
Wiki Guide to Editing the Wiki