Welcome to the RCC++ blog!
This technique allows you to change your C++ code while it's running.
Available as liberally licensed open source code, it uses no scripting, no VM, no external tools - you can apply it to your own code and you can continue to use your favourite IDE. We think the quit-recompile-restart-reload cycle we're all used to could soon be a thing of the past.
If this is your first visit, watch the first steps video on the right.
If you want to know more, start here.
02 February 2020
This comes with full source code and in addition to the article a set of videos running through it.
31 October 2017
I'm moving new RCC++ blog posts to my own site over at enkisoftware RCC++ as it's much more convenient for me to write posts with our own system.
New Blog post: Speeding up Runtime Compiled C++ compile times in MSVC with d2cgsummary
|Faster Runtime Compilation after using /d2cgsummary in MSVC to diagnose slow compile times.|
17 April 2016
|Game AI Pro||Runtime Compiled C++ chapter|
- Alternative Approaches
- Runtime Compiled C++
- Runtime Compiled C++ Implementation
- Runtime Compilation in Practice—a Step-by-Step Example
- Runtime Error Recovery
- More Complex Code-State Preservation and Header File Handling
- Code Optimizations for Performance-Critical Code
- Use Case: A Behavior Tree and Blackboard Architecture
- Crytek Case Study
- Future Work
1. IntroductionScripting languages have always been a foundation of rapid AI development but with the increasing demands of AI, their performance drawbacks are becoming ever more problematic. On the other hand, traditional C++ development approaches generally lead to lengthy compile and link times, which limit the amount of iteration and testing that programmers can undertake. Though development tools are progressing in this area, developers still need to run the build and load content to see the end result, and edit-and-continue style approaches do not work for all codebases or changes.
In this article we demonstrate how the same fast iteration times and error-handling can be achieved using pure C++ through a novel approach, which we call Runtime Compiled C++ (RCC++). RCC++ allows developers to change code while the game is running, and have the code compiled and linked into the game rapidly with state preserved. Programmers can thus get feedback on their changes in seconds rather than minutes or more. The technique has been used in the development of AAA games at Crytek, and gives similar results to Hot Reload as seen in Epic’s Unreal Engine 4. The RCC++ code is available as a permissively licensed open source project on GitHub...
04 August 2015
- The Posix compiler (for Linux and OS X) now outputs intermediates. Motivated by a request from Github user procedural, I finally got around to getting this to work. I've seen up to a 2x performance boost on repeat compiles, and small compile times are now much shorter than a second. Developers should be aware that they may need to clean their runtime Intermediate folder via the IRuntimeObjectSystem::CleanObjectFiles() function.
- Visual Studio 2015 is now fully supported from both upgrading the solution or generating with cmake. After reading Bruce Dawson's excellent post on /DEBUG:FASTLINK I've added support for this to compiles, with generated pdb's being much smaller and runtime compiles faster. Thanks to github user Ashalah for spotting I had the VS2015 version number incorrect as MS skipped 13!
- CMake support for OS X has been added, so developers can use this instead of the included XCode project if needed.
- Runtime dependencies have been extended to support arbitrary file and extensions. See the documentation on the wiki for more details.
- Added cmake install support from Github user kubaroth.
11 July 2015
04 January 2015
Developers can now call RuntimeObjectSystem::SetIntermediateDir( const char* path_, unsigned short projectId_ = 0 ); to set a path for the given project id. The main use for this is when a project might include the same source file but compile it with different settings.
Additionally the optimization level used is automatically added to the intermediate directory, so there is no need to clean a build when switching from debug to release and vice versa.
As usual, see the Pull Request for more details.
08 September 2014
The Undo / Redo feature allows developers to move backwards and forwards between changes made to code in their running program, and as this doesn't involve compilation it can be extremely fast. I find this very useful for comparing subtle changes, and for performance profiling. Note that by default the history size is 0, so the feature is disabled, and this doesn't alter or keep any source code changes. For more details on how to use the new Undo / Redo feature see the wiki.
The Optimization Level feature, used in the video to get Optimize for Debug in Release code, is a simple set of optimization controls for Runtime Compiled C++. The enumeration RCppOptimizationLevel can be used to control what level of optimization is used; for example the video demonstrates switching between RCCPPOPTIMIZATIONLEVEL_DEBUG and RCCPPOPTIMIZATIONLEVEL_DEFAULT. For many advanced developers who wish to control their own optimizations, the RCCPPOPTIMIZATIONLEVEL_NOT_SET can be used so that they can control their own settings via the additional compile options. Once again see the wiki for more information on using Optmization Levels.
The latest code also corrects a bug where the additional compile and link options were not being sent to the Posix (Linux / Mac OS X) compiler. Posix (gcc and clang++) compile options are appended to the compile string, and link options are appended with a preceding -Wl, so should use comma separated parameters.
14 March 2014
|Debug view of Kythera in action during a dogfight in Star Citizen|
Moon Collider and Cloud Imperium recently announced that the hugely ambitious crowd funded space sim Star Citizen has its AI powered by Kythera. Regular followers of our blog might spot that Moon Collider is helmed by Matthew Jack, co-founder of Runtime Compiled C++. Naturally Matthew turned to using RCC++ for making it possible to change high-level code such as behaviour selection and behaviours (more details on the Kythera website). With Kythera behind other upcoming games I expect RCC++ usage to continue to grow.
In addition to some amazing games featuring RCC++, Moon Collider (previously Intelligent Artefacts) have been contributing to RCC++ development and helping to fund me taking time away from my own project Avoyd (which uses RCC++ for almost the entire code-base) to develop new features for RCC++.
I'm looking forwards to hearing more from Moon Collider, Cloud Imperium, and other developers using Kythera about their experience with RCC++ in future, and will post any relevant news on the blog. If you happen to be in San Francisco for the GDC Conference, Matthew and the rest of the Kythera team will be there, so do try to meet up to find out more about their AI middleware and RCC++.
13 March 2014
For the complete list of changes, see the pull request.
05 February 2014
Transcript and slides
The wonderful folk who organise the yearly Develop Conference in Brighton, UK, have given us permission to publish the video we took of our 2012 talk on RCC++.
Looking back at the talk Runtime Compiled C++ has come a long way, with Mac OS X and Linux support along with a host of features which make it easier to use. Even more developers have implemented runtime compilation, with the Molecule Engine adding support for C++ code as scripts, and Seiya Ishibashi (@i_saint) having developed a commercial plugin for Visual Studio called Alcantarea along with a Dynamic Patcher available on Github which is apparently used by Riot Games.