Page 1 of 1

Support bigger screenshot sizes

Posted: Tue Nov 19, 2019 2:02 pm
by movax20h
I wish to be able to dump a screenshot that is bigger than the current limit.

Code: Select all

/screenshot 16384 16384 1
simply is not big enough. Capturing at lower quality (zoom level), is meh solution. I want to be able to zoom in on details, for archival and quick reference during new builds. PNG is fine, it support higher resolutions in the format, but I will most likely convert it later to TIFF (a lot of mapping software often reads TIFFs only). You can disable compression (set PNG compression to 0, and be sure not to use PNG interlacing aka Adam7 algorithm) to speed up the saving process considerably probably too.

65536 x 65536 should be quite sufficient probably. Yes, I know it is going to be ~8GB in PNG. That is fine. 131072 x 131072 would be even better. Even if it requires 32GB on disk and/or 32GB in memory (I have plenty of RAM to do that).

As of now I am making multiple screenshots and stitching it, but because game is updating between multiple screenshots the seam is not perfect (things inserters, machines move, clouds move, etc), not to mention manually stitching it takes quite some time (not due to the size, simply time capturing individual screenshots, finding correct positions for a good stitch and then editing things to merge) - it took me 100 minutes just to take screenshots (31 files; 15GB total size; I actually took 48 screenshots, but some of them were during the wrong time of a day in the game, so colors did change, or they were incorrectly aligned), and another 50 minutes to align them in GIMP.

Here are results of taking screenshots, stiching in GIMP, tileing using gdal2tiles and custom tiling tool, and then rendering using Leaflet and some custom JavaScript and CSS: https://www.functor.xyz/factorio/2019-11-19/index.html

Sneek peak in the screenshot below.

Re: Support bigger screenshot sizes

Posted: Tue Nov 19, 2019 10:33 pm
by Koub
There was a mod for that : https://mods.factorio.com/mod/FactorioMaps
But it doesn't seem updated any more. Maybe you can have it updated.

Re: Support bigger screenshot sizes

Posted: Tue Nov 19, 2019 10:34 pm
by Bilka
Koub wrote:
Tue Nov 19, 2019 10:33 pm
There was a mod for that : https://mods.factorio.com/mod/FactorioMaps
But it doesn't seem updated any more. Maybe you can have it updated.
https://mods.factorio.com/mod/L0laapk3_FactorioMaps is updated.

Re: Support bigger screenshot sizes

Posted: Tue Nov 19, 2019 10:41 pm
by Koub
Oh nice, missed that :)

Re: Support bigger screenshot sizes

Posted: Wed Nov 20, 2019 11:58 am
by movax20h
Bilka wrote:
Tue Nov 19, 2019 10:34 pm
Koub wrote:
Tue Nov 19, 2019 10:33 pm
There was a mod for that : https://mods.factorio.com/mod/FactorioMaps
But it doesn't seem updated any more. Maybe you can have it updated.
https://mods.factorio.com/mod/L0laapk3_FactorioMaps is updated.
What about playing a vanilla playthrough with achievements enabled? Will it work?

Also, what is the reason for the current limit of the size? Is it arbitrary, or some technical limitation?

I am not that interested about timelapse / periodic screenshots. I find it a separate issue.

Re: Support bigger screenshot sizes

Posted: Wed Nov 20, 2019 12:53 pm
by Koub
movax20h wrote:
Wed Nov 20, 2019 11:58 am
What about playing a vanilla playthrough with achievements enabled? Will it work?
I'm afraid a mod will always disable the Vanilla Steam achievements. Even if it does nothing dramatic (like change biter sprites into hot dogs), the mere presence of a mod removes the ability to get Steam achievements.

Re: Support bigger screenshot sizes

Posted: Wed Nov 20, 2019 3:05 pm
by Rseding91
The current screenshot logic creates 1 big video texture that the rendering logic then draws into and that's then written to disk.

Because it works that way, the limit is how big of a texture your graphics card can handle. In most cases 16k works. 32k might work, anything past that and most GPUs will not allow it.

The screenshot logic would have to be re-written to support streaming out blocks of a screenshot to disk and that's a lot of time for something most people won't use.

Re: Support bigger screenshot sizes

Posted: Wed Nov 20, 2019 6:41 pm
by movax20h
Rseding91 wrote:
Wed Nov 20, 2019 3:05 pm
The current screenshot logic creates 1 big video texture that the rendering logic then draws into and that's then written to disk.

Because it works that way, the limit is how big of a texture your graphics card can handle. In most cases 16k works. 32k might work, anything past that and most GPUs will not allow it.

The screenshot logic would have to be re-written to support streaming out blocks of a screenshot to disk and that's a lot of time for something most people won't use.
That makes sense. I was wondering if the screenshot code captures entire thing into memory or writes stuff in blocks instead. But if indeed it is doing just a one texture, it is not going to work with bigger than 32kx32k pictures. And instead should be captured manually or using Lua code.

Increasing to 32kx32k could do help a bit tho, and for people with 8 or 16GB it could do the trick.

Well, I given that it is not easy to fix, I will try the pointed out mod or create my own to do the job.

Re: Support bigger screenshot sizes

Posted: Wed Nov 20, 2019 8:22 pm
by Ranger_Aurelien
Koub wrote:
Wed Nov 20, 2019 12:53 pm
movax20h wrote:
Wed Nov 20, 2019 11:58 am
What about playing a vanilla playthrough with achievements enabled? Will it work?
I'm afraid a mod will always disable the Vanilla Steam achievements. Even if it does nothing dramatic (like change biter sprites into hot dogs), the mere presence of a mod removes the ability to get Steam achievements.
The original poster need only save their game in a second save file, install the mod, take the huge screenshots, and when done delete the second (forked) save.

Not quite as convenient as doing it directly in Vanilla but it is a workaround.

Re: Support bigger screenshot sizes

Posted: Thu Nov 21, 2019 9:04 am
by posila
Maximum possible texture size in Direct3D 11 is 16384. That's where the hard limit comes from.
Ranger_Aurelien wrote:
Wed Nov 20, 2019 8:22 pm
Not quite as convenient as doing it directly in Vanilla but it is a workaround.
It's certainly many times more convenient than taking the screenshots and trying to make them tilable by hand.

Re: Support bigger screenshot sizes

Posted: Fri Nov 22, 2019 11:11 am
by movax20h
posila wrote:
Thu Nov 21, 2019 9:04 am
Maximum possible texture size in Direct3D 11 is 16384. That's where the hard limit comes from.
Ranger_Aurelien wrote:
Wed Nov 20, 2019 8:22 pm
Not quite as convenient as doing it directly in Vanilla but it is a workaround.
It's certainly many times more convenient than taking the screenshots and trying to make them tilable by hand.
Yes, my GPU also supports 16384 x 16384 on Linux using OpenGL.

I understand supporting bigger screenshots is technically possible with more code, but it is not a simple tweak of a constant, so I would say topic closed, and I will try doing automated tiling using

Code: Select all

game.take_screenshot()
as described here https://lua-api.factorio.com/latest/Lua ... screenshot

There is unrealted other issue / feature I wish to have in a screenshot, and I am not sure if take_screenshot can do it: Showing the yellow arrows for the inserters and miners, blue ones for the fluid, and green one for the miners fluid inputs. AFAIK when taking the screenshot the alt mode can be enabled or disabled (show the receipe of assemblers, chemical plants, etc), and content of chests, but the arrows can't be switched on.

Re: Support bigger screenshot sizes

Posted: Sat Nov 23, 2019 3:42 pm
by eradicator
movax20h wrote:
Fri Nov 22, 2019 11:11 am
I am not sure if take_screenshot can do it: Showing the yellow arrows for the inserters and miners, blue ones for the fluid, and green one for the miners fluid inputs.
Works just fine with Screenshot Hotkey's default settings (see my signature for mod portal link).

Re: Support bigger screenshot sizes

Posted: Sun Nov 24, 2019 7:01 pm
by movax20h
eradicator wrote:
Sat Nov 23, 2019 3:42 pm
movax20h wrote:
Fri Nov 22, 2019 11:11 am
I am not sure if take_screenshot can do it: Showing the yellow arrows for the inserters and miners, blue ones for the fluid, and green one for the miners fluid inputs.
Works just fine with Screenshot Hotkey's default settings (see my signature for mod portal link).

Interesting. `show_entity_info` option ? I tough it only affects showed recipes, not the arrow thingies. Is it possible to have recipes icons only without the inserter / miners arrows then?