vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

Custom Movie Tutorial (patch 1.30.1+)

Guest · 49

0 Members and 1 Guest are viewing this topic.

Custom Movie Tutorial (patch 1.30.1+)
on: November 14, 2018, 10:13:10 PM
Category: Miscellaneous Tutorials
« Created: February 24, 2019, 05:09:55 PM by moyack »

Warcraft III has capability of playing movies similar to Blizzard's intro and ending movies. However, you need to know to what format to encode your movie that it works in the game. The video format changed with the patch 1.30, and a working support for custom movies was added in patch 1.30.1.

Warcraft III Movie Resolution and Frame Rate
By default, Warcraft III supports movies with a maximum width of 800 pixels. Therefore, a 16:9 movie will be 800x450 pixels in size. Blizzard used about 24 frames per second in their movies, but in this tutorial we will encode them with 25 frames per second. We also found that using about 25 fps for the movie helps it to play correctly with low-end computers, which might have performance problems decoding higher frame rate movies.

Preparing Your Movie
You can create your movie in any video editing software and then export it to MP4 or similar common format. It can be in any resolution and frame rate as long as it is at least 800x450 @ 25 fps. For the Gnoll Campaign intro movie, we used Final Cut Pro X and exported it to 1920x1080 @ 50 fps MP4. It was also the format we uploaded it to YouTube.

Encoding Your Movie for Warcraft III 1.30 and later
Warcraft III 1.30 uses a very specific format for movies. You also need to encode video stream and audio stream separately.

Encoding Video Stream
You need to encode the video stream into VP9 AVI using the Constant Quality (CQ) mode. You can do this using the FFMPEG command line tool. This is how you do it:

Code: [Select]
ffmpeg -i "Your Source Movie.mp4" -c:v libvpx-vp9 -crf 30 -b:v 0 -s 800x450 -r 25 -an WC3Movie.avi
-c:v libvpx-vp9 makes FFMPEG to use the VP9 codec.
-crf 30 determines the quality. We found that 30 was quite good.
-b:v 0 must be 0 to enable the CQ mode.
-s 800x450 scales the video down to 800x450.
-r 25 set the frame rate to 25.
-an removes the audio track.

The end result is WC3Movie.avi, which is a VP9 CQ AVI file. It can have any name, but the extension must be avi.

Encoding Audio Stream
The audio stream needs to be encoded to MP3. You can do it also with FFMPEG.

Code: [Select]
ffmpeg -i "Your Source Movie.mp4" -c:a libmp3lame -b:a 128k -vn WC3Movie.mp3
-c:a libmp3lame makes FFMPEG to encode using the MP3 codec.
-b:a 128k sets the bitrate to 128 kbps.
-vn removes the video stream.

The end result is WC3Movie.mp3. It must have the same name as the video stream file, except the extension is mp3.

Importing the Encoded Files to Warcraft III
When you have the files ready, you need to import them to Warcraft III. In campaigns, you can import them using the campaign import manager (F7). After importing, you need to change their paths to

Movies\WC3Movie.avi
Movies\Audio\WC3Movie.mp3

Creating a Movie Map to Campaign
The next step is to create a separate movie map to your campaign. You need to create some triggers and import a few files. The purpose of the files is to remove all useless user interface and make the screen look totally black. The triggers are used to do the same and finally play the movie.

You can find an example one in our Gnoll Campaign. Download it (version C1R5 or later) and open it in the World Editor using the Campaign Editor (F7). Export the CinematicIntro.w3x map or open it through the Edit Map command. You will see that the triggers look like this:



You can see here that

  • Game music is first stopped.
  • Game screen is made black with the Black Mask.
  • Letter Box Mode is used to remove the user interface (letter box mode graphics are removed by imports).
  • Custom Script "call PlayCinematic" is used to play the movie at the end of the map. In the Gnoll Campaign, the movie is named GCIntro. If you used WC3Movie, then you need to use it also here.
  • Wait 0.00 seconds is needed or things do not work.
  • Next level is set to Chapter 1.
  • The game is finished immediately, skipping dialogs and scores.


Now the movie will play immediately on startup and the game will automatically move to the next chapter after the movie.

You can import CinematicIntro.w3x into your campaign or create a similar one. You need to change the loading screen, though.

Playing the Movie
You can now play the movie by clicking its button in the campaign main screen.

Playback Problems
Movies may not work on Windows 7. They have been tested to work on Windows 10 and macOS High Sierra.
« Last Edit: February 24, 2019, 05:15:00 PM by moyack »



 

Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)