Author Topic: Battle End video and music support  (Read 1348 times)

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Battle End video and music support
« on: 25 September 2012, 00:24:50 »
I've added support for game end (battle end) videos AND/OR music. To use it get the svn build from tonight and setup your mod:

Videos:
look for videos in the following order:
1. check faction xml file for the following attributes (depends on win/lose) on the faction tag:
faction-battle-end-win-video="<path to video>"
faction-battle-end-lose-video="<path to video>"
if not defined 2. check the faction folder for the files:
battle_end_win_video.*
battle_end_lose_video.*
if not found check the data/core/menu/videos/ paths for:
battle_end_win.*
battle_end_lose.*

Music:
 added support for custom music on battle end screen:
look for music in the following order:
1. check faction xml file for the following attributes (depends on win/lose) on the faction tag:
faction-battle-end-win-music="<path to music>"
faction-battle-end-lose-music="<path to music>"
if not defined 2. check the faction folder for the files:
battle_end_win_music.*
battle_end_lose_music.*
if not found check the data/core/menu/music/ paths for:
battle_end_win.*
battle_end_lose.*

Using the combination of these you may create short videos without sound and longer music if desired.
« Last Edit: 25 September 2012, 01:53:59 by softcoder »

treba

  • Guest
Re: Battle End video and music support
« Reply #1 on: 25 September 2012, 14:02:05 »
sounds cool, hopefully we'll get some videos some time =)
can you also add a lookup for scenarios? to make the video a reward for playing through it

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: Battle End video and music support
« Reply #2 on: 25 September 2012, 14:10:32 »
Already added these lua methods a while ago:

playStaticVideo(const string &playVideo);
playStreamingVideo(const string &playVideo);
stopStreamingVideo(const string &playVideo);
stopAllVideo();

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: Battle End video and music support
« Reply #3 on: 26 September 2012, 04:01:08 »
Ok tested from version 3596

Good news i can successfully have both a video and music play at the battle end screen!

However,
These issues may be a results of the broken OpenAL32.dll mentioned last night.

*Music in battle end screen does not loop,

*So far the only way I have gotten this to work is having battle_end_win_video.*  and battle_end_win_music.* in the faction folder.

Code: [Select]
faction-battle-end-win-video="<../../music/victory.mp4>" doesn't work or syntax is wrong, just in case i tried,
Code: [Select]
<faction-battle-end-win-video="../../music/victory.mp4" />still did not work...  No error messages or video

Same goes for data in data/core/menu/videos/ or data/core/menu/music/ I re named files to battle_end_win.* as dictated and it wouldn't  load, I tried battle_end_win_video.* and battle_end_win_music.* and that still did not solve issue...

Faction preview still did not loop as changes in svn dictated.

*Also I cant confirm this with any real evidence, but I really feel that videos played in Intro and Battle end screen lag alot more than the same video as a faction preview. With the intro video being the worst of the two.

Overall impressions, video is nice though video generally play slow unless you apply a lot of compression to the video, and you do notice vsync issues which cant be avoided. (probably my graphics card) However, Whenever a video attempts to loop screen flashes temporarily to re-load the video which can be quite jarring the viewer.  Best solution I tried myself was to start and end with fade to/from black but its still noticeable. Perhaps there is a better way to smooth out the transition?

Overall great step forward Looking forward to using this feature! Thanks again!
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
Re: Battle End video and music support
« Reply #4 on: 26 September 2012, 07:32:57 »
To specify in the faction's xml file you would go something like: (i made some vn fixes tonight)

<?xml version="1.0" standalone="no"?>
<faction battle-end-win-video="x_battle_end_win_video.avi" battle-end-lose-video="x__battle_end_lose_video.avi" >
etc..

Music now loops

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: Battle End video and music support
« Reply #5 on: 30 September 2012, 18:52:47 »
Just tried last nights build, and video now loops seamlessly and music loops just fine now too. Thanks softcoder!
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer