- 1. Theme structure
- 2. Graphics and animations
- 3. Sounds
- 4. The theme.ini
- 4.1 Tower specifications
- 4.2 Creep specifications
- 4.3 Rotation values
- 4.4 Color values
- 4.5 Stroke values
- 4.6 Tower shot types
- 4.7 Creep effect values
- 5. Testing your theme
- 6. Example themes
Creating your own themes
CreepTD enables developers to create their very own custom theme sets for the game. This page will cover all neccessary information you need to get started with custom theme development.
1. Theme structure
Basically a theme is a set of graphics and/or sounds with their behaviour defined in a 'theme.ini'. What you need to do is to create all the graphics and sounds you want to include in your theme and specify how these are meant to behave inside the game.
To make your theme work inside the game you will then need to package all required files into a single ZIP archive. You can also start off with one of the example themes. The ZIP archive must contain a 'theme.ini' file in its root. Example:
your-theme-archive.zip ˫ theme.ini ˫ towers/ ˪ ... ˫ creeps/ ˪ ... ˪ sounds/ ˪ ...
2. Graphics and animations
The game uses a custom format on top of PNG24 to store animated sequences but it's entirely optional to use this. Plain images without animations will work, too (but animations really look better!). To make this possible every graphics may contain a sequence of frames aligned horizontally. Every frame needs to be exactly the same size. On the bottom left of each frame there is a frame descriptor pixel that contains the display length (0-255) in its blue color value. An example:
As you can see the animation is put together of 19x19 px frames plus one line below that contains the descriptor pixels. Let's go through this frame by frame:
1 | Blue color value in the descriptor pixel is 0. This is a stop frame. |
---|---|
2 | Blue color value in the descriptor pixel is 6. This frame will show for 6 ticks. |
3 | Blue color value in the descriptor pixel is 6. This frame will show for 6 ticks. |
4 | Blue color value in the descriptor pixel is 35. This frame will show for 35 ticks. |
5 | Blue color value in the descriptor pixel is 6. This frame will show for 6 ticks. |
6 | Blue color value in the descriptor pixel is 6. This frame will show for 6 ticks. |
More precisely: The second frame will start to play when the tower shots (and then reloads). When frame 6 is reached, the animation will continue with frame 1 and stop.
However, it is not required to create an animation as I already mentioned. You can simply use a plain image without any animation that simply does not contain the additional frame descriptor line.
Hint: Most image editing programs (Photoshop for example) 'optimize' images when saving them. This will usually result in every frame descriptor pixel to have a color value of 000000 (that's bad), so make sure to deactivate optimizations when saving the file.
3. Sounds
Sound effect files need to be in WAV format (OGG and MP3 are still experimental and seem under some circumstances not to play the whole sound) and require to be cut accordingly to be played without a delay.
So if you want to do this right, cut away all the silence before the first noise so that the sound's waveform looks similar to the image above.
Hint: Use WAV files with 22050 kbit (if this sounds too bad 44100 kbit), 16 bit, mono (1 channel) to make the theme small. It's also always a good idea to keep sound files as short as possible because only a couple of sounds can be played simultaneously. So the shorter the sound, the more sound effects can be played at the same time.
4. The theme.ini
The theme.ini specifies what exact graphics are used for which tower or creep and allows you to specify lots of options for every single entity. The first few lines always define your theme's name, you as its author and what customisations it actually provides. Example:
name=My Cool Theme author=MyPlayerName providesTowers=yes providesTowerSounds=yes providesCreeps=yes providesCreepSounds=yes
Optionally, a custom theme may extend one of the default themes (default or classicplus) as a starting point. However, it will only extend the theme.ini (effects, file names) and has no access to the actual contents of the extended theme (like images or sounds). You need to add those to your custom theme also, if you want to re-use them. Example:
extends=default
Afterwards the theme.ini contains the specifications of towers and creeps accoriding to the customisations it provides.
4.1 Tower specifications
Each tower is described by a tower specification section and you need to define a set of settings for each one. The start of a section is always indicated by its name in brackets like this: [TOWER1]. Towers available:
TOWER1 | Gun Turret | Level 1 |
---|---|---|
TOWER11 | Gun Turret | Level 2 |
TOWER12 | Gun Turret | Level 3 |
TOWER13 | Gun Turret | Level 4 |
TOWER2 | EMP Emitter | Level 1 |
TOWER21 | EMP Emitter | Level 2 |
TOWER22 | EMP Emitter | Level 3 |
TOWER23 | EMP Emitter | Level 4 |
TOWER3 | Cannon Tower | Level 1 |
TOWER31 | Cannon Tower | Level 2 |
TOWER32 | Cannon Tower | Level 3 |
TOWER33 | Cannon Tower | Level 4 |
TOWER4 | Missile Silo | Level 1 |
TOWER41 | Missile Silo | Level 2 |
TOWER42 | Missile Silo | Level 3 |
TOWER43 | Missile Silo | Level 4 |
TOWER5 | Tesla Tower | Level 1 |
TOWER51 | Tesla Tower | Level 2 |
TOWER52 | Tesla Tower | Level 3 |
TOWER53 | Tesla Tower | Level 4 |
TOWER6 | Ion Cannon | Level 1 |
TOWER61 | Ion Cannon | Level 2 |
For every tower you have to define a set of parameters (some of them are optional) on how the tower is supposed to behave and what content to use for this. Parameters are defined like this: name=Cool Tower Name. Available parameters are:
If graphics are provided: | ||
name | The tower's textual name (yes, you can change that) | |
---|---|---|
rotation | The tower's turret rotation (see) | |
shot | The tower's shot type (see) | Not available for TOWER4* |
shotInnerStroke | Inner stroke of the shot beam (see) | Optional, Not available for TOWER4* |
shotInnerColor | Inner color of the shot beam (see) | Optional, Not available for TOWER4* |
shotOuterStroke | Outer stroke of the shot beam (see) | Optional, Not available for TOWER4* |
shotOuterColor | Outer color of the shot beam (see) | Optional, Not available for TOWER4* |
splashInnerStroke | Inner stroke of the splash arc (see) | Optional, Only available for towers with splash damage |
splashInnerColor | Inner color of the splash arc (see) | Optional, Only available for towers with splash damage |
splashOuterStroke | Outer stroke of the splash arc (see) | Optional, Only available for towers with splash damage |
splashOuterColor | Outer color of the splash arc (see) | Optional, Only available for towers with splash damage |
targetInnerStroke | Inner stroke of the targeting beam (see) | Optional, Only available for shot=ORBIT |
targetInnerColor | Inner color of the targeting beam (see) | Optional, Only available for shot=ORBIT |
targetOuterStroke | Outer stroke of the targeting beam (see) | Optional, Only available for shot=ORBIT |
targetOuterColor | Outer color of the targeting beam (see) | Optional, Only available for shot=ORBIT |
ani | Tower graphics / animation (19x19px frames) (see) | |
turretAni | Tower turret graphics / animation (19x19px frames) (see) | Optional |
projectileAni | Tower projectile graphics / animation (7x7px frames) (see) | Optional, Only available for TOWER4* |
buildAni | Tower building animation (overlay, 19x19px frames, 50 ticks) (see) | Optional |
upgradeAni | Tower upgrading animation (overlay, 19x19px frames, 50 ticks) (see) | Optional, Only available if upgradeable |
changestrategyAni | Tower changing strategy animation (overlay, 19x19px frames, 50 ticks) (see) | Optional |
sellAni | Tower selling animation (overlay, 19x19px frames, 50 ticks) (see) | Optional |
If sounds are provided: | ||
sound | Tower shoting sound (battlefield) (see) | |
projectileSound | Projectile hit sound (battlefield) (see) | Optional, Only available for TOWER4* |
buildSound | Tower starts building sound (see) | Optional |
upgradeSound | Tower starts upgrading sound (see) | Optional, Only available if upgradeable |
changestrategySound | Tower starts changing strategy sound (see) | Optional |
sellSound | Tower starts selling sound (see) | Optional |
If you leave an optional parameter empty, it will show, draw or play nothing.
If an animation's tick length is given, the animation can be composed of this number of frames (e.g. a fancy building animation that gets more complete over time). An 'ani' animation always begins with a stop frame showing the idle tower and can contain an additional number of frames that matches the tower's cooldown time (see the Missile Silo example above).
4.2 Creep specifications
Like towers, also creeps are descripted by a creep specification section and you need to define a set of settings for each one. The start of a section is always indicated by its name in brackets like this: [CREEP1]. Creeps available:
CREEP1 | Mercury |
---|---|
CREEP2 | Mako |
CREEP3 | Fast Nova |
CREEP4 | Large Manta |
CREEP5 | Demeter |
CREEP6 | Ray |
CREEP7 | Speedy Raider |
CREEP8 | Big Toucan |
CREEP9 | Vulture |
CREEP10 | Shark |
CREEP11 | Racing Mamba |
CREEP12 | Huge Titan |
CREEP13 | Zeus |
CREEP14 | Phoenix |
CREEP15 | Express Raptor |
CREEP16 | Mothership |
For every creep you have to define a set of parameters (some of them are optional) on how the creep is supposed to behave and what content to use for this. Parameters are defined like this: name=Cool Creep Name. Available parameters are:
If graphics are provided: | ||
name | The creeps's textual name (yes, you can change that also) | |
---|---|---|
rotation | The creep's rotation (see) | |
ani | Creep graphics / animation (19x19px frames) (see) | |
dieAni | Creep die animation (19x19px frames) (see) | Optional |
effect | Built-in creep effect to use (see) | Optional |
If sounds are provided: | ||
dieSound | Creep dies sound (battlefield) (see) | Optional |
incomingSound | Creep incoming sound (see) | Optional |
escapeSound | Creep escaped sound (see) | Optional |
If you leave an optional parameter empty, it will show, draw or play nothing.
4.3 Rotation values
AUTO | The tower's turret automatically aims at creeps / the creep automatically rotates according to the path |
---|---|
float value | Independent rotation between -PI (anti-clockwise) and +PI (clockwise) per tick (50ms). For a random direction append "R". |
4.4 Color values
RGB | Hexadecimal red/green/blue values in short notation (0-F) |
---|---|
RRGGBB | Hexadecimal red/green/blue values (00-FF) |
RGBA | Hexadecimal red/green/blue/alpha values in short notation (0-F) |
RRGGBBAA | Hexadecimal red/green/blue/alpha values (00-FF) |
4.5 Stroke values
solid[:thickness] | A solid stroke | solid:1 |
---|---|---|
dashed[:thickness[:dashlength[:spacelength]] | A dashed stroke | dashed:1:10:10 |
zigzac[:thickness[:amplitude[:wavelength]]] | A zigzag stoke | zigzag:1:1:3 |
wobble[:thickness[:amplitude[:detail]]] | A wobble stoke | wobble:1:3:1 |
4.6 Tower shot types
DIRECT | The tower shots on creeps with a direct beam |
---|---|
ORBIT | The tower shots on creeps via the orbit (like the Ion Cannon) |
4.7 Creep effect values
REGENERATE | The creep's healthbar will fade in and out |
---|---|
SLOWIMMUNE | There will be a shield effect around the creep |
Of course you do not need to use the built-in effects and are free to include custom effects inside of the creep's graphics instead.
5. Testing your theme
To test your theme select "Install new theme" from the theme select boxes at the options screen. Now just start a Sandbox game and try if everything is working out like intended. Once everything is working out well, go ahead and distribute your theme.
Hint: A good place to distribute your theme might be to post it to the forums for everyone.
Enjoy!