Search Unity

External Chat Integration ?

Discussion in 'General Discussion' started by Tom163, Nov 30, 2022.

  1. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    I'm planning a game with a strong communication element, so it needs chat functionality (several channels, by location).

    One feature I'd love to have is the ability to join the chat (as a registered player) without loading the game itself. So I'm thinking to integrate some existing chat system into the game, ideally something that also does account handling for me, like Discord.

    Can't really find any assets or integrations for anything, though. I'm not talking some bot API, but the full chat stuff, channels, permissions, the whole thing. Basically, I want to have a Discord window inside my game. It doesn't have to be Discord, any other somewhat popular chat service would do as well.

    Does anything like that exist at all?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    No, quite specifically because this violates the Discord ToS. Third party clients are neither supported nor even permitted and if it's found a user is using one they can have their account banned. There's no easy solution for what you're looking for here, especially if you want it to handle accounts as well. There's stuff like Stream (getstream.io), but you're still going to be doing a lot of integration and back/frontend work yourself.
     
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    IRC and XMPP exist, but you'd need to run your own servesr. I'm fairly sure that discord offers in-game overlay where people can chat, but they can chat on any channel.
    ---
    Apparently XMPP is nearly dead, although specs and protocols are still usable.
    Articles related to XMPP mention matrix as a posisble alternatve.
     
  4. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,698
    Discord plays quite well with games. Think it's quite common to have discord open when playing.
    If you really want to integrate a chat where people already have accounts on, Telegram would be an option. Decently popular and apparently everyone can write a client for them (no idea what the requirements are): https://github.com/pi0/custom-telegram-clients

    HOWEVER, do you really think people would trust their account on those services (Telegram and Discord alike) to the game of an indie dev?
    Rather unlikely. At least I get already nervous when a reasonably large website needs access to limited features of my Google or Twitter account so I can login with them.

    Fear you'll have to resort to building it yourself.
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Discord chat and overlay already work well with games out of the box. Virtually everyone I know plays games with discord running. Discord already has features that let you read the game state and sort players by game lobby and team.

    I would be tempted to push people towards your official discord channel rather than trying to directly integrate discord.
     
    Tom163, Ryiah and DragonCoder like this.
  6. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,698
    Yep and you can enhance that server - or maybe even other peoples server, with a bot related to your game.
     
    Kiwasi and Ryiah like this.
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,775
    You can use Unity embedded browser asset and run discord chat channels in the game.
     
  8. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    Sounds like that's the best approach. I'll check on the Discord overlay. Yes, my idea was to start a server for the game, possibly enhance it with a bot, etc.

    I just need a way to transfer info between game and Discord, such as "player has entered this location, switch to that local chat group" and most importantly, only make channels available based on player location (they don't change often, so it's not like I need to poll it constantly).
     
  9. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,698
    Making only specific channels available you can easily do by ha ing the bot set the viewing rights for channels for particular users. Not sure you can force a user to open a specific channel though.
     
  10. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I know that you can force a user to move to a specific channel if they are already on a channel on your server. We have a bot on FAF that does this. It reads the lobby state and sorts players into channels that match their team ID.

    For privacy reasons, it shouldn't be possible to force a user to open a channel when they do not have an audio channel already open.
     
    DragonCoder likes this.