{"id":117,"date":"2005-09-12T18:21:52","date_gmt":"2005-09-13T00:21:52","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=117"},"modified":"2007-12-20T19:43:49","modified_gmt":"2007-12-21T03:43:49","slug":"quake-3-source-code-available-and-roq-engine-too","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/quake-3-source-code-available-and-roq-engine-too\/","title":{"rendered":"Quake 3 Source Code Available (and RoQ engine too!)"},"content":{"rendered":"<p>Little by little, proprietary multimedia codecs become open source, one way or another. Sometimes, the originating companies release the code. Eric Lasota tipped me off that <a href=\"http:\/\/www.idsoftware.com\/\">id<\/a> recently saw fit to release the source code for <a href=\"http:\/\/www.mobygames.com\/game\/windows\/quake-iii-arena\">Quake III<\/a> under the GNU GPL, just as they have previously done for their Doom 1 &#038; 2 and Quake 1 &#038; 2 engines. You can download the source code file (quake3-1.32b-source.zip) from <a href=\"ftp:\/\/ftp.idsoftware.com\/idstuff\/source\/\">this FTP directory<\/a>. What makes this development particularly pertinent to multimedia hacking is that the file quake3-1.32b\/code\/client\/cl_cin.c contains the formal decode engine for the RoQ file format, which is the FMV format used in Quake III and games derived from the Q3 engine (such as <a href=\"http:\/\/www.mobygames.com\/game\/windows\/star-wars-jedi-knight-ii-jedi-outcast\">Jedi Knight II<\/a>, <a href=\"http:\/\/www.mobygames.com\/game\/windows\/return-to-castle-wolfenstein\">Return To Castle Wolfenstein<\/a>, and <a href=\"http:\/\/www.mobygames.com\/game\/windows\/american-mcgees-alice\">American McGee&#8217;s Alice<\/a>).<\/p>\n<p>So anything that may have been confusing should be clear upon looking at the official source code. <a href=\"http:\/\/www.csse.monash.edu.au\/~timf\/videocodec.html\">Dr. Tim Ferguson<\/a> originally <a href=\"http:\/\/www.csse.monash.edu.au\/~timf\/videocodec\/idroq.txt\">reverse engineered the format<\/a>. From the official source it appears that there were some other features perhaps planned and not implemented, or omitted from the final version. These features apparently include a JPEG encoding mode. In fact, there are 4 extra chunk types that go largely unused (ROQ_QUAD = 0x1000, ROQ_QUAD_JPEG = 0x1012, ROQ_QUAD_HANG = 0x1013, and ROQ_PACKET = 0x1030). The context in which the JPEG mode is defined implies that a frame could be encoded using a JPEG or JPEG-like method. I am not entirely sure what HANG means but it could indicate that the current frame is unchanged from the previous frame. <\/p>\n<p>Eric also points out that the code does, in fact, immediately decode the codebooks from YUV -> RGB16 and everything is processed in that colorspace. I have long suspected that this is a holdover from <a href=\"http:\/\/www.mobygames.com\/game\/dos\/11th-hour\">The 11th Hour<\/a> which is where the RoQ format got its start. The FMV needed to be played back on 1995-vintage PCs which were not very capable of playing YUV data directly, and converting full frames of YUV data -> RGB would not have been plausible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RoQ source code is available&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-open-source-multimedia"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/117","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=117"}],"version-history":[{"count":0,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}