5.4 Game Parameters (RTPCs)

 

5.4) Game Parameters (RTPCs)

 
 

 

Another important type of Game Sync called a Game Parameter, is also known as an RTPC - Real Time Parameter Control. RTPCs are great for any type of information that varies over a numerical Range during gameplay. RTPCs could represent the speed or rpm of a car, mission completion percentage or even the time of day.

In the Platformer Game, two RTPCs have been implemented. One is called “Slomo” with a numerical Range of 0.1 to 1, for the slow-motion moments that act as a short tutorial in the first run. Another one called “PlayerHeight” with a Range of 0 to 3000, communicating the Y coordinate for the Player Character’s height. You’ll be trying out the functionality with the PlayerHeight RTPC in a simple example for starters. You’ll be doing more crazy things with RTPCs in an exercise following this lesson.

Pic01 Profiling RTPCs

Pic02 Creating RTPCs

Pic03 Game Syncs Monitor

Pic04 Watch List

Pic05 Current Value

Pic06 Property Editor

Pic07 RTPC Range and Default Value

Pic08 Value Graph

Pic09 RTPC Tab

Pic10 Graph View

Pic11 Graph Elements

Pic12 Control Point

Pic13 RTPC Curves + Slew Rate

  1. Open the Profiler one more time and set the Filter to filter only API Calls for RTPCs.

  2. Start the game, you don’t actually have to start playing yet.

  3. Then check out the Capture Log of the Profiler.

    There are quite a few API Calls sending a numerical value to the Wwise Audio Engine. If your Player Character hasn’t moved yet, all entries in the Capture Log show the same value. It is a default value set by the engine. Look at the Advanced Profiler.You can see one Total Call for the SetRTPCValue Function. (Pic01 Profiling RTPCs)

  4. Go to the Game Syncs Tab in the Designer Layout.

  5. Select the Default Work Unit in the Game Parameters Folder and create a new Game Parameter.

  6. Name it "PlayerHeight”. (Pic02 Create Game Parameter)

  7. Now choose Layouts > Game Object Profiler or press F12.

    Wwise's Game Object Profiler includes three Views which work together to help you monitor Game Objects and their effect on the audio and motion in your game. The reason it is better to use this specific Profiler for RTPCs is, because it makes it easier to actually see how the value sent by the game engine is changing over time, displayed by a neat graph rather than by numerical values. In this view you can see all Game Objects that emit sound in the Game Object Explorer. In the Game Object 3D Viewer you see their spatial position, rotation and relationship to the Listener, and in the Game Syncs Monitor you can view RTPCs attached to Game Objects.

  8. Add the PlayerHeight RTPC you just created to the Game Syncs Monitor. (Pic03 Game Syncs Monitor)

  9. Start the game and start a new Capture Session, but this time let the Player Character just stand there after jumping out of the transporter. Don’t start running yet, you’ll need to configure the Game Object Profiler first.

  10. In the Game Objects Tab of the Game Object Explorer you should see an Object called Player Pawn. Right-click the Player Pawn Game Object and select Add Game Object to Game Object Watch List - By Name. (Pic04 Watch List)

  11. Select the Watches Tab, where you can see all added Game Objects.

    Now look at the lower right of this Layout. You can see the current value of the RTPC PlayerHeight representing the current Y coordinate for the Player Character’s height. You can resize the Game Syncs Monitor, to better view the Graph that shows how the value changes over time. As you can see, the value is out of range. (Pic05 Current Value)

  12. Go back to the Game Syncs Tab in the Designer Layout and click on the PlayerHeight RTPC.

    To the right there are Properties to define a value Range for the RTPC, that should reflect the value range the game engine is sending to Wwise. You can even set an Interpolation on how fast or slow Wwise should react to value changes. Before changing property values, stop the Capture. (Pic06 Property Editor)

  13. Let’s keep 0 for the Min, and set 3000 for the Max height of the Player Character. You can think about Interpolation at a later point in time. As default value set what was previously displayed as the Player Character was standing on the street waiting for player input: type in 468.15. (Pic07 RTPC Range and Default Value)

  14. Now start the Capture again and play the game from start to finish.

  15. Go back to the Game Object Profiler and look at the graph.

    Now the actual value of the Player Character’s height at every point in time has been recorded by Wwise. You can stop the Profiling Session and easily revisit any particular part of the Capture by scrubbing through the timeline with the white position marker. For your own projects, this gives the Technical Sound Designer and the Audio Programmer a good starting point for discussing how to proper set up an RTPC in a game. (Pic08 Value Graph)

    You now have successfully set up an RTPC to modulate your game’s audio to your hearts content. Implementation-wise, this RTPC has been implemented with no particular Game Object or Actor attached to it. There are two methods for implementing RTPCs in the game’s code, as a global value or an Actor-specific value, which ultimately results in these two ways to modulate sounds during run-time. Since it is the player’s height you have to your disposal, lets dynamically modulate the atmospheric sounds as the player’s height is increasing and decreasing. You’ll do more exciting stuff later in the exercises.

  16. Change back to the Designer Layout, click the wind Random Container and look for the RTPC Tab on your right. Most common Wwise Objects have such a Tab.

  17. Press >> and decide which Property of this Container you want do modulate with an RTPC. (Pic09 RTPC Tab)

    Look at the extensive list of Properties you can modulate. Depending on the type of Wwise Object and its checked Properties in the Property Tab, all available Properties you can modulate can be selected here. They will be displayed in form of a two-dimensional Graph with an X and Y axis.

  18. Select the Voice Volume in this list. It now shows up as the value displayed for the Y Axis.

  19. Now select the PlayerHeight RTPC for the X Axis. The graph should now look like this. (Pic10 RTPC Graph)

    Look at it more closely. The Voice Volume is displayed as the Y value, the PlayerHeight as the X value. The value for the Y value is in dBFS within a Range of -200 and 200dBFS, with 0.0dBFS marking the current level of the Wwise Object. The value for the X value is the Min and Max value of the RTPC. The red line shows a function that indicates how those two values correlate to each other. As for now, it is a linear function. In the upper left corner of the graph you see a Position Marker for simulation a change in the RTPC’s value wihtin Wwise. Now you can adjust the translation between these values to better fit your desired creative idea. (Pic11 Graph Elements)

  20. The default value of the RTPC is 468.15. Double-click on the red function line to create a new Control Point. You can either manually set it anywhere in the graph, ir type in the values for Y and X axis at the top of the graph. For the X axis you can type in the default value, for the Y axis you can set however loud you want your wind Random Container to be -24dBFS for this value seems about right. (Pic12 Control Point)

    The graph now reads, that for every Y coordinate of the Player Character’s height being lower than the default value, the wind is even getting quieter, for every Y coordinate of the Player Character’s height being higher than the default value, the wind is getting louder. Let’s set the Control Point at the end of the line at around +12dBFS. You can decide for yourself, how loud you want the wind sound to be. You can also add other Control Points, in fact as many as you like. You can even right-click on each of the divided parts of the function to choose another type of Curve than a linear one. As a last step you can change the Interpolation for the numeric value, meaning how fast or slow Wwise reacts to a change in value by the game engine.

  21. Choose Slew Rate as Interpolation method.

    You can now set a value in units for an Attack and Release. Attack means how many units per second do you allow for the RTPC to react to an increase in value whenever the game engine updates the RTPC. Release means exactly the opposite: how many units per second do you allow for the RTPC to react to a decrease in value whenever the game engine updates the RTPC. It basically means how fast or slow do you allow for the RTPC to modulate an Object’s Property as defined by the graph. You can use this to make the change in Volume for the wind Random Container smoother, a bit less responsive to the rapid change in value sent by the game engine. Therefore you can make it sound more organic and natural. Choose appropriate values and test them! (Pic13 RTPC Curves + Slew Rate)

    Beware of the Voice Volume being too loud as the RTPC changes. It all seems good in the graph, but +200dBFS on the Y Axis is brutally loud and can damage your ears and equipment. Be gentle at first, listen back a couple of times and adjust the Control Points in a controlled manner. You can play back the wind Random Container at different Simulation Values by changing the Position Marker. It also doesn’t matter how the Curves look like, it is all about the sound.