Maps:Compiling: Difference between revisions

From Spring
Jump to navigationJump to search
Zwzsg (talk | contribs)
→Compiling Spring Maps: Finished the tutorial off. Please fix any mistakes you see.
Line 1: Line 1:
== Compiling Spring Maps ==
== Compiling Spring Maps ==


This is often the bit that scares alot of people off, but it is really not that dificult. Depending on how proficient you are at computers will define what option to take. There are three options you can take, each requiring different skills and knowledge. You can either:
This is often the bit that scares alot of people off, but it is really not that dificult. There are two different ways to compile a map, so you can choose which option suits you best. You can:


*Compile through a DOS prompt
*Compile through a DOS prompt, or
*Create and edit a shortcut file
*Create and batch file.
*Create and edit a .bat file


=== Before you start ===
=== Before you start ===


First off, download a map converter.  
First off, download a map converter. These can be found on [www.FileUniverse.com FileUniverse.com]. There are two compiliers that most people use:
* [http://www.fileuniverse.com/?p=showitem&ID=1421 mother's MapConv with 'optimisation']<br>This version does not work for some people. If you are one of these people, try:
* [http://www.fileuniverse.com/?p=showitem&ID=1507 mother's mapconc, without optimisation]<br>Use this if the other one does not work.


These can be found on FileUniverse.com, but im to lazy to find a link right now. Could someone link this to mothers map conv?<br>
Place the compiler in to a directory on your computer somewhere. Because of a bug in the program, the path to the map converter can NOT contain ANY Spaces. A Path of '''C:\Maps\MapConv\''' is good, but a path of '''C:\Maps\Map Conv\''' is BAD.
Ok, here are they:<br>
- [http://www.fileuniverse.com/?p=showitem&ID=1421 mother's mapconv, with 'optimisation' that makes it crash]<br>
- [http://www.fileuniverse.com/?p=showitem&ID=1507 mother's mapconc, without the optimisation (if the other crash for you)]<br>


Place the compiler in to a directory on your computer somewhere. Because of a bug in the program, the path to the map converter can NOT contain ANY Spaces. A Path of 'C:\Maps\MapConv\' is good, but a path of 'C:\Maps\Map Conv\' is BAD.
A good practise is to save all your source Pictures into seperate folders when making a map. However, this gets very tedious when compiling. So it is a good idea to make a copy of your source BMP files and place these in the same folder as the map converter. This just makes things alot easier later on. You should have the following files in your MapConv folder:


A good practise is to save all your source Pictures into seperate folders when making a map. However, this gets very tedious when compiling. So it is a good idea to make a copy of your source BMP files and place these in the same folder as the map converter. This just makes things alot easier later on.
* Texture.bmp
* Height.bmp
* Metal.bmp
* Feature.bmp
 
You should also put, if you are using them, your type map (Type.bmp) and your tile
map (Tile.bmp). Most maps do not use these, so you do not usually need to worry about them.
 
You need the 7-zip compression program to compress your map into a .sd7 map file.
* [http://www.7-zip.org 7-zip homepage]
* [http://prdownloads.sourceforge.net/sevenzip/7z431.exe?download Download Link]
 
A .smd file. These can be made with [http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2420 Maelstroms SMD creator].


You also need to know:
You also need to know:
Line 26: Line 36:
*How much you want to compress your map.
*How much you want to compress your map.


As the compiler runs off information entered into it as'' 'Command Line Parameters' '', you need to know a bit about them first. Command Line Parameters are really not difficult to understand. They look a bit like this:  
As the compiler runs off information entered into it as '''Command Line Parameters''' , you need to know a bit about them first. Command Line Parameters are really not difficult to understand. They look a bit like this:  


  ProgramName -Setting1 Value -Setting2 Value
  ProgramName -Setting1 Value -Setting2 Value


That isnt to difficult to understand. The first bit is how we launch the program. Windows will launch whatever program is specified by ProgramName. -Setting1 Value is also very simple. Windows basically says to the program "Setting1 is Value". A better example would be -height 10, which basicly means "Height is 10". These can be combined with as many settings as you want, as we can see with the Setting2 Value bit. In this way we can pass as much information to the compiler as we want. So to compile a map, we need the following options:
The first bit is how we launch the program. Windows will launch whatever program is specified by '''ProgramName'''. '''-Setting1 Value''' is also very simple. Windows basically says to the program "Setting1 is Value". A better example would be -height 10, which basicly means "Height is 10". These can be combined with as many settings as you want, as we can see with the '''Setting2 Value''' bit. In this way we can pass as much information to the compiler as we want. To compile a map, we need the following Command Line Parameters:


'''Map Compression'''
'''Map Compression'''
This takes the form of'' '-c Compression', where Compression is a value. Typing'' '-c 0.5' ''will give a compression of 0.5
This takes the form of '''-c Compression''', where Compression is a value. Typing '''-c 0.5''' will give a compression of 0.5


'''Max Height'''
'''Max Height'''
This specifies the maximum height of the map. This option looks like'' '-x Height' '', where Height is the maximum height of the map. Typing'' '-x 300' '' will give your map a maximum height of 300 map units.
This specifies the maximum height of the map. This option looks like '''-x Height''', where Height is the maximum height of the map. Typing '''-x 300''' will give your map a maximum height of 300 map units.


'''Minimum Height'''
'''Minimum Height'''
This specifies the minimum height of the map. This option looks like'' '-n Height' '', where Height is the minimum height of the map. Typing'' '-x -50' '' will give your map a minimum height of -50 map units.
This specifies the minimum height of the map. This option looks like '''-n Height''', where Height is the minimum height of the map. Typing '''-x -50''' will give your map a minimum height of -50 map units.


'''Texture'''
'''Texture'''
This specifies the location of your texture picture. This option looks like'' '-t Location' '', where Location is the location of your texture image. Typing'' '-t texture.bmp' '' will make the compiler look in the same directory it is in for texture.bmp. Typing'' '-t C:\Maps\HillMap\texture.bmp' '' will make the compiler look in the C:\Maps\HillMap\ for texture.bmp.
This specifies the location of your texture picture. This option looks like '''-t Location''', where Location is the location of your texture image. Typing '''-t texture.bmp''' will make the compiler look in the same directory it is in for '''texture.bmp'''. Typing '''-t C:\Maps\HillMap\texture.bmp''' will make the compiler look in the '''C:\Maps\HillMap\''' for texture.bmp. This name cannot contain spaces.


'''Other Picture files'''
'''Other Picture files'''
These work in basically the same way as the texture option works, with just a changed Setting name.
These work in basically the same way as the texture option works, with just a changed Setting name.
*''-m metal.bmp'': Specifies the location of the metal map.
*'''-m metal.bmp''': Specifies the location of the metal map.
*''-a height.bmp'': Specifies the location of the height map.
*'''-a height.bmp''': Specifies the location of the height map.
*''-f feature.bmp'': Specifies the location of the feature map.
*'''-f feature.bmp''': Specifies the location of the feature map.
*''-y typemap.bmp'': Specifies the location of the terain type map.
*'''-y typemap.bmp''': Specifies the location of the terain type map.
Please note that these names cannot contaion spaces.


'''Map Name'''
'''Map Name'''
The Map Converter needs to know where to save your map, and what to call it. We use the'' '-o Mapname.smf' ''setting to do this. Of course, you replace Mapname with the name of your map, but you NEED to have the '.smf' bit on the end of it, otherwise the compiling wont work.
The Map Converter needs to know where to save your map, and what to call it. We use the '''-o Mapname.smf''' setting to do this. Of course, you replace Mapname with the name of your map, but you NEED to have the '.smf' bit on the end of it, otherwise the compiling wont work. An example would be '''-o HillMap.smf'''. This name cannot contain spaces.


'''Other Tags'''
'''Other Tags'''
Some of these tags are helpfull, some are annoying and some are just a mystery. This is basicly the mics tags settings.
Some of these tags are helpfull, some are annoying and some are just a mystery. This is basicly the mics tags settings.
*'''Low Pass''': If you map has very steep slopes or rough areas that look ugly, this will smooth them a bit. Is activated just by typing '-l'.
*'''Low Pass''': If you map has very steep slopes or rough areas that look ugly, this will smooth them a bit. Is activated just by typing '''-l'''.
*'''Invert Height map''': As the logical way to make a height map is the same way up as all the other maps, but the way the map is actually used is the inverted version of this. To make things easier, they included this option to invert the height map. Is activated just by typing '-i'.
*'''Invert Height map''': As the logical way to make a height map is the same way up as all the other maps, but the way the map is actually used is the inverted version of this. To make things easier, they included this option to invert the height map. Is activated just by typing '-i'. Most maps will use this.
 
 
=== Compiling through a batch file ===
 
This is perhaps the easiest option. You just have to create a simple text file, rename it, and run.
 
First, open up Notepad. Notepad can be found in Start > Program Files > Accessories > Notepad. In notepad, type or copy the following:
 
'''mapconv -c 0.5 -x 500 -n 50 -o MapName.smf -t texture.bmp -m metal.bmp -a height.bmp -f feature.bmp -i '''
 
Replace the relevant values with the values you need, as the settings here will not work for all the maps. Then, in Notepad click File > Save As. In the file name box, type '''"Compile.bat"''', with the quotes. If you do not have the quotes, it will not work. Save the file in the same directory as your compiler.
 
Go to the MapConv folder on your hard drive, and you should see a new file. This file will be called Compile.bat. Double click this file, and a black Dos window should pop up. After a few minutes the window should close. There will now be 2 extra files in that directory. '''MapName.smt''' and '''MapName.smf'''.
 


=== Compiling through DOS ===
=== Compiling through DOS ===


This option is the easiest and simplest for those who are familiar with DOS. If you are not familiar with DOS, then dont bother. This way is not for you.
Use this option if you want to read the information that the MapConv outputs. If you are not familiar with how DOS works, then this way is not for you.


All you need to do is navigate your way through DOS to the location of your map converter program. Then, type in the following:
All you need to do is navigate your way through DOS to the location of your map converter program. Then, type in the following:


'''mapconv -f feature.bmp -i -c 0.5 -x 530 -n 20 -o Pits.smf -m metal.bmp -a height.bmp -t texture.bmp'''
'''mapconv -c 0.5 -x 500 -n 50 -o MapName.smf -t texture.bmp -m metal.bmp -a height.bmp -f feature.bmp -i '''
 
Replace the relevant values with the values you need, as the settings here will not work for all the maps.
 
Once compiled, there will be 2 extra files in that directory. '''MapName.smt''' and '''MapName.smf'''.
 
=== Compressing your map ===
 
Your SMD file needs to have the same name as the .smt and .smf files. If your smt file is calles '''HillMap.smt''', your .smd file needs to be called '''HillMap.smd'''.
 
Place the '''MapName.smd''', '''MapName.smt''' and '''MapName.smf''' files into an empty folder called maps\. Eg: '''C:\maps\'''. Right click this folder, and a right click menu should appear. In that menu, there will be a 7-Zip'''>''' submenu. Open this menu, and click '''Add to Archive...'''. A 7-zip window will appear. Make sure the settings are identical to the following picture:
[[Image:7-zip_options.jpg]]
 
Change the '''Archive''' box at the top to the name of your map, with .sd7 on the end. Eg: '''HillMap.sd7'''. Click the '''OK''' button. After the compression has completed, there will be a file called '''HillMap.sd7''' in the same directory as the folder was. In this example, the '''HillMap.sd7''' would be straight on the C:\ drive. Copy '''HillMap.sd7''' to your TASpring\Maps\ directory.


Or copy that line into notepad and save as whatever'''.bat'''
If all of this was done correctly, the map should now appear your maps list in the lobby, and you can go play it.

Revision as of 08:00, 7 December 2005

Compiling Spring Maps

This is often the bit that scares alot of people off, but it is really not that dificult. There are two different ways to compile a map, so you can choose which option suits you best. You can:

  • Compile through a DOS prompt, or
  • Create and batch file.

Before you start

First off, download a map converter. These can be found on [www.FileUniverse.com FileUniverse.com]. There are two compiliers that most people use:

Place the compiler in to a directory on your computer somewhere. Because of a bug in the program, the path to the map converter can NOT contain ANY Spaces. A Path of C:\Maps\MapConv\ is good, but a path of C:\Maps\Map Conv\ is BAD.

A good practise is to save all your source Pictures into seperate folders when making a map. However, this gets very tedious when compiling. So it is a good idea to make a copy of your source BMP files and place these in the same folder as the map converter. This just makes things alot easier later on. You should have the following files in your MapConv folder:

  • Texture.bmp
  • Height.bmp
  • Metal.bmp
  • Feature.bmp

You should also put, if you are using them, your type map (Type.bmp) and your tile map (Tile.bmp). Most maps do not use these, so you do not usually need to worry about them.

You need the 7-zip compression program to compress your map into a .sd7 map file.

A .smd file. These can be made with Maelstroms SMD creator.

You also need to know:

  • The minimum and maximum heights of your map.
  • The name of your map.
  • How much you want to compress your map.

As the compiler runs off information entered into it as Command Line Parameters , you need to know a bit about them first. Command Line Parameters are really not difficult to understand. They look a bit like this:

ProgramName -Setting1 Value -Setting2 Value

The first bit is how we launch the program. Windows will launch whatever program is specified by ProgramName. -Setting1 Value is also very simple. Windows basically says to the program "Setting1 is Value". A better example would be -height 10, which basicly means "Height is 10". These can be combined with as many settings as you want, as we can see with the Setting2 Value bit. In this way we can pass as much information to the compiler as we want. To compile a map, we need the following Command Line Parameters:

Map Compression This takes the form of -c Compression, where Compression is a value. Typing -c 0.5 will give a compression of 0.5

Max Height This specifies the maximum height of the map. This option looks like -x Height, where Height is the maximum height of the map. Typing -x 300 will give your map a maximum height of 300 map units.

Minimum Height This specifies the minimum height of the map. This option looks like -n Height, where Height is the minimum height of the map. Typing -x -50 will give your map a minimum height of -50 map units.

Texture This specifies the location of your texture picture. This option looks like -t Location, where Location is the location of your texture image. Typing -t texture.bmp will make the compiler look in the same directory it is in for texture.bmp. Typing -t C:\Maps\HillMap\texture.bmp will make the compiler look in the C:\Maps\HillMap\ for texture.bmp. This name cannot contain spaces.

Other Picture files These work in basically the same way as the texture option works, with just a changed Setting name.

  • -m metal.bmp: Specifies the location of the metal map.
  • -a height.bmp: Specifies the location of the height map.
  • -f feature.bmp: Specifies the location of the feature map.
  • -y typemap.bmp: Specifies the location of the terain type map.

Please note that these names cannot contaion spaces.

Map Name The Map Converter needs to know where to save your map, and what to call it. We use the -o Mapname.smf setting to do this. Of course, you replace Mapname with the name of your map, but you NEED to have the '.smf' bit on the end of it, otherwise the compiling wont work. An example would be -o HillMap.smf. This name cannot contain spaces.

Other Tags Some of these tags are helpfull, some are annoying and some are just a mystery. This is basicly the mics tags settings.

  • Low Pass: If you map has very steep slopes or rough areas that look ugly, this will smooth them a bit. Is activated just by typing -l.
  • Invert Height map: As the logical way to make a height map is the same way up as all the other maps, but the way the map is actually used is the inverted version of this. To make things easier, they included this option to invert the height map. Is activated just by typing '-i'. Most maps will use this.


Compiling through a batch file

This is perhaps the easiest option. You just have to create a simple text file, rename it, and run.

First, open up Notepad. Notepad can be found in Start > Program Files > Accessories > Notepad. In notepad, type or copy the following:

mapconv -c 0.5 -x 500 -n 50 -o MapName.smf -t texture.bmp -m metal.bmp -a height.bmp -f feature.bmp -i

Replace the relevant values with the values you need, as the settings here will not work for all the maps. Then, in Notepad click File > Save As. In the file name box, type "Compile.bat", with the quotes. If you do not have the quotes, it will not work. Save the file in the same directory as your compiler.

Go to the MapConv folder on your hard drive, and you should see a new file. This file will be called Compile.bat. Double click this file, and a black Dos window should pop up. After a few minutes the window should close. There will now be 2 extra files in that directory. MapName.smt and MapName.smf.


Compiling through DOS

Use this option if you want to read the information that the MapConv outputs. If you are not familiar with how DOS works, then this way is not for you.

All you need to do is navigate your way through DOS to the location of your map converter program. Then, type in the following:

mapconv -c 0.5 -x 500 -n 50 -o MapName.smf -t texture.bmp -m metal.bmp -a height.bmp -f feature.bmp -i

Replace the relevant values with the values you need, as the settings here will not work for all the maps.

Once compiled, there will be 2 extra files in that directory. MapName.smt and MapName.smf.

Compressing your map

Your SMD file needs to have the same name as the .smt and .smf files. If your smt file is calles HillMap.smt, your .smd file needs to be called HillMap.smd.

Place the MapName.smd, MapName.smt and MapName.smf files into an empty folder called maps\. Eg: C:\maps\. Right click this folder, and a right click menu should appear. In that menu, there will be a 7-Zip> submenu. Open this menu, and click Add to Archive.... A 7-zip window will appear. Make sure the settings are identical to the following picture:

Change the Archive box at the top to the name of your map, with .sd7 on the end. Eg: HillMap.sd7. Click the OK button. After the compression has completed, there will be a file called HillMap.sd7 in the same directory as the folder was. In this example, the HillMap.sd7 would be straight on the C:\ drive. Copy HillMap.sd7 to your TASpring\Maps\ directory.

If all of this was done correctly, the map should now appear your maps list in the lobby, and you can go play it.