In Game Video / Trailer - Is there any instructions or howto

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

In Game Video / Trailer - Is there any instructions or howto

Post by riftroamer »

Hi there,

since a few weeks the Most Recent Updates to Subversion Repository show entries about video, video dejittering and things that somehow suggest (to me) that inGame video might be possible within Vega Strike or a mod.

I envision a short mood-setting intro trailer (similar to what's already been discussed on the forum) for a VS-Mod I have in mind and some decriptive video cutscenes that portray the forthcoming of a story line or campaign.

However searching the forum and wiki and the way the intro sequence of Parallel Universe is implemented (an image sequence) showed no sign of i.e. an AVI video file (or an Ogg Theora video file) being played back while the game is up and running. There seems to be something in the vegastrike subdir: vegastrike/src/gfx (vid_file.h, vid_file.cpp) but - to be honest - I am completely clueless making any use of this. I found a set of functions on the wiki that are available to python programming. These make use of the ".ani" files for use with cockpits, I suppose.

How do I add an actual video (playback) to Vega Strike?
Can I simply replace the image reference in an animation definition ".ani" file (wiki) to reference a video file located in a specific directory and everything's fine (I Suppose not), or will there be any advanced coding necessary to implement such thing?
What do I need to keep in mind regarding folder structure or video format (video/audio encoding)?

I am no coder at all, so please accept my apologies if the terminology used in my post does not fit exactly in all cases. I'd apreciate any info / link on this, including links pointing to an example if available. Thank you very much.

And to the devs: Keep up the good work, please. Vega Strike is an inspiring and exciting game.
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: In Game Video / Trailer - Is there any instructions or h

Post by klauss »

When VS is compiled with ffmpeg support, the base interface can be used to play video cutscenes in any format supported by ffmpeg.

The video subsystem is able to handle pluggable formats too, so even without ffmpeg, we could (though it's not done) add support for Theora and other free formats.

Most of the releases, however, do not include ffmpeg support, because many distros consider ffmpeg a legal liability (due to unknown/fuzzy patent issues with the codecs it contains).

When built with ffmpeg support, however, intro scenes are very easy to set up: there's a little piece of code in the main menu script that plays the video, if it's there and support is built. You just have to drop your video files in data/movies/preintro.ogv (for the cutscene that always plays at game start), and data/movies/intro.ogv (for the cutscene that plays when you start a campaign).

They file names are "ogv" for "theora video", but you could use any other extension and format (just change the file reference in data/bases/main_menu.py).

Best of luck ;)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

Re: In Game Video / Trailer - Is there any instructions or h

Post by riftroamer »

Thanks a lot on the info. I'll dive into that as soon as I got some badly needed sleep.
Your answer is quite promising. I'll keep in touch with my progrees (if any).
;-)
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: In Game Video / Trailer - Is there any instructions or h

Post by TBeholder »

also, communication "video" talking heads are implemented as simple animation sequences - see data/animations/com_tutorial_oswald.ani/ used in data/modules/quests/quest_tutorial.py script used in data/mission/test/tutorial.mission (tutorial mission with Oswald).
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: In Game Video / Trailer - Is there any instructions or h

Post by klauss »

Yep, been thinking about using video for those too.
Not difficult at all, only we don't have the assets.
Our current assets work a lot better as they are: a sequence of still frames.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: In Game Video / Trailer - Is there any instructions or h

Post by TBeholder »

klauss wrote:Our current assets work a lot better as they are: a sequence of still frames.
Agreed - would be cool, but no great need.
Hmm... If doing it via textures doesn't somehow interfere with video drivers' features, like using up texture caching or frames. Probably not, though.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: In Game Video / Trailer - Is there any instructions or h

Post by klauss »

Videos are just textures, only they get updated as time passes.

In the sense of caching, they're neutral, since you can't cache them. They use no more VRAM space than a single frame, and only while they're being used.

They do however require CPU cycles to decompress the video on the fly.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

Re: In Game Video / Trailer - Is there any instructions or h

Post by riftroamer »

Well, I finally managed to compile vs with ffmpeg support on debian squeeze. Basically I appended "--enable-ffmpeg" to the configure command and got no errors - after meeting the dependencies - not hazzle free, but manageable.

Since I am doing this on a rather dated mono-core machine testing whether vs still launches and works correctly will have to wait for friday night ;-)

After realizing just how many codecs ffmpeg supports I wonder if there are a bunch of "preferred" codecs (cpu-cycle friendly)?

Personally I think replacing every image sequence with actual video (cockpit communication video for example) would be unnecessary.

During combat or generally busy in-flight procedures one barely realises whether the com-video consists of a few repeating frames used to animate the mouth of the person shown, or actual syllables being portrayed.

But having your own avatar shown to your multiplayer comrades would be a nice touch, even if it's only shown for this purpose. Could be a neat idea for my modding fantasies ;-)

Perhaps this could be achieved by assigning a separate privateer subfaction for each registered multiplayer account with appropriate communication animation (or still image). Could that possibly work?

How extensible is the faction system anyway? Are there practical limits? Could individual protagonists or antagonists be implemented with - say - a sub-subfaction to the privateer faction? Any drawbacks?
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: In Game Video / Trailer - Is there any instructions or h

Post by klauss »

Preferred codecs, probably theora, since it's free and most likely to get ffmpeg-free support.

Some distros will never ship VS if it's built with ffmpeg, so the only format I know you'll get playing without ffmpeg is theora.

If you don't care about that, probably one of the mpeg4 family would suffice. The lower the mpeg4 profile, the fast decoding will be, but decoding speed is not the only important factor anyway.

About factions, VS doesn't have subfactions. Only factions.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

Re: In Game Video / Trailer - Is there any instructions or h

Post by riftroamer »

Thanks a lot for the insight. I am quite inclined to stick to Open Source whenever possible. So I'd probably opt for Theora.

I hope I am not straining anyone's patience with questions that may be more or less obvious to developers or coders.
Can I replace "--enable-ffmpeg" with something like "--enable-theora" if I chose to use only ogg based codecs?
Or is it ffmpeg compiled with only theora support enabled that's doing the trick? Loads of questions... :)

Are the media related options for "./configure" for VS documented somewhere? I have quite possibly overlooked something.

Thanks for the info regarding factions, by the way. The Faction "grouping" (wiki) into factions and subfactions on the wiki has nothing to do with the technical implementation, got it. :wink: Is there a practical limit to the total number of factions (only for ease of maintenance, I suppose)?
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: In Game Video / Trailer - Is there any instructions or h

Post by klauss »

riftroamer wrote: Can I replace "--enable-ffmpeg" with something like "--enable-theora" if I chose to use only ogg based codecs?
Only if you also decide to provide a patch supplying the libtheora-based codec ;-)
Note: it wouldn't be difficult for an experienced coder, it's pretty modular.
riftroamer wrote:Or is it ffmpeg compiled with only theora support enabled that's doing the trick? Loads of questions... :)
ATM, --enable-ffmpeg will let VS decode theora video, since ffmpeg supports theora.
The benefit in sticking to theora is that it's possible to, eventually, code the libtheora-based module that will let VS have the --enable-theora you mention and not require ffmpeg for theora videos.
riftroamer wrote:(only for ease of maintenance, I suppose)?
Technical limit, probably around 10k or so (memory and savegame consumption is quadratic on the number of factions). Practical, probably a LOT less (around 100 I'd say).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

Re: In Game Video / Trailer - Is there any instructions or h

Post by riftroamer »

Thanks a lot for the input. Meanwhile I've been able to make a quick test run but failed. As soon as I put a theora video into the /data/movies folder the game crashes. For lack of an available one I used the trailer from Sintel (Blender Open Movie Project) and renamed it according to your instructions.

I think I got a few errors or notices either when compiling ffmpeg or vegastrike but need a bit of time to look into that. The crash itself however quite certainly means that the game is recognizing and automatically using the video files, so I think I made an error with ffmpeg prior to compiling vegastrike.

I am certainly quite inexperienced with programming and compiling, though the usual "./configure", then "make" (, then - optional for VS - "make install") is fine. Well if no errors occur, that is ;-).

If I understood correctly there is a game intro video and a campaign intro video. Assuming I manage to get it right. Can I replace other ".ani"-sequences with video by referencing the video file within such an ".ani" sequence file? The aim is to make individual mission videos or special antagonist or protagonist portrait videos or location/ station/ planet information videos. Even videos for presenting an in-game object (like a special ship or cargo or passenger) might be nice.

Well it's not a necessity as I usually don't like video overkill in a game, but sometimes it makes sense to transport a story.

However I could still create low frame-rate Homeworld 2-like animatics (YouTube) with the features already present, if the above is out of the reach.

Oh! One thing just came to my mind. In game video grabbing, scripting or camera manipulation. Is there any way to easily "position" or "control" ships to capture slow passes or something like (the 7th to 20th second) in this EVE-Online video on YouTube?

Of course I could do this in Blender, but a scripted sequence could be made in a more or less seamless way that the camera perspective finishes where the player would enter gameplay (assuming there is any way to "auto-launch" in the background during video playback or start gameplay in space not docked).

Oh my, I am possibly quite far into dreamland with this :-)

Edit: klauss answered the bit about cut-scenes and the base interface already. Is there a reference implementation/ code example I can have a look at?
I sort of think about setting up a "room" that plays the video and then connects to the "main concourse", possibly further extended by "cut-scene rooms" showing e.g. a taxi ride from the port to a roadside cafe or something similar, before showing the "bar". Of course it remains to be evaluated whether such video makes sense regarding gameplay or storytelling at all, but as an option...:-)
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: In Game Video / Trailer - Is there any instructions or h

Post by TBeholder »

klauss wrote:In the sense of caching, they're neutral, since you can't cache them. They use no more VRAM space than a single frame, and only while they're being used.
They do however require CPU cycles to decompress the video on the fly.
I meant the texture cache being washed by conversations. But yeah, in a massive simulation CPU is more important.
riftroamer wrote:But having your own avatar shown to your multiplayer comrades would be a nice touch, even if it's only shown for this purpose. Could be a neat idea for my modding fantasies ;-)
There are GIMP plugins working with DXT, so it's probably not too hard to make a straightforward PNG 2 DXT converter and make the server use it.
riftroamer wrote:In game video grabbing, scripting or camera manipulation. Is there any way to easily "position" or "control" ships to capture slow passes or something like (the 7th to 20th second) in this EVE-Online video on YouTube?
Yes. Create a mission that launches the player on any existing ship into a system set up in XML. E.g.: Modelview mission in Modelview system (files data/mission/modelview.mission and data/sectors/Special/Modelview.system).
Place and orient ships and other objects however you need. If you set them as fixed objects (like planets and stations), they won't even try to fly anywhere.
Then you only need to launch VS with " mission/my_scene_01.mission" at the end of the command line. Do it in a copy of the desktop shortcut and the scene is only click (and a few loading screens) away. Fly PC ship around fixed objects on the scene and switch looks as needed.
If you want other ships flying around and not just hanging there, <python> part of the mission can be used to launch anything, anywhere and with any AI script (including "Run away! Run away!") as long as it's already in the game. Example: data/mission/launch.mission
Ships and fixed objects alike can be set to any factions, so they will try to attack or protect each other accordingly.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

Re: In Game Video / Trailer - Is there any instructions or h

Post by riftroamer »

TBeholder wrote:
riftroamer wrote:In game video grabbing, scripting or camera manipulation. Is there any way to easily "position" or "control" ships to capture slow passes or something like (the 7th to 20th second) in this EVE-Online video on YouTube?
Yes. Create a mission that launches the player on any existing ship into a system set up in XML. E.g.: Modelview mission in Modelview system (files data/mission/modelview.mission and data/sectors/Special/Modelview.system).
Thanks a lot! I wasn't aware of that possibility. Sounds like a perfectly nice solution.

By the way, what unit are these extraordinarily large coordinates in, that define the position of a ship or planet and to which origin are these related to? Lightseconds? Kilometers? Multiples of Meters?
The origin I suppose is the star. It's not the center or a corner of the VS-Universe volume, is it?

My apologies if this has been asked before or if there's something in the wiki.

Well, thanks for the primer. I'll definitely give it a try during the next days.
Last edited by riftroamer on Wed Dec 07, 2011 4:57 pm, edited 1 time in total.
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: In Game Video / Trailer - Is there any instructions or h

Post by klauss »

About the crash, please, provide details. Console output, and even a stack trace would help.
But I'm betting it's not a hard crash, it must be throwing an exception, so you should see something explaining why in the last console lines.
riftroamer wrote:If I understood correctly there is a game intro video and a campaign intro video. Assuming I manage to get it right. Can I replace other ".ani"-sequences with video by referencing the video file within such an ".ani" sequence file?
I don't think you can, sadly.
It could be a worthwhile feature request, though.
riftroamer wrote:The aim is to make individual mission videos or special antagonist or protagonist portrait videos or location/ station/ planet information videos. Even videos for presenting an in-game object (like a special ship or cargo or passenger) might be nice.
At bases, you can add "video sprites". The issue with them ATM is that videos don't contain alpha channels, so they're always rectangular (and we don't support color keying).
With video files in .ani files, we might (might) be able to provide two videos (color in one, alpha in the other). I don't know how hard it would be, would have to try.
But many uses of video files don't need alpha or color keying, so you can use them right now for those applications.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: In Game Video / Trailer - Is there any instructions or h

Post by TBeholder »

riftroamer wrote:By the way, what unit are these extraordinarily large coordinates in, that define the position of a ship or planet and to which origin are these related to? Lightseconds? Kilometers? Multiples of Meters?
The origin I suppose is the star.
Kilometers, as can be seen from data/sectors/Sol/Sol.system values.
On top of the hierarchy, relative to the system's abstract point of reference (usually the star is here, but remeber: there are also binary ones).
Or the current object's center on lower levels - as in Sol -> Earth -> Luna -> "Moon Bulk Depot #2" station (okay, the station isn't in XML, but you see the point).
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
riftroamer
Merchant
Merchant
Posts: 45
Joined: Mon Nov 01, 2010 2:32 pm
Location: Sol, 3rd rock from the sun
Contact:

Re: In Game Video / Trailer - Is there any instructions or h

Post by riftroamer »

thanks. I'm currently preparing to helping Hicks out to assemble some dimensional data for the modular ships thread, so I haven't yet had a chance to get familiar with setting up a test Mission for experimenting with grabbing Videos from gameplay.

Also I need to figure out what went wrong with compiling ffmpeg. probably a noob error.

I'll get back on this later. if I have questions I'll post them including - if applicable - the log-data klauss asked for.
And on the eighth day the Lord went riftroaming...

IMTU tc+ tm+ tn+ tg ru- ge+ 3i c+ jt au+ pi+ he+
OTU 42% au+ br- cpu- fs- ge+ j- ti+ tv+ uwp+
Tarlon Rhaan 0201 C88885A-9 S hi as+ va- so- zh vi+ da 723
Post Reply