How-To: Creating new theme [updated, still old illustrations]

47 replies [Last post]
unC0Rr
unC0Rr's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 11/27/2006
Posts: 561

We receive many requests on theme creating topic. So, I'll try to describe this process.

Land generator theme in Hedgewars consists of many files: LandTex.png, Sky.png, horizont.png, Border.png, Flake.png and theme.cfg.

Let's have a look at 'nature' theme:

  • LandTex.png is an image of 640x480 size. Actually, you may choose any dimensions you like when creating your own theme. The LandTex picture is tiled over generated landscape, so it should have no visible joints when being tiled for better looking.
  • Sky.png is the picture of the sky, it should be 1024 px high, any width. The color of the sky above clouds is described in theme.cfg. 'avematan' theme has 64x1024 Sky.png, which is actually a gradient from dark-blue bottom to blue top. Sky.png is tiled horizontally.
  • horizont.png is an image, drawn behind the landscape in front of the sky. It could be of any size. horizont.png is tiled horizontally, just under the water line.
  • Border.png is the image of the border of landscape. It could be of any width, 32 px height. Top half of the picture is the border of the top lanscape edges, and the bottom half is the border of bottom edges.
  • Flake.png is the image of those objects flying behind map.

Let's look at the screenshot:

'1' points to horizont.png
'2' shows where the Border.png is drawn
'3' is over Sky.png
'4' is painted on LandTex.png
'5' shows so-called 'map objects'.

What are 'map objects'? To understand well, we should look into theme.cfg and see, what's there.

  • The first line of theme.cfg is the color value of landscape hole border color after explosion. It has format "R G B", where R, G and B are red, green and blue color components, each has value from 0 to 255;
  • The next line describes sky color in the same format;
  • Third line is soundtrack name, you may leave this line empty;
  • Fourth line is the number of clouds to fly in the sky;
  • 5th line is the number of map objects included in this theme
There could be no map objects, but theme is quite sad without them. 'nature' theme has 4 map objects. Next lines describe map objects, two lines per object. So, let's look at these lines:
plant2
0 85 25 25 2 0 0 170 70 50 70 120 40

The first line is the name of the map object picture. The second describes the object: '0 85 25 25' is the rectangle of picture that should be behind the landscape, hidden from view (it has "left top width heigth" format). '2' is the number of rectangles that should be visible, '0 0 170 70' and '50 70 120 40' are visible rectangles described for this object. Let's see:

Green rectangles are rectangles described for 'inf' map object. Left rectangle is guaranteed to be visible, and the right - to be invisible when the land is generated.
The next line contains '0' - the number of special objects - that are painted on top of landscape. The example could be found in theme 'wood' (line '5' there means the maximum number of objects placed on the land).

Last two lines are: number of flakes and their properties in format 'number_of_frames frame_duration rotation_velocity falling_speed'

So, that's all! Enjoy creating new themes!

Displacer
User offline. Last seen 2 years 3 days ago. Offline
Joined: 11/27/2006
Posts: 29

If you have created a new nice looking theme or map and wish to share it to community - you are welcome to tell us about that. We will be pleased to include your artwork in the next release of hedgewars.

omen
User offline. Last seen 4 years 13 weeks ago. Offline
Joined: 10/11/2007
Posts: 5

Here ya go i just made this map in about 5 mins and thought id share it i have also made a new theme to go with it the download link is at the bottom of the page.

image:

Quote:
map link:
http://www.mediafire.com/download.php?7dvztxdbco3
to use this unzip this to your map folder you will also have to download my theme pack

Quote:
theme pack:
http://www.mediafire.com/?djbipvd2g9m
to use this unzip it into you theme folder then edit you theme.cfg with notepad and add volcano to the end of the list

then just run the game HAVE FUN!!:P
PS if you make me a sub-forum/thread i will make lots more stuff
PSS this project rulez!!

unC0Rr
unC0Rr's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 11/27/2006
Posts: 561

Good job, thank you! Smile We plan to include this theme and map into the next release. What is the licence you are willing to choose? Does GPL satisfy you? Feel free to create your own thread in this forum!

omen
User offline. Last seen 4 years 13 weeks ago. Offline
Joined: 10/11/2007
Posts: 5

unC0Rr wrote:
Good job, thank you! Smile We plan to include this theme and map into the next release. What is the licence you are willing to choose? Does GPL satisfy you? Feel free to create your own thread in this forum!

Yeah GPL licence is good il make more soon!!

robdun
User offline. Last seen 1 year 7 weeks ago. Offline
Joined: 08/22/2008
Posts: 7

thanks for this awesome topic now Im working on my own super mario theme.

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

robdun wrote:
working on my own super mario theme

Dammit. I was just thinking about the same!

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

Hi Smile

A question: we create a map (nice big image of some sort Smile). When we want to assign a theme to it and write "nature" in the cfg-file for example, what do we take from this theme? oundtrack - obviously.Skyline, flying things in the background - that too. But do we take the border properties and coordinates and if yes - how does this adjustment work? The walkable areas are obviously not in the cfg-file in the map's folder (along with 2 more images). How do we make all these walkable areas fit on our map?

Thanks in advance!
Best regards,
rbaleksandar

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

What walkable areas do you speak about? Every pixel that has alpha other than 0 is a solid shit. I wonder why no one created a semitransparent map yet. I was going to but ima lazy arse. Border properties sound like fun. There's destruction border color. It's described in theme.cfg. Border.png doesn't apply to a map anyhow since it's drawn, not generated. Still thinking about coordinates. Sholda smoke my guru-ganesh-beedies for this one.

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

Josh
Josh's picture
User offline. Last seen 2 years 27 weeks ago. Offline
Joined: 11/09/2008
Posts: 430

DrDickens wrote:
I wonder why no one created a semitransparent map yet.

My UFO fort takes advantage of semi-transparency. Not too much, but it does.

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

DrDickens wrote:
What walkable areas do you speak about? Every pixel that has alpha other than 0 is a solid shit. I wonder why no one created a semitransparent map yet. I was going to but i'm a lazy arse. Border properties sound like fun. There's destruction border color. It's described in theme.cfg. Border.png doesn't apply to a map anyhow since it's drawn, not generated. Still thinking about coordinates. Should smoke my guru-ganesh-beedies for this one.

Thanks. Well, actually there are non-walkable areas. For example a slope with an angle more than 60 degree. A hedgehog can't walk there.

There should be some kind of coordinates for the borders in a team. The border is an image (e.g little grass with small amount of dirt underneath) and when you generated a random map and change themes, this borders are placed on slopes, valleys etc.

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

In fact borders are placed over the terrain, like a landtex patch. I feel dumb. Looks like i am, cause i can't understand you. I got whut a non walkable means (60 deg is walkable i think but 90 is surely not). But the rest... Can you try and explain exatly what you mean? I guess you are talking about some shit that is coded and not written in any cfg.

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

Okay, let me try Smile

You have an image of a border. Like this one:

..\Hedgewars 0.9.9\share\hedgewars\Data\Themes\nature\Border.png

You can apply this theme (Nature I mean) on a map, right?
So now you have chosen your theme and you map.
How does the game adjust this border to the given map?
Look at all red circled areas. This is this Border.png. But how? The image itself is a rectangle. On the terrain it isn't at all. There are small circles, triangles, curves etc.

http://img218.imageshack.us/my.php?image=hwbordercs9.png

Hope this time I made myself clear enough Smile

Best regards,
rbaleksandar

PS: Sorry, can't make the darn think to resize. When I put

img=640x480

it just shows...nothing. Only the label "Click to view full image" (or something like that). Same with other resolutions Sad Smiley

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

Josh
Josh's picture
User offline. Last seen 2 years 27 weeks ago. Offline
Joined: 11/09/2008
Posts: 430

The border.png is split into 2 parts, top border and the undershadow.
The engine automatically places it WITH the theme, it isn't separately chosen...
The game engine warps the image about to fit the top of the texture, probably with some mathematical algorithm based on the terrains angle etc. and tiles the image across.

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

Quote:
You can apply this theme (Nature I mean) on a map, right?
So now you have chosen your theme and you map.
How does the game adjust this border to the given map?
Look at all red circled areas. This is this Border.png. But how? The image itself is a rectangle. On the terrain it isn't at all. There are small circles, triangles, curves etc.

Why would you care about this one? In fact the engine takes that rectangle splits it rorizontaly in 2 and verticaly in 128 or whatever images width is. Then engine aplies it to the terrain, rescaling those tiny stripes. You can do nothing about that.
Oh and once again, when you speak about maps, point out what exactly do you mean (predrawn maps or generated).
I hope that helped a little bit.

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

I was just very curious that's all Smile And wanted to know if I had to do something too complicated for my tiny brain Wink Smiley Obviously - don't have to Smile

Thanks for the replies guys.

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

Josh
Josh's picture
User offline. Last seen 2 years 27 weeks ago. Offline
Joined: 11/09/2008
Posts: 430

No problem rbaleksandar. The best way to learn is to try yourself first, remember that. Smile

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

I've already made one. Needs soundtrack and some other stuff, but it's almost ready Smile

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

rbaleksandar wrote:
I've already made one. Needs soundtrack and some other stuff, but it's almost ready Smile

Man, when i hear this, i compare to myself. By some stuff i usualy mean... Well when i hear this i imagine a 6% completion product, lol. I hope you do better that this.

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

Well, yes Smile But trust me, since in next months I won't have any time at all (except study, eat, sleep, sh*t, f*ck from time to time lol), don't expect it soon Big Grin

PS: When I'm ready with the drawing, I'll looks for some music talents around here Wink Smiley

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

Quote:
(except study, eat, sleep, sh*t, f*ck from time to time lol)

One can live without theese in bold believe me, cause i do, lol (can't live withoth lol though).

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

Josh
Josh's picture
User offline. Last seen 2 years 27 weeks ago. Offline
Joined: 11/09/2008
Posts: 430

It's cause DrDickens is shamefully a virgin xD

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

Josh wrote:
It's cause DrDickens is shamefully a virgin xD

Josh, please...Not everyone likes the c*ck Big Grin So patience is needed here Wink Smiley

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

Josh wrote:
It's cause DrDickens is shamefully a virgin xD

You say a virgin as if it was something bad....

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

Magik_18l
Magik_18l's picture
User offline. Last seen 17 hours 7 min ago. Offline
Joined: 06/13/2008
Posts: 171

DrDickens wrote:
Josh wrote:
It's cause DrDickens is shamefully a virgin xD

You say a virgin as if it was something bad....

It depends on how old are you Big Grin

If you were 40 then it's weird... doesn't it?

Press any key to continue, or any other key to cancel.

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

Magik_18l wrote:

If you were 40 then it's weird... doesn't it?

No, it doesn't. Let's not start no holywar.

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

Hey, guys, are we trolls or what? Big Grin Now, a question to ask: how many objects can a theme include and how many is appropriate to make for the res of current maps?

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

unC0Rr
unC0Rr's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 11/27/2006
Posts: 561

32 is maximum, but this can be easily changed in sources

rbaleksandar
rbaleksandar's picture
User offline. Last seen 16 weeks 5 days ago. Offline
Joined: 01/09/2009
Posts: 730

Thanks a lot!

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

Block
Block's picture
User offline. Last seen 2 years 31 weeks ago. Offline
Joined: 06/17/2009
Posts: 2

omen wrote:

Here ya go i just made this map in about 5 mins and thought id share it i have also made a new theme to go with it the download link is at the bottom of the page.

image:

Quote:
map link:
http://www.mediafire.com/download.php?7dvztxdbco3
to use this unzip this to your map folder you will also have to download my theme pack

Quote:
theme pack:
http://www.mediafire.com/?djbipvd2g9m
to use this unzip it into you theme folder then edit you theme.cfg with notepad and add volcano to the end of the list

then just run the game HAVE FUN!!:P
PS if you make me a sub-forum/thread i will make lots more stuff
PSS this project rulez!!

The download link for the theme doesn't work for me. Sad Smiley
and now the map download also not!
can u upload it again?

Hi!

Magik_18l
Magik_18l's picture
User offline. Last seen 17 hours 7 min ago. Offline
Joined: 06/13/2008
Posts: 171

Block wrote:
The download link for the theme doesn't work for me.

That's because that map was created 2 years ago.
That link just expired.

There are plenty of maps in Hedgewars, so why do you want download this map?

Press any key to continue, or any other key to cancel.

Block
Block's picture
User offline. Last seen 2 years 31 weeks ago. Offline
Joined: 06/17/2009
Posts: 2

i mean the download-link for the theme.
and there are not very much themes on this site.

Hi!

DrDickens
DrDickens's picture
User offline. Last seen 9 weeks 6 days ago. Offline
Joined: 08/28/2008
Posts: 315

Block wrote:

i mean the download-link for the theme.
and there are not very much themes on this site.

Oh my! Did you download the game? Then go to (C:\Program Files )\Hedgewars 0.9.11\share\hedgewars\Data\Themes there are plenty of themes fre for you to modify. Just note you won't be able to play on off server if you tinker with themes.

БЫСТРО БЛДЖАД! Полицейский, что это необходимо для Вас, блджа, падает отсюда блджад!

Winhelp
Winhelp's picture
User offline. Last seen 6 weeks 3 days ago. Offline
Joined: 03/11/2010
Posts: 8

Is something changed in the syntax? I've read the first post, then i looked into theme EarthRise and i don't know what two lines from this file do.

Quote:

0 0 0
106 106 106
$54 $5C $9D <- what is this?
$34 $3C $7D $80 <- what is this?
city.ogg
(...)

Sorry for English Smile

Palewolf
Palewolf's picture
User offline. Last seen 20 weeks 6 days ago. Offline
Joined: 09/01/2008
Posts: 90

Those are the water colors, top and bottom in RGBA format, if iirc. The $ means it's in HEX notation (as in HTML #FFFFFF)

Smaxx
Smaxx's picture
User offline. Last seen 38 weeks 2 days ago. Offline
Joined: 04/29/2009
Posts: 391

Right. The optional fourth number is the alpha color/channel.

Winhelp
Winhelp's picture
User offline. Last seen 6 weeks 3 days ago. Offline
Joined: 03/11/2010
Posts: 8

But it's an inconsistency - or can I use RGB values(0 - 255) instead?

nemo
User offline. Last seen 7 hours 29 min ago. Offline
Joined: 01/28/2009
Posts: 725

TIAS? Smile

Smaxx
Smaxx's picture
User offline. Last seen 38 weeks 2 days ago. Offline
Joined: 04/29/2009
Posts: 391

You can use both, e.g. to get some simple white you can use both of the following lines:

255 255 255
or
$FF $FF $FF

If you'd like to have some 100% red with 50% alpha:

255 0 0 128
or
$FF $0 $0 $80

You could mix number formats as well (which might be a bad idea):

$FF 255 $FF

nemo
User offline. Last seen 7 hours 29 min ago. Offline
Joined: 01/28/2009
Posts: 725

You're no fun :-p

Winhelp
Winhelp's picture
User offline. Last seen 6 weeks 3 days ago. Offline
Joined: 03/11/2010
Posts: 8

nemo wrote:

TIAS? Smile

Actually, I don't know what does it mean and Google doesn't know it too Big Grin

Magik_18l
Magik_18l's picture
User offline. Last seen 17 hours 7 min ago. Offline
Joined: 06/13/2008
Posts: 171

Winhelp wrote:
Actually, I don't know what does it mean and Google doesn't know it too

It's Try It And See acronym.

Less harsh version of RTFM (Read This "Fascinating" Manual) :P

http://www.acronymfinder.com/Slang/TIAS.html

Press any key to continue, or any other key to cancel.

Palewolf
Palewolf's picture
User offline. Last seen 20 weeks 6 days ago. Offline
Joined: 09/01/2008
Posts: 90

I created a wiki article with updated and more complete info about theme creation:
http://www.hedgewars.org/node/2075

Uncharted
Uncharted's picture
User offline. Last seen 9 weeks 4 days ago. Offline
Joined: 08/18/2010
Posts: 56

I will try to create a theme:D

MeinCookie95
MeinCookie95's picture
User offline. Last seen 3 days 4 hours ago. Offline
Joined: 09/23/2010
Posts: 75

Thanks for the tute, Palewolf - it was very helpful =)

I've started work on my own theme called Egypt...

MeinCookie95
MeinCookie95's picture
User offline. Last seen 3 days 4 hours ago. Offline
Joined: 09/23/2010
Posts: 75

Finally happy with it =)

http://www.box.net/shared/x9bck03oai

Star and Moon
Star and Moon's picture
User offline. Last seen 1 hour 39 min ago. Offline
Joined: 04/03/2010
Posts: 312

Hi, nice Theme How-to

This doesn't have to do with creating a new theme but I lost the Landtex.png, Landbacktex.png and the icon.png for the 9.14.1 nature theme, can someone re upload them for me?


"If you see any awesome hedgehogs on the map then they're my hedgehogs."

sheepluva
sheepluva's picture
User offline. Last seen 3 days 6 hours ago. Offline
Joined: 07/18/2009
Posts: 175

Star and Moon wrote:

Hi, nice Theme How-to

This doesn't have to do with creating a new theme but I lost the Landtex.png, Landbacktex.png and the icon.png for the 9.14.1 nature theme, can someone re upload them for me?

You can always download separate files from the repo:

http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/LandTex.png?r=c279aeb615dfc34b006471d9e7b1cce472260a25

http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/LandBackTex.png?r=c279aeb615dfc34b006471d9e7b1cce472260a25

http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/icon.png?r=c279aeb615dfc34b006471d9e7b1cce472260a25

or just reinstall the game :P

  sheepluva
a Chaos Developer (crazy'n'lazy),
  Community Relations

Copyright © 2004-2011 Hedgewars Project. All rights reserved.