I was particularly impressed by :
The first striking thing is that the Visual Studio workspace is not made of one project but eight. Not all of them are used depending if the build is DEBUG or RELEASE (especially game,cgame and q3_ui : the virtual machines projects). Some of the projects are never used (splines and ui).
A table is better to summarize what project is contributing to which module:
Projects Type DEBUG Builds RELEASE Builds Comments botlib Static Library botlib.lib botlib.lib A.I cgame Dynamic Libary/Bytecode cgamex86.dll - game Dynamic Libary/Bytecode qagamex86.dll - q3_ui Dynamic Libary/Bytecode uix86.dll - quake3 Executable quake3.exe quake3.exe renderer Static Library renderer.lib renderer.lib OpenGL based Splines Static Library Splines.lib Splines.lib Used NOWHERE ! ui Dynamic Libary/Bytecode uix86_new.dll - Used for Quake III Arena.
Trivia : idTech3 working title was "Trinity". Since idTech4 was called "Neo" I assumed it was from the "Matrix" franchise...but id Software stated in interview with firingsquad.com thatit was named after "Trinity River in Dallas":
John : I've got a couple of engine things that I'm working on, as far as research. FS : So is one of those things Trinity? I think there's been a little confusion about "Trinity." John : I was never really certain how this got as confusing as it did to everybody. After Quake, when I was starting on new rendering technologies and everything, everybody was just calling it "the next engine" or whatever. Michael Abrash suggested we just take Intel's tack of naming your next project after a river near you. We have the Trinity River in Dallas, and so it was just like "Trinity Engine," the next step.
Edit ( July 07, 2012 ) : Jeremiah Sypult contacted me after publication of this article: He "unrotted" the Mac OS X build with an XCode 4.0 project for Quake3. I have fixed it further and you can get it on here on github. You will need the Quake III Arena baseq3 (not the demo version) and be sure to use the parameters "+set vm_game 0 +set vm_cgame 0 +set vm_ui 0" in order to use the dylib virtual machines. Open /code/quake3.xcworkspace and it builds in one click !!
On a pie chart we can vividly see how unusual the proportion are since 30% of the codebase is dedicated to tools:
This is explained partly because idtech3 features a ANSI C compiler: The open source Little C Compiler (LCC) is used to generate bytecode for the virtual machines.
Buildings collapse, and the street splits wide open as Jacob runs for safety from a devastating earthquake. With just his dog, he embarks on a perilous search for shelter, food and water, and missing loved ones while grappling with his Jewish traditions and fighting prejudices against a new Chinese friend.
Robert Papp has produced hundreds of award-winning illustrations for books from many different publishers, from romance novels to young adult books. He lives in Pennsylvania, with his wife, Lisa, who is also an artist.
I beat a 1mil bounty quake user in pvp with ice fruit and having only 300,000 bounty at the moment, quake sucks in my opinion, plus magma has the best damage in the whole entire game, it is good for pvp and grinding if you have the skills to do it, just relying on a fruit that does not need skills is bad, one of the reasons I have light users, cuz their fruit is too overpowered and most of them are toxic, using a braindead fruit just because it is good for some situations just because of the fruit is bad
My friend once fought a max lvl before and he was in second sea and won with awk magma so I think magma is better also the damage and range is better so if u want a pvp and grinding fruit magma is the fruit
The Rust-loving team at Immunant has been hard at work on C2Rust, a migration framework that takes the drudgery out of migrating to Rust. Our goal is to make safety improvements to the translated Rust automatically where we can, and help the programmer do the same where we cannot. First, however, we have to build a rock-solid translator that gets people up and running in Rust. Testing on small CLI programs gets old eventually, so we decided to try translating Quake 3 into Rust. After a couple of days, we were likely the first people to ever play Quake3 in Rust!
Of these libraries, the UI, client, and server libraries can be built as either Quake VM assembly or native X86 shared libraries. We opted to use the native versions of these libraries for our project. Translating just the VM into Rust and using the QVM versions would have been significantly simpler but we wanted to thoroughly test out C2Rust.
To preserve the directory structure used by Quake 3 and not need to change its source code, we needed to produce exactly the same binaries as the native build, meaning four shared libraries and one executable.Since C2Rust produces Cargo build files, each binary needs its own Rust crate with a corresponding Cargo.toml file.For C2Rust to produce one crate per output binary, it would need a list of the binaries along with their corresponding object or source files, and linker invocation used to produce each binary (used to determine other details like library dependencies).
Instead, we wrote our own compiler and linker wrapper scripts that dump out all compiler and linker invocations to a database, and then convert that into an extended compile_commands.json. Instead of the normal build using a command like:
As a quality of life improvement, all of the binaries can be built all at once by having them within a workspace.C2Rust produces a top-level workspace Cargo.toml file, so we can build the project with a single cargo build command in the quake3-rs directory:
The C standard (see e.g. C11, Section 6.5.6) allows pointers to an element one past the end of the array. However, Rust forbids this, even if we are only taking the address of the element. We found examples of this pattern in the AAS_TraceClientBBox function.
The Rust compiler also flagged a similar but actually buggy example in G_TryPushingEntity where the conditional is >, not >=. The out of bounds pointer was then dereferenced after the conditional, which is an actual memory safety bug.
Since rustc passes Rust inline assembly to LLVM with very few changes, we decided to fix this particular case in C2Rust.We implemented a new c2rust-asm-casts crate that fixes the issue above via the Rust type system using a trait and some helper functions that automatically extend and truncate the values of tied operands to an internal size that is large enough to hold both operands. The code above correctly transpiles to the following:
Rust currently supports the alignment attribute on structure types, but not on global variables, i.e., static items.We are looking into ways to solve this in the general case in either Rust or C2Rust, but have decided to fix this issue manually for ioquake3 with a short patch file for now.This patch file replaces the Rust equivalent of ssemask with:
Running cargo build --release emits the binaries, but they are all emitted under target/release using a directory structure that the ioquake3 binary does not recognize. We wrote a script that creates symbolic links in the current directory to replicate the correct directory structure (including links to the .pk3 files containing the game assets):
As an alternative to installing c2rust with the command above, you may build C2Rust manually using cargo build --release. In either case, the C2Rust repository is still required as it contains the compiler wrapper scripts that are required to transpile ioquake3.
Installed Direct3D SDK and Microsoft SDK (for MFC) and the thing compiled fine.
Software erosion: It seems that what happened to Quake codebase has started to happen with Quake 2: You cannot open the workspace with Visual Studio 2010. You will need to use VS 2008 :(.
Note : If after compiling you run into the error: "Couldn't fall back to software refresh!" it means the renderer DLL failed to load properly, this is easy to fix:
Quake2 kernel loads its two dlls using win32 API: LoadLibrary. If the DLL is not exactly what it was expecting or if the DLL dependencies cannot be resolved it will fail silently instead of displaying the error message. So:
Since I was running Windows on a Mac with Parallels it was uneasy to hit "printscreen" while the game was running. I hardcoded the '*' from the keypad to produce the same:
// keys.c if (key == '*') if (down) //Avoid auto-repeat !! Cmd_ExecuteString("screenshot");
Finally I added a lot of comments and diagrams. Here is "my" full source code:
Notes : If you start working on this source you need to compile the sub-project libpng first otherwise you will get an error message at runtime: "Couldn't fall back to software refresh!". This is very easy to fix here is the solution i posted on reddit:
I ran into this issue a month ago and you are right it is a DLL loading error and it is very easy to fix. You see quake2 kernel loads some dlls using win32 API: LoadLibrary: If the DLL is not exactly what it was expecting or if the DLL dependencies cannot be resolved it will fail silently instead of displaying the error message. So: - Make sure you are linking all 5 projects with the same runtime library by right clicking on each project -> properties -> C/C++: Check that "runtime library" = Multi-threaded Debug DLL (with configuration "Debug", otherwise use release). If you are using the quake2 release from id software it should fix the issue. If you are using my version: I added the engine capability to output PNG screenshots, so you also need to build libpng and libz (it is in a subdirectory). Make sure your select the Debug DLL configuration. Once built don't forget to place the libpng and zlib dlls in the same folder as quake2.exe. Done ;) !