DarkDoomZ v1.10 [idgames]

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.
Jarewill
Posts: 1388
Joined: Sun Jul 21, 2019 8:54 am

Re: DarkDoomZ [Finished]

Post by Jarewill »

Just wanted to say that launching DarkDoomZ 1.9 results in two warnings:

Nothing major or game breaking though.
User avatar
Caligari87
User Accounts Assistant
Posts: 5997
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: DarkDoomZ [Finished]

Post by Caligari87 »

Hotfixed in v1.9b (available at same link), thanks for the report!

8-)
shaodoomkahn
Posts: 47
Joined: Tue Sep 01, 2020 7:48 pm
Graphics Processor: Intel (Modern GZDoom)

Re: DarkDoomZ [Finished]

Post by shaodoomkahn »

now we need horror monsters settings to fit with this mode (like slenderman,freddy krueger or siren head)
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: DarkDoomZ [Finished]

Post by Enjay »

I have been trying to modify the flashlight so that it alerts monsters for as long as it is switched on.

I have tried inserting A_AlertMonsters(512); in various places around the code. The closest that I have come to success is having monsters be alerted when the flashlight is switched on, but the effect is only momentary and not constant. I'd like to make it so that the light alerts monsters all the time that it is switched on to give the player a reason to switch it off rather than just wandering around with the beacons of Gondor constantly lit all of the time with no consequences.

Can anyone give me a clue as to how to do this please?
User avatar
Dr_Cosmobyte
Posts: 2562
Joined: Thu Jun 04, 2015 9:07 pm
Location: Killing spiders.

Re: DarkDoomZ [Finished]

Post by Dr_Cosmobyte »

Hmmm, maybe the flashlight can "fire" a custom projectile that spawns an item (let's call it "AlertThing"). And make it loop while firing this actor that alerts monsters on a small radius, like A_AlertMonsters(32,AMF_EMITFROMTARGET).

The other thing i thought is to add a custom DamageType and a PainState for monsters like Pain.Flashlight and make them go to the wander/see state.
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: DarkDoomZ [Finished]

Post by Enjay »

That's certainly a possibility, the problem is, that I'm unable to find a way to make anything happen more than once. I've tried adding an instruction to spawn a projectile but, just like the alerting, I could only get it to happen when I pressed the toggle button rather than constantly emitting the projectile.

This is the area of the code where I had that success:

Code: Select all

	States {
	Spawn:
		ROCK A -1;
		Stop;
	Use:
		TNT1 A 1 { invoker.ToggleActive(); }
		loop;
	}

	virtual void ToggleActive() {
		if(Active) { Active = false; owner.A_StartSound("DDZ_Flashlight_Off", CHAN_AUTO, 0, 0.5); }
		else { Active = true; owner.A_StartSound("DDZ_Flashlight_Off", CHAN_AUTO, 0, 0.5); }
	}
If I change

Code: Select all

TNT1 A 1 { invoker.ToggleActive(); }
to

Code: Select all

TNT1 A 1 { invoker.ToggleActive(); A_AlertMonsters(512);}
the monsters awake when I press the flashlight toggle (or I get one projectile (and another when I toggle the light off) if I put a projectile instruction in there) - but I don't understand why because, by my reading of that, the Use state loops. No?

Putting the Alert into the ToggleActive function, at least the way that I did it, just broke the function: I got a loud click when activating the light (as if the on and off sounds played simultaneously) but no light and, from that point on, I couldn't even get the click again without starting a new game.
User avatar
Caligari87
User Accounts Assistant
Posts: 5997
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: DarkDoomZ [Finished]

Post by Caligari87 »

Put the alert in the DoEffect() override, under the Active check. This will have it run every tick so long as the flashlight is on.

Code: Select all

	override void DoEffect() {
		super.DoEffect();
		Quality = CVar.GetCvar("ddz_fl_quality").GetInt();
		Type = CVar.GetCvar("ddz_fl_type").GetInt();
		Mount = CVar.GetCvar("ddz_fl_pos").GetInt();
		if(Active) {
			owner.A_AlertMonsters(512);
That said, this very simply alerts monsters in hearing range as if the player were constantly firing a gun. Some optimizations could include only calling it once a second, for example.

Code: Select all

		if(Active) {
			if (level.time % 35 == 0) { owner.A_AlertMonsters(512); }
Personally I actually like the projectile idea, where it alerts monsters based on where the beam is hitting, but that is a tad more complex.

8-)
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: DarkDoomZ [Finished]

Post by Enjay »

Brilliant! That's exactly the information that I needed. Thank you. And now that I know where to add it, I have also managed to get a projectile firing repeatedly using that same section of code. So I can mess with the straight A_AlertMonsters option, or set up a a projectile version and see which suits me the best.

Thanks again and to Dr_Cosmobyte for the projectile idea. :)

BTW, I do also like the custom pain state that sends the enemies into a wandering idle state too. I don't think that I'll use that this time, but I'll hang on to the idea because it could come in useful. :)



[edit]
While poking around, I noticed this:

Code: Select all

	virtual void ToggleActive() {
		if(Active) { Active = false; owner.A_StartSound("DDZ_Flashlight_Off", CHAN_AUTO, 0, 0.5); }
		else { Active = true; owner.A_StartSound("DDZ_Flashlight_Off", CHAN_AUTO, 0, 0.5); }
Both use DDZ_Flashlight_Off so, as far as I can see, the sound defined in SNDINFO called DDZ_Flashlight_On is never used.
JohnnyTheWolf
Posts: 1144
Joined: Mon Oct 05, 2015 8:37 am

Re: DarkDoomZ [Finished]

Post by JohnnyTheWolf »

This looks like a good idea of improvement for DarkDoomZ! Do you plan on releasing it to the public?

If so, will you upload it as a separate download or is your modification going to be integrated to the main file?
User avatar
Enjay
 
 
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: DarkDoomZ [Finished]

Post by Enjay »

I hadn't really planned on releasing a modified version of DarkDoomZ. I guess I could post something here if I get something that I'm happy with.

What I have currently got working is a projectile that flies out about as far as the effective range of the flashlight roughly every half second. It alerts any monsters that it comes within 256 units of. So, in most cases, it gives the impression that the light shining in the direction of the enemies is what alerts them.

I've also kept just the raw alerting of monsters from the player location. Every second, the player also alerts monsters in a 256 unit radius (may tweak). So, that gives the impression that the monsters are getting woken up by detecting someone nearby with a flashlight even if it isn't pointed directly at them.

None of the above is toggleable or adjustable in any way - and it might be beyond me to do that. So, I'll happily post what I have (when I have it) and if someone wants to make a better, more professional, version for integration into a modification of DarkDoomZ, then they can. To be honest, the bits that I have done are the easy ones and if someone can do the trickier stuff, they could easily replicate what I have done themselves.
User avatar
vsonnier
Posts: 75
Joined: Wed Apr 10, 2019 11:22 pm
Graphics Processor: nVidia with Vulkan support

Re: DarkDoomZ [Finished]

Post by vsonnier »

I've implemented for Brutal Doom Black Edition a working solution, which roughly lies on the following principles:

1) A Lamp beam is a cone of half-angle Theta. Therefore, A beam intersects a monster if the angle between the Vector_Player_To_Monster and the Vector_Player_To_Beam_Direction <= Theta.
which translates to is_alerting = (Vector_Player_To_Monster dot Vector_Player_To_Beam_Direction ) > cos (Theta)
2) Iterate Monsters around Player , test and for each (is_intersecting = true) AND (CheckSight = true) do monster.lastheard = Player
3) Profit !

I've also added other goodies like simulating a "real electric torch" where you can make the Light beam more or less wide, i.e more or less intense accordingly (supposing constant power), and consequently alterting monsters also accordingly : the more concentrated, the farther away monsters can be alerted.
Those additions may be rather complicated, but only 1) and 2) are needed to implement a Light altering monsters like Brutal Doom v21 has, only smarter :)

Here is in attachement the core Zscript used to implement all this, using Caligari87 FlashLight as base of course, hope you will find it usefull.

Edit:
Vector_Player_To_Monster and Vector_Player_To_Beam_Direction are supposed to be unit vectors there, obviously.

A previous version of the BE Flashlight, done before I heard of ShericalCoordinates function and examples (https://zdoom.org/wiki/SphericalCoords), can be found here as a standalone addon :
https://www.moddb.com/mods/brutal-doom/ ... l-doom-v21

This code is more DIY and monster position was taken from its "foot" so is not entirely correct but I didn't bother to update the addon yet.
You do not have the required permissions to view the files attached to this post.
User avatar
ClessxAlghazanth
Posts: 159
Joined: Sun Feb 17, 2019 9:29 am

Re: DarkDoomZ [Finished]

Post by ClessxAlghazanth »

Not what's wrong but flashlight only seems to lighten a circular area around the player , no matter what the settings are (flashlight placement , density etc)

On GZDoom 4.6.1 gles , using Opelgl es renderer , hw acceleration

Tried on both vanilla and mods including DRLA , Beautiful Doom , Doom Incarnate etc but the result is same

Any ideas on this ?

Best regards
You do not have the required permissions to view the files attached to this post.
User avatar
Caligari87
User Accounts Assistant
Posts: 5997
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: DarkDoomZ [Finished]

Post by Caligari87 »

Spotlights in GZDoom are a fairly "modern" rendering feature, so I'm almost 100% certain this is due to lacking shader support on either your video hardware / drivers, or the GLES renderer due to the very old hardware support it targets. Nothing I can do about it on my end unfortunately.

8-)
User avatar
Rachael
Admin
Posts: 13100
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: DarkDoomZ [Finished]

Post by Rachael »

Spotlights do not work properly in GLES - period. I don't know what could or should be done about it, though.
User avatar
m1lk
Posts: 120
Joined: Sun Apr 04, 2021 10:00 pm
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: DarkDoomZ [Finished]

Post by m1lk »

great mod, I use it to make everything just a little dimmer

Return to “Gameplay Mods”