TwitchPlay

TwitchPlay updated to 4.21!

TwitchPlay is now completely **open source **and free to download from GitHub, buy from the marketplace only to show support.

PLEASE USE EMAIL FOR FASTER PLUGIN SUPPORT: [EMAIL=“altairjp@gmail.com”]altairjp@gmail.com

You can get it here: https://www.unrealengine.com/marketp…tchplay-plugin
GitHub repository: GitHub - TheDiG3/TwitchPlay: Unreal Engine 4 Plugin for Twitch Chat integration

Ciae everyone!

I’ve always wanted to be able to integrate the Twitch chat inside a game in order to try an create cool behaviors without the need to use external software/mappers.
So, given I’ve had some free time recently (and did not find anything similar to what I want to achieve), I’ve decided to dive in and create my own Twitch API!

This is a plugin for Unreal Engine 4 that makes communication with the Twitch chat of ANY channel super simple to use. You just need to add a single component from my API which you’ll be able to use from both C++ and Blueprint. After that, Setup the user info, Connect to the Twitch server and Authenticate (you’ll need an oauth token which you can easily generate); after that, you’re all set!

I have two components available for you: **TwitchIRCComponent **and TwitchPlayComponent.

TwitchIRCComponent: enables communication back and forth with a Twitch channel chat. You can read each message (with relative username of the sender) by receiving a simple event (OnMessageReceived) or send your own messages to the chat (SendIRCMessage with SendTo enabled and chosen channel).

TwitchPlayComponent: in addition to what the TwitchIRCComponent does, this is a wonderful utility and time saver for when you want to implement user generated commands directly inside the game!
No need to do any parsing or checks on you side. Just Register a text command on the component and associate your own event that should fire whenever that user sends a chat message in the correct form (which is [DELIMITER]command[DELIMITER][OPTIONS]options[OPTIONS]. DELIMITER is ‘!’ by default, but you can choose what you want. You can specify options for the command by using another delimiter, ‘#’ by default, separated by ‘,’).
You can also unregister commands that you don’t need anymore at runtime. The only limitation is that a single object/function can be registered for a single command (if a second object tries to register it will overwrite the previous one’s registration) at the moment. This might change in future API versions.

Well documented source code is provided both in the plugin and on GitHub.

watch?v=QCcoUbKkOjw

What other features would you like implemented?

Let me know what you think guys :smiley:

@DiG

I hear Epic is pretty good about chasing down instances of plugin piracy, but unfortunately there really doesn’t appear to be a system in place to actually stop it before it happens.
Even stuff bought on the marketplace can be shared without issue of the launcher or engine rejecting it.

This is the information for publishing to the marketplace: Publisher Portal
But I don’t think they’re accepting C++ based plugins yet, just blueprint. So you might have to look at something like Sellfy for the time being.

It sounds like you could use this to have events in the game trigger based on chat commands, correct?

Exactly.

Let’s say you want to make spawnable enemies based on the chat commands. You could either register one command for each type of enemy spawn (e.g. BIGMONSTER/ALIEN/CLOWN) or have a single command (e.g. SpawnEnemy) and then read the options given by the player (e.g. Alien, Red, Lvl2). The system in place is very flexible and I actually plan on using it for a game which I’m building.

I was just thinking about making this myself to use for some things, good job hopefully it is clean enough that it will save me time in the future.

Epic actually is already accepting c++ plugins but they take awhile to go over and haven’t released any of them yet (should be some out with 4.11 soon).

While browsing around before considering starting on it I ran into a few unity version packs that do the same thing and they have text color and emoticon support, you might want to look into that as i’m sure they would be heavily requested optional features.

This is an awesome plugin!

Please sell it to us. :slight_smile:

Either on Gumroad, your own site, or the Unreal Marketplace. :slight_smile:

I’ll try to get in contact with Epic to see whether it’s possible to have it on the marketplace :smiley:

I am really, really interested in this and would love to buy it! Regarding other features I can’t actually think of anything since you can receive and send text already, which you should be able to work with for everything. What else is the Twitch API able to do? Also, how does this work if people are spamming dozens of lines per second? I’m assuming a part of the traffic will just drop?

This is what the Twitch IRC API offers: https://github.com/justintv/Twitch-API/blob/master/IRC.md

As far as message spamming goes, I have tested this inside the RiotGames channel with 30000 viewers. The spam was pretty heavy, but it looked like pretty much every message was being received correctly :slight_smile:

What is your plan with the Plugin as of today?

I have a very simple C++ file but without some of your more complex functionality,

I would be really interested in using your system.

I’ve just sent an email to EPIC, so we’ll see about trying to get it on the Marketplace. I intend to develop it more in order to add any kind of functionalities that people deem useful, so if you have any ideas feel free to suggest :wink:

Regarding the functionalities btw. If the plugin supports checking for Join/Part and Names (from here https://github.com/justintv/Twitch-API/blob/master/IRC.md), you could do interesting stuff by integrating viewers.

What is the state of the availability of this plugin?

Still not available. Just got back from a 2 weeks trip around Cali so I was not able to work on it. I’ll try to contact someone from Epic again and see what we can do about it. Hold on tight! :smiley:

Awesome! Looking forward to it. In fact I have big plans with it :smiley:

Is this still a thing or not going to happen?

Epic is reviewing the code as we speak :slight_smile:

Not sure how long those processes take, but it’s been another month ^^

I watched the video, great stuff!

So with your plugin you can do things like in Streamline? https://www.youtube.com/watch?v=E7l2UxrSVQc

This is interesting. My game will eventually have unit customization like Xcom and I was thinking of the idea that a streamer could have a button which picks a random name from the viewers or people that donated. Or similar things which creates more interaction between the viewers and the streamer.
Wasn’t there already a Twitch API or isn’t it supported by UE4?
Anyway good job!

TwitchPlay is now out :smiley:

Yes! You could choose to drive the whole game through the Twitch chat.

The official Twitch API was dropped IIRC :frowning:

Link to Twitchplay: TwitchPlay Plugin in Code Plugins - UE Marketplace