How to compile map?

How to compile map?

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

How to compile map?

Post by MasterBel2 »

Hi there!

I am new to map making, so have just read all of the documentation about it, but don't know how to get past just having the metal map, heightmap, featuremap and texture files (I have all of them).

What I've gathered is the next step is to compile, then to compress. However, I'm not sure how to do either. Can anyone advise me? (solution for mac, please)
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

This is the general solution: https://springrts.com/wiki/Mapdev:Tutorial_Finalizing but it lacks anything Mac specific.

Try compiling https://github.com/spring/SpringMapConvNG or https://github.com/enetheru/smf_tools on your OS, then use any of those programs to compile the map.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

Hmm ok I have no idea how to use them. Three questions then:

1) Anyone know enough about them to explain it very carefully to one who hasn't done much in this area? (I try to learn fast)

2) Even if it might be time consuming, how might I do it manually? What steps would I need to do to convert my four .bmp files into the .smf and .smt files?

3) Based on the above, is there enough written in the programs mentioned by gajop that I might be able to work out everything myself, as someone new to that kind of code? (As in what data is in the smf/smt; how I find that out from the .bmp files etc)
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

1st step is to fully read https://springrts.com/wiki/Mapdev:Tutorial_Finalizing
If you haven't already read the previous steps (https://springrts.com/wiki/Mapdev:Tutorial_Simple and https://springrts.com/wiki/Mapdev:Tutorial_Intermediate) you should do so now.

After you've done that, please write what you don't understand.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

Those sites were all read before I started, plus some others. On the finalizing - the Mac part of it has been left blank. What I don't understand is how to run it. EDIT: I'm looking at clang and g++ now, I think I have to use one or the other to run it, however I'm not sure what file to run. Enlighten me please?

I'm also really horrible at understanding what to do with the command prompt (I think I have to use that) and I'm not sure exactly where I need to put the files for the compiler to work.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

Ok I downloaded clang but no Idea how to use it. I think that it's not compiled either…

Can someone tell me how I should be doing this because I don't think I'm doing it right.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

There are two tasks that need to be done here. Both are commonly called "compilation", but they mean very different things.

1. Compiling (cmake + make) one of the two map compiler programs. The output of this is a map compiler program that you can run.
For this you need to have the appropriate compilation tools setup. In case of SpringMapConvNG that would mean a C++ compiler, either GNU's gcc(g++) or clang (which seems to be the default on Mac), cmake (which is there to prepare the compilation), and two libraries (ImageMagick-devel and DevIL-dev).
I've never used Mac, so I really can't give you instructions here, but there should be plenty tutorials online. Alternatively a more knowledgeable Mac person may help you out with that.

The next step is to compile the program.
Using the same example of SpringMapConvNG, you need to execute two commands (both in the folder of the tool:
1) "cmake ." -> This will configure the program for compilation. You may spot additional errors, such as missing libraries or incompatible versions here.
2) "make -j4" -> This will begin the program compilation process using 4 cores (-j4) to speed things up. While unlikely, you might get C++ syntax and semantic errors contained in the code of the program.

After this is successfully done, you should get an executable program (probably called "springMapConvNG") that you'll run next.

2. Using the map compiler program to compile the map. The output of this is the compiled (smf/smt) map you can distribute.

The instructions (https://springrts.com/wiki/MapConvNG and https://springrts.com/wiki/Mapdev:Tutorial_Finalizing) should be identical as to those for Linux.
You will want to run something similar to this:

Code: Select all

springMapConvNG -t diffuse.png -h heightmap.png -m metalmap.png -v grassmap.png -minimap mini.bmp -ct 1 -o mymapname
The metal, grass and minimap parameters are optional, so you may reduce it to something like this:

Code: Select all

springMapConvNG -t diffuse.png -h heightmap.png -ct 1 -o mymapname
As far as I can see ".png" files are required in some cases, so you may need to convert your .bmp files into .png. This should be trivial to do with any image editing software, by just saving it in different format.

If you want additional help, I (we) need to see what you're doing so we can spot errors and correct you. Don't worry about trying things and making mistakes, you're unlikely to destroy your PC.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

I only have a dual core machine; is it still reccomended to do 'make -j4' ?

ty
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

Probably, or you can do -j2. It's not very important
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

So I've installed ImageMagick-devel and I think/hope the installation of DevIL-dev was successful (not quite sure, but the processes ran I think what was properly). I go to cmake SpringMapConvNG and I realise I don't know what to do.

What I have tried entering into the console:
  • ~/SpringMapConvNG-master cmake .
  • cmake . ~/SpringMapConvNG-master
  • cmake .
What am I doing wrong, and what should I be doing?
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

In case it's not clear, the position of the folder 'SpringMapConvNG-master' is users/MasterBel2/SpringMapConvNG-master
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

MasterBel2 wrote:What am I doing wrong, and what should I be doing?
You should run the below command in the folder of the tool you downloaded:
cmake .
You also need to provide us with the command output.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

How do I run a command in the folder?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

You first go to that folder via the cd command.
Something like: "cd ~/SpringMapConvNG-master"
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

Ok, I'm in the folder, type "cmake ." and get the error

Code: Select all

-bash: cmake: command not found
I do have cmake installed, so… where did I go wrong?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

MasterBel2 wrote:Ok, I'm in the folder, type "cmake ." and get the error

Code: Select all

-bash: cmake: command not found
I do have cmake installed, so… where did I go wrong?
You didn't install it correctly or you haven't added it to your PATH.
Please provide the guide you followed for installation and show us how you installed it.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

It was downloaded from https://cmake.org/download/. I then opened the file and then moved the application into 'applications'.

On the path I used the one you approved.

Is there anything else I need to do for setting up cmake?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

Please make some more effort to search for these solutions on your own.
A very quick google search for installing cmake on Mac gives me this video, which seems decent enough: https://www.youtube.com/watch?v=sK4sVg4SRsg
I'm willing to offer assistance, but I need to see you trying your best yourself first.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How to compile map?

Post by MasterBel2 »

Thanks gajop! Cmake is now running fine.

Unfortunately the video was of an older version, so the exact method didn't work. It showed me what I didn't know I had to do, which was compile for command-line use. But I found out how to do what I needed to do easy enough. Currently working on *properly* installing ImageMagick as CMake informed me that I hadn't done it right the first time.

Lets see how far I get this time :D

Thanks for your patience, gajop. Really appreciated.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to compile map?

Post by gajop »

MasterBel2 wrote:Thanks gajop! Cmake is now running fine.
Lets see how far I get this time :D
Thanks for your patience, gajop. Really appreciated.
Glad to hear things are working out, let us know if you need any further help.

PS: It is my opinion that making maps shouldn't require these laborious steps that are likely to dissuade users from pursuing the work.
Post Reply

Return to “Map Creation”