Skip to content
Doug Binks edited this page Sep 25, 2013 · 2 revisions

Demo Tutorials

Preconditions to all tutorials

  • Follow the installation instructions in Getting started with Runtime Compiled C Plus Plus. Use example SimpleTest to ensure the Pulse simulation is running.
  • If possible, display Source Browser (Visual Studio, XCode, Eclipse or text editor) and Pulse side by side.

Tutorial01: First steps

An introduction to Runtime-Compiled C++, this tutorial enables you to replicate the actions performed in the First Steps video.

Objective

Use Runtime-Compiled C++ to change the colour of objects whilst the Pulse simulation is running.

Steps

  • In Pulse
    • Click on the screen to start the simulation
      => Rotating red objects (blood cells) are displayed
  • In Source Browser
    • Open GameObject.cpp
    • Search for keyword: [Tutorial01]
    • Uncomment m_pRenMesh->SetColor( AUColor(1,1,1) );
      (i.e. delete // at the start of the code line)
    • Save GameObject.cpp
      => In Pulse, the objects’ colour has changed to white.

Tutorial02: Crash Protection

Introducing Runtime-Compiled C++ crash protection, this tutorial enables you to replicate the actions performed the Crash Protection video. Due to an issue with GDB, this works best in Visual Studio, XCode, or a visual debugger which can use LLDB.

Objective

Experience how Runtime-Compiled C++ manages an unhandled exception.

Steps

  • In Pulse
    • Click on the screen to start the simulation
      => Rotating red objects (blood cells) are displayed
  • In Source Browser
    • Open GameObject.cpp
    • Search for keyword: [Tutorial02]
    • Break the code: replace m_pBehavior with NULL
    • Save GameObject.cpp
      => In Source Browser, an unhandled exception message is displayed
      => Pulse is frozen
  • In Source Browser
    • Click Continue
      => In Pulse, the beacon icon shows an exclamation mark on a red background (small square in the bottom right-hand corner)
  • In Pulse
    • Click the beacon icon
      => The Event Log window opens, stating that an exception has been caught
    • Close the Event Log
  • In Source Browser
    • Fix the code: replace NULL with m_pBehavior
    • Save GameObject.cpp
      => Pulse resumes its original behavior: rotating blood cells are displayed
      => The beacon icon no longer shows an exclamation mark.

Note


Tutorial03: Include File Tracking

Runtime-Compiled C++ handles changes to Include Files. This tutorial enables you to replicate the actions performed the Include File Tracking video, with minor differences.

Objective

Set up Runtime-Compiled C++ to automatically handle include files. Change the behaviour of the objects (red cells) whilst the Pulse game is running.

Steps

  • In Pulse
    • Click on the button with a cog symbol, in the upper left-hand corner
    • Click New Game
  • In Source Browser
    • Open BB_Individual_RBC.h
      • Search for keyword: [Tutorial03]
      • Uncomment SERIALIZE(visible_dangerous);
        (i.e. delete // at the start of the code line)
      • Uncomment AUDynArray visible_dangerous;
        (i.e. delete // at the start of the code line)
      • Save the file
    • Open Behavior_RBC_Evade.cpp
      • Search for keyword: [Tutorial03]
      • Uncomment the class Behavior_RBC_Evade
        (i.e. add // in front of /* Demo)
      • Save the file
    • Open BehaviorTree_RBC.cpp
      • Search for keyword: [Tutorial03]
      • Uncomment the block else if...
        (i.e. add // in front of /* Demo)
      • Uncomment the block m_Behavior_RBC_Evade...
        (i.e. delete // at the start of the code line)
      • Uncomment the block ConstructorId... m_Behavior_RBC_Evade;
        (i.e. delete // at the start of the code line)
      • Save the file
    • Open Behavior_RBC_Base.h
      • Search for keyword: [Tutorial03]
      • Uncomment the two lines m_pPerception->GetPerceived... and m_pPerception->AddPerceived
        (i.e. add // in front of /* Demo)
      • Save the file
        => In *Pulse, the red cells move away from the enemy (green).
        (Click New Game again if the game ended)
  • In Pulse
    • Click the beacon icon (small square in the bottom right-hand corner)
      => The Event Log window opens
    • In the Event Log, scroll up
      => The cpp source files which include the modified headers were recompiled, and are therefore listed in the Event Log.