Page 8 of 9

Re: DarkDoomZ [Finished]

PostPosted: Mon Nov 16, 2020 8:59 am
by Jarewill
Just wanted to say that launching DarkDoomZ 1.9 results in two warnings:

Nothing major or game breaking though.

Re: DarkDoomZ [Finished]

PostPosted: Mon Nov 16, 2020 6:57 pm
by Caligari87
Hotfixed in v1.9b (available at same link), thanks for the report!

8-)

Re: DarkDoomZ [Finished]

PostPosted: Tue Nov 17, 2020 6:50 am
by shaodoomkahn
now we need horror monsters settings to fit with this mode (like slenderman,freddy krueger or siren head)

Re: DarkDoomZ [Finished]

PostPosted: Sun Jan 17, 2021 7:56 pm
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?

Re: DarkDoomZ [Finished]

PostPosted: Sun Jan 17, 2021 8:16 pm
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.

Re: DarkDoomZ [Finished]

PostPosted: Sun Jan 17, 2021 8:31 pm
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 allExpand view
   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 allExpand view
TNT1 A 1 { invoker.ToggleActive(); }

to
Code: Select allExpand view
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.

Re: DarkDoomZ [Finished]

PostPosted: Sun Jan 17, 2021 10:39 pm
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 allExpand view
   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 allExpand view
      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-)

Re: DarkDoomZ [Finished]

PostPosted: Mon Jan 18, 2021 5:27 am
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 allExpand view
   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.

Re: DarkDoomZ [Finished]

PostPosted: Mon Jan 18, 2021 8:10 am
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?

Re: DarkDoomZ [Finished]

PostPosted: Mon Jan 18, 2021 8:26 am
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.

Re: DarkDoomZ [Finished]

PostPosted: Fri Mar 19, 2021 2:16 pm
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/addons/bdbe-flashlight-for-brutal-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.

Re: DarkDoomZ [Finished]

PostPosted: Tue Sep 14, 2021 11:51 pm
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

Re: DarkDoomZ [Finished]

PostPosted: Wed Sep 15, 2021 12:43 am
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-)

Re: DarkDoomZ [Finished]

PostPosted: Wed Sep 15, 2021 4:58 am
by Rachael
Spotlights do not work properly in GLES - period. I don't know what could or should be done about it, though.

Re: DarkDoomZ [Finished]

PostPosted: Thu Sep 16, 2021 11:03 pm
by m1lk
great mod, I use it to make everything just a little dimmer