Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Currently if you are implementing EFX in your map, you need to maintain an .efx file: https://wiki.thedarkmod.com/index.php?title=Setting_Reverb_Data_of_Rooms_(EAX)

If you are using presets only, all this is is simply a 1:1 mapping of location entities to an EFX preset.  Doing this in a file is kind of tedious and error-prone, as you have to check each location entity in your map, and then check the file to make sure you got the location entity name correct, or didn't leave one out, etc.

Would it be a worthwhile feature request to be able to just set the EFX preset with a spawnarg on the location entity itself?  Something like:

"efx_preset"    "WOODEN_SMALLROOM"

Also, the location entity has other zone-related information, like ambient sound, ambient light, etc.  It would just make sense to have the EFX here as well.

This would only make sense for the presets, since you just need the preset name.  If you wanted to do anything more complicated, the file could still be used.  If both are used for the preset, one could take precedence over the other (the spawnarg pehaps).

I don't think anything would need to change in DR either, as it's just a new spawnarg on the entity.

 

 

  • Like 2

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

Posted

On a related note, I would like to be able to change a room's EAX settings on the fly. Currently it's possible to change a room's ambient light and sound by using a script to swap out one atdm:location for another, though you do need to leave through an atdm:locationseparator and come back. However, the EAX settings do not update.

  • Like 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                                                                                                  

                              

Posted
8 hours ago, thebigh said:

Currently it's possible to change a room's ambient light and sound by using a script to swap out one atdm:location for another

I needed this functionality as well, but I found that simply updating the ambient spawnargs on the location entity (via a script) worked fine, although like you said you had to leave and come back into the room.

Anyways, getting slightly off topic :-).

 @stgatilov does the original ask make sense? I'm never sure if we should wait and hope for the dev team to see these, or just add a feature request to the bugtracker....

  • Like 1

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

Posted
46 minutes ago, stgatilov said:

Yes, I think it is possible to specify efx preset in location entity.

Probably worth it to implement cross-fading of EFX settings simultaneously.
 

Thank you - feature request here: https://bugs.thedarkmod.com/view.php?id=6273

  • Like 1

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

Posted

That'd be a great idea.

To dynamically change EFX, we have to know that it's a dynamic feature and not one permanently set during dmap or spawn time.

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Posted
On 3/19/2023 at 12:55 AM, Frost_Salamander said:

I found that simply updating the ambient spawnargs on the location entity (via a script) worked fine, although like you said you had to leave and come back into the room.

True. However, if the EFX settings are read from a file I think you'd need to pull the switcheroo script trick because those are determined by the name of the atdm:location entity. I suspect that changing its name spawnarg during play would be asking for all sorts of trouble.

  • Like 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                                                                                                  

                              

Posted
15 hours ago, thebigh said:

True. However, if the EFX settings are read from a file I think you'd need to pull the switcheroo script trick because those are determined by the name of the atdm:location entity. I suspect that changing its name spawnarg during play would be asking for all sorts of trouble.

Well you don't need to change the name of the entity, only the ambient/ambient_light spawnargs on it.  That's what I did anyways.

I did actually try the 'switcheroo' trick first, but kept getting errors about multiple entities with the same name even though I was removing the old one first.  No idea why.  Then I tried the spawnarg thing and that worked so I left it at that.

  • Like 1

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

Posted

If you're not using a preset, a custom EFX setting read from the file looks something like this:

eaxreverb "loc_streets_alcove_1" {
    density                    0.576
    diffusion                  0.633
    gain                       0.3162
    gainhf                     0.7655
    gainlf                     0.769
    decay_time                 1.79
    decay_hfratio              0.6267
    decay_lfratio              0.4433
    reflections_gain           0.4281
    reflections_delay          0.0167
    reflections_pan            0 0 0
    late_reverb_gain           0.9058
    late_reverb_delay          0.0133
    late_reverb_pan            0 0 0
    echo_time                  0.218
    echo_depth                 0.1
    modulation_time            0.25
    modulation_depth           0
    air_absorption_gainhf      0.9905
    hfreference                10364
    lfreference                192.2
    room_rolloff_factor        0
    decayhf_limit              1
}

where loc_streets_alcove_1 is the name of the atdm:location entity for that location. If you wanted to change such an EFX during play you would need another entry in the file, then refer to it by either changing the name of the location entity (BAD!) or exchanging one for another.

  • Like 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                                                                                                  

                              

  • 2 weeks later...
Posted
On 3/19/2023 at 12:55 AM, Frost_Salamander said:

I found that simply updating the ambient spawnargs on the location entity (via a script) worked fine

How did you get this to work? I cannot get the sound to update by scripting this sort of thing:

$location_room1.setSpawnArg( "ambient", "snd_somenewsound" );

if location_room1 is a location_info entity and snd_somenewsound has been defined in the atdm:location_settings entity. It just goes back to playing the original sound when I go back into room1.

  • Like 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                                                                                                  

                              

Posted
5 hours ago, thebigh said:

How did you get this to work? I cannot get the sound to update by scripting this sort of thing:

$location_room1.setSpawnArg( "ambient", "snd_somenewsound" );

if location_room1 is a location_info entity and snd_somenewsound has been defined in the atdm:location_settings entity. It just goes back to playing the original sound when I go back into room1.

I used setKey() instead of setSpawnArg(). Not sure what the difference is but it worked.

  • Like 2

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

Posted

Yep, that did the trick. Thanks!

  • Like 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                                                                                                  

                              

  • 1 year later...
Posted (edited)
On 3/17/2023 at 11:50 PM, Frost_Salamander said:

Currently if you are implementing EFX in your map, you need to maintain an .efx file: https://wiki.thedarkmod.com/index.php?title=Setting_Reverb_Data_of_Rooms_(EAX)

If you are using presets only, all this is is simply a 1:1 mapping of location entities to an EFX preset.  Doing this in a file is kind of tedious and error-prone, as you have to check each location entity in your map, and then check the file to make sure you got the location entity name correct, or didn't leave one out, etc.

Would it be a worthwhile feature request to be able to just set the EFX preset with a spawnarg on the location entity itself?  Something like:

"efx_preset"    "WOODEN_SMALLROOM"

Also, the location entity has other zone-related information, like ambient sound, ambient light, etc.  It would just make sense to have the EFX here as well.

This would only make sense for the presets, since you just need the preset name.  If you wanted to do anything more complicated, the file could still be used.  If both are used for the preset, one could take precedence over the other (the spawnarg pehaps).

I don't think anything would need to change in DR either, as it's just a new spawnarg on the entity.

 

 

@stgatilov @nbohr1more I'm wondering if it would be possible to get this implemented for 2.13?  I'm really not loving the EFX files - it's way too easy to miss/forget locations and just a general PITA.

I am even considering offering to help implement - any reluctance on my part is purely down to lack of confidence.  But with some hand-holding I could possibly accomplish something that isn't a total disaster.

Maybe an alternative is to have a feature that allows DR to manage the EFX preset in the EFX file?  Basically what I'd like is to be able to manage everything related to a location entity in the one place, preferably in DR.   Not sure if that's ever been considered? @greebo?

Edited by Frost_Salamander
  • Like 2

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

Posted
23 hours ago, Frost_Salamander said:

@stgatilov @nbohr1more I'm wondering if it would be possible to get this implemented for 2.13?  I'm really not loving the EFX files - it's way too easy to miss/forget locations and just a general PITA.

I am even considering offering to help implement - any reluctance on my part is purely down to lack of confidence.  But with some hand-holding I could possibly accomplish something that isn't a total disaster.

Maybe an alternative is to have a feature that allows DR to manage the EFX preset in the EFX file?  Basically what I'd like is to be able to manage everything related to a location entity in the one place, preferably in DR.   Not sure if that's ever been considered? @greebo?

If you wanna put together a prototype implementation, we could provide assistance. I think it mostly just requires adding EFX parser parts to the entity def parser. The big wrinkle is what to do if a mission has both EFX and Entity Def args?

  • Like 1

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 (edited)
On 3/18/2023 at 12:50 AM, Frost_Salamander said:

Doing this in a file is kind of tedious and error-prone, as you have to check each location entity in your map, and then check the file to make sure you got the location entity name correct, or didn't leave one out, etc.

Maybe it's possible to make a script that extracts all the info_locations from the map file and creates an efx file from that in the correct format (run again to update). Then you can simply fill it in. Possibly you could also edit in DR the efx-data as a fake spawnarg for that info_location entity and make the script write that to the efx file.

This might also be possible via a script/plugin inside DR.

image.thumb.png.d0a86cd74f91439fd4af8034a31a0433.png

Edited by datiswous
  • Like 3
Posted
7 minutes ago, datiswous said:

This might also be possible via a script/plugin inside DR.

This should definitely be possible.  The python scripting API has functions to loop through entities and read their spawnargs, and then you could use standard python file functions to write the EFX file.

It would be cool to have a proper EFX editor in DR, but writing a script would be a lot less work.

@Frost_Salamander if you decide to write a script like this I'd be happy to help you out if you get stuck.  You can check out count_loot.py for a minimal example of looping through entities.

 

  • Like 4
Posted

The script might not be too far off what I was thinking anyways, because one of the reasons I wanted to be able to do it in DR is because you could then have a test script like 'Check for missing EFX on info_location entities'.  So maybe we can just have a script called 'generate EFX file' or something like @datiswous is suggesting.

The problem is that if feels a bit like a halfway house instead of a proper implementation.  Also I think we all could probably agree the EFX file will never go away in case people want to do more than just presets, so we would have to support both the info_location method and the file method.

Just thinking out loud here, and good discussion 👍

  • Like 2

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

Posted
On 5/12/2024 at 1:37 PM, Frost_Salamander said:

I am even considering offering to help implement - any reluctance on my part is purely down to lack of confidence.  But with some hand-holding I could possibly accomplish something that isn't a total disaster.

Do you really want to try? 🤩

I'd suggest looking at idSoundWorldLocal::MixLoopInternal.
That seems to be the only place where effect is found by area index, then by area name, then default.
If you manage to add a member like idSoundWorldLocal::listenerEfxPreset and ensure it is set properly, then you most likely can pass the preset name here (perhaps via something like idEFXFile::FindPreset).

In my opinion, the location spawnarg should get top priority.
If missing or empty, then the ordinary approach with .efx file works.

 

  • Like 2
Posted
5 hours ago, Frost_Salamander said:

Also I think we all could probably agree the EFX file will never go away in case people want to do more than just presets, so we would have to support both the info_location method and the file method.

 

I use custom EFXs heavily, so I for one would not want to be restricted entirely to presets.

  • Like 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                                                                                                  

                              

Posted (edited)
18 hours ago, Frost_Salamander said:

Also I think we all could probably agree the EFX file will never go away in case people want to do more than just presets, so we would have to support both the info_location method and the file method.

It would be nice to be able to create your own EFX presets, this will solve that issue.

https://github.com/kcat/openal-soft/blob/master/include/AL/efx-presets.h lists all the presets. Here they can be seen in the tdm source file. I think these could be read from an external file instead of inside game code? If TDM reads the presets from an external file, anyone could easilly make their own presets by overriding that file and these could be used inside a spawnarg when that gets implemented.

Edited by datiswous
  • Like 1
  • 4 weeks later...
Posted

Right now there is a working implementation by @Frost_Salamander of the following.
If you add spawnarg "efx_preset" "WOODEN_SMALLROOM" to location entity, then this preset will be used for this location.

The main issue with this implementation is that you can only specify predefined presets. If you want to assign custom-made EFX to several locations, you have to copy/paste it in .efx file as you do it now.


There is another idea which looks like this:

  1. You can set spawnarg "efx" "MyCosyAttic" on location entity "loc15", then it will use effect named "MyCosyAttic" instead of effect named "loc15".
  2. For each builtin preset like "WOODEN_SMALLROOM" engine automatically defines efx effect named "preset_WOODEN_SMALLROOM". So if you don't want to have .efx file, you can use spawnarg "efx" "preset_WOODEN_SMALLROOM" straight on location entity.

The only downside of this idea is that you still cannot define new presets. But you can share effects between locations.


Do we have mappers who want to write custom efx effects and want to share them between locations?
Or is the first solution with "efx_preset" enough for us for the years to come?
Or maybe someone wants to be able to define custom presets and we should think on another proposal?

  • Like 1
Posted

@kingsal likes to use custom EFX so he's probably the best audience here but I think presets with locations are enough as long as the old def file method still works and both can be used in the same mission with precedence given to def file.

  • Like 1

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
1 hour ago, nbohr1more said:

with precedence given to def file.

Any reason for this? Right now precedence is given to the spawnarg, as this would potentially enable us to do dynamic EFX.  

  • Like 1

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

Posted
1 hour ago, Frost_Salamander said:

Any reason for this? Right now precedence is given to the spawnarg, as this would potentially enable us to do dynamic EFX.  

When you use the location system, all attributes have a default value so if the location entity took precedence a Null EFX preset would take precedence over a carefully created EFX def.

  • Like 1

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...)

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

    • Goblin of Akenash

      Goblin-Secrets episode 2 is out now!
       
      · 3 replies
    • Airship-Ballet

      https://www.twitch.tv/airshipballet2 There was a mapping stream here, it's gone now.
      · 8 replies
    • peter_spy

      Stumbled upon a documentary on Enki Bilal, he is one of the most influential comic book artists of my adolescence. English auto-subtitles is rubbish, so you might need to brush up on your French
      · 3 replies
    • Goblin of Akenash

      Today I did a bit of an experiment! I wanted to see if I could get a dark radiant map into garry's mod, the quickest and dirtiest and not-workiest method is "OBJ2VMF" which converts .obj models into VMF files for hammer to then compile, the way its supposed to work is that you input a 6 sided cube and it turns it into a 6 brush room (not exactly ideal for this since that's not how TDM maps work, this honestly would have been a better idea with any thief game from 1 to the one from 2014 since they all work like that) so what ended up happening was that for every brush there was 6 brushes would be ontop of that almost inflating everything in the map like a balloon, map scale was also an issue that I couldn't fine-tune easily either so the scale is way off ontop of everything being inflated making the space inside the map very tiny! anyways heres the result of that and it looks almost nothing like footloose (plus I did add a bunch of random props in gmod for funsies and better visibility since the process involved replacing all the textures with dev ones that look very flat when in full-bright)

      https://streamable.com/ctmh58

      (streamable link will expire in 2 days but I'll have a spoken word version of this post along side the video and other fun images relating to the bsp inflation effect in the next "Goblin Secrets" video next month)
      · 0 replies
    • Frost_Salamander

      @taaaki Wiki seems broken. Main page works but click any link and:

      · 2 replies
×
×
  • Create New...