Commands & Requests Channel

Genvid uses a messaging channel to communicate between an application and the game. It allows an application to send a message to the game, and possibly receive receive a reply back.

Using Unreal Tournament 4 as an example, you can have the broadcaster affect the environment during a match by selecting a different loot drop location or closing off sectors of the map to increase difficulty.

There is two types of message that can send: a broadcast message, called a command, that would be sent to all game instance connected but do not allow for a reply, and a request message who could be sent to a single instance of the game, but will expect a reply back.

Note

Commands and Requests are independent from events and should not be used for viewer input. Commands send input to the game directly and are not scalable. You could, however, use the results of events to help determine what commands the broadcaster should send.

Commands

A Command is message with a topic (called id) and a value, which must be a UTF-8 string. Any game can subscribe to the id and all subscribers will receive the command.

Requests

A Request contain both a topic and an opaque payload (called data). A single game should subscribe to a request’s topic, and if more than one game is subscribed to the same topic, there is no guarantee which game will received the request. Once a game receive a request, it must replies to it and the reply will be send back to the origin of the request, with an arbitrary opaque payload.