Thoughts about Discord Integration?
Moderator: OpenTTD Developers
Thoughts about Discord Integration?
Hello everyone!
Since you are re-building the game, I think you can take Discord integration. I am sure that they'll support you!
These are the links that may help you:
https://discordapp.com
https://discordapp.com/rich-presence
https://discordapp.com/verification
Since you are re-building the game, I think you can take Discord integration. I am sure that they'll support you!
These are the links that may help you:
https://discordapp.com
https://discordapp.com/rich-presence
https://discordapp.com/verification
- Redirect Left
- Tycoon
- Posts: 7249
- Joined: 22 Jan 2005 19:31
- Location: Wakefield, West Yorkshire
Re: Thoughts about Discord Integration?
That reminds me, Discord used to recognise when i was playing OpenTTD, it no longer does
Re: Thoughts about Discord Integration?
I noticed that too. I must select .exe file manually everytime I open the game.Redirect Left wrote:That reminds me, Discord used to recognise when i was playing OpenTTD, it no longer does
Re: Thoughts about Discord Integration?
The suggestion has been raised before. The consensus last year was that we don't want integration for specific platforms built in to OpenTTD itself, but may be open to having some general method of querying game status.
Re: Thoughts about Discord Integration?
That could be super cool!jfs wrote:The suggestion has been raised before. The consensus last year was that we don't want integration for specific platforms built in to OpenTTD itself, but may be open to having some general method of querying game status.
Re: Thoughts about Discord Integration?
we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Thoughts about Discord Integration?
Quite right:Eddi wrote:we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.
There exists a python script which connects to the admin port and communicates ingame to IRC.
https://dev.openttdcoop.org/projects/soap/repository and a fork at https://github.com/ropenttd/suds
This surely can be changed to talk to discord, too, especially as there is a ready-made python API: https://discordpy.readthedocs.io/en/latest/api.html
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Thoughts about Discord Integration?
But there is just little problem. I don't know how to code. I just wanted to come out with an idea.planetmaker wrote:Quite right:Eddi wrote:we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.
There exists a python script which connects to the admin port and communicates ingame to IRC.
https://dev.openttdcoop.org/projects/soap/repository and a fork at https://github.com/ropenttd/suds
This surely can be changed to talk to discord, too, especially as there is a ready-made python API: https://discordpy.readthedocs.io/en/latest/api.html
Re: Thoughts about Discord Integration?
Is the admin port usable (or useful) when you are on the main menu? In a singleplayer game? Joined as a client in multiplayer?Eddi wrote:we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.
The goal here is not to query information about a multiplayer game you are hosting, but to query information about which game you are playing, possibly including server address of a multiplayer session you have joined. Also, from within the IM client (be it Discord or anything else) instruct a running OpenTTD to join a specific server, or to allow friends to request to join your game, still from within their IM client.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Thoughts about Discord Integration?
The admin port only works when OpenTTD runs in server mode (why would you externally control your single-player session?). As such: it is not useful nor even usable at all in main menu as in that case no server is running.jfs wrote:Is the admin port usable (or useful) when you are on the main menu? In a singleplayer game? Joined as a client in multiplayer?Eddi wrote:we already have an interface in the form of "admin port" (primarily aimed at network servers). it would be nice if we could provide a ready-made script to handle the connection.
The goal here is not to query information about a multiplayer game you are hosting, but to query information about which game you are playing, possibly including server address of a multiplayer session you have joined. Also, from within the IM client (be it Discord or anything else) instruct a running OpenTTD to join a specific server, or to allow friends to request to join your game, still from within their IM client.
In server mode it can query many game states, including player and map info as well as interactions between them. It is possible to use it as some kind of command-logging; while it does not have every game action available, it can get those via a game script which can have an interface to the admin port as well.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Thoughts about Discord Integration?
Yep exactly. The idea behind an IM client integration is not to query the status of a game server, but to report what the user is doing with the game, whether that's just having it open, playing alone, or playing multiplayer.
Re: Thoughts about Discord Integration?
there is a path Openttd -> libOTTDAdmin2 -> SUDS bot (Supybot) -> IRC
-> Discord, I tried to start it, but I couldn't make it completely, too complicated ...
-> Discord, I tried to start it, but I couldn't make it completely, too complicated ...
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
- Redirect Left
- Tycoon
- Posts: 7249
- Joined: 22 Jan 2005 19:31
- Location: Wakefield, West Yorkshire
Re: Thoughts about Discord Integration?
I've recently been working with Node to create my Discord bot for my gameserver (not OpenTTD related, San Andreas Multiplayer). So i can give some pointers on how to make the Discord connections, although i woludn't know how to read the OTTD data without looking into it, and then it should be aasy to word into human readable sentences.
The issue I have found, as i was converting from an IRC to a Discord bot. Discord, unlike IRC, doesn't have limitless lines. It is throttles quite heavily, so if your OpenTTD instance outputs lines rapidly, you may get your bot throttled. May not be an issue for OpenTTD, but my IRC bot was spewing out 5+ lines per 10 seconds, which Discord does not like. So be wary of those limit in Discord, compared to IRC.
The issue I have found, as i was converting from an IRC to a Discord bot. Discord, unlike IRC, doesn't have limitless lines. It is throttles quite heavily, so if your OpenTTD instance outputs lines rapidly, you may get your bot throttled. May not be an issue for OpenTTD, but my IRC bot was spewing out 5+ lines per 10 seconds, which Discord does not like. So be wary of those limit in Discord, compared to IRC.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Thoughts about Discord Integration?
Do you possibly feel like making discord integration into soap / suds? That bot currently connects to IRC. However the detour via IRC is not necessary as in python one can directly connect to discord, too.Redirect Left wrote:I've recently been working with Node to create my Discord bot for my gameserver (not OpenTTD related, San Andreas Multiplayer). So i can give some pointers on how to make the Discord connections, although i woludn't know how to read the OTTD data without looking into it, and then it should be aasy to word into human readable sentences.
The issue I have found, as i was converting from an IRC to a Discord bot. Discord, unlike IRC, doesn't have limitless lines. It is throttles quite heavily, so if your OpenTTD instance outputs lines rapidly, you may get your bot throttled. May not be an issue for OpenTTD, but my IRC bot was spewing out 5+ lines per 10 seconds, which Discord does not like. So be wary of those limit in Discord, compared to IRC.
Links to repos are at viewtopic.php?f=32&t=84974#p1219543
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Thoughts about Discord Integration?
Hey,
I know it was advised from planetmaker and other devs to use the admin port. I still decided to make it a full integration into the source code of the game. So... Here's what I made to combine OpenTTD and Discord Rich Presence: All the basics are finished. Only additional information is not being shown, e.g. current year or map size, whatever. (Would be nice to hear some suggestions what this could be). I'm debating making this a PR into the github repository of OpenTTD... See what the devs think.
Example:
Note: This is based on a fairly new version I pulled from the github.... so this may have a few bugs and it has a few new features coming with 1.10
I know it was advised from planetmaker and other devs to use the admin port. I still decided to make it a full integration into the source code of the game. So... Here's what I made to combine OpenTTD and Discord Rich Presence: All the basics are finished. Only additional information is not being shown, e.g. current year or map size, whatever. (Would be nice to hear some suggestions what this could be). I'm debating making this a PR into the github repository of OpenTTD... See what the devs think.
Example:
Note: This is based on a fairly new version I pulled from the github.... so this may have a few bugs and it has a few new features coming with 1.10
Who is online
Users browsing this forum: No registered users and 29 guests