QuakeC
Encyclopedia
QuakeC is an interpreted language developed in 1996 by John Carmack of id Software
Id Software
Id Software is an American video game development company with its headquarters in Richardson, Texas. The company was founded in 1991 by four members of the computer company Softdisk: programmers John Carmack and John Romero, game designer Tom Hall, and artist Adrian Carmack...

 to program parts of the computer 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
Quake engine
The Quake engine is the game engine that was written to power 1996's Quake, written by id Software. It featured true 3D real-time rendering and is now licensed under the terms of the GNU General Public License ....

 was the only game engine to use QuakeC. Following engines used DLL game modules for customization written in C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 and C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

 from idtech 4 on.

Overview

The QuakeC source to the original id Software
Id Software
Id Software is an American video game development company with its headquarters in Richardson, Texas. The company was founded in 1991 by four members of the computer company Softdisk: programmers John Carmack and John Romero, game designer Tom Hall, and artist Adrian Carmack...

 Quake game logic was published in 1996 and used as the basis for modifications like capture the flag
Capture the flag
Capture the Flag is a traditional outdoor sport generally played by children, where two teams each have a flag and the objective is to capture the other team's flag, located at the team's "base," and bring it safely back to their own base...

 and others. QuakeC source code is compiled using a tool called qcc into a bytecode
Bytecode
Bytecode, also known as p-code , is a term which has been used to denote various forms of instruction sets designed for efficient execution by a software interpreter as well as being suitable for further compilation into machine code...

 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
Quake engine
The Quake engine is the game engine that was written to power 1996's Quake, written by id Software. It featured true 3D real-time rendering and is now licensed under the terms of the GNU General Public License ....

 to dominate the direction of the first-person shooter
First-person shooter
First-person shooter is a video game genre that centers the gameplay on gun and projectile weapon-based combat through first-person perspective; i.e., the player experiences the action through the eyes of a protagonist. Generally speaking, the first-person shooter shares common traits with other...

 genre. Thanks to Carmack's idea of extending computer game life by adding unlimited expandability (extensibility already played a big role in Doom), an enormous Internet
Internet
The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite to serve billions of users worldwide...

 community of gamers and programmers alike has arisen and many modern multiplayer games are extensible in some form.

Limitations

The syntax
Syntax
In linguistics, syntax is the study of the principles and rules for constructing phrases and sentences in natural languages....

 of QuakeC is based on that of the C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, 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 computer games at the time had their game logic written in plain C/C++ and compiled
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 into the executable, which is faster. However, this makes it harder for the community to create mods
Mod (computer gaming)
Mod or modification is a term generally applied to personal computer games , especially first-person shooters, role-playing games and real-time strategy games. Mods are made by the general public or a developer, and can be entirely new games in themselves, but mods are not standalone software and...

 and it makes the process of porting
Porting
In computer science, porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed...

 the game to another platform (such as GNU/Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

) more costly.

Despite its advantages, the concept of implementing the game logic in a separate scripting language and writing an interpreter
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

 for it was soon dropped (even by John Carmack who had implemented this concept) because of the overall inflexibility of an interpreted language, the increasingly complex game logic and the fact that the game logic could be packaged into a native Dynamic link library whose source code could be released to the mod community.

Modified compilers and language extensions

As is their custom to do with nearly everything they make, id Software
Id Software
Id Software is an American video game development company with its headquarters in Richardson, Texas. The company was founded in 1991 by four members of the computer company Softdisk: programmers John Carmack and John Romero, game designer Tom Hall, and artist Adrian Carmack...

 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
Id Software
Id Software is an American video game development company with its headquarters in Richardson, Texas. The company was founded in 1991 by four members of the computer company Softdisk: programmers John Carmack and John Romero, game designer Tom Hall, and artist Adrian Carmack...

 released the code from Quake's engine under the GPL
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

, 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 builtin 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.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK