QuakeC

Last updated
QuakeC
Paradigm imperative (procedural), structured
Designed by John Carmack
Developer id Software
First appeared1996
Typing discipline static, strong
Major implementations
Quake C Compiler, FastQCC, FTEQCC, QCCx, GMQCC
Influenced by
C

QuakeC is a compiled language developed in 1996 by John Carmack of id Software to program parts of the video game Quake . Using QuakeC, a programmer is able to customize Quake to great extents by adding weapons, changing game logic and physics, and programming complex scenarios. It can be used to control many aspects of the game itself, such as parts of the AI, triggers, or changes in the level. The Quake engine was the only game engine to use QuakeC. Following engines used DLL game modules for customization written in C, and C++ from id Tech 4 on.

Contents

Overview

The QuakeC source to the original id Software Quake game logic was published in 1996 and used as the basis for modifications like capture the flag and others. [1] QuakeC source code is compiled using a tool called qcc into a bytecode kept in a file called progs.dat. The programmers of Quake modifications could then publish their progs.dat bytecode without revealing their source code. Most Quake mods were published this way.

QuakeC allowed the Quake engine to dominate the direction of the first-person shooter genre.[ citation needed ] Thanks to Carmack's idea of extending video game life by adding unlimited expandability (extensibility already played a big role in Doom ), an enormous Internet community of gamers and programmers alike has arisen and many modern multiplayer games are extensible in some form.[ citation needed ]

QuakeC is known as interpreted because as Quake runs, it is continually interpreting the progs.dat file. [2]

Limitations and subsequent solutions

The syntax of QuakeC is based on that of the C programming language, explaining its name, but it does not support the implementation of new types, structures, arrays, or any kind of referencing other than the "entity" type (which is always a reference). QuakeC also suffers from the fact that many built-in functions (functions prototyped in the QuakeC code but actually defined within the game engine and written in C) return strings in a temporary string buffer, which can only hold one string at any given time. In other words, a construct such as

SomeFunction (ftos (num1), ftos (num2));

will fail because the second call to ftos (which converts a floating-point value to a string) overwrites the string returned by the first call before SomeFunction can do something with it. QuakeC does not contain any string handling functions or file handling functions, which were simply not needed by the original game.

Most video games at the time had their game logic written in plain C/C++ and compiled into the executable, which is faster. However, this makes it harder for the community to create mods and it makes the process of porting the game to another platform (such as Linux) more costly.

Despite its advantages, the choice of implementing game logic using a custom scripting language and interpreter was dropped from the next generation Quake II engine in favor of compiled C code due to the overall inflexibility of QuakeC, the increasingly complex game logic, the performance to be gained by packaging game logic into a native dynamic link library, and the advantage of leveraging an already established programming language's community, tools, educational materials, and documentation. [3]

Distributing native code created new security and portability concerns. QuakeC bytecode afforded little opportunity for mischief, while native code has access to the whole machine. QuakeC bytecode also worked on any machine that could run Quake. Compiling to native code added an additional barrier to entry for novice mod developers, because they were being asked to set up a more complicated programming environment. The eventual solution, implemented by the Quake III engine, was to combine the advantages of original QuakeC with the advantages of compiling C to native code. The lcc C compiler was extended to compile standard C into bytecode, which could be interpreted by a virtual machine in a manner similar to QuakeC. This addressed the security, portability, and tool chain problems, but lost the performance advantage of native code. That was solved by further compiling the bytecode into native code at run time on supported machines. [4]

Modified compilers and language extensions

A decompiler and a recompiler were released by Armin Rigo (called DEACC and REACC respectively). These programs were made through the process of reverse engineering, and were most likely published before the release of qcc. [5]

id Software released the source of qcc, their QuakeC compiler, along with the original QuakeC code in 1996. Modified versions soon sprung up, including Jonathan Roy's fastqcc and Ryan "FrikaC" Smith's FrikQCC. These added functionality, optimizations, and compiling speed boosts.

In 1999, when id Software released the code from Quake's engine under the GNU General Public License (GPL), the workings of the bytecode interpreter were examined and new QuakeC compilers were released, such as J.P. Grossman's qccx and a new version of FrikQCC. These compilers took advantage of newly discovered features in a backwards-compatible way so that the bytecode could still be properly interpreted by unmodified Quake engines. New features include arrays, pointers, integers, for loops and string manipulation.

With the Quake engine source code now able to be changed, further features were added to QuakeC in the form of new built-in functions. Features long yearned for by QuakeC coders finally reached realization as QuakeC now had file and string handling functions, enlarged string buffers, more math functions, and so on. However, programmers taking advantage of these changes lost backwards compatibility with the unmodified Quake engine.

Xonotic since version 0.7 uses the gmqcc compiler. [6]

Client-side QuakeC

Some enhanced Quake engines (notably DarkPlaces and FTEQW)[ clarification needed ] have support for an extension of regular QuakeC (now commonly referred to as server-side QuakeC) that allows client-side-only scripting of the Quake engine, also abbreviated as CSQC (client-side QuakeC). This is especially useful for GUIs, HUDs[ clarification needed ] and any visually heavy effects that do not need to be simulated on the server and transferred over the network. [7]

See also

Related Research Articles

id Software American video game developer

id Software LLC is an American video game developer based in Richardson, Texas. It was founded on February 1, 1991, by four members of the computer company Softdisk: programmers John Carmack and John Romero, game designer Tom Hall, and artist Adrian Carmack.

<i>Quake III Arena</i> 1999 video game

Quake III Arena is a 1999 multiplayer-focused first-person shooter developed by id Software. The third installment of the Quake series, Arena differs from previous games by excluding a story-based single-player mode and focusing primarily on multiplayer gameplay. The single-player mode is played against computer-controlled bots. It features music composed by Sonic Mayhem and Front Line Assembly founder Bill Leeb.

<span class="mw-page-title-main">John Carmack</span> American computer programmer and video game developer (born 1970)

John D. Carmack II is an American computer programmer and video game developer. He co-founded the video game company id Software and was the lead programmer of its 1990s games Commander Keen, Wolfenstein 3D, Doom, Quake, and their sequels. Carmack made innovations in 3D computer graphics, such as his Carmack's Reverse algorithm for shadow volumes.

OCaml is a general-purpose, high-level, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez, and others.

<span class="mw-page-title-main">Interpreter (computing)</span> Program that executes source code without a separate compilation step

In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An interpreter generally uses one of the following strategies for program execution:

  1. Parse the source code and perform its behavior directly;
  2. Translate source code into some efficient intermediate representation or object code and immediately execute that;
  3. Explicitly execute stored precompiled bytecode made by a compiler and matched with the interpreter's virtual machine.

Bytecode is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.

In computer science, a high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language elements, be easier to use, or may automate significant areas of computing systems, making the process of developing a program simpler and more understandable than when using a lower-level language. The amount of abstraction provided defines how "high-level" a programming language is.

LCC is a small, retargetable compiler for the ANSI C programming language. Although its source code is available at no charge for personal use, it is not open-source or free software according to the usual definitions because products derived from LCC may not be sold, although components not derived from LCC may be sold. It was developed by Chris Fraser and David Hanson.

Doom WAD is the default format of package files for the video game Doom and its sequel Doom II: Hell on Earth, that contain sprites, levels, and game data. WAD stands for Where's All the Data?. Immediately after its release in 1993, Doom attracted a sizeable following of players who created their own mods for WAD files—packages containing new levels or graphics—and played a vital part in spawning the mod-making culture which is now commonplace for first-person shooter games. Thousands of WADs have been created for Doom, ranging from single custom levels to full original games; most of these can be freely downloaded over the Internet. Several WADs have also been released commercially, and for some people the WAD-making hobby became a gateway to a professional career as a level designer.

<i>Quake</i> engine Video game engine developed by id Software

The Quake engine, is the game engine developed by id Software to power their 1996 video game Quake. It featured true 3D real-time rendering. Since 1999, it has been licensed under the terms of GNU General Public License v2.0 or later.

<i>Quake II</i> engine Video game engine

The Quake II engine, is a game engine developed by id Software for use in their 1997 first-person shooter Quake II. It is the successor to the Quake engine. Since its release, the Quake II engine has been licensed for use in several other games.

id Tech 4 Video game engine

id Tech 4, popularly known as the Doom 3 engine, is a game engine developed by id Software and first used in the video game Doom 3. The engine was designed by John Carmack, who also created previous game engines, such as those for Doom and Quake, which are widely recognized as significant advances in the field. This OpenGL-based game engine has also been used in Quake 4, Prey, Enemy Territory: Quake Wars, Wolfenstein, and Brink. id Tech 4 is licensed under the terms of the GNU General Public License v3.0 or later, and was the last id Tech engine to be open-sourced.

Haxe is a high-level cross-platform programming language and compiler that can produce applications and source code for many different computing platforms from one code-base. It is free and open-source software, released under an MIT License. The compiler, written in OCaml, is released under the GNU General Public License (GPL) version 2.

The Java programming language and Java software platform have been criticized for design choices including the implementation of generics, forced object-oriented programming, the handling of unsigned numbers, the implementation of floating-point arithmetic, and a history of security vulnerabilities in the primary Java VM implementation, HotSpot. Software written in Java, especially its early versions, has been criticized for its performance compared to software written in other programming languages. Developers have also remarked that differences in various Java implementations must be taken into account when writing complex Java programs that must work with all of them.

In computer science, ahead-of-time compilation is the act of compiling an (often) higher-level programming language into an (often) lower-level language before execution of a program, usually at build-time, to reduce the amount of work needed to be performed at run time.

id Tech 5 Video game engine

id Tech 5 is a proprietary game engine developed by id Software. It followed its predecessors, id Tech 1, 2, 3 and 4, all of which had subsequently been published under the GNU General Public License. It was seen as a major advancement over id Tech 4. The engine was first demonstrated at the WWDC 2007 by John D. Carmack on an eight-core computer; however, the demo used only a single core with single-threaded OpenGL implementation running on a 512 MB 7000 class Quadro video card. id Tech 5 was first used in the video game Rage, followed by Wolfenstein: The New Order, The Evil Within and Wolfenstein: The Old Blood. It was followed up by id Tech 6.

id Tech Series of video game engines

id Tech is a series of separate game engines designed and developed by id Software. Prior to the presentation of the id Tech 5-based game Rage in 2011, the engines lacked official designation and as such were simply referred to as the Doom and Quake engines, from the name of the main game series the engines had been developed for. "id Tech" has been released as free software under the GNU General Public License. id Tech versions 0 to 3 were released under GPL-2.0-or-later. id Tech versions 3.5 to 4.5 were released under GPL-3.0-or-later. id Tech 5 to 7 are proprietary, with id Tech 7 currently being the latest utilized engine.

Google Native Client (NaCl) is a discontinued sandboxing technology for running either a subset of Intel x86, ARM, or MIPS native code, or a portable executable, in a sandbox. It allows safely running native code from a web browser, independent of the user operating system, allowing web apps to run at near-native speeds, which aligns with Google's plans for ChromeOS. It may also be used for securing browser plugins, and parts of other applications or full applications such as ZeroVM.

<i>Xonotic</i> 2011 video game

Xonotic is a free and open-source first-person shooter video game. It was developed as a fork of Nexuiz, following controversy surrounding the game's development. The game runs on a heavily modified version of the Quake engine known as the DarkPlaces engine. Its gameplay is similar to Quake Arena series games, but with various unique elements.

Based on id Software's open stance towards game modifications, their Quake series became a popular subject for player mods beginning with Quake in 1996. Spurred by user-created hacked content on their previous games and the company's desire to encourage the hacker ethic, Id included dedicated modification tools into Quake, including the QuakeC programming language and a level editor. As a game that popularized online first-person shooter multiplayer, early games were team- and strategy-based and led to prominent mods like Team Fortress, whose developers were later hired by Valve to create a dedicated version for the company. Id's openness and modding tools led to a "Quake movie" community, which altered gameplay data to add camera angles in post-production, a practice that became known as machinima.

References

  1. Lasse Lehtinen (1996-07-25). "QuakeC released". Quake and QuakeWorld history. Retrieved 2011-01-14.
  2. Andrew Wu. "Quake C Basics" . Retrieved 2013-04-06.
  3. Carmack, John (13 March 1997). "Here is a technical issue to be discussed, Pg.18" (PDF). .plan . id Software . Retrieved 5 November 2018.
  4. Carmack, John (24 July 1999). "Jul 24, 1999, Pg.54" (PDF). .plan . id Software . Retrieved 5 November 2018.
  5. "Interview with Armin Rigo - Feb. 12th 1997". April 30, 1997. Archived from the original on 1997-04-30.
  6. "Xonotic 0.7 Release".
  7. "Client-Side QuakeC". QuakeWiki. 30 September 2012. Retrieved 2016-11-16.