Wednesday, June 19, 2013

Tutorial - Recording Videos of Games under MAME

I include a video of myself playing some video game in almost every one of my posts. In addition to the videos I share here, I have a YouTube page where I have 19 videos as of this writing. You might be wondering how I record these videos. In this tutorial, I will explain different methods that can be used to record videos while playing some arcade game on MAME.

The methods that I will discuss will use MAME's built-in "-mngwrite" and "-aviwrite" options and therefore, will not require any additional software (though some additional software may be necessary for processing the video and audio files generated by MAME). I will just mention that there are software which can be used to capture videos from the screen. This process is called screencasting. These programs, such as FRAPS, will record anything you see on screen as opposed to MAME's built-in functions which only record the game screen. In other words, if you press the TAB button to access the options menu, this menu will be a part of the video that FRAPS records but the MAME video will not show this screen. My personal recommendation is not to use FRAPS or any other additional software unless the built-in functions of MAME do not work.

The options "-mngwrite" and "-aviwrite" tells MAME to record the output to a .mng and a .avi file respectively, but the common practice is not to use these commands while playing the game. The reason for this is that these commands, especially "-aviwrite", slows the system down considerably, sometimes to a point where it becomes impossible to play the game. A simple remedy for this problem is to record the input while playing the game and use the record commands while playing this recorded input.

MAME is capable of recording the user input and later playing these recorded input files. In other words, it is possible to create a replay file which contains all the moves you make while playing the game and can later be used to playback the entire recorded game. This is achieved using the "-rec" command. The usage is as follows:

mame -rec <filename>

To playback a recorded game, the "-pb" command is used in the following way:

mame -pb <filename>

Let me illustrate the usage of these commands on an example. Suppose a 64-bit version of MAME is installed in the directory " c:\mame" and you would like to play the game "Hard Hat" and record the input to a file named "input_rec.inp". The command you should enter is the following:

c:\mame>mame64.exe hardhat -rec input_rec.inp

This will create a file "input_rec.inp" in the "c:\mame\inp" directory. If you want, you can edit "mame.ini" file to change where the recorded input files are saved. To playback the recorded file, the following command should be entered:

c:\mame>mame64.exe hardhat -pb input_rec.inp

After entering this command, MAME will look for the "input_rec.inp" file in the "c:\mame\inp" directory and start the replay if this file is found. If this file is in some other directory, then you should enter the filename with the full path.

If there are problems with recording and replaying, you can try deleting the .cfg that belongs to whichever game you are playing. You should delete this file before recording and before the playback. This file is located in the "c:\mame\cfg" directory and the name of the file is the same as the name of the rom of the game. In the above example, the .cfg file will be "c:\mame\cfg\hardhat.cfg". You should also make sure that your version of MAME is the same as the version that was used to record the game.

After recording your input, you can use the "-mngwrite" command to write the recorded game to a .mng file, though it is claimed that this command stopped working on the newer versions of MAME. In addition, this command does not record any sounds from the game. Therefore, the "-mngwrite" command is usually accompanied by the "-wavwrite" command. The usage for these two commands is as follows:

mame -mngwrite <filename> -wavwrite <filename>

The files that were created by this command, by default, will be saved to "c:\mame\snap" folder. This, in addition to any other folder that MAME uses, can be changed by editing the "mame.ini" file in the "c:\mame" directory. You can also turn on/off recording of .mng videos by pressing SHIF + F12 anytime during the game, though with this method you will not be able to record any sound.

These commands can be used together with the "-pb" command. For example, suppose we want to make a video of the game "Hard Hat" from the recording "input_rec.inp" where the name of the video file is "video.mng" and the name of the audio file is "audio.wav". The command that we should enter is the following:

c:\mame>mame64.exe hardhat -pb input_rec.inp -mngwrite video.mng -wavwrite audio.wav

Now, after the playback, the files "video.mng" and "audio.wav" will be saved to the folder "c:\mame\snap". You can then use additional software to combine the audio and video files. There are free software that can be used for this purpose, such as MPlayer. I am not going to be able to offer any help about how to use this program, as this is not usually the method that I use to record my videos.

An easier way to record videos is to use the "-aviwrite" command. Unlike the "-mngwrite" command, the "-aviwrite" command will record both video and audio. The usage of this command is similar to the "-mngwrite" command:

mame -aviwrite <filename>

The files created with this command are saved to the "c:\mame\snap" directory as usual. For example, if we want to make a video of the game "Hard Hat" from the recording "input_rec.inp" where the name of the video file is "video.avi", the following command should be entered:

c:\mame>mame64.exe hardhat -pb input_rec.inp -aviwrite video.avi

After the playback, the file "video.avi" will be saved to the folder "c:\mame\snap". The avi files created by MAME are uncompressed and therefore they are extremely large (about 1gb per minute). You might want to compress these files, especially if you want to share these videos on Youtube or some other website. A free software that can be used for this purpose is Handbrake.

Finally, I will remark that throughout the tutorial, the assumption was that you are using the command line version of MAME, though user interface versions of MAME are also capable of recording and replaying game input and writing video and audio files; however I could not find a way to playback some recorded game and write a video file at the same time. In fact, that was the reason I started using the command line version.

Friday, June 7, 2013

Game Review - Golden Axe

Golden Axe, a side scrolling beat 'em up which was made in 1989 by Sega, is well known both as an arcade game and as a home game. I have a lot of fond memories of playing this game with my friends, though it was the PC version of this game that we played. In fact, I think I only came across this game once or twice in an arcade. There is quite a difference between the arcade and the PC version of this game; after having played the PC version for such a long time, I remember I was amazed when I saw the arcade version which had much superior sound effects and graphics. There were other differences too, I think the PC version was a little longer because I remember the game did not end after beating Death=Adder in the PC version.

There are three characters in this game, each with different skills and abilities, and each with their own reason to go after Death=Adder, the main antagonist in the game. The first of these characters is Gilius Thunderhead, a dwarf from the mines of Wolud whose twin brother was killed by Death=Adder. His attacks are slow, but punishing. Especially, his jumping axe attack has a wide range and is a life saver against crowded or strong enemies. On the other hand, being a dwarf, he is not particularly strong with magic. He can only cast magic spells up to the third level and carry at most four potions, which means the player either has to use the magic spells frequently or waste most of the potions that appear in the game. Nevertheless, his strength in fighting far makes up for his weak magic usage. He is also my favorite character in the game.

Next, there is Ax Battler, a male barbarian whose mother was murdered by Death=Adder. This character has a nice balance between strength and magic; his attacks are not weak and his magic use is stronger compared to the dwarf. He can use his broad sword in a variety of ways against the enemy and his running shoulder attack can be especially useful during the game. He can cast spells up to fourth level and his strongest magic attack uses six potions. He is the ideal character for those who want a strong character that can also make good use of magic.

The last of the playable characters in the game is Tyris Flare, an amazon who seeks revenge for her mother and father who were killed at the hands of Death=Adder. Her strong side is magic usage, she can magic spells up to sixth level. To cast her strongest spell, she needs nine potions, at which point a dragon sweeps the screen from side to side with a powerful fire blast. If you want to play with this character, magic should definitely be a part of your strategy.

Here's a video of me winning the game on a single coin, with the dwarf character:

To say a few words about the gameplay, winning the game with a single coin is difficult but not impossible. One needs to know about strength and weakness of every single opponent, as well as what opponent to expect at which point. The weak opponents, such as those attacking with clubs and maces, are easy to handle unless they are very crowded. One just need to be careful not to be in their way when they do running attacks. Giants with mauls are harder, but they can also be countered without that much trouble. The skeletons and dark, colorless versions of weak guys (who I suspect are undead) are very tricky; not only because of their speed but also because they are hard to kill. It is possible to ride dragons and the little reptile looking animals which attack with their tail, it is usually a good idea to make use of them when they appear. Just to keep in mind, you can still do your running attack while riding these animals and some situations may call for these attacks over their regular attacks.

In closing, I think Golden Axe is a great game which stands the test of time. Anyone with any sort of interest in gaming, especially arcade gaming, should know about and preferably have played this game, in one platform or other. The game also has a grading system where the player is assigned a grade for the skill demonstrated during the game, which makes it desirable to play the game over and over even after winning it once, just to get a higher grade; though it is pretty easy to get the highest grade by winning the game with just one coin, as I got the highest grade with the worst possible play resulting in a single coin win. Just a final note about this game is that there are a number of sequels and spin-offs based on this game; interested player may check those games out.