[0.4 BETA] TwitchyDoom - Streamer interaction!

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
kevansevans
Spotlight Team
Posts: 420
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: [0.2b BETA] TwitchyDoom - Streamer interaction!

Post by kevansevans »

Cutmanmike wrote:Now if only there was a way to write data to a file to be read by another program...
Maybe setting a bunch of cvars? Not the most elegant solution, but strings are values that can be set and stored! The hurdle would be making an interpreter that can navigate the gzdoom.ini file. Getting proper support of writing data would definitely get shot down quickly for fear of people shipping mods with malicious code.
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: [0.2c BETA] TwitchyDoom - Streamer interaction!

Post by Cutmanmike »

I don't think cvars are actually written to the ini until the game closes
User avatar
Undead Zeratul
Posts: 3
Joined: Sat Mar 13, 2021 5:49 pm
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: [0.3 BETA] TwitchyDoom - Streamer interaction!

Post by Undead Zeratul »

Well this will be fun once I can get it all set up...

I noticed it's leveraging Streamlabs' older Chatbot instead of Cloudbot, which doesn't seem to behave them same way (I assume because Cloudbot doesn't have access to your local files). This should work as long as the file is appended, right? I'm thinking of leveraging a bit of software called Touch Portal to do the file I/O that can be kicked off via events from Twitch such as chat messages or (what I intend to try) channel point redemptions.

I've been successful with getting the file updated but it doesn't seem to react in-game. Any suggestions how to proceed?

Edit: Well hey! I think I actually got something working while dicking around with it tonight... it took some messing around to understand how it's working, but I can redeem channel points and summon a squad of 4 random marine allies, hook into when I get raided and mass resurrect everything as well as summon 32 random former humans... I like this
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: [0.3 BETA] TwitchyDoom - Streamer interaction!

Post by Cutmanmike »

Any extra information you can give me about setting up cloudbot or any other bots would be appreciated as my bot + twitch streamer knowledge is limited and I want to make it as accessible as possible.
User avatar
Undead Zeratul
Posts: 3
Joined: Sat Mar 13, 2021 5:49 pm
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: [0.3 BETA] TwitchyDoom - Streamer interaction!

Post by Undead Zeratul »

Oh, sure!

The way I'm going with it doesn't use chat commands, but rather the 1st party Channel Points Twitch has set up, as I already integrated them with a few things in OBS and want to continue leveraging them. My solution involves a third party software called Touch Portal which acts as a Stream Deck, but can also hook into various events from Twitch once you connect it.

Essentially, Touch Portal's actions include a set of FileSystem I/O interactions, which itself includes appending to an existing file. So I just added an action to open the STREAM.txt file and append a "SpawnItem|Actor=HealthBonus,Effect=ItemFog|$twitch_last_channel_point_redeemer|$twitch_last_channel_point_message" (along with a newline). From there, I just add a button to my Stream Deck (my phone running the mobile app) and when I hit the button, the item gets spawned. I still have to test the channel point redemption live, but since I have infinite points, I can test it through OBS locally and it does seem to work as well. It's worth noting that Touch Portal DOES hook into chat messages so you could use it to make a chatbot, but I just chose not to go that route.

The thing I had to mess with and understand better was the fact that the number of lines in the file matters and can't be cleared out during gameplay, but once the game exits the file can be wiped just fine. I'm hoping to figure out how to automate that, as I'd rather not have that file grow potentially indefinitely without intervention.

Because the items spawn out of Line of Sight, it's sometimes hard to find the item (noclipping helps) and I've noticed it sometimes doesn't seem to fire at all? It's probably something on my end (I'm doing some more complex stuff with randomized logic and whatnot in Touch Portal so I'm not surprised).

I'm hoping to get hosts to spawn a friendly marine with a random weapon, raids to mass resurrect and summon a horde of former humans, among other stuff going this route.

Was there something in particular you were curious about, or did I answer your question? I can get some screenshots once I confirm all my stuff works live if that helps?
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: [0.3 BETA] TwitchyDoom - Streamer interaction!

Post by Cutmanmike »

Undead Zeratul wrote:Because the items spawn out of Line of Sight, it's sometimes hard to find the item (noclipping helps) and I've noticed it sometimes doesn't seem to fire at all? It's probably something on my end (I'm doing some more complex stuff with randomized logic and whatnot in Touch Portal so I'm not surprised).
You could try the NoLOS=true parameter so they can spawn in line of sight, but they will still appear at a random spot. I'm also adding an optional parameter to show the item on the automap. Failing that, you could just use the GiveItem command instead to give it directly to the player.
Undead Zeratul wrote:Was there something in particular you were curious about, or did I answer your question? I can get some screenshots once I confirm all my stuff works live if that helps?
That's probably enough for me to try out at some point, thanks.
User avatar
Captain J
 
 
Posts: 16890
Joined: Tue Oct 02, 2012 2:20 am
Location: An ancient Escape Shuttle(No longer active here anymore)
Contact:

Re: [0.3 BETA] TwitchyDoom - Streamer interaction!

Post by Captain J »

Never thought of making Doom Twitch-friendly and can be possible. This is very clever and surprising! But i do wonder if anyone tried this in Multiplayer aka Co-op Stream. Did they? It surely doesn't work on Zandronum though.
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: [0.3 BETA] TwitchyDoom - Streamer interaction!

Post by Cutmanmike »

I haven't tested it but it should work.

I've updated to 0.4 which improves the random spawning of actors and adds some extra parameters such as showing the actors on the automap. There's also some basic settings in the option menus now too.
Netheritor
Posts: 123
Joined: Tue Dec 03, 2019 5:22 am

Re: [0.4 BETA] TwitchyDoom - Streamer interaction!

Post by Netheritor »

I have a few ideas;

1. Give the ally monsters movement state. I know there is one where the ally don't teleport to player and teleport to player. Can you add the guard variant? Like monster as a sentry to allies and enemies alike? The monster in this state can be walk-through.

2. Is there nothing else for viewers to gain points except by watch time? Maybe make the points increase if streamer defeating monster?

3. Can you edit the title to include "twitch integrated / integration" or something like that? Just because I want this mod easily found in google search with those keywords.

Edit: One more question; Can this work with Zandronum?
User avatar
Rachael
Posts: 13561
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [0.2b BETA] TwitchyDoom - Streamer interaction!

Post by Rachael »

kevansevans wrote:
Cutmanmike wrote:Now if only there was a way to write data to a file to be read by another program...
Maybe setting a bunch of cvars? Not the most elegant solution, but strings are values that can be set and stored! The hurdle would be making an interpreter that can navigate the gzdoom.ini file. Getting proper support of writing data would definitely get shot down quickly for fear of people shipping mods with malicious code.
Cutmanmike wrote:I don't think cvars are actually written to the ini until the game closes
Cutmanmike is right.

However, you can use a program to parse out GZDoom's cvar data directly from memory and write to a file that way, but that's a bit advanced. ;) (Something simpler might be to inject a DLL that forces the 'writeini' command to happen frequently, but that is wasteful far from ideal...)

Another thing you can do is enable logging. As far as I know logs are flushed after every print, so it should be possible to use a program to grab hints from the program with another program using the log file. (They will, however, show on the screen)

Anyway...

I think it's important to put out a word of caution on this. This *IS* exploiting a kind of unintended/undocumented feature in GZDoom. I have no plans to break it (don't worry, you can all breathe a sigh of relief) and it's fairly harmless so there isn't any need to worry about this getting a dev's attention.

However - that does not immediately dismiss this little important caveat that must be said ...

As you all well know, refactorings can and do happen often in GZDoom. Because of the way this mod works where it exploits GZDoom not using any sort of stored in memory version of the file, this mod doesn't and never will have a promise of tomorrow. It's an interesting mod - it's not likely to break anytime soon - but keep in mind - it could, and without warning.

That is ultimately the unfortunate price to pay of all unintended/undocumented features. Like I said, I don't have any plans to break this and I don't see any reason to - but that little caveat applies to all programs, not just GZDoom. When you're using unintended features, you are on your own.
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: [0.2b BETA] TwitchyDoom - Streamer interaction!

Post by Cutmanmike »

Rachael wrote:That is ultimately the unfortunate price to pay of all unintended/undocumented features. Like I said, I don't have any plans to break this and I don't see any reason to - but that little caveat applies to all programs, not just GZDoom. When you're using unintended features, you are on your own.
Not the end of the world if does get broken down the line, for me anyway. The scope of the mod is pretty small compared to what you could be doing with ReadLump and other third party programs. The person who is planning server MMO features is the one that needs to be warned ;)

Also users could always stick to an older GZDoom if they want to use this in a worse case scenario.
Netheritor wrote:1. Give the ally monsters movement state. I know there is one where the ally don't teleport to player and teleport to player. Can you add the guard variant? Like monster as a sentry to allies and enemies alike? The monster in this state can be walk-through.
This is outside the scope of this mod. You'll have to create your own actors in decorate/zscript to handle this.
Netheritor wrote:2. Is there nothing else for viewers to gain points except by watch time? Maybe make the points increase if streamer defeating monster?
You can use whatever points system your stream bot software is capable of, but reading game data back into said software (i.e when a monster is killed) is tricky/not feasible (see the discussion about writing to cvars).
Netheritor wrote:Edit: One more question; Can this work with Zandronum?
Not without a modified Zandronum client or some other hack. And even then it would be hard to get the same features. Ask anyone who has tried to make names appear above player's heads using only DECORATE and ACS :blergh:
User avatar
Dr. Denson
Posts: 4
Joined: Thu Jul 07, 2016 12:57 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Slovakia
Contact:

Re: [0.4 BETA] TwitchyDoom - Streamer interaction!

Post by Dr. Denson »

I was wondering, Is there any possible way to make this also work with Twitch Channel points?
User avatar
DragonFlayer
Posts: 17
Joined: Tue Apr 02, 2019 11:39 am

Re: [0.4 BETA] TwitchyDoom - Streamer interaction!

Post by DragonFlayer »

Greetings, I was wondering if anyone is having issues seeing in-game notifications? using TwitchyDoom_beta-0.4.pk3, tried GZDoom 4.5, 4.6 and 4.6.1, but I can't seem to get notifications when a command is used, they execute successfully, and I'm not passing NoNotify=true or anything like that, the in-mod setting 'Command notifications' is enabled too.

The only way I've been able to display notifications is by using the Log command from the documentation, but seeing the screenshots and videos, and the fact that you still pass the username and message parameters to most other commands, I was under the impression commmands would have some notifications of their own, or am I doing something wrong?

This is the command I'm using

Code: Select all

$savetofile("STREAM.txt Location","SpawnMonster|Actor=Cacodemon|$username|$dummyormsg")
Only way I've gotten notifications to show up is by adding Log commands as such

Code: Select all

$savetofile("STREAM.txt Location","SpawnMonster|Actor=Cacodemon|$username|$dummyormsg")
$savetofile("STREAM.txt Location","Log|||$username has summoned a Cacodemon!")
$savetofile("STREAM.txt Location","Log|||$dummyormsg")
User avatar
frozenfoxx
Posts: 8
Joined: Mon Jul 20, 2020 3:10 pm
Contact:

Re: [0.4 BETA] TwitchyDoom - Streamer interaction!

Post by frozenfoxx »

This is wonderful! I've been working on something similar using Zandronum with the server console and ACS, but this is much slicker and more like what I wanted to do originally!

Do you need some help with maintaining this? I've been spending time building with Node.js specifically to use the Twurple library for configuring up remote channel points redemptions and whatnot if you wanted this to be configured up outside of Streamlabs.
User avatar
DragonFlayer
Posts: 17
Joined: Tue Apr 02, 2019 11:39 am

Re: [0.4 BETA] TwitchyDoom - Streamer interaction!

Post by DragonFlayer »

I'm really loving every bit of this mod!

That said, I had to make a little change to how friendly spawn works, given I tend to pair this up with stuff like Colorful Hell or DoomRL Monster replacers, some monsters can spawn new monsters, and they don't inherit the friendliness or properties/inventory given to the parent monster, so some of their spawns will be hostile to the players, or they will be friendly but lack consistency with how the actual TwitchyDoom ally functions as they lack any of extra properties given to the parent.

So I made an event handler to make any new spawning monster with a friendly master copy the same properties TwitchyDoom gives to friendly spawn, however, I have never done anything in ZScript before, so here's the thing I wrote:

Code: Select all

Class Friendliness_Handler : EventHandler
{
	override void WorldThingSpawned(WorldEvent e)
	{
		if(!e.Thing.bISMONSTER)
		{
			return;
		}
		Actor mst = e.Thing.Master;
		if(mst)
		{
			if(mst.bFRIENDLY)
			{
				e.Thing.bFRIENDLY = true;
				e.Thing.bNOBLOCKMONST = true;
				e.Thing.bSOLID = false;
				e.Thing.target = mst;
				e.Thing.lastheard = mst;
				if(e.Thing.bCOUNTKILL)
				{
					e.Thing.A_ChangeCountFlags(0);
					e.Thing.bCOUNTKILL = false;
				}
				if(mst.FindInventory("Twitchy_FriendlySpawnProtection"))
				{
					e.Thing.GiveInventory("Twitchy_FriendlySpawnProtection", 1);
				}
				if(mst.FindInventory("Twitchy_FriendlyFireProtection"))
				{
					e.Thing.GiveInventory("Twitchy_FriendlyFireProtection", 1);
				}
				if(mst.FindInventory("Twitchy_FriendlyFollower"))
				{
					e.Thing.GiveInventory("Twitchy_FriendlyFollower", 1);
				}
				if(mst.FindInventory("Twitchy_Username"))
				{
					String username = mst.FindInventory("Twitchy_Username").GetTag();
					Twitchy_Username.Show(e.Thing, username);
				}
			}
		}
	}
}
This works fine, as I said, but there's certain monsters like RLBruiserBrother from DoomRL Monsters that spawn a secondary demon (RLBruiserBrother2) and they are both supposed to also spawn their own respective aura effects as non-monster actors (RLBruiserBroAura) on spawn, that just gets fixed on their position and follows them around to give them this fiery look, however, with this Friendliness Handler I wrote, it seems the original brother does not spawn the aura or it goes somewhere else, I'm kind of stuck to be honest, as I said, I don't know anything about ZScript so I thought using bISMONSTER would allow me to filter those actors out, I'd appreciate any help!
Post Reply

Return to “Gameplay Mods”