Jump to content
The Dark Mod Forums

Recommended Posts

Posted (edited)

  A recent thread of discussion has cropped up in the TDM Discord channel and a couple forum threads ( this comment 

and the general discussion after it came to mind) about the usability and efficacy of Flashbombs in TDM.

To wit, most people seem to think they're kinda bad because they're just a stun, which still requires you to hide in a very narrow time frame and then wait for the AI to cool off after use. One of the big upsides of flashbombs in TG/T2 was that, if you had alerted human enemies chasing you, you could drop a flashbomb and then turn around and blackjack them to non-lethally remove them from play. It was an inventory-limited opportunity to recover from failure and continue playing the game, as opposed to just reloading a save. This is a fun and proactive interaction, and I propose that we add it to TDM.

Specifically, I think this can be accomplished with minimal code. After a read through the public TDM git repository, I think the most appropriate change would be to adjust the condition here: https://github.com/stgatilov/darkmod_src/blob/ac0a286561630eefee1cbb44d09d77128cd3d8e7/game/ai/AI.cpp#L11892 to read as follows:

  if ((GetMoveType() == MOVETYPE_SLEEP || // grayman #3951
         GetMind()->GetState()->GetStr() == "Blinded") && // proposed - maybe there's a better way to write this condition like checking the type or something?
        ((minDotVert != 1.0f) && (minDotHoriz != 1.0f))) // cos(DEG2RAD(0.0f)) indicates elite faceguard helmet
    {

Currently, this check does not pass for blinded AIs and they move to the if-else branch at L11903, and since they're very alert because they were actively chasing the player, they cannot be blackjacked. This change should give a flashbomb-blinded AI the same knockout vulnerability angle as a sleeping AI. Helmeted human AIs (and undead/magical AIs because they can't enter that particular mind state) retain their blackjack immunity, and everyone else can be clunked in the face as a reward to the player for spending a limited resource, not flashing themselves, and having the quick thinking to turn around and draw the blackjack. The blinded mind state lasts for about 8 seconds (I forget where I found that but its a hardcoded magic number in a Damage() function somewhere), which feels a bit short but about right, and then when the state changes the player's window of opportunity is lost.

My brain kinda glazed over when I looked at the SVN checkout+compilation.txt instructions, but if I can help test or debug this with a little hand holding I'd be happy to do so.

Edited by chumbucket91
  • Like 3
Posted

Personally I would love to see this change - as it would great to have another way beyond gas arrows to open up alert AI to KO.

It feels like there is very little reason as is for a player to invest in flashbombs at all and it’d be one more option for players that might provide one less reason to just reload the game.

  • Like 3

-=  IRIS  =-    ♦    = SLL =

Posted (edited)

I totally support this change. The way it is now, flashbombs are absolutely useless in TDM.

Flashbombs are parcticularly useful in Thief 1/2 for multiple guards which face each other, and are not blackjackable in other ways without alerting them to your presence. As it is now, there is no practical way to get rid of them in TDM.

Typically, you won't need more than 1 or 2 flashbombs in any Thief 1/2 mission, so, they are rare, and the use cases are also rare anyway. Another use for them in Thief 1/2 is against undead, of course, but, I don't even know if they do anything against them in TDM, where the undead are even less killable than in Thief 1/2 (another one of those things which actually need a change, but, let's not open that "box" for now ;) ).

Edited by chakkman
  • Like 1
Posted

@chumbucket91Not sure if in the code you can see anything that might cause some of the other polish issues with the flashbombs - such as the bizarre hit detection , "blinded" animation not looping properly on affected ai, and blind timer seemingly not working at all (the default duration for ai to blinded is supposed to be 8 seconds base + 1-4 of random time, but they seem to come out of it in maybe 4)

 

 

-=  IRIS  =-    ♦    = SLL =

Posted (edited)
1 hour ago, OrbWeaver said:
GetMind()->GetState()->GetStr() == "Blinded"

We use string comparisons to check AI states? 😮

Ya I saw that state class and wasn't sure what exactly the canonical way to interact with it was. I imagine there must be a better way - maybe dynamic_pointer_cast<BlindState>(GetMind()->GetState()); would be a better check? But I figured that was best left to the dev who ends up having to compile and implement the change. I wrote it that way just to illustrate the point.
If I end up drafting the actual PR instead of just a forum post, I'll try to do better than string comparison haha - or at least extract the magic string from the class instead of just hard coding it in to the AI code.

 

43 minutes ago, Wellingtoncrab said:

@chumbucket91Not sure if in the code you can see anything that might cause some of the other polish issues with the flashbombs - such as the bizarre hit detection , "blinded" animation not looping properly on affected ai, and blind timer seemingly not working at all (the default duration for ai to blinded is supposed to be 8 seconds base + 1-4 of random time, but they seem to come out of it in maybe 4)

Not sure about the animation loop or the timer, but the bizarre hit detection is probably caused somewhere in https://github.com/stgatilov/darkmod_src/blob/trunk/game/ai/States/State.cpp#L489-L515 . In TDM, it looks like instead of dropping a flashbomb near-ish the AI, you have to drop it inside their vision cone in order for it to be effective, and they also have to pass a line of sight check to the bomb. That... might be too finicky or elaborate for the gameplay purpose of the flashbomb? Maybe it should be simplified to a radius or have more generous vision checks or something - there appears to be an else branch trying to do this in some cases. Or maybe there's a subtle math bug in one of those FOV checks or something?

Edited by chumbucket91
  • Thanks 1
Posted (edited)
28 minutes ago, chumbucket91 said:

In TDM, it looks like instead of dropping a flashbomb near-ish the AI, you have to drop it inside their vision cone in order for it to be effective, and they also have to pass a line of sight check to the bomb. 

FWIW, the former is the way it worked in the original Thiefs as well, I think. Makes perfect sense to me, a flashbomb which isn't exploding in your vision cone won't be as effective.

Edited by chakkman
Posted

Not sure what all it would take but that would be a very welcome addition. Would really boost the utility of the flashbomb.

Modeler galore & co-authors literally everything

 

 

Posted

I like it!

Now we gotta get some mission authors to chime in.

I don't know if any missions that rely on guards being BJ immune during flashbomb for proper difficulty but I'm no expert on difficulty tuning. Probably should have a CVAR to enable the behavior change.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted

As a mission author I always give the player the chance to BJ guards unconscious in dark corners. Flashing them beforehand is just more versatility for the toolkit imo.

Posted
On 5/31/2025 at 12:20 PM, chakkman said:

FWIW, the former is the way it worked in the original Thiefs as well, I think. Makes perfect sense to me, a flashbomb which isn't exploding in your vision cone won't be as effective.

Did some testing on this, and indeed in TG and T2 you have to land the flashbomb in front of the ais. "In front" is pretty generous, though - its like a 180 degree cone. So that part staying as-is in TDM makes sense, and it looks like that's whats intended by this line: https://github.com/stgatilov/darkmod_src/blob/trunk/game/ai/States/State.cpp#L510 (distVec * owner->viewAxis.ToAngles().ToForward() ) > 0 is a vector dot product to figure out that 180 degree cone).

Improving the feeling of flashbombs in general might be a follow up proposal, but I'll keep one improvement suggestion to one topic. It'll be easier to narrow down exactly what else about flashbombs is funky when people have more incentive to use them in FMs and play around with them in the first place!

Posted

The "issue" with the animation at least appears to be on the script side, so even those of us who only know enough to be dangerous can still play with it. In "tdm_ai_base.script" there are blocks to specify how animations are handled when an ai is blinded. It only plays the animation once across the torso and legs channels and the ends regardless if the ai is still blind or not.

Spoiler
void ai_darkmod_base::Torso_Blinded() 
{
    // play the blinded animation
    playAnim( ANIMCHANNEL_TORSO, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_TORSO, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }

    finishAction( "blinded" );
    animState( ANIMCHANNEL_TORSO, "Torso_Idle", 4 );
}

void ai_darkmod_base::Legs_Blinded() 
{
    // play the blinded animation
    playAnim( ANIMCHANNEL_LEGS, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_LEGS, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }

    finishAction( "blinded" );
    animState( ANIMCHANNEL_LEGS, "Legs_Idle", 4 );
}

The result is it that rather quickly after the animation is complete, the ai seems to snap to idle and it is imo very hard to tell what state the ai is actually in. You kind of expect them to snap out of it, but they are actually still blind and just standing there:

I am a very bad scripter, but by copy pasting the torso channel animations a few times and adding some pauses in between for the leg channel you already get what is imo a not perfect but a much more legible "I'm blind" response: The ai is covering their eyes the entire time, they switch between stumbling forward and standing in place, they change direction, etc. You can also much more clearly see the difference from the randomization at the end the blind timer:

Spoiler
void ai_darkmod_base::Torso_Blinded() 
{
    // play the blinded animation
    playAnim( ANIMCHANNEL_TORSO, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_TORSO, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    
    playAnim( ANIMCHANNEL_TORSO, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_TORSO, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    
    playAnim( ANIMCHANNEL_TORSO, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_TORSO, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    
    playAnim( ANIMCHANNEL_TORSO, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_TORSO, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    
    playAnim( ANIMCHANNEL_TORSO, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_TORSO, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    
    finishAction( "blinded" );
    animState( ANIMCHANNEL_TORSO, "Torso_Idle", 4 );
}

void ai_darkmod_base::Legs_Blinded() 
{
    // walk forward play the blinded animation
    playAnim( ANIMCHANNEL_LEGS, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_LEGS, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    // wait a cycle before walking again
    sys.wait(animLength(ANIMCHANNEL_LEGS, "walk_blind") + 0.0166667);
        
    // walk forward play the blinded animation
    playAnim( ANIMCHANNEL_LEGS, "walk_blind" );
    
    while( !animDone( ANIMCHANNEL_LEGS, 4 ) ) {
        // waitFrame();
        sys.wait(0.0166667);
    }
    // wait a cycle before walking again
    sys.wait(animLength(ANIMCHANNEL_LEGS, "walk_blind") + 0.0166667);
    
    finishAction( "blinded" );
    animState( ANIMCHANNEL_LEGS, "Legs_Idle", 4 );
}

Again very bad at scripting. There is probably a much better way to handle this. For example it'd probably be better to pull the blind duration spawnargs from the ai and loop the animations for that length specifically and not repeat so many lines. Maybe introduce some kind of randomization to try and break up the "synchronized swimmer" look.

  • Like 1

-=  IRIS  =-    ♦    = SLL =

Posted
1 hour ago, nightmare said:

Could you also reduce or make a scale from 0-1 how strong is flash screen effect? 

Some games do make it a black flash instead of white in the accessibility options, couldn't be too hard to implement (I say, with no experience in implementing anything).

  • 3 weeks later...
Posted (edited)
On 6/10/2025 at 5:43 AM, Airship-Ballet said:

a black flash instead of white

This might be a thing we can do with modding!

I went digging through the source again because this was hanging in the back of my mind, and there is no actual use of the cvars that are defined in the c++ code for how the player reacts to the flashbomb. Seeing that, I followed that cvar through the scripts in my TDM install instead.
As it turns out, the white flash that occurs when you flash yourself is defined as a gui element in tdm_gui01.pk4\guis\playertools\flashbomb.gui. Most of the lines of this script are defining color values to fade from and to, as vector4's that presumably represent RGBA values. Everywhere in that script that says something along the lines of 

transition backcolor "1 1 1 1" "0 0 0 0" "4000";

, "1 1 1 1" represents fullbright, fully opaque white. Changing that to "0 0 0 1" would be fully opaque black, and doing that across the whole script might just solve the problem.

The going-all-the-way solution would be to change this color value to a cvar that you can set through a menu accessibility option, but it'd probably be simpler to mod it out in the shorter term

Edited by chumbucket91
  • 3 weeks later...
Posted (edited)

I don't have a bugtracker account, so no I don't believe there is any tracking for this. I'd be willing to do the actual write-ups, but I'd need to be inducted as a bugtracker person or have someone paste them in for me. I think I'd make three separate tickets at this point?
1. flashbombed state increases the blackjacking radius (the original post)
2. flashbombed state plays its animations properly (wellingtoncrab's june 9th reply here: https://forums.thedarkmod.com/index.php?/topic/22738-proposal-flashbombed-ais-become-blackjackable/#findComment-502037 )
3. flashbombs deal damage to team 9 enemies (undead, not mentioned here but another glaring issue that makes them less useful than their original TG/T2 incarnations)

Edited by chumbucket91
Posted
9 minutes ago, chumbucket91 said:

I don't have a bugtracker account, so no I don't believe there is any tracking for this.

Since you're a forum member, you should be able to sign up for a bugtracker account easily enough

  • Thanks 1
Posted (edited)

Apparently I don't even need to sign up! I got an error that said something to the effect of "account already exists".

Off I go to make some bugtracker tickets.

EDIT: ...after my real job is done for today. And I play through Year of the Rat

Edited by chumbucket91
  • Haha 1
  • 2 months later...
Posted
On 5/31/2025 at 2:19 AM, chumbucket91 said:

To wit, most people seem to think they're kinda bad because they're just a stun, which still requires you to hide in a very narrow time frame and then wait for the AI to cool off after use. One of the big upsides of flashbombs in TG/T2 was that, if you had alerted human enemies chasing you, you could drop a flashbomb and then turn around and blackjack them to non-lethally remove them from play. It was an inventory-limited opportunity to recover from failure and continue playing the game, as opposed to just reloading a save. This is a fun and proactive interaction, and I propose that we add it to TDM.

I think a first step is to make that timeframe longer. Also the (default) cool-off time should be shorter? Then you can decide if they're still useless.

Apart from that I personally don't like the idea that guards are not knockable when they're alert. To me that is just too far from logical. When they're alert they should do more head/body-turning, etc. to make it harder to knock them out, but you should still be able.

Posted (edited)

I believe we should remind ourselves that flashgrenades in TDM work exactly the same as Deadly Shadows. It seems like the team felt knockouts were too powerful in Thief 1-2 and nerfed both the blackjack and flashgrenades.
TDM found a (improvable, as datiswous and other have said in the past) compromise with the blackjack, but copy-pasted TDS flashgrenades design.

1 hour ago, datiswous said:

I think a first step is to make that timeframe longer. Also the (default) cool-off time should be shorter? Then you can decide if they're still useless.

Searching and Agitated Searching states (Alert 3 and 4) have non-sensical durations, indeed. I've been tweaking their values locally in the file tdm_ai_base.def

"alert_time3" "15" // was 25
"alert_time3_fuzzyness" "3" // was 8

"alert_time4" "30" // was 65
"alert_time4_fuzzyness"    "5" // was 20

But even if you increased the blinded state duration and decreased alert times, you'd still have to wait for guards to calm down, as if you completely screwed up. And even if guards were at alert 3 or 4 when you blind them, does forbidding you a knockout for using a limited tool really add anything to the game flow? I think not.

1 hour ago, datiswous said:

Apart from that I personally don't like the idea that guards are not knockable when they're alert. To me that is just too far from logical. When they're alert they should do more head/body-turning, etc. to make it harder to knock them out, but you should still be able.

Definitely. TDM compromise is still too restrictive for restrictiveness sake. The rules don't specify which alert level counts as "alerted", what counts as "having their weapon out" (Alert 5? The state of raised awareness when they completely cooldown after Alert 4?), and the little differences between bare-headed, helmeted but bare-necked and full-helmeted guards makes the mechanic a PITA: https://wiki.thedarkmod.com/index.php?title=The_Dark_Mod_Gameplay#Blackjacking
@snatcher Classic Blackjack mod doesn't force you to remember obtuse requirements; civilians are free knockouts, guards (bare-headed or "necked") are always knockable from any direction including fleeing, except in Alert 5 (Combat); fully-helmeted guards can only be killed or gased.
At most, TDM core could force knockouts from behind for guards in Alert 4, but that'd be the extent of complexity.

Edited by Taffingtaffer
Posted

The weird thing is, I HAVE blackjacked an alerted, flashbomb blinded enemy in the training mission.

It's very inconsistent though, and I can't reproduce it.

  • Like 1

I always assumed I'd taste like boot leather.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • demagogue

      I saw a let's play video with the indicator that pops up showing the direction for AI barks. This for the record. I hadn't looked into it before and wanted to now, but search terms weren't helping me find info on it in the forum. Could anyone drop a link to a thread or post on it?
      · 2 replies
    • Petike the Taffer

      I think I still have the login details for the Google Account used to log in to The Dark Mod's official YouTube channel. With all the new videos that have been done regarding 2.12 and 2.13, it really feels like it's time for an update. I don't know if logging into another account is going to work, as I've had some issues with it in recent times, but If I manage to do so, I'll do some updating regarding the newer videos.
      · 0 replies
    • The Black Arrow

      New Year Plans:
      Play Thief Gold
      Play Thief 2
      Play Thief 3
      Play Thief Gold...To play "The Black Parade"
      Finally, eat Velvet Cake and...Play The Dark Mod, wooeey!
      · 6 replies
    • DeTeEff

      I've started working on a new mission and today I thought it would be cool to merge it with something I worked on back in 2018...It was back when I thought it was cool to work in "spread out your project like old marmalade on every wall in your house" so it took some time to fix broken assets and optimize file names and material files and those things...But it feels nice to hopefully be able to implement all that effort I put down back then. It will be "något i hästväg" as we say in Sweden 
      · 1 reply
    • BoilerDunce

      I'm very proud to say I've gotten a better PC and can now actually play a lot of the missions I previously had to shelf.
      · 8 replies
×
×
  • Create New...