Alpha 37 – Anniversary Edition

For the third anniversary of Unvanquished’s first release, we are proud to present to you an engine milestone in Alpha 37!


Our first release was February 29th, 2012, which was exactly three years ago (considering Leap Day), three years during which we have greatly improved all aspects of the game. This includes replacements for almost all inherited models, great new maps, and significant gameplay enhancements. At the same time, Daemon, the engine powering Unvanquished, has come a long way from being just ioquake3 plus fancy a renderer, being iteratively upgraded to a more modern engine with HTML-based UI and special effects. This release adds another engine milestone, so read on for what’s new!

The overmind watches you on Forlorn.

This release has major engine changes in addition to two map updates, some gameplay changes, a new model for the overmind that will creepily follow you with his unique eye, and a technical preview of an updater to easily keep the game up to date. Parpax’s layout has been updated while Forlorn has received yet another graphical update with particularly beautiful lighting in the central area. On the gameplay side, the spiker has been rebalanced by changing the fire pattern of the spikes to be more deadly and the human team has been slightly nerfed by reducing the damage and radius of the firebomb, and putting the Lucifer Cannon in a new momentum threshold, providing a smoother transition to human team’s most potent weapon.

On the engine side, we rewrote and improved the “system” modules of Daemon and ported the client-side VM to NaCl, completely replacing the QVM system that was inherited from Quake III. The latter is a very big change and is likely to introduce bugs and performance regressions, but releasing this will allow us to find these problems and fix them over the next alphas. Finally, for consistency, we renamed the server-side VM from “game” to “sgame”, so server administrators and package maintainers may have to update their scripts.

Overview of the engine changes

Two feature branches were merged for this release. The first one, sys_rewrite, simplified, refactored and improved the code responsible for the operating system-specific parts of the engine, altering the error handling in the engine to use exceptions instead of setjmp/longjmp, unifying error handling behavior across all platforms, as well as adding the ability to send commands to a running instance of the engine from the shell, a feature formerly provided by ad-hoc shell scripts. The second branch, nacl-cgame, marks a huge milestone in the evolution of Daemon by completing a project started back in the summer of 2013 to make the gamelogic virtual machines use NaCl instead of QVM. This allows us to use C++ for the gamelogic, include external libraries, and increase code-sharing with the engine; we had already moved the server-side VM to NaCl in Alpha 27.

The biggest problem with NaCl VMs is that calls between the engine and the virtual machine are much slower because they run in separate processes and must communicate through a socket. This is why, when porting CGame, we added the ability to communicate through a command buffer in shared memory: asynchronous commands are buffered in it and socket communication is only needed to signal when the buffer needs to be flushed. All audio related commands as well as most of the renderer commands are sent through the command buffer, greatly reducing the performance overhead of the communication. While in most cases there is no difference in performance compared to the previous releases, and even a gain of a couple FPS for mostly empty games (parpax default human base); a busy layout on the training server with hundreds of buildings and dozens of players incurs a 30% performance hit. This an acceptable loss given that we will further optimize the communication and that it is a worst case situation for a CGame NaCl VM.

Now that both VMs are using Native Client, we have deleted all of the QVM handling code, removing 23.000 lines of code of tools and 8.000 in the engine, although in fairness this delta doesn’t take into account the addition of the NaCl SDK, which is huge. Having C++ in the gamelogic brings a lot of benefits, ranging from having an intuitive vector math library that uses operator overloading, to structuring our entity types using components, all of which will hopefully help us move forward faster.

Changes for users

The curses console is now off by default and command-line flags for the executables have been changed, they are now the following:

  • -homepath <path> to set the path for the “home directory path” where configuration files are written and paks downloaded
  • -libpath <path> to set the path for the “executable path” containing additional executables used to load a NaCl VM
  • -pakpath <path> adds another path from which pk3s can be loaded
  • -resetconfig resets all cvars to their default value by not loading autogen.cfg on startup
  • -curses activates the curses console, for server-owners wanting colors and a nicer console UI
  • -set <variable name> <value> is now the preferred way to set a configuration variable (unlike +set which will now only be executed after engine initialization has finished)
  • +<command> still works as before, but must be specified after the flags. It executes a console command after the engine has finished initializing.
  • -help/–help shows a list of all available options and exits
  • -version/–version shows the engine’s version number and exits
  • unv://ADDRESS[:PORT] allows you to connect directly to the server with the given address

Changes for developers

The workflow when developing the gamelogic is now the following: while developing, build the VMs as native DLLs and run the engine with “-set vm.sgame.type 3 -set vm.cgame.type 3”, which will make the virtual machines run in a thread of the main process, making debugging easier. The engine looks for the native DLLs in the same directory as the engine  executable, which is where they are built when Unvanquished is compiled from sources. When you want to release the VMs, build them as NaCl executables which will result in four files for each vm: with and without a “-stripped” suffix and targeting x86 and x86_64. Put both the x86-stripped and x86_64-stripped files in the root directory of a pk3, renamed as x86 and x86_64. In the future, the “basepak.sh” scripts automates this process.

In the rare event of a bug specific to NaCl VMs, or if you are an engine developer, you’ll want to debug the NaCl VMs directly. To do this, set the VM type to 1 and drop the nexe files next to the executable. You can then run the game with an added parameter vm.<name>.debug 1 which will start the VM in a gdb server. You can then connect to that server using the nacl-gdb provided in external_deps. In nacl-gdb, use “target remote localhost:4014” to connect to the gdb server and type “c” to start the gamelogic.

Below are the commits that were added in this release:

  • 46f6f11 Initial work on rewriting the sys_*.c code
  • 5b6ae42 Simplify sleep code
  • 93ebe4d Mark process as DPI-aware on Vista and above
  • 9c46d70 Some more work on Sys
  • 94a9f27 Split system code between common and framework
  • bbd2247 Move DynamicLib into common
  • 5525d24 Start using some of the new system code
  • e317cbe Compatibility with gcc 4.6
  • b0fd8ed Don’t include dlfcn.h in NaCl builds
  • 52d55be Fix gamelogic compilation
  • c7d99a6 Reset signal handlers when a signal is caught
  • b39c65a Start work on CGame NaCl
  • 3199321 Nuke lcc too
  • ce19958 Implement more initialization code, including a new URL-handling system
  • 021df60 More work on sys_rewrite
  • 06d1e35 Whitespace fixes and make (c)gvm a unique_ptr
  • ab037ac Remove the need for StaticInit and clean up CommonProxies.cpp includes
  • f1d205c Remove excessive pointers from GameVM
  • 3d1eef6 Remove excessive pointers from CGameVM
  • acee865 Add STATIC_INIT VMCalls back, they are needed for proper initialization
  • dff074f Move game traps that are common with cgame in common files
  • 8e34694 Active back cgame compilation (no syscalls implemented yet)
  • aaf0ab2 Remove cg_api.asm and cg_api.c
  • e9a50fe Remove the map loading hack in the game vm
  • 719e183 Purge all QVM-related code
  • 37d655a More work on sys_rewrite
  • 83bb31f Implement Misc cgame syscalls
  • 79101d2 Add Audio cgame syscalls
  • 6f7e336 Unify the parse syscalls
  • f1f2842 Rename all C files in cgame/* and shared/* to C++ files
  • aaeb548 Remove unused syscall S_ClearSounds, thanks ZTM
  • 190abbe Allow client and server to run concurrently on the same homepath
  • 60f3200 Remove unused renderer cgame syscalls
  • 71886a8 Implement renderer syscalls
  • 77c6380 Remove the rest of the unused cgame syscalls
  • a1758ad Implement all key cgame syscalls and a missing renderer one
  • f891efe Implement all LAN cgame syscalls
  • 93211f0 Remove unused LAN functions
  • 8f86c89 Fix whitespace
  • fc223c8 Brutally implement rocket cgame syscalls
  • c3036b5 Remove CGame QVM syscall stats
  • 970ffd2 Fake the completion callback syscalls
  • 0e17e03 Add the last VM->engine syscalls, implemented in the VM or in shared code
  • cd8d89c Implement the Engine->VM syscall handlers
  • b93384a Add back the rocket VM initialization
  • ce09a16 Fix some message definitions and make VMs exit cleanly
  • c39a484 Change CM_LoadMap to load the map data itself
  • d41f6d7 More small fixes, we can now see the map for a frame
  • 3cc52f4 Fix CG_Trace not handling NULL vectors
  • 66f119a Handle more arguments that can be null
  • 7256ac9 Improve the tracing of syscalls (to have start and end markers)
  • 8edbc5d Disable CG_TutorialText temporarily, see #448
  • 2c134da Remove uses of tokenized strings for syscall param passing
  • cd18f56 Add trap_LAN_ResetServerStatus to fix crashes
  • a3843ba Init and shutdown cgame VM Services at the same time as cgame
  • ba6299b Quickfix for a crash in BG_UnloadConfigs
  • 0e4a280 Replace SetClipRegion with a null argument to ResetClipRegion
  • 1cc241d Delete duplicate entries in the CMakeLists.txt
  • 74bbd73 Revert “Revert “Add a check to avoid sending sync messages while handling async messages””
  • f49ef0f Fix trap_Rocket_GetProperty
  • 96971d3 Fix #471, progressbars not working on nacl-cgame
  • e00f966 Do not remove /listCgameCmds when removing a cgame VM
  • 15b137e Fix compilation of the TTY client
  • 2b3d000 Fix MarkFragment trap call, partially fixes #474
  • c8ba1b8 Fix the MarkFragment syscall more, #474
  • df0eddb Fixes #474 by fixing AddPolysToScene
  • 3f14e66 #474 fix MarkFragments even MORE…
  • a952f9b Move Com_*Time to q_shared to remove 2 syscalls
  • 709a976 Remove unused demo getter syscalls
  • 2c15b70 Send glconfig on CG_Init instead of doing a syscall to get it
  • 28d37ab Remove the GetGameState syscall, refactor gamestate
  • d452100 Move the getting of client state from a syscall to rocket_frame
  • 7ab31ef Remove an unused member of snapshot_t
  • 93521a7 Remove trap_Log
  • 13aa830 Fix async in sync error when a VM calls Com_Error
  • aaced1d Improve DynamicLib::LoadSym interface a bit
  • b5abf28 Make daemon work out of the compile on mac
  • 30bb43a Fix some crashes on macosx
  • f0d5478 Fix compilation for VS
  • 08eab7e Initialize all fields of IPC::Channel in constructors
  • 5c86c93 Various improvements for sys_rewrite
  • 4a69ce0 Remove some dead ‘viewlog’ code
  • fbb8dce Some more minor changes
  • 5b8f1e6 More sys_rewrite stuff, including proper error handling for VMs
  • a14c832 Properly reset the internal handle in DynamicLib::Close
  • a34a08f Make snapshot_t contain server commands and use a vector for entities
  • 7216345 Remove SetClientLerpOrigin
  • 6d0f514 Remove usages of identClient keeping netcode compatibility
  • ee6a40d Try to make Travis happy
  • 660fbab Add NET_Init to Com_Init
  • 4e5b085 Fix typo in VirtualMachine.h comments
  • 2b44a37 Fix compilation >_>
  • 446c67a Fix last-minute error in a34a08f4fec4
  • 436c198 Ensure all fds in loadedPaks are closed on shutdown
  • 4c1d445 Fix compilation on Mac
  • ff3acca Initial work on removing the old sys_ code
  • b99a9e3 Reimplement is num lock down
  • 006a664 Replace missing sys_main/{os} functions
  • 005b0ec Remove sys_local.h (move the remaining functions in qcommon.h)
  • f18693f Remove Com_TouchMemory
  • d12b12d Remove unused SDLMain.h
  • f4ddd6b Fix TTY client compilation
  • c792f8d Revert “Revert overmind animation changes.”
  • 8c3a559 Add new overmind config files.
  • 0fa3b2b Revert changes to NORETURN
  • 5cf9eb4 Add a warning if the VM process did not exit cleanly
  • b0e6cda Reset the background color to default instead of black in con_tty, this fixes terminals with fancy backgrounds
  • c4800c6 Fix crash when calling CG_CapTrace with null bounds
  • d4307d1 Split IPC in several files
  • 6944b6d IPC::Desc -> IPC::FileDesc
  • 522e4f2 Split the messages of cg_api.h in cg_msgdef.h, same for g_api
  • 9391dc8 Fix compilation without PCH
  • 1033577 Serialize -> Utils
  • c5433e1 Comment parts of the IPC and Serialize code
  • eb6a83c Make spiker deal locational damage.
  • ca846f9 Add more randomization to spiker fire pattern and improve trigger condition.
  • 087d30f Rename namespace Utils to Util to match previous Util namespace
  • dd30643 Disable the curses console by default
  • b46f476 First implementation of IPC command buffers
  • 059c026 Remove the key mechanism from Channel
  • 0bdeb5b Fix memory leak. No need for dynamic allocation here.
  • 00caaf8 Try flushing the buffer after every syscall (they are all synchronous)
  • 41bfcfc Ensure command buffer flushes are in sync message handling
  • e40ee01 Fix windows build. Define _USE_MATH_DEFINES to get M_PI etc.
  • 12f44f0 Remove a stack of unused variables. No intended functional change.
  • 6593545 Remove exception name comments as requested to by reviewer for pull request.
  • 4311ad6 Increase spiker spike damage (20 → 30).
  • 7459740 Fix a few compilation errors on MSVC
  • 737efae Fix MSVC build
  • 4fa449f Fix Win32 build
  • a4d33da Implement circular shared mem buffer, compiles but might not work yet
  • 2ccccf6 Fix the first implementation of the circular command buffer
  • f622f72 Add srand to static cgame initialization, fixes #575
  • e4e8747 Remove unused member in Channel
  • c271b16 Fix co;pilation after the merge
  • 651c91f Fix an IPC bug caused by a buffer Flush doing sync in toplovel
  • d251cf1 Misc changes to CommandBuffer, some suggested by Amanieu
  • 28655ac Mark win32 binaries as large address aware
  • 0f2de16 Don’t use smart pointers in client_t
  • 21047ac Prevent sending sync messages in VM toplevel
  • 0584d09 Fix last commit (no sync in VM toplevel)
  • 209d8ca Set CMake Policy 26 to new
  • b827b72 Revert “Set CMake Policy 26 to new”
  • ed1ce79 Reduce DATA_OFFSET, reload writer data when finished in CommandBufferHost
  • 88d0838 Drop on incomplete command buffer writes
  • c07e10e Switch of warning for MSVC about truncated symbols.
  • 88751db Switch of warning for MSVC about use of open instead of _open. etc.
  • 93dceff Fix MSVC performance warnings
  • 5ee8e83 Remove some unneeded move statements. They might even hinder than help.
  • 19cc636 Fix hive sometimes attacking while OM is down.
  • 24f4dfb Refactor hive target selection.
  • f796178 On /devmap do not clear the hunk after starting cgame
  • 4d3e496 Fix #606
  • 6fd994b Fix null com_consoleLines crashing the StringRef constructor in Com_StartupVariable
  • a5bb31d Fix Command already registered spam
  • dbf7d4d Refactor target selection of turrets and Rockedpods
  • 8eb6fe4 Update external_deps
  • 75e6a78 Make build.sh work on mac with two new hacks
  • 66274e8 Newer NaCl sdk versions don’t put executables in bin64/ anymore
  • 9175cd6 Add a copy of BlendSkeleton on the VM side (uglily)
  • dae519e Fix warnings in CommandBuffer.cpp
  • 4b90e61 Some more doc for IPC, hopefully it will be useful to someone someday
  • ebb7012 Fix one reason for “invalid source” in issue #516
  • 27ce34f Fix command buffer, better logging
  • c070f95 Make the renderer call use the command buffer
  • 290d825 Optimize the binding getting syscall and re-enable the tutorial
  • 7e94483 Updated NaCl SDK prevents VM from creating shm, wors around this limitation
  • b60a3a2 Make the alignement of transform_t match between native and NaCl
  • 2335346 Add checks that the entire message is consumed in HandleMsg
  • 3c4e9e2 Avoid the use of sigwait because it interferes with gdb
  • 8a8114c Update the quit mechanism for VM type 4
  • 4a2935a Nerf firebomb, adjust human unlock thresholds.
  • 55b652b Escape text sent from a rocket chatfield
  • ac7c905 Ensure that we always blank the element if we return early.
  • 3265b37 Ensure that scoreboard shows at intermission. Disable +/-scores during intermission
  • b0b3426 Fix a bunch of warnings in the cgame
  • f384507 Fix compilation on Windows after nettle update
  • 5300122 Super ugly fix for nettle in non-win
  • 689b352 Detect the parameter type of nettle_random_func with templates
  • 3b7524c Make VMBase::Free free libpath nacl vms
  • bcf8107 Use physical keyboard layout instead of virtual for game controls
  • 04f7e8e Clean up vm.*.type values and native vm filenames
  • f4dbc7d adjust .gitignore
  • 65c7092 Fix compilation of Nettle version detection on Windows
  • f86fb4f Better error description for snapshotNum
  • fe50af5 Fix CMake warning
  • 7f2c27f Correct buffer size for formatted net address with port
  • 8386499 Force the command environment to be transient instead of stateful
  • ca5a57b Fix Exec printing execing … after sending the file to the command buffer
  • 8d518c2 Execute the command buffer on an rcon, fixes #598
  • 427ce7c Change -path to -pakpath and add path validation to the FS
  • a748f38 Rename sel_ldr to nacl_loader
  • 8937e6d Add some basic thread safety for the command system
  • 09883f9 Fix another cmake warning
  • 1565c21 Fix filesystem syscalls not passing file handles properly
  • a60f07e Avoid deadlock on exit on Windows due to CloseHandle blocking
  • 207e19c Fix compilation on Windows
  • dbac194 Don’t let nacl_loader create a console window
  • 51ee5f8 Enable the curses console by default for the windows server and tty client
  • ffa2121 Pass refEntity_t by rv-ref to HandleMsg, fixes compile for Win32
  • 710f10b Use M_PI_2 and M_PI_4 where applicable.
  • 3196474 Revert “Use physical keyboard layout instead of virtual for game controls”
  • 94c50c0 Clean up command line options, make -help useful
  • 9f066ee Make stdout/stderr visible on the parent process’s console on Windows
  • 224b5f9 Rename game to sgame
  • ef1d72b Add basic target tracking for the overmind eye.
  • 0b1524e adjust .gitignore
  • fa2afc1 No need to use floor to truncate alien evo value
  • ed48a17 Fix command escaping for rocket chatfields
  • 16731ab Remove the ability to run commands from a chat text field

5 thoughts on “Alpha 37 – Anniversary Edition”

Comments are closed.