Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Getting FollowActorTask to work with the player is probably a good bugtracker request.

BTW, I was curious about the behavior. It seems the follower gets as close as 60 units by walking, then stops. If the distance is over 480 units, the follower runs until within 180, then resumes walking. Given by these constants:

#define DISTANCE_FOLLOWER_REACHED                        60
#define DISTANCE_FOLLOWER_CATCHUP_DISTANCE                480
#define DISTANCE_FOLLOWER_CLOSE_ENOUGH_TO_STOP_RUNNING    180

I don't know if there's a means to tell the follower, "stop following, go to some path node".

Link to comment
Share on other sites

1 minute ago, Geep said:

Getting FollowActorTask to work with the player is probably a good bugtracker request.

BTW, I was curious about the behavior. It seems the follower gets as close as 60 units by walking, then stops. If the distance is over 480 units, the follower runs until within 180, then resumes walking. Given by these constants:

#define DISTANCE_FOLLOWER_REACHED                        60
#define DISTANCE_FOLLOWER_CATCHUP_DISTANCE                480
#define DISTANCE_FOLLOWER_CLOSE_ENOUGH_TO_STOP_RUNNING    180

I don't know if there's a means to tell the follower, "stop following, go to some path node".

Since you're looking already, can you tell if there is an obvious reason why it doesn't work with the player?

TDM Community Github: https://github.com/thedarkmodcommunity

My fan missions: The Hare in the Snare, Part 1

The Lieutenant Series: In Plain Sight  High Expectations Foreign Affairs

Link to comment
Share on other sites

...double post sorry...

Edited by thebigh
double post

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

2 hours ago, Geep said:

Possibly the reason this doesn't work is because the FollowActorTask code screens out actors that are NULL, AI_DEAD, or AI_KNOCKEDOUT.

 

So giving it none of those tags, but making the AI invisible, silent, non-solid, and on a team neutral to everyone would not work? Oh well, it was a horrible inelegant idea anyway.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

6 hours ago, Frost_Salamander said:

Since you're looking already, can you tell if there is an obvious reason why it doesn't work with the player?

Sorry, I was only reading the static code with limited understanding. It references the idActor class, so which does include the player, so it would seem it should work with the player. If it doesn't, it probably needs someone with the code in the debugger (i.e., not me) to figure out why.

4 hours ago, thebigh said:

So giving it none of those tags, but making the AI invisible, silent, non-solid, and on a team neutral to everyone would not work? Oh well, it was a horrible inelegant idea anyway.

Yeah, but then the AI wants to move on it's own, so how can it be bound to the player without messing the player up? Sounds like a 3-legged race!

Link to comment
Share on other sites

Is there a way to make a specific light not contribute to the dynamic ambient lighting?

 

I'm using Sotha's old technique of binding a very dim light to the player's head so you can faintly see a little way ahead of you in darkness, but obviously this should not affect the real ambient in any way. More importantly, if I use any ambient_light_falloff other than zero alongside the nightvision light, the results are completely insane and psychedelic- no doubt caused by divide-by-zero errors due to the nightvision light being at zero distance from the camera.

 

heir(2023-06-0615-13-49)(-270.61218.56444.81).thumb.jpg.eeaf52db1aaa1304116a168431318264.jpg

 

Ew yuck.

Edited by thebigh

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

9 hours ago, thebigh said:

Is there a way to make a specific light not contribute to the dynamic ambient lighting?

 

I'm using Sotha's old technique of binding a very dim light to the player's head so you can faintly see a little way ahead of you in darkness, but obviously this should not affect the real ambient in any way. More importantly, if I use any ambient_light_falloff other than zero alongside the nightvision light, the results are completely insane and psychedelic- no doubt caused by divide-by-zero errors due to the nightvision light being at zero distance from the camera.

 

heir(2023-06-0615-13-49)(-270.61218.56444.81).thumb.jpg.eeaf52db1aaa1304116a168431318264.jpg

 

Ew yuck.

Look into the script call setLightgemModifier. It's used in the lantern (see tdm_playertools.script). You could make your light kind of like another lantern, but this one with no or little effect on the light gem.

Link to comment
Share on other sites

The lit-up light gem isn't caused by the nightvision light directly (I put ai_see 0 on it) but by its interaction with the dynamic ambient lighting. The dynamic ambient lighting adds a bit of extra ambient to a room depending on the brightness of the light sources that are in it, so that a flickering fireplace will also cause subtle variations in the brightness of shadowed corners, not just the areas that are directly illuminated. If you set ambient_light_falloff to something other than zero, the strength of this dynamic effect also depends on your proximity to the light sources. The wiki says this looks better than the default, and I agree.

I've really been working hard on lighting in my latest level. Specifically I want deep shadows punctuated by smallish light sources and generally low ambient to avoid that milky, washed-out look you get with high ambient. In the darkest areas I want to use the nightvision to stop the player getting lost in pitch blackness. Obviously if I have a faint light strapped to my head, an ambient_light_falloff that brightens the ambient for nearby lights is going to defeat the purpose. What I really need is a spawnarg that tells the nightvision light not to contribute anything to the dynamic ambient. Is there anything like that?

I also think ambient_light_falloff is a bit bugged. There's supposed to be a cap, by default rgb(0.1, 0.1, 0.1), on the absolute brightest the dynamic ambient can get. However, I'm routinely exceeding that for my setup.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

I want some guards to react to an alarm. Specifically, I want them to go to the room where the alarm is going off. I tried using the alarm technique, but that just alerts the guards where ever they are - they just look around in place, they don't head to the source of the alarm. I tried using path nodes - specifically, I set alert_idle_only on a path_corner, hoping the guard would head there when he was alerted. But, it turns out alert_idle_only is based on HasEvidence, and this flag is not set when the AI is alerted by noise. (it is based on the following:

return memory.enemiesHaveBeenSeen
        || memory.hasBeenAttackedByEnemy
        || memory.itemsHaveBeenStolen
        || memory.itemsHaveBeenBroken
        || memory.unconsciousPeopleHaveBeenFound
        || memory.deadPeopleHaveBeenFound
        || spawnArgs.GetBool("alert_idle", "0")

)

Anyone know of a technique for getting guards to converge on the source of an alarm?

EDIT: I found this: https://wiki.thedarkmod.com/index.php?title=Path_Nodes#Switching_Immediately_(TDM_2.08+)

It works by itself - the guard will be alerted and run to the room. But, in combination with the alarm bell, it confuses him, and he stops and searches. So I think I'll use that technique to switch his path, and then make the alarm not audible by AIs (since it doesn't do what I want).

EDIT #2: I'm still struggling with this, so if anyone has any ideas or techniques, please let me know.

Edited by joebarnin
additional info
Link to comment
Share on other sites

Your approach is basically how I did it with the custom AI alert behaviour in Iris. You can only steer AIs while they're unalerted, so my script would tell them to approach the source of the commotion. Once they come close enough to see the problem, TDM's stock AI routines would take care of the rest.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Is there a spawnarg or other simple way to have a fog light be turned off when the mission starts? I just want the fog to turn on when the player enters a particular area.  I have a call_on_entry to trigger it, but it needs to be off to start with or I get the opposite result. 💭

  

Link to comment
Share on other sites

That turns out to be not completely trivial. You can use the start_off spawnarg on the foglight to have the fog be turned off at map start, but this just turns the grey fog into black fog. I doubt if that's what you want, so don't use that spawnarg.

With a little bit of scripting to hack the foglight radius, you can fake it pretty convincingly though.

Suppose your foglight has a radius of 1024, that is, shaderParm3 = 1024 on your foglight. Then put the following in your script file:

float foglightradius = 1024;

void toggle_fog() {
    foglightradius = 10000000 - foglightradius;
    $foglight.setLightParm( 3, foglightradius );
    $foglight.activate($player1);
    return;
}

We'll turn the fog off at map start; make an atdm:target_callscriptfunction entity that calls the toggle_fog() function, go to any worldspawn brush and target that entity from it. That'll call the script once the moment the level starts and switch off the fog. Crucially, it will also set the fog radius to 9998976, which is huge and will make the fog almost completely transparent so the fact that it's now black fog instead of grey will be almost imperceptible.

When you want to turn the fog back on, call the script again from trigger_once or whatever you're using, and it'll switch the light on and restore the fogradius to 10000000-9998976 = 1024.

  • Thanks 2

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

2 hours ago, grodenglaive said:

Is there a spawnarg or other simple way to have a fog light be turned off when the mission starts? I just want the fog to turn on when the player enters a particular area.  I have a call_on_entry to trigger it, but it needs to be off to start with or I get the opposite result. 💭

  

If you don't want to try the script solution as described in the post above, you can try the following

1. Create a blue room far away from the map and put the fog light in it

2. Place an atdm:teleport entity at the fog light position in your map

3. Let the atdm:teleport target the fog light in the blue room

4. Trigger the atdm:teleport entity with a trigger_once entity or whatever you have in mind.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, JackFarmer said:

If you don't want to try the script solution as described in the post above, you can try the following

1. Create a blue room far away from the map and put the fog light in it

2. Place an atdm:teleport entity at the fog light position in your map

3. Let the atdm:teleport target the fog light in the blue room

4. Trigger the atdm:teleport entity with a trigger_once entity or whatever you have in mind.

This would also have the advantage that the foglight wont be contributing to an extra rendering pass of everything it touches in the map, even if its transparency were ultra high. IIRC a foglight added 1000+ drawcalls to the Perilous Refuge harbour scene.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, thebigh said:

That turns out to be not completely trivial. You can use the start_off spawnarg on the foglight to have the fog be turned off at map start, but this just turns the grey fog into black fog. I doubt if that's what you want, so don't use that spawnarg.

With a little bit of scripting to hack the foglight radius, you can fake it pretty convincingly though.

Suppose your foglight has a radius of 1024, that is, shaderParm3 = 1024 on your foglight. Then put the following in your script file:

float foglightradius = 1024;

void toggle_fog() {
    foglightradius = 10000000 - foglightradius;
    $foglight.setLightParm( 3, foglightradius );
    $foglight.activate($player1);
    return;
}

We'll turn the fog off at map start; make an atdm:target_callscriptfunction entity that calls the toggle_fog() function, go to any worldspawn brush and target that entity from it. That'll call the script once the moment the level starts and switch off the fog. Crucially, it will also set the fog radius to 9998976, which is huge and will make the fog almost completely transparent so the fact that it's now black fog instead of grey will be almost imperceptible.

When you want to turn the fog back on, call the script again from trigger_once or whatever you're using, and it'll switch the light on and restore the fogradius to 10000000-9998976 = 1024.

thanks, that's a big help!

Link to comment
Share on other sites

1 hour ago, Dragofer said:

This would also have the advantage that the foglight wont be contributing to an extra rendering pass of everything it touches in the map, even if its transparency were ultra high. IIRC a foglight added 1000+ drawcalls to the Perilous Refuge harbour scene.

That's a lot of drawcalls, this sounds like the way to go then.

Link to comment
Share on other sites

Yeah, I guess physically moving the foglight away is more efficient. It might still be worth remembering the scripting methods as it does allow finer control over the fog than just turning it on and off.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

7 hours ago, thebigh said:

Yeah, I guess physically moving the foglight away is more efficient. It might still be worth remembering the scripting methods as it does allow finer control over the fog than just turning it on and off.

definitely good to know. One question: why does the toggle reference the player?

$foglight.activate($player1);

 

Link to comment
Share on other sites

2 hours ago, grodenglaive said:

definitely good to know. One question: why does the toggle reference the player?

The .activate() function requires some entity as its argument- I guess some applications of triggering something may need it. For this application it seems not to matter, so I just give it the name of an entity that I know definitely exists.

Edited by thebigh
  • Thanks 1

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

How do I get the spider_child to patrol? It just wanders around aimlessly. I've made sure the Patrol spawnarg is on and the Animal_Patrol spawnarg is off, and it can chase me all along the path I've set for it if I let it spot me. A human, which also uses the AAS32, can manage the patrol route, so I cannot understand why the spider is having trouble. And, weirdly, if I use the console to set the timescale to anything higher than 1 [i]then[/i] the spider will start walking to the path_corners. How do I fix this?

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

I had a look at the C++ code, here's what I found (I'm no expert). There is code that attempts to deal with AI being blocked when on a path. Specifically, MovementSubsystem::CheckBlocked has this line:

if (traveledPrev < 0.1) // movement is very close to zero

traveledPrev is the distance travelled during the previous cycle. If this check is true, the system thinks that the AI might be blocked, and it starts processing movement a bit differently. With most AI, their walking speed is such that this check only happens when they bump into something. But the spider_child walks so slowly that sometimes this check happens even when isn't blocked. I think that's what is happening here - normal walking by the spider results in the movement subsystem thinking that the spider is blocked, so it has the spider back up and try a different path. So the spider looks like it is doing an animal patrol.

The walking speed of an AI is determined by its walking animation. To test my theory, I made a custom spider_child that uses the ai_spider's animation, and sure enough, it followed the corner paths correctly (because it is walking faster). The downside is, the spider_child looked weird as heck, because the animation is made for a larger spider. So this really isn't a solution. Maybe the spider_child animation needs to be modified (sped up)? Or the code needs to handle slower creatures? I don't know.

This explains why your timescale change allowed the spider to follow the paths - by speeding it up, it was moving fast enough to avoid that check in the C++ code.

Edit: If you set "anim_rate_walk" to 1.6 or greater on the spider_child, it seems to work fine. Give it a try.

Edited by joebarnin
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

It seems like that could be easily fixed by making the traveledPrev cutoff some fraction of the AI's walking speed rather than a hard-coded "magic number".

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

When you pick up an inventory object it will display a message like "Acquired MacGuffin". Is there a way to turn that message off for specific items? I'd like to handle it with my own scripts and UI.

Edited by thebigh

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

  • 4 weeks later...

Sound shaders used in conversations are given the reverb effect defined in the associated efx file for the defined info location.

If you have a room with an intense reverb (example: efx cathedral), then the voice files are sometimes not easy to understand. If you could use a different reverb for the voice files (then maybe exf Medium Stone Room), it would be more understandable again.

Question: Is it possible to define a different reverb effect independent from the Info Location for such voice files?

It wouldn't help if I converted the voice files with a more "understandable" reverb using an editing program, because the defined room reverb via the Info Location would still be applied, which would probably only make things worse.

@nbohr1more

Link to comment
Share on other sites

2 hours ago, JackFarmer said:

Sound shaders used in conversations are given the reverb effect defined in the associated efx file for the defined info location.

If you have a room with an intense reverb (example: efx cathedral), then the voice files are sometimes not easy to understand. If you could use a different reverb for the voice files (then maybe exf Medium Stone Room), it would be more understandable again.

Question: Is it possible to define a different reverb effect independent from the Info Location for such voice files?

It wouldn't help if I converted the voice files with a more "understandable" reverb using an editing program, because the defined room reverb via the Info Location would still be applied, which would probably only make things worse.

@nbohr1more

Im not sure if you can setup a different efx for the conversation sound shader. However I'm sure you can disable efx for the necessary shader completely. This may help.

If it sounds too strange having no efx at all then you need to add a manual reverb into your wav sound files.

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

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

    • Sotha

      WIP mission name confirmed: "The Last Offering"
       
      · 5 replies
    • Sotha

      Today I started writing readables for my WIP mission.
      I wrote my usual text and then crammed it into AI and boom, high quality stuff comes out.
      I used to say that clipper is the mappers best friend, but now it seems it is more like "AI is the mappers best friend."
      · 2 replies
    • The Black Arrow

      Just saw further into 2.13 development, or is it 2.14? Anyway, proper Parallax Mapping...Absolutely fuck yes, please!
      · 2 replies
    • nbohr1more

      Happy Halloween! "Gem of Souls" is out:
       
      Psst, someone let Darkfate know...
      · 1 reply
    • The Black Arrow

      Is there a thread for "Moving Day 2: Look Who's Moving Now"? If not, could someone hint me on what is Dick's birthday? This mission is quite enjoyable on its disturbing creepy implications.
      · 3 replies
×
×
  • Create New...