Unity-based game sending DMs to viewers

I’ve got a concept for an auto-played RPG in which viewers in chat can use a command to set up their character and equipment, for example, !birth_battlemage_fireball_shield in order to spawn a new character as a fireball main weapon, shield secondary, with health and intelligence as their base stats.

To cut to the chase a bit more, if a large number of viewers were doing this at the same time, I have a plan for that, but letting each player know what’s going on with their character would be practically impossible in open chat, so is it possible for a game to send DMs to someone’s account?

The game would need to have a connection to Twitch Chat from which is can read what users are saying in chat, and also send whispers to the users.

One important thing to keep in mind though is that it’s generally considered bad design to respond to messages through a different method than which they came in on, eg if a message is sent in chat it should be replied to in chat, and if a message is sent as a whisper it should be replied to in a whisper. If your bot were to be the one initiating lots of whispers, potentially with similar/duplicate messages, it would likely get either banned or have whispers disabled due to Twitch’s anti-spam features.

A much better solution which would leave chat free of spam, both from a bot and from users trying to use commands and also avoid the issue of your bot being marked as a spammer, would be to create a Twitch Extension and do the functionality you want through that.

1 Like

Okay, so (please allow me to try and make sure I get this) creating a custom extension which would allow viewers to send commands and receive updates in, maybe an external window of some description?

One thing I would like to do as well is keep any characters localized to the channel hosting the game, giving the streamer the option to load up a file containing info for all viewers who have participated in past and are currently in chat, or to start from scratch as they see fit.

(Just as a quick fill-in on the concept, it would be most likely an isometric overworld style map with little blips to represent the avatars for people in chat, which can create a ping for the streamer on the map when something particularly interesting is going on, for example, a group of chat viewers are taking on a boss or something. Keeping gameplay as simple as possible so that it doesn’t turn into too much of a mess. Or even having the streamer be able to join in on whatever the AI are doing, just to keep chat interaction high.)

I know this is kind of a lot to throw out at once, so thank you for your patience.

An extension is basically a web page, so you could have buttons for creating characters or using abilities, and even display any graphics for each user if you wish.

You would need some sort of backend server to store the data for each channel rather than the streamers loading the data from a file.

I’d suggest browsing some of the existing extensions on Twitch to get an idea of what they’re capable of and the sort of things people have done with them so far, it’ll give you a better understanding of how to go about it if you decide to create an extension for your idea.

1 Like

Thank you so much for the help! Though, are you sure there wouldn’t be an apt solution to keep files local for the streamer as opposed to stored via server/ site? I’d rather that the characters be non-transferable for purposes of updates and options. Afterall, the game would be a locally-stored game rather than the entire thing being an extension. So the player (streamer) would have direct control of a character in a world populated by AI controlled allies belonging to the viewers, and the viewers determine the gear and general actions of their character. (For example, [Go to Dungeon] [Go to Forest] [Help Build Homes] [Forge Weapons] and so on.)

The files would be on Twitch’s CDN.

And then the characters can be loaded from where ever.

So the characters can be localized to the streamer. (I run an extension that has data uploaded from the game to the extension so the game data is local to the streamer, theres no transfer of game data between casters).

TLDR: There are many ways for data to be specific to the streamer/channel and be non transferrable

1 Like

I suppose the option to allow character transfer is something the streamer could set up themselves, yeah. Why not give the option, provided that it’s clear as an option?

I’ve done some work with Unity in past, but never with twitch integration, hence I want to keep actual gameplay simplistic until the full system is made functional.

I suppose I’ll keep looking into integration methods, but thank you for the guidance. (This would be so much better if I just knew a programmer who would be willing to work on this with me x_x
I do the programming myself out of necessity, but I’m far more design-oriented.)

Side note, if anyone knows somebody with the time and patience to answer the occasional question on extensions, I could use a guru.

The best place to ask questions is either here, or on the TwitchDev Discord server https://link.twitch.tv/devchat

Big McThankies

This topic was automatically closed after 30 days. New replies are no longer allowed.