Page 1 of 1

Headless Mode

Posted: 27 Jul 2018, 17:00
by laxon
I am curious if it would be possible to setup OpenMW in a headless mode (for linux/macos). Something that would allow for a save to be loaded and then an in-game console command(s) or script to be executed after load.

With the steps being:

Code: Select all

Start OpenMW >
Load Save > 
Run Game Script (transition to a cell/coordinate & activate spell) > 
Take Screen Shot > 
Quit
With arguments like:

Code: Select all

OpenMW --save=path-to-save --script-(id/name/file)=string
If this isn't possible already it could be handy to automate certain visual tests for mod authors/openmw developers.

Re: Headless Mode

Posted: 27 Jul 2018, 18:48
by lysol
I guess this is what you are looking for?

Re: Headless Mode

Posted: 28 Jul 2018, 13:53
by laxon
Yes! But more of the thing that that PR is turning into a GUI: https://wiki.openmw.org/index.php?title ... _Arguments

The elements missing are:
  • Running Headless (no GUI)
  • Triggering an exit (via a script, or event?)
  • Capturing a Screenshot (ether via script, or on exit)
I am not new to C++ but am new to the OpenMW codebase. Could anyone tell me if adding this would be hard or medium difficulty?

I believe that OSG can already run in a headless mode, rendering without output to a GUI.

Thanks for taking a look!

Re: Headless Mode

Posted: 28 Jul 2018, 23:58
by AnyOldName3
In later Elder Scrolls games, there's a script command which quits the engine, so I wouldn't be surprised if Morrowind had that too, in which case, OpenMW will support it.

Re: Headless Mode

Posted: 29 Jul 2018, 07:41
by Atahualpa
AnyOldName3 wrote: 28 Jul 2018, 23:58 In later Elder Scrolls games, there's a script command which quits the engine, so I wouldn't be surprised if Morrowind had that too, in which case, OpenMW will support it.
AFAIK, there is no such command in Morrowind. Oblivion and Skyrim have the "qqq" command to quit the game - is that what you meant?

Re: Headless Mode

Posted: 29 Jul 2018, 11:56
by AnyOldName3
I think it is.

Re: Headless Mode

Posted: 29 Jul 2018, 13:03
by laxon
That sounds like a promising reason to maybe add this command.

I also found this relating to running OSG without a GUI: https://stackoverflow.com/questions/316 ... stem-using

It seems that they were also looking for GUI free draw and screen capture.

Any advice on where in the codebase I should begin editing to do a quick test of this functionality?