Shield Protocol

Shield Protocol is an example GVA external application that demonstrates the external application interface while providing an entertaining 80s-style Breakout game for operator training and recreation.

Shield Protocol Welcome Screen

Gameplay in action:

Shield Protocol Gameplay

Overview

Shield Protocol is a defense-themed twist on the classic Breakout bat-and-ball game. The player operates a defense shield platform to intercept threats by bouncing a kinetic interceptor ball upward to destroy descending enemy blocks.

It showcases:

  • External application registration via LDM10 DDS
  • Display rendering via Qt Quick/QML
  • Soft key input handling (F19=Left, F20=Right, F13=Fire, F18=Enter)
  • Game state management
  • AdLib-style FM synthesized sound effects for authentic 80s arcade experience
  • Vector graphics rendering with Qt Quick Shapes

Gameplay

Objective

Protect your defense line by bouncing the ball off your shield to destroy the descending blocks. Clear all blocks to advance to the next wave. Don't let the ball pass your shield!

Controls

Key Function
← / A Move shield left
→ / D Move shield right
Space Launch ball
Enter Start game / Pause
Escape / P Toggle pause
F / F11 Toggle fullscreen

HMI Soft Keys (when running as external app)

Soft Key Function
F19 (▲) Move left
F20 (▼) Move right
F13 (Up) Launch ball
F18 (Enter) Start / Pause

Scoring

Action Points
Block destroyed 10
Multi-hit combo 10 × combo multiplier
Wave bonus Wave × 100
Power-up collected Varies

Power-Ups

Power-ups occasionally drop from destroyed blocks:

Power-Up Effect
Wide Shield Temporarily increases shield width
Multi-Ball Spawns additional balls
Slow Ball Reduces ball speed
Fast Ball Increases ball speed

Game Architecture

Application Flow

sequenceDiagram participant Op as Operator participant HMI as HMI participant DDS as DDS Network participant Game as Shield Protocol participant Audio as AdLib Synth Note over Game: Game starts Game->>DDS: Register application Game->>DDS: Set soft key labels Note right of Game: LEFT, RIGHT, FIRE, ENTER DDS->>HMI: Update button labels Op->>HMI: Select BMS screen HMI->>DDS: Display Extension active DDS->>Game: Application mapped Game->>Game: Init game state Game->>Audio: Initialize AdLib synth Op->>HMI: Press ENTER to start HMI->>DDS: Key event (F18) DDS->>Game: Start game Game->>Audio: Start background music loop Game loop (60 FPS) Game->>Game: Update game state Game->>Game: Move shield Game->>Game: Move ball Game->>Game: Check collisions Game->>DDS: Render frame via QML alt Block destroyed Game->>Audio: Play block hit Game->>Game: Add score Game->>DDS: Raise score alarm end alt Ball lost Game->>Audio: Play ball lost Game->>Game: Lose life Game->>DDS: Raise life lost alarm end alt Wave complete Game->>Audio: Play wave complete Game->>Game: Next wave end end alt Game Over Game->>Audio: Play game over Game->>DDS: Raise game over alarm Game->>Game: Show game over screen end

Class Structure

classDiagram class GameWindow { -GameController* m_controller +handleHmiAction(action) +handleHmiActionReleased(action) #keyPressEvent(event) #keyReleaseEvent(event) } class GameController { -GameState m_state -qreal m_shieldX -QList~Ball~ m_balls -QList~Block~ m_blocks +startGame() +togglePause() +moveShieldLeft() +moveShieldRight() +launchBall() +tick() } class RegistrationManager { -int m_domainId -int32_t m_resourceId +start() +stop() +raiseScoreAlarm() +raiseLifeLostAlarm() +raiseGameOverAlarm() } class AdLibSynth { +initialize() +playSound(effect) +startMusic(track) +stopMusic() } GameWindow --> GameController GameWindow --> RegistrationManager GameWindow --> AdLibSynth

Running Shield Protocol

Standalone Mode

Run the game directly:

./build/bin/gva-qt6-app-shield-protocol

The game starts in fullscreen mode. Press F or F11 to toggle fullscreen.

With GVA HMI

Run the full GVA stack with Shield Protocol as an external application:

# Terminal 1: Start registry
./build/bin/registry

# Terminal 2: Start HMI (BMS functional area)
./build/bin/gva-qt6-hmi -a 8

# Terminal 3: Start Shield Protocol
./build/bin/gva-qt6-app-shield-protocol

Or use the launcher script:

./run_gva_shield_protocol.sh

When running with the HMI:

  1. Shield Protocol registers with the platform registry
  2. The HMI receives the Third_Party_Session and maps it to the BMS display area
  3. Use the HMI bezel buttons (F19/F20) or physical keyboard to control the game
  4. Game alarms appear in the HMI alarm display

Building

Shield Protocol is built as part of the main build:

cd build
cmake ..
make gva-qt6-app-shield-protocol -j$(nproc)

Dependencies

  • Qt6 Core, Gui, Qml, Quick, QuickControls2
  • Qt6 Multimedia (for AdLib sound synthesis)
  • LDM10 library (for DDS registration)
  • AdLib Synth library (included)

DDS Topics

Shield Protocol publishes and subscribes to the following LDM10 topics:

Published

Topic Purpose
C_Configured_Platform_With_Registry_requestResourceId Request resource ID
C_Third_Party_Session Register display extension session
C_Hard_Button_Label Set soft key labels
C_Configured_Platform_setOperatingMode Set operational mode
C_Alarm Game event alarms
C_Alarm_Condition Alarm conditions

Subscribed

Topic Purpose
C_Registered_Platform_Resource_supplyResourceId Receive resource ID
C_Hard_Button_Event Receive soft key events
C_Missing_Resource_Mapping_mapDescriptor Role assignment

Sound Effects

Shield Protocol uses the AdLib Synth library for authentic 80s-style FM synthesized sounds:

Event Sound
Block destroyed Short percussive hit
Shield bounce Shield activation sound
Ball lost Damage/failure sound
Power-up collected Rising arpeggio
Wave complete Victory fanfare
Game over Descending jingle

Background music plays during gameplay using procedurally generated FM synthesis.