This is a demo to show how to use the [QA Co-AI Plugin] to integrate with Razer QA Co-AI. This project was made with Unreal Engine 5.5.4.
- Make sure MSVC is installed. Preferred compiler version for Unreal Engine 5.5.4 is v14.38-17.8. Not tested on Clang.
- Make sure Razer Chroma is installed and running.
- Log in to Razer QA Co-AI
- Create Game project with game design document in "Content/GDD/Unreal.Shooter.GDD.pdf" and ensure the Game Title of the project is set to "RazerUnrealQADemo".
- Go to the settings page to download and install the Razer AI Service.
- Download and replace the service configuration file.
- Open QACoAIDemo.uproject.
- Press play.
- You should see json messages in the top-left corner of the screen.
- If not, press ESC or CTRL+P to open the pause menu. On the bottom left, it should state "SDK Started: OK"
- If not, please make sure to launch and update Razer Chroma and Razer Synapse.
- Go through the level. Bugs detailed in the Bugs section should be reported in the QA Co-AI web dashboard.
This is a list of blueprints used in the demo along with how the QA Co-AI Plugin was used.
- StartGameSession is called on Init event. For Performance Metrics feature to work, the process name should be the same as the Title that is passed into StartGameSession. This involves editing the Target.cs file and setting the OutputFile variable.
- SetPrintOutput is also called here, with both print options set to true. This will print to screen and logs everything that is output to Razer QA Co-AI.
- SetApplicationTracking to track changes to window resolution and window focus (alt-tabbing)
- EndGameSession is called on Shutdown event.
-
Every property to be tracked is registered using RegisterPropertiesToTrack. This is done by making an Array of QACoAIPropertyInfo and passing it into the function, with Category set to "Player". Player position is tracked every second by calling the TrackActorPosition function and setting the tickrate to 1000ms. Currently tracking:
- isAiming
- health
- Ammo
- MaxAmmo
- LevelTimeRemaining
- Position
-
Also logging "Level started" and "{Player} spawned" events.
-
AddInputTrackingComponent for input tracking
-
Log out "{Player} received damage"
-
If HP <= 0, log out "{Player} out of health"
-
Log out "{Player} fired weapon" if firing was successful
-
Log out "{Player} hit {Name}" if player hit a NPC target. This is logged twice, one for aiming and one for hip fire.
- Logging "Out of Time" when LevelTimeRemaining property is <= 0.
-
Log out "Enemy {Name} spawned in room {Room}"
-
Track health by calling RegisterPropertyToTrack
-
Track position by calling TrackActorPosition. Tickrate is set to 5000ms because enemy position info is not important to track accurately in this game.
-
Category is set to "Enemy"
- Log out "Enemy {Name} dead" when out of health.
- Log out "{Name} hit {Target}" when the entity hits a target.
- Log out "{Player} entered Room {Room}"
- Log out "{Player} left room {Room}"
- TrackActorPosition. Category is set to Items
- Log out "{Player} picked up health"
- TrackActorPosition. Category is set to Items
- Log out "{Player} picked up ammo"
- TrackActorPosition. Category is set to Items
- Log out "{Player} picked up endgame"
- Log out "Player killed by killzone"
| Output | Purpose | Found in Blueprint |
|---|---|---|
| GameSessionStart | Start of a gamesession. Should be sent first before any other event. This will reset certain cached game states. | BP_GameInstance |
| InitProp, SetProp, ClearProp | These, along with the 1P and 2P suffix versions, help to keep track of property values. Register properties to track using RegisterPropertyToTrack, RegisterPropertiesToTrack, TrackActorPosition, and TrackActorOrientation | BP_ThirdPersonCharacter BP_AI_002 BP_Healthpickup BP_AmmoPickup BP_Enggamepickup |
| LogEvt | Logging specific game events. | BP_ThirdPersonCharacter BP_AI_002 BP_Healthpickup BP_AmmoPickup BP_Enggamepickup BP_RoomCheck BP_Killzone |
| GameSessionEnd | End of the gamesession. | BP_GameInstance |
- Health pickup is giving 25 health instead of 20
- Ammo pickup is giving 35 ammo instead of 30.
- Dead enemies can still be shot
- Last 3 enemies are dealing 6,7,8 damage instead of 5 damage