Project COSM, my IOQ3 fork

I am currently in the process of transitioning ioq3 to C++, utilizing the C++20 standard. The project’s build system is based on CMake, and uses Clang via MSYS2 and VSCode as the project workspace. To maintain a clean folder structure, I have removed other build systems. Additionally, I have removed the GL1 renderer and am now focusing on the GL2 renderer. However, I may modify it in the future to detect users’ GL capabilities and toggle rendering features accordingly.

The glsl_stringift vbs script has been replaced with a Python script that performs the task and conducts basic checks to avoid updating unchanged shaders. While there are challenges to overcome, I have successfully built the cgame, game, and ui for the base game, without mission pack support.

To clean up the code and make use of classes and an IOQ3 namespace, I plan to restructure the code. To reduce the code base and make it cross-platform, I will update the code to support other platforms and architectures. Currently, support is only available for Windows, but I will add support for Linux and Mac if I can access another system.

After seeing the Quake 1 re-release’s use of ImGui for menus, I am considering using ImGui for a new menu system that could also be utilized for pop-up dialogs and the built-in editor. I have a pre-existing config system for creating custom huds from a previous C++ project that can be adapted for this project, which is highly configurable and user-friendly.

Initially, I wanted to remove the VM, but I have decided to keep it and modify it to use Clang instead of LCC for Multiplayer security reasons, rather than using dynamic libraries. The libraries have been replaced with those available on MSYS2, with only the ones not available on MSYS2 being added to the internals. I plan to replace what I can in the code with nothing’s stb, as it is smaller and reduces the number of libraries used. However, I am still weighing this decision, as stb lacks some features.

I am working on many additional ideas and features, which I will detail once I have a stable build available. Once I have a stable build, I will make a repository available on Github.

1 Like

Just an update on the current progress.

I have developed a CMake project version of ioq3 to align with the C code base. The code has been modified to address errors and warnings that occurred during Clang-based builds. Additionally, all source files have been formatted using clang-formatting, and I am currently integrating Doxygen into the source. The Doxygen project will be going up to a website I’m working on.

To comply with GPL2 licensing, I have relocated the license header to a separate file which is included in all relevant source files.

Although there are some minor issues with the build process that require my attention, I will resolve these before uploading my branch to Github.

My C branch will deviate significantly from ioq3, particularly in its menu system overhaul, which will introduce a customizable menu system capable of operating on the base game, missionpack, and possibly standalone games.

The Project COSM C++ branch is still in early stages of development, which I am constructing from scratch to better align with C++ paradigms.

If you mean adding the_license.h with the GPL file license header and #include "the_license.h" … that’s probably less clear than a single line comment to see the LICENSE file at the project root or an SPDX id (see later in post). The per-file GPL license header it isn’t needed for compliance. It’s recommended by the license authors but not required by the GPL license.

Files list copyright holders separate from just the license and they should not be removed. (Technically ioquake3 should probably list a lot more copyright holders on a per-file basis as it’s the only required way to be attributed for ones work on GPL software…)

I think it would okay to do something like this on a per-file basis using the existing Copyright lines from the file:

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (C) Year Entity
// Copyright (C) Year Entity

As you move code around and it’s hard to track copyright … I honestly don’t know what to do in that situation. (At least it’s rarely a problem because most files only list id Software as a copyright holder…)

(I have not reviewed the GPL FAQs recently to see what exactly it says on attribution and moving copyright notices.)

If you replace QVM with a different bytecode format when replacing LCC with Clang, I would suggest using WebAssembly (which Clang can output) over Clang’s native bitstream format which can break compatibility between versions.

That suggestion is indeed valuable, as it is desirable for the project to have web compatibility in the future. However, my expertise in assembly and web assembly is currently limited. I am presently striving to comprehend how the virtual machine operates. The Address Sanitizer has revealed various issues, many of which are associated with the virtual machine, during the debugging process.

this is the current format I have for the license header, according to my lawyer friend this should be valid.

// Copyright (C) 1999-2005 Id Software, Inc. Quake III Arena GPL2 and other License Information

#include "Licensing.h"

/** ====================================================================================================

* @file tr_image_png.c

* @brief PNG Handling

=======================================================================================================*/

WebAssembly is a general bytecode format similar in concept to QVM but with modern tooling/languages available. It’s not really web-specific or assembly language; native web browser support might be plus but not my reason for suggest it over Clang bitstream. I’m not very familiar with the QVM JIT compilers that convert the bytecode to assembly to be honest. I imagine it’s easier to add an existing WebAssembly JIT compiler to a Quake 3 engine than it is to add QVM output to Clang. If you want to use QVM, it’s fine.

If the file notice keeps the copyright attribution(s) for the file, it would be valid yes because the GPL doesn’t require anything else in the individual files. I haven’t seen other projects do it like this specifically but I’m not a lawyer. My suggestion is based on how the Linux kernel handles per-file license and copyright.

tr_image_png.c is copyrighted by Joerg Dietrich, not id Software, contrary to the text you have. ioquake3 is not only copyrighted by id Software. This is why I suggest keeping the original copyright lines in each file.

1 Like

I plan to investigate the use of WebAssembly as an alternative, although I am uncertain if it would impact compatibility with qvm files. It would be preferable to leverage modern tools that are supported by a larger community.

To ensure compliance, I intend to reach out to Id Software’s legal department (Zenimax I guess) regarding the header change.

Thank you for bringing the licensing matter of Joerg Dietrich to my attention. I will rectify the information and modify the relevant source files to acknowledge community contributions.

The licensing header will also serve as a centralized location to track names and contributions, making it easier to manage.

LLVM profiling has been incorporated into the build process, but I am unable to test it at present because the debug build is encountering heap errors and throwing exceptions. In the future, I intend to read the profile log and create a web interface to visualize the data. As I am unfamiliar with LLVM profiling, I may utilize its output in the engine to draw statistics with imgui, depending on how it works.

I have submitted an inquiry to the Free Software Foundation regarding the GPL2 License header alteration and am currently awaiting their response.

Furthermore, I have successfully integrated the DLLs and QVMs into the x64 build and have implemented enhancements to the VM code.

It appears that the exceptions are being detected by the stringent debugging flags. The problem seems to lie in the section of the code responsible for configuring the Gamma Ramp. I am diligently pursuing further investigation into this matter.

The FSF has responded to me about the GPL2 License.

This is part of the response:

I also recommend against removing the copyright notice from any of the
files. Moreover, section 2(a) of GPLv2 requires that when you modify a
work: “… You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.”
Therefore, you will need to add your copyright notice to each of the
files you modify.

I will be keeping the original headers until I can get proper legal advice from someone who specializes in this field.

The format I had for the Doxygen based header is in the following format:

/** ====================================================================================================
* \file  tr_postprocess.c
* \brief Postprocessing
* \authors Id Software
*          Andrei Drexler
*          Richard Allen
*          James Canete
* \copyright Copyright (C) 1999-2005 Id Software, Inc.
*            Copyright (C) 2011 Andrei Drexler, Richard Allen, James Canete
* \note This file falls under the GNU GPL2 License and has been moved on \date 29/03/23
*       to review the license please look at \headerfile Licensing.h "Licensing.h."
=======================================================================================================*/

This provides the notices as well as the date changed and navigation for the license.
So unfortunate for an existential nihilist to deal with this.