Hecatomb Quake II v0.1.0 released!

I have spent the last five (5) weeks writing a portable Quake II client based mostly on Yamagi Quake II, it has been made mostly towards being a highly portable Q2 client.

Initial patching of the original YQ2 source code has diverged into my own project: Hecatomb (a.k.a. htq2), a Quake II client who’s being intensely developed towards high portability. The name came to my mind after I realized I had to do almost groundbreaking changes, hence that name, which in fact is also an allusion to a very old and cancelled game project back in the 90’s in which John Romero had something to do with. Serious decisions are being made by me at this point of its current ongoing development.

The main focus of this project is portability, modernization and most of all, expansion capabilities, that will mean htq2 would be not only portable, but also extensible. Hecatomb Quake II is actually fully supported on GNU/Linux, FreeBSD, OpenBSD, Windows and OS X systems, it runs at least on i386, amd64 and ia64 architectures. I’m doing efforts to make a portable codebase, and with that on the table it’s highly possible to port htq2 to these trending processor architectures and OS’s like Raspberry Pi on ARM, that would be interesting, though :). I would like to denote something on the ioquake3 project, what I like most from that project is the fact that it hasn’t let Q3A to die at all, the game is more alive than ever and still kicking!, that’s what I have always wanted to do with Q2 and this was for me the chance for it.

htq2 v0.1.0 running with high resolution textures (using libjpeg), stencil shadows and anisotropic filtering. This is nothing new.
htq2 v0.1.0 running on a Ubuntu 13.04-amd64 box: with high resolution textures (using libjpeg), stencil shadows and anisotropic filtering. This is nothing new.

These are the main changes for this release (and main differences from the original YQ2 client):

The codebase: I made several decisions. First of all was to reformat all code, there were lots of tabs and spaces and therefore the indentation was somewhat kinky with the different text editors, it’s a very distracting factor indeed, so for that I applied a lot of AStyle formatting at first as a way to normalize all code (2-space indentation, visual aid comments, operator spaces, etc.). All headers were moved to an isolated include/ directory, the code layout is now independent from headers organization, all #include statements are fixed to this directory and the code looks  now much more clean. A prerequisites header (prereqs.h) is now used in ALL source files

Unified refresher: I made this change originally as a contribution to YQ2 and submitted it as a pull request, it’ll be present after 5.11 release. Originally, on YQ2 the refresher (or renderer) was separated as a DLL and the same imports/exports way of doing things were present between it and the kernel, I proceeded to get rid of that, the kernel is now tightly coded with the renderer, a lot of refactoring was indeed necessary for this to happen. This was in fact the change that started to inspire this whole project.

CMake: I just love it, and it’s sincerely the biggest strength of htq2 so far. It gives htq2 the power to be built virtually anywhere, and not only that, many features are now controlled by this baby: OS detection, architecture detection, byte order detection, headers and libraries detection, symbol definitions through a dynamic configuration header (config.h), cross-compilation, enabling/disabling features, etc. I originally started with premake4 experimentation as it looked really good, and it is, but its lack of modules for finding basic stuff made the way for CMake to win the race.

No QAL: No, it doesn’t mean that OpenAL isn’t there anymore, it means that OpenAL backend is no longer based on crazy QAL pointers, OpenAL is used directly instead (when enabled on CMake). A great amount of this contribution came from ioquake3‘s QAL implementation.

Get rid of CD-Audio playback: Yes, it means it, I ripped off any CDA support for two reasons: the first one is to give priority to the OGG music backend and the second and most important is that htq2 will migrate eventually to SDL2 (an article on this matter will be discussed soon), and we all know that this new kid on the blocks comes with no CD support at all.

Generic Hunk allocator (based on plain malloc/free):  This is a general purpose Hunk_* backend based solely on plain malloc/free. I made this when I realized that YQ2 memory system was tightly coded with direct system calls, which is great in fact, but as soon as you try to port the engine to another OS … well … you’ll get issues. So, I made a generic Hunk memory system for that, totally based on C standard library, it is not intended for production purposes, it should be used only as a generic solution for memory allocation so it would be a lot easier to port htq2 to non-unix/non-windows platforms, despite all of this it should be know that direct system calls are still by far the best option. The Hunk memory system is now separated into two parts, a high level layer where typical Hunk_* calls are residing, and a low level system-dependent layer in which the dirty work is actually done, this subsystem is called by the high level subsystem and its entry points are Sys_HunkBegin, Sys_HunkAlloc, Sys_HunkEnd and Sys_HunkFree.

htq2 using generic Hunk memory driver with tracing for debug
htq2 using generic Hunk memory driver with tracing for debug

The code seems fairly solid at this point, although there are still some very small deficiencies to be fixed up. The project’s source code tarball can be obtained at alericoveri.com.ve/htq2 or if you prefer it, you can get it at GitHub.

Now that you’ve seen a glance of what htq2 is about, I invite you do a test drive of it. If you have any interest in tweaking deficiencies, reporting issues or make a general contribution,  please feel free to do them so as pull requests on GitHub , I will appreciate it a lot. Hecatomb Quake II is being released in the same terms as his YQ2 ancestor, it’s free as in freedom under the terms of the GPLv2 license. Come and join in our IRC channel to have realtime information and latest updates about Hecatomb Quake II. Feel free to chat with us, tell us about your ideas and proposals, make your questions, bug reports, etc. Connect to irc.freenode.net and join #htq2.

Prost! Happy fragging! 🙂

Hecatomb Quake II v0.1.0 released!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s