Trying to make a map
Moderator: Moderators
Trying to make a map
So I decided to take a shot at making a map.
I obtained a heightmap I'm interested in, made a suitable texture (just a shaded version of it) and made a metal map (red on black). Also I shrunk the texture to make a minimap.
I got my copy of SpringMapConvNG, first from Zero-K then from git. Currently I have a local build in which I have added lots of debug statements. It seems like all my input images are the correct sizes, and it seems like it identifies their formats.
So I can compile my .smf and .smt files, but them into map.sdd/maps, put that in the maps directory for Spring, and can find the map in the lobby. This much is good.
However the lobby (Zero-K in this case) doesn't show a thumbnail or even the map size, and the game crashes if I try to launch with that map. Shouldn't these 3 (plus minimap = 4) files make a suitable map package these days? Most information about map-making that I can find is rather old. I haven't tried with a different game yet, mostly because I would rather just let Steam handle installation for me. Also I haven't tried adding the any .lua files yet, would like to keep things as basic as possible.
I suppose the next step is to grab an a non-Zero-K lobby client and see if it can display a thumbnail.
I obtained a heightmap I'm interested in, made a suitable texture (just a shaded version of it) and made a metal map (red on black). Also I shrunk the texture to make a minimap.
I got my copy of SpringMapConvNG, first from Zero-K then from git. Currently I have a local build in which I have added lots of debug statements. It seems like all my input images are the correct sizes, and it seems like it identifies their formats.
So I can compile my .smf and .smt files, but them into map.sdd/maps, put that in the maps directory for Spring, and can find the map in the lobby. This much is good.
However the lobby (Zero-K in this case) doesn't show a thumbnail or even the map size, and the game crashes if I try to launch with that map. Shouldn't these 3 (plus minimap = 4) files make a suitable map package these days? Most information about map-making that I can find is rather old. I haven't tried with a different game yet, mostly because I would rather just let Steam handle installation for me. Also I haven't tried adding the any .lua files yet, would like to keep things as basic as possible.
I suppose the next step is to grab an a non-Zero-K lobby client and see if it can display a thumbnail.
Re: Trying to make a map
Well, I guess this is documentation... after obtaining and compiling springlobby, it agrees that my map is broken. The thumbnail is some kind of strange color (I would not call it pink, and I have not renamed any files), no dimensions (or any other properties) are shown. I wonder what I have done to bring this upon myself.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Trying to make a map
is it orangey-pink? smt and smf locations should be defined in mapinfo.lua
Upload it and I'll have a look.
Upload it and I'll have a look.
Re: Trying to make a map
Yeah its a strange color like that. So I pretty much need a lua file these days do I?
Thanks for offering to look at it. When I decompile my files, it seems to think all the texture tiles are "out of range". Planning on digging into that before I try to upload anything, but I'm done for today I think.
Thanks for offering to look at it. When I decompile my files, it seems to think all the texture tiles are "out of range". Planning on digging into that before I try to upload anything, but I'm done for today I think.
Re: Trying to make a map
I found that TileStorage::WriteToFile() was writing in the header that there was 0 tiles, which caused decompile to expect 0 tiles, and therefore fail to extract anything. With that fixed, the decompile correctly generated a huge texture. (To be clear, this is https://github.com/spring/SpringMapConvNG which I have built locally.)
It seems that this has not helped the map to actually function. The springlobby shows that strange pinkish-orange color still, and zero-K continues to be frowny in its own way. (Why would a texture issue cause the metadata display to break, for example map size?)
I note that the texture.png generated by decompile is grayscale, as it metalmap.png. These were both RGB PNG when I fed them into compile. This seems like something to investigate.
It seems that this has not helped the map to actually function. The springlobby shows that strange pinkish-orange color still, and zero-K continues to be frowny in its own way. (Why would a texture issue cause the metadata display to break, for example map size?)
I note that the texture.png generated by decompile is grayscale, as it metalmap.png. These were both RGB PNG when I fed them into compile. This seems like something to investigate.
Re: Trying to make a map
After looking around in the headers and adding one parameter and one line to Image::Save() I can get RGB PNG's out again. It seems like everything in the SMF and SMT are fine.
Why do the lobbies not display so much as a thumbnail? Is that functionality of the SMF no longer in use?
I may be forced to add a lua file next.
Why do the lobbies not display so much as a thumbnail? Is that functionality of the SMF no longer in use?
I may be forced to add a lua file next.
Re: Trying to make a map
Zero-K lobby fetches the thumbnail from the server, so there will be no thumbnail until you upload the map to springfiles. Perhaps the map size is similarly based on server data.
So I wouldn't worry too much about the thumbnail. Also, if you don't include any minimap in your compiled map, the minimap will be the same as the map's texture.
So I wouldn't worry too much about the thumbnail. Also, if you don't include any minimap in your compiled map, the minimap will be the same as the map's texture.
Re: Trying to make a map
I recommend using PyMapConv instead for both compilation and decompilation.
https://github.com/Beherith/springrts_smf_compiler
Has windows .exe too.
https://github.com/Beherith/springrts_smf_compiler
Has windows .exe too.
Re: Trying to make a map
Good to know about Zero-K's use of a server for some of the map info. I note in springlobby that generating thumbnails for a new directory of maps is an intensive process, I wonder if it uses the thumbnails from the maps or just looks at the main texture. Didn't like my map either way.
I should take another look at PyMapConv, was using SpringMapConvNG hoping it was less work. (When I started this process, I was on Windows, but then as it started getting into odd software packages I decided this called for Linux.) Nice to see there are some code updates happening over there.
Got a few possible updates for SpringMapConvNG, myself!
I should take another look at PyMapConv, was using SpringMapConvNG hoping it was less work. (When I started this process, I was on Windows, but then as it started getting into odd software packages I decided this called for Linux.) Nice to see there are some code updates happening over there.
Got a few possible updates for SpringMapConvNG, myself!
Re: Trying to make a map
Yeah a mapinfo.lua made things work immediately. Perhaps it should be listed as an official required file? I suppose the how-to's are not updated very often. It seems that both PyMapConv and SpringMapConvNG do the job if I provide a mapinfo.lua, and at about the same speed too.
The lighting section is interesting. If you give "sunDir" without any day length stuff, does the sun stay in place? I see some shadows being made in the terrain but they are not very strong, so perhaps it would be better to render some into the texture so things are more clear.
Interesting effect if groundAmbientColor is over 1,1,1 ... also interesting that groundDiffuseColor causes more shadows with higher values.
Is the height of the terrain entirely controlled by the mapinfo.lua, or are those values combined with the smf baked-in values? (I admit I could discover this for myself.)
When you answer questions, you are creating documentation.
The lighting section is interesting. If you give "sunDir" without any day length stuff, does the sun stay in place? I see some shadows being made in the terrain but they are not very strong, so perhaps it would be better to render some into the texture so things are more clear.
Interesting effect if groundAmbientColor is over 1,1,1 ... also interesting that groundDiffuseColor causes more shadows with higher values.
Is the height of the terrain entirely controlled by the mapinfo.lua, or are those values combined with the smf baked-in values? (I admit I could discover this for myself.)
When you answer questions, you are creating documentation.
Re: Trying to make a map
1. Yes, maps work without mapinfo.lua, used to be an smd file but just use the lua for sanity.
2. Most games have dynamic sun off, it screws with baked in lighting on maps.
3. Try these:
groundambientcolor = { 0.4, 0.4, 0.4 }, --low values, always on
grounddiffusecolor = { 0.7, 0.7, 0.7 }, --gets added in sun
groundshadowdensity = 0.9, --controls shadow strength
unitambientcolor = { 0.35, 0.35, 0.35 },
unitdiffusecolor = { 0.85, 0.85, 0.85 },
unitshadowdensity = 1.0,
4. Height by default is in .smf file, .lua can override it.
2. Most games have dynamic sun off, it screws with baked in lighting on maps.
3. Try these:
groundambientcolor = { 0.4, 0.4, 0.4 }, --low values, always on
grounddiffusecolor = { 0.7, 0.7, 0.7 }, --gets added in sun
groundshadowdensity = 0.9, --controls shadow strength
unitambientcolor = { 0.35, 0.35, 0.35 },
unitdiffusecolor = { 0.85, 0.85, 0.85 },
unitshadowdensity = 1.0,
4. Height by default is in .smf file, .lua can override it.
Re: Trying to make a map
I really couldn't get that map to work without the mapinfo.lua, with either compiler. I wonder what was wrong. Perhaps it is something that can be detected by one or both compilers so that sort of time-waste can be shut down.
Thanks for those lighting values, I'll try them. Also good to have confirmation that baked-in lighting is expected.
Need to write some scripts to manipulate my elevation data next. I started with real data, but its only desirable in some areas of the map.
Thanks for those lighting values, I'll try them. Also good to have confirmation that baked-in lighting is expected.
Need to write some scripts to manipulate my elevation data next. I started with real data, but its only desirable in some areas of the map.
Re: Trying to make a map
Why is there no in-engine map editor? It seems such a basic thing to have, to prevent having to fiddle with external "map compilers" and other barriers to creativity.