Xonotic Forums
[SOLVED] How to make preview image for map? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Help & Troubleshooting (https://forums.xonotic.org/forumdisplay.php?fid=4)
+--- Thread: [SOLVED] How to make preview image for map? (/showthread.php?tid=6067)



How to make preview image for map? - DOOMer - 03-08-2016

MOD EDIT 2019: updated instructions are on the wiki now: Mapping - Map Picture

In Quake3 was a console command "levelshot", created image  preview of the map based on the location of the info_intermission entity. Is there a similar method for Xonotic, or preview for map should be done manually?


RE: How to make preview image for map? - Brot - 03-08-2016

type in console r_letterbox 1
press f12
copy the screenshot from your screenshot folder. Change name to mapname.jpg and put it in the maps folder in your pk3. Smile


RE: How to make preview image for map? - kaadmy - 03-09-2016

Try running the script <Xonotic basedir>/misc/tools/xonotic-map-screenshot


RE: How to make preview image for map? - DOOMer - 03-10-2016

(03-09-2016, 11:02 AM)kaadmy Wrote: Try running the script <Xonotic basedir>/misc/tools/xonotic-map-screenshot
I took the directory misc/tools from the git repo "xonotic", because in my Gentoo Linux package xonotic-data does not contain this directory. Start of script generates an error.


RE: How to make preview image for map? - Mario - 03-10-2016

I'm not sure what Gentoo supplies, but the data directory wouldn't have it anyway.

As for the script; It appears to just screenshot a random point on the map...
To make it work with Xonotic Git though, use it like this (starting on xonotic directory):

./misc/tools/xonotic-map-screenshot dance

Change dance with the bsp name of your map (minus the extension).


RE: How to make preview image for map? - DOOMer - 03-10-2016

I copied git repo in my ~/.xonotic/ directory, and try use "xonotic-map-screenshot" script for my current development map. It's not finished successfully.

Code:
[~/.xonotic] ./misc/tools/xonotic-map-screenshot whitemeza                                      
head: : invalid number of lines
Timing not supported.
Found main repo = git@gitlab.com:xonotic/
Repository . enabled because it already exists
Repository data/xonotic-data.pk3dir enabled by default
Repository data/xonotic-music.pk3dir enabled by default
Repository data/xonotic-nexcompat.pk3dir disabled by default, create data/xonotic-nexcompat.pk3dir.yes to enable
Repository darkplaces enabled by default
Repository netradiant enabled by default
Repository div0-gittools disabled by default, create div0-gittools.yes to enable
Repository d0_blind_id enabled by default
Repository data/xonotic-maps.pk3dir enabled by default
Repository mediasource disabled by default, create mediasource.yes to enable
Repository gmqcc enabled by default
Repository xonstat disabled by default, create xonstat.yes to enable
Repository xonstatdb disabled by default, create xonstatdb.yes to enable
Repository wiki disabled by default, create wiki.yes to enable
Client darkplaces/darkplaces-sdl not found, aborting



RE: How to make preview image for map? - sev - 03-10-2016

MOD EDIT 2019: updated instructions are on the wiki now: Mapping - Map Picture

The advice to use the scripts is well-meaning, but dealing
with the git repo just for a map preview is a bit of an overkill.
Just do what Brot said.
  • Load your map in the game
  • Use the command "r_letterbox -1" in the console to turn off the HUD
  • Take a nice screenshot with F12
  • Go to the /.xonotic/data/screenshots directory
  • Open the screenshot with an image editor, e.g. GIMP
  • Crop it so that it has a 4:3 ratio
  • Scale it to 512x512 px (weird but standard)
  • Save it as a jpg file (~90% quality)
  • Put it in the same location as the bsp file, with the same name



RE: How to make preview image for map? - Mario - 03-11-2016

That would indeed be easier, just one note:
The standard size for map screenshots is 512x512 (at least, that's what all the stock map use).


RE: How to make preview image for map? - sev - 03-11-2016

(03-11-2016, 12:35 AM)Mario Wrote: The standard size for map screenshots is 512x512

You are right, I corrected it.


RE: How to make preview image for map? - terencehill - 03-11-2016

(03-10-2016, 05:26 PM)sev Wrote: The advice to use the scripts is well-meaning, but dealing
with the git repo just for a map preview is a bit of an overkill.
Just do what Brot said.
  • Load your map in the game
  • Use the command "r_letterbox 1" in the console to turn off the HUD
  • Take a nice screenshot with F12
  • Go to the /.xonotic/data/screenshots directory
  • Open the screenshot with an image editor, e.g. GIMP
  • Crop it so that it has a 4:3 ratio
  • Scale it to 512x512 px (weird but standard)
  • Save it as a jpg file (~90% quality)
  • Put it in the same location as the bsp file, with the same name

It's preferable to take the screenshot in a loseless format like tga or png, not jpg (scr_screenshot_png 1).

Btw the command screenshot accepts a filename in input, optionally with an extension so you can change the output format on the fly without changing the default format (jpg): screenshot mymap.png. Note that it creates the screenshot in data/, not in data/screenshots/.

Slightly better than r_letterbox 1: r_letterbox -1 doesn't reduce image size at all.
Even better, r_draw2d 0 not only hides the HUD but the engine informations too (time, date, netgraph) except fps.

I set up a script that allows you to take a clean screenshot in the png format without changing any setting (and automatically uses the name of the map you are currently playing on):
Code:
alias screenshot_clean "r_drawviewmodel 0; r_draw2d 0; set showfps_save $showfps; showfps 0; wait; screenshot $sv_worldbasename.png; r_drawviewmodel 1; r_draw2d 1; showfps $showfps_save;"
bind k screenshot_clean
copy-paste it in the console and execute it, then press k in game to take a clean screenshot.


RE: How to make preview image for map? - sev - 03-11-2016

(03-11-2016, 09:19 AM)terencehill Wrote: Slightly better than r_letterbox 1: r_letterbox -1 doesn't reduce image size at all.
Good to know, I corrected it.

(03-11-2016, 09:19 AM)terencehill Wrote: It's preferable to take the screenshot in a loseless format like tga or png, not jpg (scr_screenshot_png 1) [...].
Yes, this will produce the best possible raw screenshot.
But it won't make much of a difference, because you still should
scale it down afterwards and save the scaled version in jpg format,
otherwise it greatly inflates the size of the map package.


RE: How to make preview image for map? - Mario - 03-11-2016

Map screenshots are often sent lossy from the server via bytes anyway, so making them top quality and lossless only increases download time.