QuakeC
   HOME

TheInfoList



OR:

QuakeC is a
compiled language Compiled language categorizes a programming language as used with a compiler and generally implies not used with an interpreter. But, since any language can theoretically be compiled or interpreted the term lacks clarity. In practice, for some lan ...
developed in 1996 by
John Carmack John D. Carmack II (born August 21, 1970) 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'', ''Do ...
of
id Software 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: game programmer, programmers John Carmack and John Romero, game designer T ...
to program parts of the
video game A video game or computer game is an electronic game that involves interaction with a user interface or input device (such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device) to generate visual fe ...
'' 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 A game engine is a software framework primarily designed for the development of video games which generally includes relevant libraries and support programs such as a level editor. The "engine" terminology is akin to the term " software engine" u ...
to use QuakeC. Following engines used DLL game modules for customization written in C, and C++ from
id Tech 4 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 D. Carmack, John Carmack, who also created previous game engines, such a ...
on.


Overview

The QuakeC source to the original
id Software 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: game programmer, programmers John Carmack and John Romero, game designer T ...
''Quake'' game logic was published in 1996 and used as the basis for modifications like capture the flag and others. QuakeC source code is compiled using a tool called qcc into a
bytecode Bytecode (also called portable code or p-code) 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 (normal ...
kept in a file called . The programmers of ''Quake'' modifications could then publish their bytecode without revealing their
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
. Most ''Quake'' mods were published this way. QuakeC allowed the ''Quake'' engine to dominate the direction of the
first-person shooter A first-person shooter (FPS) is a video game genre, video game centered on gun fighting and other weapon-based combat seen from a First person (video games), first-person perspective, with the player experiencing the action directly through t ...
genre. 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. QuakeC is known as interpreted because as ''Quake'' runs, it is continually interpreting the progs.dat file.


Limitations and subsequent solutions

The
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
of QuakeC is based on that of the
C programming language C (''pronounced'' '' – like the letter c'') is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of ...
, 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 In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally desig ...
the game to another platform (such as
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
) more costly. Despite its advantages, the choice of implementing game logic using a custom scripting language and
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
was dropped from the next generation
Quake II engine The ''Quake II'' engine (part of id Tech 2) 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 lic ...
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 A dynamic-link library (DLL) is a shared library in the Microsoft Windows or OS/2 operating system. A DLL can contain executable code (functions), data, and resources. A DLL file often has file extension .dll even though this is not require ...
, and the advantage of leveraging an already established programming language's community, tools, educational materials, and documentation. 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 An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some ...
. 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. LCC was extended to compile standard C into bytecode, which could be interpreted by a
virtual machine In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
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.


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 Reverse engineering (also known as backwards engineering or back engineering) is a process or method through which one attempts to understand through deductive reasoning how a previously made device, process, system, or piece of software accompl ...
, and were most likely published before the release of qcc.
id Software 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: game programmer, programmers John Carmack and John Romero, game designer T ...
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 The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was the first ...
(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 th
gmqcc
compiler.


Client-side QuakeC

Some enhanced ''Quake'' engines (notably DarkPlaces and FTEQW) 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 and any visually heavy effects that do not need to be simulated on the server and transferred over the network.


See also

* Quake modding *
Video game modding Video game modding (short for "modifying") is the process of alteration by players or fans of one or more aspects of a video game, such as how it looks or behaves, and is a sub-discipline of general ''modding''. A set of modifications, commonly c ...
*
Computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...


References


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



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
{{DEFAULTSORT:Quakec Domain-specific programming languages Video game development Quake (series) Scripting languages Id Tech Statically typed programming languages