I've just published a new tutorial on RCC++ over on our devlog: Runtime Compiled C++ Dear ImGui and DirectX11 Tutorial
This comes with full source code and in addition to the article a set of videos running through it.
Runtime-Compiled C++
Edit your C++ code while it's running
Welcome
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
31 October 2017
Speeding up Runtime Compiled C++ compile times in MSVC with d2cgsummary
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
Runtime Compiled C++ article available online
Our 2013 article on Runtime Compiled C++ for Game AI Pro is now available for free online. If you're interested in AI development the entire book can be found for for free at the bottom of the main Game AI Pro website.
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...
Game AI Pro | Runtime Compiled C++ chapter |
Sections
- Introduction
- 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
- Conclusion
1. Introduction
Scripting 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...
Continue (pdf)
04 August 2015
Faster Runtime Compiles and Improved Compiler support
Recent code changes have concentrated on getting faster runtime compiles, and improving compiler support.
- 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
Runtime Compiled C++ at Develop:Brighton 2015
I'll be attending Develop:Brighton 2015 (but won't be giving a talk like we did in 2012), so if anyone there would like to meet up and chat about RCC++ then please drop me a line through my twitter account @dougbinks or email me through doug@enkisoftware.com.
04 January 2015
Per-project build intermediate directories and cmake additions.
The latest additions to Runtime Compiled C++ improves cmake support by fixing a few issues with Visual Studio and QtCreator on Windows, and adds per project build intermediate directories.
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.
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
Undo / Redo and Optimization Level features in Runtime Compiled C++.
I've just merged the code for two new features I've been working on into the master branch & repo for RCC++. Check out the video for a quick introduction to what these do - for HD video click on the vimeo link.
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.
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
Runtime Compiled C++ is in Kythera, the AI behind Star Citizen.
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
Introducing Runtime Compiled Projects
I've finally gotten around to testing and integrating a bunch of work on RCC++ which I've had on my development fork for a while. The main feature was requested by the team behind Kythera AI (previously Intelligent Artefacts and now Moon Collider) who've been sponsoring much of the recent work on RCC++. They've found that it would be beneficial to be able to set compile options such as include and library paths on a per-module basis, so we've introduced a feature called 'Projects'. Read more about that on our wiki page for Using ProjectIds and Projects.
For the complete list of changes, see the pull request.
For the complete list of changes, see the pull request.
05 February 2014
Video: RCC++ at the 2012 Develop Conference
Rapid Development with Runtime Compiled C++
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.
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.
Subscribe to:
Posts (Atom)