Minimap creation

Minimap creation

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

Moderator: Moderators

User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Minimap creation

Post by qray »

Split(*) from viewtopic.php?f=81&t=33015 to discuss if there might be a way to do better minimaps, preferably (semi-)automatic.
Is this even necessary: minimap is for overview and simplicity might be preferable? I am bit torn on this topic...

To create a minimap:

Easy way one: take the automatically created one (mapconv on windows) or just re-scale your diffuse texture. Mostly gives a not-too-good looking minimap and misses water as well a lot of the shinyness - especially when specular, splat and lightning effects or LUA drawing are being used.
Could be worked over in image editor of your choice, but to bring it close to the real map might include a lot of work (drawing blue over water areas is the easy part :wink:, getting SSMF effects right the hard).

Easy way two: take screenshot from far above (TAB -> "tactical view"), cut to the right size, re-scale. Problem: perspective distortion - works OKish for some maps but can also be quite bad depending on map size / layout.

I used for different maps both ways. Both are not perfect. ATM I can't think of another way that would give better results. But maybe I am missing sth. obvious or easy :-)
Maybe a LUAish solution (my knowledge there is still thin)? :wink:

------
(*) to not derail that thread
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Minimap creation

Post by enetheru »

by no means easier, but i created my minimaps in blender by rendering out orthographic view from above, i included a water plane and ll the features.. i created my maps in blender too so it wasnt a huge stretch from what i was already doing.
Orfelius
Posts: 103
Joined: 17 Nov 2014, 20:57

Re: Minimap creation

Post by Orfelius »

enetheru that works only if you are making diffuse in blender :P

How about grabbing a empty game that has recently been updated into Springfiles. Launching the game on high settings (with disabled shadows). Disabling FoW. Clicking battle overview button (tabulator by deflaut) and making a screene in game? This will get all the rendered shaders that are on the map but the downside is that it still will be slightly perspectivistic.

I can't think on any other way araund this.
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

In the last weeks, I was thinking about a widget/gadget that moves the camera and makes multiple screenshots. Then combine these images outside the game with something like ImageMagick. But this is not as simple as it first sounds (if the perspectives and image transitions should be halfway right, at least :wink:)

Today, I got an idea of a much simpler approach.
After your map is done, recompile it again with a flat (plain black) heightmap. Load, make screenshot after hitting Tab ("tactical view"). Crop and resize (*) and voila:
Minimap without distortions from height differences and overall very close to a minimap created from diffuse texture. But with all the nice ssmf effects (and water resp. skybox background on voidwater/ground).

I think of writing a small gadget that would make the screenshot before the game actually starts, so there are no units and no vent smoke on the screenshot...

(*) in this step a comparison with the diffuse map helps to find right values
User avatar
Funkencool
Posts: 542
Joined: 02 Dec 2011, 22:31

Re: Minimap creation

Post by Funkencool »

If you go about it that way, it would be much easier to set the max and min height to be the same in lua rather than go through the trouble of recompiling.

Just a suggestion :wink:

edit:
or just make the difference small to eliminate most distortion and still retain the water plain.
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

Right you are!

Sometimes I miss the obvious :oops: :lol:
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: Minimap creation

Post by enetheru »

is there no way to change the camera to make an orthogonal render ?
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Minimap creation

Post by Anarchid »

Some (maybe most?) of the cameras have a FOV setting, so presumably a widget could set a very low FOV and displace the camera very high up, resulting in nearly orthogonal view.

Completely ortho probably won't work.
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

enetheru wrote:is there no way to change the camera to make an orthogonal render ?
Would have to be implemented on the engine side, I guess.
Anarchid wrote:Some (maybe most?) of the cameras have a FOV setting, so presumably a widget could set a very low FOV and displace the camera very high up, resulting in nearly orthogonal view.
Which is -as I understand it- basically what happens when switching with Tab to the overview camera (large height, limited fov). Could probably be pushed to more extreme values; I am not sure where the height limit is. Overview camera is set to show whole map so large that it's still fitting into the window.
Also, resolution will be a limiting factor from a certain distance on.

Yesterday, I got the script to do a pre-game screenshot nearly done; most time did go into finding the right camera state settings, partly due to my sleepiness(=stupidity :wink:). Will post it later on, when it's finished. Maybe together with screenshots of diffuse / screenshot minimaps for comparison.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Minimap creation

Post by Anarchid »

Pretty sure Tab mode moves camera as to encompass whole map but keeps FOV constant.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Minimap creation

Post by Silentwings »

I tried once using a screenshot of the engines auto-generated minimap (which afaik is an orthogonal render), which I then touched up and used as the final minimap. It made a nice minimap but its not really a good solution.
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

Anarchid wrote:Pretty sure Tab mode moves camera as to encompass whole map but keeps FOV constant.
When listing camStates it gives out a fov 45. Now I would only have to know what the fov of ta camera is :wink:
When back home, I will try to play around with fov and height...
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

So, I had some time to play :-)

Using oberhead camera (the Tab thing) is not the best solution: it has a very slight angle. If you decrease fov and increase height accordingly the effect gets worse :( So it doesn't really match the diffuse map 100%.

That's why I ended up using FPS camera. This seems to have the usual(?) fov of 45. Then I get a perfect match of screenshot and diffuse texture.

I attached a gadget to make the screenshot.

Usage:
Set minheight and maxheight to zero in mapinfo.lua (thanks Funkencool :wink:). Put the gadget in luarules/gadgets of your map and start a game. It makes the screenshot (saved to the usual spring screenshot dir), writes some cropping information into the infolog.txt (to make life easier) and automatically exits spring again. Crop screenshot according to written numbers and rescale to 1024^2. Done.
(well, you should of course reset min/maxheight again and remove the gadget before release)

Did only test with one map, so it might still have bugs :wink:
I left the overhead camera settings in (commented), in case sbd. wants to play with it. Also: I didn't bother to localize everything since performance is not important in this case. I hope I didn't forget to clean up anything totally stupid in the code :mrgreen:
Attachments
minimap_screenshot.lua
(4.27 KiB) Downloaded 13 times
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Minimap creation

Post by Forboding Angel »

You guys are making it too hard on yourself.

Pull diffuse texture into ps/gimp Resize to 1024x1024 (or whatever aspect you need)
Open heightmap in ps/gimp
Add heightmap layer on top of diffuse texture
Use color range selection on full 0,0,0 black and use the fuzzyness slider to adjust selection range
Copy selection to new layer
Hide heightmap layer
Use color overlay on new layer top whatever your water color is... set layer mode to "Overlay"
Have a beer
Profit???
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

As I wrote in the first post, it's not just about water. Adding just this is easy. But all the ssmf effects, lightning etc. change the look (sometimes quite a lot). And with the script posted above, getting all this and water is not more work than what you suggest.

For comparison here side by side mini maps from diffuse and in-game:
Image
Attachments
mini_comparisons.png
(716.03 KiB) Not downloaded yet
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Minimap creation

Post by Forboding Angel »

Frankly, the two are not different enough to matter. This is going to be in a semi small box in the corner, it doesn't need to be perfect.

The skybox shouldn't be in the minimap anyway, it's distracting.
8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Minimap creation

Post by 8611 »

So the overhead-cam was not able to look perfectly straight down but is always slightled angled?

Why gadget: Do you plan to add more stuff (deleteing features for ex.?)
Atm It seems everything you need/use GamePreload, GameStart, GameFrame, Spring.SetCameraState is unsynced and works in widget too.
(would saved you the sync-to-unsynced stuff)

Good trick with setting the maxheight,minheight to zero to avoid perspective warping. But when everything is at same height then water will not show right or does it? Perhaps very little height differences (maxheight 10 or so) still look perspectively okay but work with water?

Maybe relevant, since Spring 92.0 all camera modes can change their FOV at playtime. https://springrts.com/mantis/view.php?id=3291

Not so important but SendCommands("HideInterface") *toggles* the GUI.
To set it to defined state use "HideInterface 1" / "HideInterface 0"
User avatar
Funkencool
Posts: 542
Joined: 02 Dec 2011, 22:31

Re: Minimap creation

Post by Funkencool »

qray wrote:As I wrote in the first post, it's not just about water. Adding just this is easy. But all the ssmf effects, lightning etc. change the look (sometimes quite a lot). And with the script posted above, getting all this and water is not more work than what you suggest.

For comparison here side by side mini maps from diffuse and in-game:
Image
Results look good; the lighting is much better. It's kind of hard to notice on this particular map, but it could add a lot of perceived depth in hilly maps for instance ( for maps that didn't bake shading/shadows in anyway ).

Also, I actually like the skybox background; it better represents what the map is. I think there's enough contrast that it wouldn't be distracting, but that's pretty subjective. Plus it's nice to have pretty minimaps things like http://zero-k.info/maps
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Minimap creation

Post by jK »

qray wrote:Usage:
Set minheight and maxheight to zero in mapinfo.lua (thanks Funkencool :wink:). Put the gadget in luarules/gadgets of your map and start a game. It makes the screenshot (saved to the usual spring screenshot dir), writes some cropping information into the infolog.txt (to make life easier) and automatically exits spring again. Crop screenshot according to written numbers and rescale to 1024^2. Done.
(well, you should of course reset min/maxheight again and remove the gadget before release)
1. why a gadget?
2. why not gl.CopyToTexture + FBO + gl.SaveImage? (no external tools needed for cropping & resizing)
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

Forboding Angel wrote:Frankly, the two are not different enough to matter. This is going to be in a semi small box in the corner, it doesn't need to be perfect.
The skybox shouldn't be in the minimap anyway, it's distracting.
Whether the box with minimap is small, is a matter of your settings (and screen size). Also in the lobby, when searching maps, an image that is close to the look you remember from ingame is helpful. Maybe the example is not the best one, but that's the only one I tried so far since I needed it to complete the map...
Anyway: as always it's a matter of taste :-)
8611 wrote:So the overhead-cam was not able to look perfectly straight down but is always slightled angled?
Yes. But only slightly. I only noticed it when comparing with diffuse texture in graphics program. Got more obvious with smaller fov / larger camera height. At least I wasn't able to figure out how this could be changed (which doesn't mean it is not possible).
8611 wrote: Why gadget: Do you plan to add more stuff (deleteing features for ex.?)
Atm It seems everything you need/use GamePreload, GameStart, GameFrame, Spring.SetCameraState is unsynced and works in widget too.
Since using GamePreload or GameStart didn't lead to the desired results if in a widget (fully black screenshots, SendCommands not executed etc.). I started with a widget and tried it.
And after setting camera and hiding interface -I noticed during testing- I need a bit of time or the screenshot contains image of the setting before (somewhere in the camera state transition and interface still visible).
I didn't want to introduce some sleep command hack in the script so using a gadget seemed easier.
8611 wrote: Good trick with setting the maxheight,minheight to zero to avoid perspective warping. But when everything is at same height then water will not show right or does it? Perhaps very little height differences (maxheight 10 or so) still look perspectively okay but work with water?
Regarding including water in the screenshot: I am torn. On the one hand side it's nice when using minimap outside game (web page maplist, lobby map overview). In the game water is drawn in minimap image anyway by the game. With some water settings having it "double drawn" looks very bad; with others it doesn't matter and still looks good.
As I said: I am torn...
8611 wrote: Maybe relevant, since Spring 92.0 all camera modes can change their FOV at playtime. https://springrts.com/mantis/view.php?id=3291
Sure it's all camera modes? I didn't see the fov value when listing the values of camState of the fps camera. Would have to try when back home.
8611 wrote: Not so important but SendCommands("HideInterface") *toggles* the GUI.
To set it to defined state use "HideInterface 1" / "HideInterface 0"
Good point. Would make it more foolproof.

Funkencool wrote:It's kind of hard to notice on this particular map, but it could add a lot of perceived depth in hilly maps for instance ( for maps that didn't bake shading/shadows in anyway ).
I am not sure if I myself would like to have shadows on the minimap. But might be useful when texture doesn't show the elevations. Maybe using min/maxheight just tuned down (factor 50 or 100) instead of zero could lead to a good compromise. Would have to be adjusted to specific map, I guess.
jK wrote:1. why a gadget?
2. why not gl.CopyToTexture + FBO + gl.SaveImage? (no external tools needed for cropping & resizing)
1. see above
2. Because I have just recently started with some basic gl stuff and didn't know it was possible :wink:
Post Reply

Return to “Map Creation”