Convert Figma logo to code with AI

id-Software logoQuake

Quake GPL Source Release

4,791
886
4,791
4

Top Related Projects

13,702

DOOM Open Source Release

Half-Life 1 engine based games

1,790

Vulkan Quake port based on QuakeSpasm

Quick Overview

The id-Software/Quake repository contains the source code for the iconic first-person shooter game Quake, originally released in 1996. This open-source release allows developers to study, modify, and build upon the game's engine and mechanics, fostering community-driven improvements and mods.

Pros

  • Historical significance: Access to the source code of a groundbreaking 3D game engine
  • Modding potential: Allows for extensive customization and creation of new content
  • Educational value: Provides insights into game development techniques from the mid-1990s
  • Cross-platform support: Can be compiled and run on various modern operating systems

Cons

  • Outdated codebase: Written in C, using techniques that may be considered obsolete by modern standards
  • Limited documentation: Requires significant effort to understand and navigate the codebase
  • Potential licensing issues: Some parts of the original game assets are not included due to copyright restrictions
  • Performance considerations: May require optimization for modern hardware and display resolutions

Getting Started

To get started with the Quake source code:

  1. Clone the repository:

    git clone https://github.com/id-Software/Quake.git
    
  2. Install necessary dependencies (varies by platform)

  3. Build the engine using the provided makefiles or project files

  4. Acquire the game data files (not included in the repository due to licensing)

  5. Run the compiled executable with the appropriate command-line arguments

Note: Detailed build instructions vary depending on your operating system and development environment. Refer to community-maintained guides for specific platforms.

Competitor Comparisons

13,702

DOOM Open Source Release

Pros of DOOM

  • Simpler codebase, easier to understand for beginners
  • More iconic and recognizable game, potentially attracting more contributors
  • Faster rendering engine, suitable for lower-end hardware

Cons of DOOM

  • Limited 3D capabilities compared to Quake's full 3D engine
  • Less advanced networking code for multiplayer functionality
  • Older technology, may require more work to modernize

Code Comparison

DOOM (main game loop):

void D_DoomLoop (void)
{
    while (1)
    {
        // Frame syncronous IO operations
        I_StartFrame ();

        // Process one or more tics
        TryRunTics ();

        // Move positional sounds
        S_UpdateSounds (players[consoleplayer].mo);

        // Update display, next frame
        D_Display ();
    }
}

Quake (main game loop):

void Host_Frame (float time)
{
    if (setjmp (host_abortserver) )
        return;            // something bad happened, or the server disconnected

    // keep the random time dependent
    rand ();

    // decide the simulation time
    if (!Host_FilterTime (time))
        return;            // don't run too fast, or packets will flood out

    // get new key events
    Sys_SendKeyEvents ();

    // allow mice or other external controllers to add commands
    IN_Commands ();

    // process console commands
    Cbuf_Execute ();

    // if running the server locally, make intentions now
    if (sv.active)
        CL_SendCmd ();

    //-------------------
    //
    // server operations
    //
    //-------------------

    // check for commands typed to the host
    Host_GetConsoleCommands ();

    if (sv.active)
        Host_ServerFrame ();

    //-------------------
    //
    // client operations
    //
    //-------------------

    // if running the server remotely, send intentions now after
    // the incoming messages have been read
    if (!sv.active)
        CL_SendCmd ();

    host_time += host_frametime;

    // fetch results from server
    if (cls.state == ca_connected)
    {
        CL_ReadFromServer ();
    }

    // update video
    if (host_speeds.value)
        time1 = Sys_FloatTime ();

    SCR_UpdateScreen ();

    if (host_speeds.value)
        time2 = Sys_FloatTime ();

    // update audio
    if (cls.signon == SIGNONS)
    {
        S_Update (r_origin, vpn, vright, vup);
        CL_DecayLights ();
    }
    else
        S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);

    CDAudio_Update();

    if (host_speeds.value)
    {
        pass1 = (time1 - time3)*1000;
        time3 = Sys_FloatTime ();
        pass2 = (time2 - time1)*1000;
        pass3 = (time3 - time2)*1000;
        Con_Printf ("%3i tot %3i server %3i gfx %3i snd\n",
                    pass1+pass2+pass3, pass1, pass2, pass3);
    }

    host_framecount++;
}

The DOOM main loop is simpler and more straightforward, while Quake's loop is more complex, handling additional features like network play and 3D graphics.

Half-Life 1 engine based games

Pros of Half-Life

  • More extensive codebase with a wider range of features and gameplay elements
  • Better organized project structure, making it easier to navigate and understand
  • More recent updates and active community contributions

Cons of Half-Life

  • Larger codebase may be more challenging to understand and modify for beginners
  • Less focus on core engine functionality, as it builds upon the Quake engine
  • More complex build process and dependencies

Code Comparison

Half-Life (player movement):

void CBasePlayer::PlayerRun( void )
{
    if ( ( m_nButtons & IN_FORWARD ) && !( m_nButtons & IN_BACK ) )
    {
        pev->velocity = pev->velocity + gpGlobals->v_forward * sv_accelerate.value;
    }
}

Quake (player movement):

void SV_WalkMove (edict_t *ent)
{
    if (ent->v.movetype == MOVETYPE_NOCLIP)
    {
        SV_FlyMove (ent, frametime, NULL);
        return;
    }
}

The Half-Life code shows more detailed player movement handling, while Quake's implementation is more straightforward. Half-Life's approach allows for finer control and more complex movement mechanics.

1,790

Vulkan Quake port based on QuakeSpasm

Pros of vkQuake

  • Utilizes Vulkan API for improved performance and modern graphics capabilities
  • Supports higher resolutions and widescreen displays
  • Includes enhanced lighting and particle effects

Cons of vkQuake

  • May have compatibility issues with older hardware
  • Potentially more complex codebase due to Vulkan implementation
  • Smaller community and less frequent updates compared to the original Quake

Code Comparison

Quake (OpenGL rendering):

void GL_BeginRendering (int *x, int *y, int *width, int *height)
{
    extern cvar_t gl_clear;

    *x = *y = 0;
    *width = glwidth;
    *height = glheight;

    GL_SetCanvas (CANVAS_DEFAULT);

    glViewport (glx, gly, glwidth, glheight);
}

vkQuake (Vulkan rendering):

void R_BeginFrame (void)
{
    VID_BeginFrame ();

    r_framecount++;

    // clear the z-buffer and stencil-buffer
    VkClearAttachment clear_attachments[2];
    clear_attachments[0].aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
    clear_attachments[0].clearValue.depthStencil.depth = 1.0f;
    clear_attachments[0].clearValue.depthStencil.stencil = 0;
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

This is the complete source code for winquake, glquake, quakeworld, and glquakeworld.

The projects have been tested with visual C++ 6.0, but masm is also required to build the assembly language files. It is possible to change a #define and build with only C code, but the software rendering versions lose almost half its speed. The OpenGL versions will not be effected very much. The gas2masm tool was created to allow us to use the same source for the dos, linux, and windows versions, but I don't really recommend anyone mess with the asm code.

The original dos version of Quake should also be buildable from these sources, but we didn't bother trying.

The code is all licensed under the terms of the GPL (gnu public license).
You should read the entire license, but the gist of it is that you can do anything you want with the code, including sell your new version. The catch is that if you distribute new binary versions, you are required to make the entire source code available for free to everyone.

Our previous code releases have been under licenses that preclude commercial exploitation, but have no clause forcing sharing of source code.
There have been some unfortunate losses to the community as a result of mod teams keeping their sources closed (and sometimes losing them). If you are going to publicly release modified versions of this code, you must also make source code available. I would encourage teams to even go a step farther and investigate using public CVS servers for development where possible.

The primary intent of this release is for entertainment and educational purposes, but the GPL does allow commercial exploitation if you obey the full license. If you want to do something commercial and you just can't bear to have your source changes released, we could still negotiate a separate license agreement (for $$$), but I would encourage you to just live with the GPL.

All of the Quake data files remain copyrighted and licensed under the original terms, so you cannot redistribute data from the original game, but if you do a true total conversion, you can create a standalone game based on this code.

I will see about having the license changed on the shareware episode of quake to allow it to be duplicated more freely (for linux distributions, for example), but I can't give a timeframe for it. You can still download one of the original quake demos and use that data with the code, but there are restrictions on the redistribution of the demo data.

If you never actually bought a complete version of Quake, you might want to rummage around in a local software bargain bin for one of the originals, or perhaps find a copy of the "Quake: the offering" boxed set with both mission packs.

Thanks to Dave "Zoid" Kirsh and Robert Duffy for doing the grunt work of building this release.

John Carmack Id Software