QuakeC
strong | |
---|---|
Major implementations | |
Quake C Compiler, FastQCC, FTEQCC, QCCx, GMQCC | |
Influenced by | |
C |
QuakeC is a
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
) more costly.Despite its advantages, the choice of implementing game logic using a custom scripting language and
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
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
See also
References
- ^ Lasse Lehtinen (1996-07-25). "QuakeC released". Quake and QuakeWorld history. Retrieved 2011-01-14.
- ^ Andrew Wu. "Quake C Basics". Retrieved 2013-04-06.
- .plan. id Software. Retrieved 5 November 2018.
- .plan. id Software. Retrieved 5 November 2018.
- ^ "Interview with Armin Rigo - Feb. 12th 1997". April 30, 1997. Archived from the original on 1997-04-30.
- ^ "Xonotic 0.7 Release".
- ^ "Client-Side QuakeC". QuakeWiki. Retrieved 2016-11-16.
External links
- id's github repository containing the C source code of qcc (QuakeC compiler)
- id's github repository containing the QuakeC source code to QuakeWorld game logic
- Unofficial QuakeC specifications
- Large collection of QC mods, including their source
- Inside3d - nice collection of QC tutorials here
- InsideQC - New website to inherit Inside3D's legacy after it was shut down