Jump to content

[1.12.x] Automated Screenshots


linuxgurugamer

Recommended Posts

New Release 0.6.0 (new feature: Supersize screenshots)

 

The new version for KSP 1.4.1 has new dependencies

New Dependencies

CKAN has been updated to install the dependencies, if needed

 

0.1.0 initial release

0.2.0 Added pre crash/landing detection

Added ability to take screenshots both with and without UI

Bug fixed where if you had the UI hidden, it would be enabled after a screenshot

Fixed missing toolbar icons

0.3.0 Updated logging code so INFO is forced during development/debugging

Added code to be able to tell the Historian mod a screenshot is happening. Needs a small change to Historian to work

Cleaned up some more code

Updated buildrelease.bat

Removed unnecessary PNG files from release

Added ChangeLog.txt to release

Moved ChangeLog.txt up one directory

0.4.0 Changed minimum frequency of screenshots from 1 sec to 0.1 sec

Fixed bug where no active vessel caused spamming in log file in the SpaceCenter scene

Added automated saving of save files

Added rotation of save files to limit number of files

Fixed screenshots during timewarp, to NOT take too many snapshots. Now

uses realtime, not gametime

Fixed name of Plugin directory, changed to Plugins

Added check for colon in file name, replace it with a dash

Updated hour/min/sec time to have leading zeroes

0.4.1 updated AVC version file

0.5.0 Added public function for external mods to call to do an automated save

Added public funciton for external mods to call to do an automated screenshot

Updated zero-padding code for filename to use the ToString() syntax available, save a little codespace

Refactored game save code to put all save functions into single class

0.5.1 Added line to config window to show the activation key for the automated saves. Not configurable at this time

0.5.2 Changed from LateUpdate to FixedUpdate, to allow faster screenshots

Changed minimum time interval from 0.1 to Time.deltaTime (usualy 0.02)

Fixed bug where if screenshots were stopped, and there was a png waiting to be converted, and it was

deleted, no more screenshots could be taken until the game was restarted

0.5.3 Fixed bug where if a directory was unwritable, the screen could get locked with the gui hidden

Fixed bug where a relative path would not work.

0.6.0 Added ability to supersize screenshots

0.7.1  Recompiled for 1.1

0.7.2  New option for automatically start saving when game is loaded

 

Please note: If you are upgrading by hand, first delete the entire AutomatedScreenshots directory before installing

 

Have you ever wished you had a screenshot of a scene? Would you like to have a whole series of screenshots of a mission?

Wait no more, Automated Screenshots is here!

Have you ever forgotton to save a game, and needed to restore?

Wait no more, Automated Saves is here (two mods in one!)

http://spacedock.info/mod/43/Automated%20Screenshots%20%26%20Saves

License is GPLv3

A mod to grab automated screenshots at specific time intervals and special events

This mod will take screenshots at specified intervals.

Donations gratefully accepted

Patreon.png

https://www.patreon.com/linuxgurugamer

Screenshots Types

 

 

  • The intervals can be specified by time in seconds between each screenshot
  • Screenshots can be taken at each scene change
  • Screenshots can be taken at special events.
  • The UI can be hidden during the screenshots. Be aware that this will be visible, the UI will flicker off and then on during the screenshot.
  • The screenshots are saved as PNG files. PNG files can be big, so you can also specify that the PNG files be converted to JPG files, and optionally delete the PNG file after conversion
  • Can detect an imminent crash or landing, and switch to a faster rate of screensho
  • Can now take 2 screenshots, one with AND one without the UI

 

 

Credit must go to magico13 for his Sensible Screenshots mod, which provided the code for the following filename functionality.

Please note that this mod does NOT rename manual screenshots.

The filename is fully configurable, by using variables in the file name.

 

The following are the "variables" available in file names

 

 

  • [date] = Parsed DateString
  • [uT] = Current in-game time in seconds
  • [save] = Name of current save game
  • [vessel] = Active Vessel name
  • [body] = Current primary celestial body name
  • [situation] = Active Vessel situation (PRELAUNCH, FLYING, ORBITING, etc.)
  • [biome] = Current Active Vessel biome
  • [year] = Current in-game year (as seen in top left during flight (1, 2, etc.))
  • [day] = Current in-game day (similar to year)
  • [hour] = in-game hour
  • [min] = in-game minute
  • [sec] = in-game seconds
  • [evt] = event flag

 

The hour, min and sec variables have a leading zero added if <10

Event Flag

 

 

  1. If a screenshot by time interval: time
  2. If by scene change: scene
  3. If by special event: event

 

Example

An example (ridiculous) possible filename is: AS_[date][save][vessel][body][biome]_[situation]_Y[year]_D[day]_H[hour]_M[min]_S[sec]_UT[uT]

which could turn out to be: AS_2015-04-30-22-22_KSPv1.0.0_SaveGameTest_Kerbal#X_Kerbin_Shores_PRELAUNCH_Y1_D10_H5_M7_S36_UT212856.png

 

The code for the JPG conversion and the custom filenames was taken from the Sensible Screenshot mod, written by magico13

While this can take screenshots as fast as one per second, I wouldn't recommend taking anything faster than 1/every 5 seconds or so, just to avoid any performance problems, especially when there is a lot of physics going on.

Special Events

The following are the special events which the mod can sense:

 

 

Crash
Spashdown
Crew Killed
Crwe on eva
Flag Planting
Launch
Part couple
Part die (explode)
Joint breaking
undocking
activating stage
stage seperation
changing vessel
making orbit
escaping orbit
SOI changed

 

Automated Saves

The mod will now do automatic saves at specified intervals. it will only keep a specified number of save files.

Automatic saves is turned on by hitting Ctrl-F5

Usage

Assuming you are using the default of F6 for the screenshots, the icon in the toolbar will be one of the following. The icons for the regular toolbar and the Blizzy toolbar are the same except for size:

 

1 All White AS.png  Nothing is activated
2 Reversed   Configuration window is active
3 Green camera AS-snapshot.png  Automated screenshots are active
4 Green disk AS-autosave.png  Automated saves are active
  Green camera and disk AS-snap-save.png  Both automated screenshots and automated saves are active

Configuration

New Feature added (not in screen below yet): Supersize Screenshots

Important note regarding the Supersize option:

The values range from 0-4. 0 is the default, 1 is the same as 0.

Note that a value of 4 can take up to a second to do the screenshot. This option is extremely processor intensive, only use it if you need it for cinematics.

Set this to the factor which you want your screen resolution to be multiplied by. For example, if your game resolution is 1280x720, setting the number here to 2 would give you screenshots of size 2560x1440.

 

See the image below for the configuration screen. Explanations of the fields are below the image:

ASS.png

 

Screenshot interval in seconds Time between each screenshot. You can go down to 1/10 of a second
Convert to JPG Screenshots are saved as PNG files, which are large. This will convert the saved file to a JPG file, which is a lot smaller
Keep original PNG If checked, will keep the original PNG file after conversion
Screenshot path Path to save screenshots. Defaults to standard screenshot folder
Filename format The filename is completely configurable. See the section on the filename variables for complete information
JPEG Quality Quality of the converted JPG. Default is 75, I suggest you leave it there. Lower numbers means a smaller file, but also a loss of quality
Screenshot after scene change If you want an additional screenshot after each scene change, enable this
Screenshot after special event KSP has special events (ie: crash, crew killed, etc). See the section on special events for more details
Use Blizzy Toolbar if available If the Blizzy toolbar is installed, use it.
Activation Keycode What key will activate the screenshots
No GUI on Screenshot Disable the GUI (ie: F2) before taking the screenshot
GUI on screenshot Take the screenshot with the GUI on. Both this and the previous can be done, which would result in 2 screenshots
   
Take pre-crash snapshots Take extra snapshots if a crash is imminent
Seconds until impact Start taking snapshots this many seconds before impact
Altitude limit Must be below this altitude for pre-crash screenshots to be taken.
Minimum vertical speed If speed is below this, it isn't a crash
Screenshot interval (pre-crash) Interval between screenshots for the pre-crash settings. You can go down to 1/10 of a second
   
Minutes between saves Save the game once this many minutes
Save file format Name of the save file, uses same rules as the snapshot files
Max save files Keep this many save files and no more, deletes any extra (only of the ones that were saved using this mod

 

Edited by linuxgurugamer
New release
Link to comment
Share on other sites

very interesting, not just for the screenshots but the event triggers. Being able to capture the clock when I pass into a new SOI, for example, would be great for my timeline record when I go back and work up tweets about it later.

what happens if the game is time warping?

Link to comment
Share on other sites

very interesting, not just for the screenshots but the event triggers. Being able to capture the clock when I pass into a new SOI, for example, would be great for my timeline record when I go back and work up tweets about it later.

what happens if the game is time warping?

You know, I have no idea :-)

I think it will continue. The timer is based on real time, not game time. And special events are generated by the game.

Link to comment
Share on other sites

NO!

That would be a huge performance hit. If you want it faster, then I suggest that you look at something like FRAPS or OBS

You read my mind. Very astute.

Very well, this mod may not be for me, however, I believe that the telemachus mod and user variants can use something like this to stream into a browser.

Peace.

Link to comment
Share on other sites

You read my mind. Very astute.

Very well, this mod may not be for me, however, I believe that the telemachus mod and user variants can use something like this to stream into a browser.

Peace.

Possibly. I don't recommend doing anything more than one screenshot every 5 seconds, both because of performance and space. But it would be easy enough to change it to allow multiple screenshots per second. if requested enough, I may do that, but for now, would just like to see it used as is.

Link to comment
Share on other sites

Have you ever wished you had a screenshot of a scene?

Yes

Would you like to have a whole series of screenshots of a mission?

YES

Wait no more, Automated Screenshots is here!

YES!!!

It would be cool if you could add an "about to crash" automatic screenshot event. Something like if vessel.GetHeightFromTerrain() is less than 100 m and vessel.verticalSpeed is more than -10 m/s or so, take a screenshot every 2 seconds.

It'd also be cool to have the screenshots taken both with and without the UI, back to back.

Link to comment
Share on other sites

Yes

YES

YES!!!

It would be cool if you could add an "about to crash" automatic screenshot event. Something like if vessel.GetHeightFromTerrain() is less than 100 m and vessel.verticalSpeed is more than -10 m/s or so, take a screenshot every 2 seconds.

It'd also be cool to have the screenshots taken both with and without the UI, back to back.

the "about to crash" is intriguing , I'll think about it.

The multiple screenshots, can be a performance problem. Also, my code isn't designed to do more than one shot per second, so that might not work for you.

Link to comment
Share on other sites

Yes

YES

YES!!!

It would be cool if you could add an "about to crash" automatic screenshot event. Something like if vessel.GetHeightFromTerrain() is less than 100 m and vessel.verticalSpeed is more than -10 m/s or so, take a screenshot every 2 seconds.

It'd also be cool to have the screenshots taken both with and without the UI, back to back.

So, how about this (some pseudocode follows):

New config values:


high speed screenshots when (either/or):
secondsUntilImpact
hsAltitudeLimit
hsMinVerticalSpeed
hsScreenshotInterval

vessel = FlightGlobals.ActiveVessel.get();

if ( (vessel.verticalSpeed > hsMinVerticalSpeed) AND
( (vessel.GetHeightFromTerrain() / vessel.verticalSpeed < secondsUntilImpact) or
(vessel.GetHeightFromTerrain() < hsAltitudeLimit )
)
) then
Take screenshot every hsScreenshotInterval

I also think I can add the ability to take two screenshots, 1 sec apart, one with and one without the UI

Link to comment
Share on other sites

Yes

YES

YES!!!

It would be cool if you could add an "about to crash" automatic screenshot event. Something like if vessel.GetHeightFromTerrain() is less than 100 m and vessel.verticalSpeed is more than -10 m/s or so, take a screenshot every 2 seconds.

It'd also be cool to have the screenshots taken both with and without the UI, back to back.

As requested. It's done, download the latest.

LGG

Link to comment
Share on other sites

I thought this looked eerily similar to one of my mods ;) Very nice, and now I won't have to write this up myself. I'll include a link to here in the Sensible Screenshots description, if you wouldn't mind also linking back to that in the part where you credit me :)

Edit: Does this also rename manual screenshots? It's not totally clear to me in the OP.

Edited by magico13
Link to comment
Share on other sites

I thought this looked eerily similar to one of my mods ;) Very nice, and now I won't have to write this up myself. I'll include a link to here in the Sensible Screenshots description, if you wouldn't mind also linking back to that in the part where you credit me :)

With pleasure.

Your mod was the inspiration for this.

I'll get the code updated in a day or so

JBB

- - - Updated - - -

I thought this looked eerily similar to one of my mods ;) Very nice, and now I won't have to write this up myself. I'll include a link to here in the Sensible Screenshots description, if you wouldn't mind also linking back to that in the part where you credit me :)

Edit: Does this also rename manual screenshots? It's not totally clear to me in the OP.

This does NOT rename manual screenshots.

Link to comment
Share on other sites

Idea coming to the surface... hit the deck if you want to live....

Okay, so taking screenshots of the entire screen is possibly a performance killer if you're on a non-gaming system or if you're running a lot of mods and your RAM is already nearing maximum... so how about this (no idea if it's even feasible, just bear with me for a few moments): Have a GUI window that represents a "frame" of some sort in which the user could resize and position to fit where the screenshots are to be taken, and then have the shots only save what is at the GUI's screen coords + the height and width of the frame. Just something to mull over. Only other idea would be to allow this to interface with other screenshot automation mods so that captioned screenshots could be taken automatically as well (along with the usual caption automation variables as well, if they exist.) I don't sue any of those mods, so I can't be certain what is possible, but it's something to think about.

Link to comment
Share on other sites

Idea coming to the surface... hit the deck if you want to live....

Okay, so taking screenshots of the entire screen is possibly a performance killer if you're on a non-gaming system or if you're running a lot of mods and your RAM is already nearing maximum... so how about this (no idea if it's even feasible, just bear with me for a few moments): Have a GUI window that represents a "frame" of some sort in which the user could resize and position to fit where the screenshots are to be taken, and then have the shots only save what is at the GUI's screen coords + the height and width of the frame. Just something to mull over. Only other idea would be to allow this to interface with other screenshot automation mods so that captioned screenshots could be taken automatically as well (along with the usual caption automation variables as well, if they exist.) I don't sue any of those mods, so I can't be certain what is possible, but it's something to think about.

Ummm, what other screenshot automation mods?

The only one I'm aware of is Historian, and it doesn't do screenshots, it just puts captions on

Not sure about the frame, I'm trying to keep this small and simple. But I will think about it.

LGG

Edited by linuxgurugamer
Link to comment
Share on other sites

Ummm, what other screenshot automation mods?

The only one I'm aware of is Historian, and it doesn't do screenshots, it just puts captions on

Not sure about the frame, I'm trying to keep this small and simple. But I will think about it.

LGG

I've made changes to allow this mod to talk to Historian. I just need Zeenobit to add a function to Historian.

Thanks for the suggestion.

LGG

Link to comment
Share on other sites

Ummm, what other screenshot automation mods?

The only one I'm aware of is Historian, and it doesn't do screenshots, it just puts captions on

Not sure about the frame, I'm trying to keep this small and simple. But I will think about it.

LGG

Crash

Spashdown

Cre Killed

Cre on eva

Flag Planting

Launch

Part couple

Part die (explode)

Joint breaking

undocking

activating stage

stage seperation

changing vessel

making orbit

escaping orbit

SOI changed

Link to comment
Share on other sites

For those interested, I've been working with the Historian mod to made AutomatedScreenshots able to work with it.

I am happy to say that the work is complete. Currently you can get the (deleted, Zeenobit released) once Zeenobit makes his release I'll delete this.

The first version of AutomatedScreenshots to support this will be 0.3.0, which I expect to release in a couple of days.

LGG

- - - Updated - - -

You know what would be fun? Integration with MovieTime to take enhanced screenshots...

Can you elaborate on this? While I haven't tested it, I'm sure that if MovieTime is running, that the screenshots will be modified by MovieTime.

Edited by linuxgurugamer
Link to comment
Share on other sites

The timer is based on real time, not game time. And special events are generated by the game.

Would it be possible to have an option to use game time for triggering the screenshots? Sometimes it is desirable to have screenshots taken at an exact interval, and using game time should automatically account for any physics lag.

Also, I'd like to ask for shorter, sub-second interval duration; if you deem it necessary, you could always "hide" that behind a warning, but I think it's self-evident that taking screenshots puts additional load on the computer and as such, should be avoided if performance is of the essence...

Finally regarding your concerns about size, df reports about 2.5 TB free disk space, that should last a minute or two ;)

Link to comment
Share on other sites

Would it be possible to have an option to use game time for triggering the screenshots? Sometimes it is desirable to have screenshots taken at an exact interval, and using game time should automatically account for any physics lag.

Also, I'd like to ask for shorter, sub-second interval duration; if you deem it necessary, you could always "hide" that behind a warning, but I think it's self-evident that taking screenshots puts additional load on the computer and as such, should be avoided if performance is of the essence...

Finally regarding your concerns about size, df reports about 2.5 TB free disk space, that should last a minute or two ;)

First, re. game time. What would you expect to happen if, for example, you set it to take screenshots every game minute, and then you are in the middle of a timewarp? Would you want it to take the screenshot of the warp, ignore it?

Second, sub-second intervals. Why not just run FRAPS or OBS? How sub-second would you like?

The disk space can be an issue for some people if they aren't aware of it.

LGG

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...