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

    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 3 replies
    • Goblin of Akenash

      My mapping discord if anyone is interested, its more of a general modding thing rather than just for TDM 
      https://discord.gg/T4Jt4DdmUb

       
      · 0 replies
    • nbohr1more

      2.13 Moddb Article is up: https://www.moddb.com/mods/the-dark-mod/news/the-dark-mod-213-is-here
      · 1 reply
×
×
  • Create New...