Trying to make a map

Trying to make a map

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

Moderator: Moderators

Post Reply
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Trying to make a map

Post by tp40 »

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.
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Trying to make a map

Post by Forboding Angel »

is it orangey-pink? smt and smf locations should be defined in mapinfo.lua

Upload it and I'll have a look.
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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.
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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.
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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. :shock:
Sprang
Posts: 37
Joined: 10 Oct 2008, 15:05

Re: Trying to make a map

Post by Sprang »

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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Trying to make a map

Post by Beherith »

I recommend using PyMapConv instead for both compilation and decompilation.
https://github.com/Beherith/springrts_smf_compiler
Has windows .exe too.
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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!
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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. ;)
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Trying to make a map

Post by Beherith »

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.
tp40
Posts: 21
Joined: 20 Sep 2017, 21:32

Re: Trying to make a map

Post by tp40 »

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.
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: Trying to make a map

Post by ThinkSome »

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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Trying to make a map

Post by FLOZi »

ThinkSome wrote: 20 Apr 2020, 02:49 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.
There is, though with limits.

viewforum.php?f=85
Post Reply

Return to “Map Creation”