WYVRN Unreal SDK
The WYVRN SDK has a C++ / Blueprint library to integrate with AI, Chroma, and haptics.
This WYVRN SDK plugin has been tested with Unreal
versions 4.21 through 5.5.
About
The WYVRN SDK
is a runtime game plugin that is shared to provide a common API for naming events and triggering external AI, Chroma playback and haptic events.
Security
The C++ WYVRN SDK
Library loads the core Razer DLL RzChromatic.dll
. To avoid a 3rd party injecting malicious code, the C++ WYVRN SDK Library checks for a valid signature on the Razer libraries. The DLL issuer is validated to be Razer USA Ltd.
InitSDK will return RZRESULT_DLL_INVALID_SIGNATURE
if the signature check fails.
The plugin build file Wyvrn_Sample\Plugins\WyvrnSDKPlugin\Source\WyvrnSDKPlugin\WyvrnSDKPlugin.Build.cs
has a preprocessor definition to check the signature of the WYVRN SDK Library
. This a security feature and the library won't be loaded that fail to pass the signature validation when this flag is enabled.
PrivateDefinitions.Add("CHECK_WYVRN_LIBRARY_SIGNATURE=1");
PublicDefinitions.Add("CHECK_WYVRN_LIBRARY_SIGNATURE=1");
Windows PC
For Windows builds, the WyvrnSDK.dll
and WyvrnSDK64.dll
are included in your build folder for 32-bit and 64-bit builds.
General
- The WYVRN SDK allows an application or game to set the details in the Chroma Apps list within the
Chroma App
.
This document provides a guide to integrating AI, Chroma, and haptics using the WYVRN C++ SDK. Here is the list of available methods from the API:
-
Initialize SDK: Initialize the WYVRN SDK to use the library.
-
Set Event Name: Name a game event or game trigger to add Chroma and haptics.
-
Uninitialize SDK: Cleanaly uninitialize the WYVRN SDK when done.
WYVRN SDK
The WYVRN SDK is the combination of AI, Chroma, and Razer Sensa HD Haptics in a single SDK. By integrating AI, RGB lighting and haptics into game environments and events, players can enjoy a truly immersive gaming experience. The WYVRN SDK
is capable of playing Chroma animations and haptics on the Razer Sensa HD Haptics devices. SetEventName()
can trigger AI interaction, RGB lighting, or haptics or all of the above.
Downloads
Engine | Git Repo | Download Link |
---|---|---|
WYVRN Design Template | Git | Download |
WYVRN C++ SDK | Git | Download |
WYVRN Unreal SDK | Git | Download |
WYVRN Unity SDK | Git | Download |
Event names can follow a naming convention which assists with the generation of the event configuration for your title. Event names are specified with the SetEventName()
method. The event name suffix can be left off or used to prepopulate common settings for _ON
, _OFF
, and _MERGE
.
-
"Jump" - (without a suffix) Existing haptics stop, the named haptic plays to completion and then ends
-
"Attack_ON" - Existing haptics continue to play, the named haptic plays as a continuous looping haptic
-
"Attack_OFF" - Existing haptics continue to play, the named looping haptic stops
-
"Punch_MERGE" - Existing haptics continue to play, the named haptic plays to completion and ends
-
"Block_MERGE" - Existing haptics continue to play, the named haptic plays to completion and ends
Upon completion of event implementation, the list of Chroma events and game triggers should be shared with the team for QA to verify they execute as expected.
Targeting features can be optionally described for each haptics effect.
-
"Target" defaults to
"All"
. GroupID options can be found at https://doc.wyvrn.com/docs/interhaptics-sdk/haptics-sdk-for-game-engines/shared-types/#groupid -
"Spatialization" defaults to
"Global"
. Other LateralFlag options can be found at https://doc.wyvrn.com/docs/interhaptics-sdk/haptics-sdk-for-game-engines/shared-types/#lateralflag -
"Gain" defaults to 1.0.
Runtime Plugin Structure
Plugin Definition: Plugins/WyvrnSDKPlugin/WyvrnSDKPlugin.uplugin
Plugin Source: Wyvrn_Sample/Plugins/WyvrnSDKPlugin/Source/WyvrnSDKPlugin/
Headers: Wyvrn_Sample/Plugins/WyvrnSDKPlugin/Source/WyvrnSDKPlugin/Public/
Implementation: Wyvrn_Sample/Plugins/WyvrnSDKPlugin/Source/WyvrnSDKPlugin/Private/
Sample Blueprint Init / Uninit Setup
Event BeginPlay
invokes InitSDK
passing the AppInfo
that provides the information that displays within Synapse->Connect->Apps
. InitSDK
returns 0
upon success after a 100ms delay the WYVRN API is ready to use. If InitSDK
returns nonzero, avoid further calls to the WYVRN API.
InitSDK
UnInit
SetEventName
Namespace
The UWyvrnSDKPluginBPLibrary
uses a global namespace to make the Blueprint library available.
#include "WyvrnSDKPluginBPLibrary.h"
API Class
The WyvrnAPI
class provides a wrapper for the WYVRN SDK Library. The UWyvrnSDKPluginBPLibrary
class exposes the WYVRN API to blueprints. The UWyvrnSDKPluginBPLibrary
functions can also be called from C++.
Initialize SDK
Initialize the WYVRN SDK in order to utilize the API. The InitSDK
method takes an AppInfo
parameter which defines the application or game details that will appear in Synapse and the Chroma App
within the Chroma Apps
tab. The expected return result should be RZRESULT_SUCCESS
which indicates the API is ready for use. If a non-success result is returned, the WYVRN implementation should be disabled until the next time the application or game is launched. Reasons for failure are likely to be the user does not have the Synapse
or the Chroma App
installed. After successfully initializing the WYVRN SDK, wait approximately 100 ms before setting events.
if (!UWyvrnSDKPluginBPLibrary::IsInitialized())
{
FWyvrnSDKAppInfoType appInfo;
appInfo.Title = "Unreal WYVRN Sample Game Application";
appInfo.Description = "A sample application using Razer Wyvrn SDK";
appInfo.Author_Name = "Razer";
appInfo.Author_Contact = "https://WYVRN.com";
// 0x01 | // Utility. (To specifiy this is an utility application)
// 0x02 // Game. (To specifiy this is a game);
appInfo.Category = 1;
int32 result = UWyvrnSDKPluginBPLibrary::WyvrnSDKInitSDK(appInfo);
if (result == RZRESULT_SUCCESS)
{
// Init Success! Ready to use the WYVRN SDK!
}
else
{
// Init Failed! Stop using the WYVRN SDK until the next game launch!";
}
}
Set Event Name
Game events can be named to add supplemental technology to your lighting experience. By naming game events and game triggers, the event name can be used as a lookup to do things for AI, Chroma, and haptics. SetEventName("Jump")
could be used to play a Chroma animation for the jump game event. The Jump
event can also use A corresponding haptic effect to enhance emersion for the title. No other APIs are required to add Chroma and haptics other than to invoke SetEventName(). Some game events can have lighting or haptics or both. It just depends on the game design to create an experience that makes sense.
// Trigger AI, Chroma, and haptics
int32 result = UWyvrnSDKPluginBPLibrary::SetEventName("Jump");
if (result == RZRESULT_SUCCESS)
{
// Event named successfully!"
}
else
{
// Unable to set event name. Unexpected result!"
}
Uninitialize SDK
Applications should uninitialize the WYVRN SDK with Uninit() for a clean exit. Uninitialization is only needed if the WYVRN SDK was successfully initialized. The expected successful return result should be RZRESULT_SUCCESS
.
int32 result = UWyvrnSDKPluginBPLibrary::WyvrnSDKUnInit();
if (result == RZRESULT_SUCCESS)
{
// WYVRN has been uninitialized!
}
else
{
// WYVRN uninitialization was unsuccessful!
}
Getting Started
Frameworks supported
-
Windows WyvrnSDK (32-bit)
-
Windows WyvrnSDK (64-bit)
Assets
A game uses SetEventName
to name game triggers. No other assets need to be included in the game to add haptics and lighting effects. Playback is controlled from the external Events.config
for the named events.
Full API
WYVRN SDK Library Methods:
PluginCoreInitSDK
Direct access to low level API.
// DLL Interface
EXPORT_API RZRESULT PluginCoreInitSDK(
ChromaSDK::APPINFOTYPE* AppInfo);
// Class Plugin
int32 Result = UWyvrnSDKPluginBPLibrary::WyvrnSDKInitSDK(AppInfo);
PluginCoreSetEventName
Direct access to low level API.
// DLL Interface
EXPORT_API RZRESULT PluginCoreSetEventName(LPCTSTR Name);
// Class Plugin
int32 Result = UWyvrnSDKPluginBPLibrary::SetEventName("Effect1");
PluginCoreUnInit
Direct access to low level API.
// DLL Interface
EXPORT_API RZRESULT PluginCoreUnInit();
// Class Plugin
int32 Result = UWyvrnSDKPluginBPLibrary::WyvrnSDKUnInit();