{"id":3510,"date":"2011-08-03T22:19:13","date_gmt":"2011-08-04T05:19:13","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=3510"},"modified":"2011-08-04T09:35:21","modified_gmt":"2011-08-04T16:35:21","slug":"mgs-vp3-easter-egg","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/mgs-vp3-easter-egg\/","title":{"rendered":"Metal Gear Solid VP3 Easter Egg"},"content":{"rendered":"<p><a href=\"http:\/\/www.mobygames.com\/game\/gamecube\/metal-gear-solid-the-twin-snakes\">Metal Gear Solid: The Twin Snakes for the Nintendo GameCube<\/a> is very heavy on the cutscenes. Most of them are animated in real-time but there are a bunch of clips &#8212; normally of a more photo-realistic nature &#8212; that the developers needed to compress using a conventional video codec. What did they decide to use for this task? On2 VP3 (forerunner of Theora) in a custom transport format. This is only the second game I have seen in the wild that uses pure On2 VP3 (<a href=\"http:\/\/multimedia.cx\/eggs\/vp3-in-the-wild\/\">first was a horse game<\/a>). Reimar and I <a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Metal_Gear_Solid_VP3\">sorted out most of the details<\/a> sometime ago. I sat down today and wrote a <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> \/ <a href=\"http:\/\/libav.org\/\">Libav<\/a> demuxer for the format, mostly to prove to myself that I still could.<\/p>\n<p>Things went pretty smoothly. We suspected that there was an integer field that indicated the frame rate, but 18 fps is a bit strange. I kept fixating on a header field that read <code>0x41F00000<\/code>. Where have I seen that number before? Oh, of course &#8212; it&#8217;s the number 30.0 expressed as an IEEE 32-bit float. <a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=4xm_Format\">The 4XM format<\/a> pulled the same trick.<\/p>\n<p><strong>Hexadecimal Easter Egg<\/strong><br \/>\nI know I finished the game years ago but I really can&#8217;t recall any of the clips present in <a href=\"http:\/\/samples.mplayerhq.hu\/game-formats\/mgs1-vp3\/\">the samples directory<\/a>. The file mgs1-60.vp3 contains a computer screen granting the player access and illustrates this with a hexdump. It looks something like this:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2011\/08\/metal-gear-solid-hexdump.jpg\" alt=\"\" title=\"Metal Gear Solid: Hexdump\" width=\"320\" height=\"240\" class=\"aligncenter size-full wp-image-3512\" srcset=\"https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2011\/08\/metal-gear-solid-hexdump.jpg 320w, https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2011\/08\/metal-gear-solid-hexdump-300x225.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><br \/>\n<\/center><\/p>\n<p>Funny, there are only 22 bytes on a line when there should be 32 according to the offsets. But, leave it to me to try to figure out what the file type is, regardless. I squinted and copied the first 22 bytes into a file:<\/p>\n<pre>\r\n 1F 8B 08 00   85 E2 17 38   00 03 EC 3A   0D 78 54 D5\r\n 38 00 03 EC   3A 0D \r\n<\/pre>\n<p>And the answer to the big question:<\/p>\n<pre>\r\n$ file mgsfile\r\nmgsfile: gzip compressed data, from Unix, last modified: Wed Oct 27 22:43:33 1999\r\n<\/pre>\n<p>A gzip&#8217;d file from 1999. I don&#8217;t know why I find this stuff so interesting, but I do. I guess it&#8217;s no more and less strange than writing playback systems like this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Metal Gear Solid: The Twin Snakes uses VP3; here&#8217;s something weird I found in one of the videos<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-3510","post","type-post","status-publish","format-standard","hentry","category-game-hacking"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3510","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=3510"}],"version-history":[{"count":8,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3510\/revisions"}],"predecessor-version":[{"id":3519,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3510\/revisions\/3519"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=3510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=3510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=3510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}