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.

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.

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.

21 October 2013

Source directory discovery and turning off RCC++

I've just added support for discovering the source directories when the paths compiled into the modules do not match that of the machine the code is being run from. This is especially useful when using pre-compiled libraries. Once again I'd like to thank the team at Intelligent Artefacts for highlighting this issue and helping to develop the solution. For more information on this see the documentation.

This source code discovery doesn't noticeably increase start up times, but it brought forwards my priorities on the issue of improvements to turning off RCC++. I've introduced two new methods, one which can be used at runtime and another which is a compile flag. Documentation is again available on the wiki.

Details of the changes for both these fixes are found in the pull request here and bug fix here.

Márton Tamás once again has helped finding and fixing a bug with the alternative file watcher API on Windows, and whilst testing this fix I found that the watched paths were not being cleaned of ..'s so I also fixed that. The fixes for these are in the pull request here.

29 September 2013

Build Tests, Improved Documentation and more

Build Tests

The team over at Intelligent Artefacts recently asked if I could help them add build tests for their continuous integration testing. These tests are needed to ensure that they know if they'd added code which would breaks runtime compilation. This is a really good addition to the library, and I'm thankful to them for sponsoring the work and allowing me to include the changes under the standard RCC++ zlib license so that anyone can use and modify the code.


There are two new test functions added to IRuntimeObjectSystem and implemented in RuntimeObjectSystem:


struct IRuntimeObjectSystem
{
    // other functions...

    // tests one by one touching each runtime modifiable source file

    // returns the number of errors - 0 if all passed.
   virtual int TestBuildAllRuntimeSourceFiles(
                 ITestBuildNotifier* callback, bool bTestFileTracking ) = 0;

    // tests touching each header which has RUNTIME_MODIFIABLE_INCLUDE.

    // returns the number of errors - 0 if all passed.
    virtual int TestBuildAllRuntimeHeaders(
                 ITestBuildNotifier* callback, bool bTestFileTracking ) = 0;

};


For the most simple use case, the following should be sufficient to perform the required tests:

pRuntimeObjectSystem->CleanObjectFiles();
pRuntimeObjectSystem->TestBuildAllRuntimeSourceFiles( NULL, false );

Have a look at the SimpleTest application example in the source file Game.cpp for a more complete example. This updates the GUI and permits cancelling mid test by closing the application normally. The tests are performed using the Options menu.

Note that the bTestFileTracking  parameter should be false for most circumstances. When true this also tests the file change notification system in RCC++ by changing the modification times on the files. This will then require a full rebuild of these when you next come to normally compiling the code. The TestBuildAllRuntimeHeaders function will test the header file tracking code in RCC++. Both of these tests are mainly for those modifying The RuntimeObjectSystem or RuntimeCompiler libraries.

Running these alongside any normal compilation checks on a build server after check-ins is a great way to ensure you don't break RCC++ by accident without realizing.

The changeset for these changes is here.

Improved Documentation

I've been making some effort to increase the documentation. If you're curious head over to the wiki and take a look. As always feedback appreciated. In future I plan to move to using Doxygen so everything is part of the git repository.

An alternative Windows file watcher

Márton Tamás spotted an issue with the current Windows file watcher, in that it's incompatible with an alternate API, making integration with libraries using that API difficult. Márton has contributed an alternative solution using this API, which can be enabled with the define WIN32_FW_USE_FINDFIRST_API.

And more...

  • Matthew Jack at Intelligent Artefacts (and a founder of RCC++) discovered an issue when using code on machine with no development environment. I've submitted the fix here.
  • Ethan Trịnh has contributed a compile fix for VS2013.
  • Some further fixes, added missing license files for included dependencies and the alternate Windows file watcher API are all listed here.

31 July 2013

Added runtime compile of source dependencies, and improved compiler support.

The latest update adds support for the runtime compile of source dependencies, significantly enhancing the amount and type of code which can be runtime compiled. Additionally, I've improved compiler support amongst other changes. Full details below.

Runtime compile of source dependencies

If you have a header which adds a source dependency, and you also mark that header as being runtime modifiable, the runtime object system will now track both the header and the source file for changes and recompile them along with any runtime compiled code which includes the header.

This allows pretty much any code to be runtime compiled so long as the source and header names are in the format name.h and name.cpp, and you can add the following to the header:

#include "RuntimeSourceDependency.h"
RUNTIME_COMPILER_SOURCEDEPENDENCY;

#include "RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE;

Note that in order for this to work properly, the header must be included from a source file which uses the REGISTERCLASS macro on an IObject based class  (either directly or via another header). This is because the program needs to preserve state somehow across compiles, and currently the IObject class handles this.

Take care using this feature, as it can be easy to introduce changes which break the code - though in practice I've found this very useful.

Improved compiler support

  • Added support for Visual Studio 2013 - however this is as yet untested.
  • Added support for cross compile to 32bit on 64bit Linux/MacOSX systems, thanks to Gaoren Xu for discovering this issue and helping with the solution.

Singleton support

At the request of a project using RCC++ I've improved support for singleton type classes. This is especially useful as a good practice in using RCC++ in a performant way is to have singleton system classes which operate on arrays of data.

The REGISTERSINGLETON macro takes a class name and a boolean as arguments, where the boolean controls auto construction of the class. This macro causes the constructor to only ever make one instance of the class. For an example look at the MainObject.cpp file in SimpleTest where we use the macro as:

REGISTERSINGLETON(MainObject, true);

to auto construct an instance of the MainObject class during the Initialise call of RuntimeObjectSystem.

Cleaning build temporaries

Build temporaries can now be cleaned up using the RuntimeObjectSystem::CleanObjectFiles() call, which uses the new FileSystemUtils::PathIterator class. The demos currently do this when the program ends.