Jump to content

Issues with archive chandelier sounds (and cave lights)


hoxi
  • Fixed

Something I noticed a while back and forgot to report, and got reminded of now with archive_chandelier.lua getting some nice updates, is that archive chandeliers, and the new vault ones from the beta, play some ambience sounds on entity wake that likely belong to cave lights:

local function OnEntityWake(inst)
    inst.SoundEmitter:PlaySound("dontstarve/AMB/caves/forest_spot", "loop")
end

local function OnEntitySleep(inst)
    inst.SoundEmitter:KillSound("loop")
end

 

Meanwhile.. cave lights (and book lights) play chandelier sounds:

local function OnEntityWake(inst)
    inst.SoundEmitter:PlaySound("grotto/common/chandelier_LP", "loop")
end

local function OnEntitySleep(inst)
    inst.SoundEmitter:KillSound("loop")
end

(which I should note, sounds like something burning, while the other one sounds like muffled forest sounds)

 

The thing is, chandeliers also already play that same burning sound with some different (and slightly erroneous) logic:

-- NOTE: this doesn't account for entity sleep, so sounds play at all times, which isn't good
local function firesound(inst, setting)
    if inst.sfxprop then
        if setting > 0 then
            if not inst.sfxprop.SoundEmitter:PlayingSound("firesfx") then
                inst.sfxprop.SoundEmitter:PlaySound("grotto/common/chandelier_LP", "firesfx")
            end
            inst.sfxprop.SoundEmitter:SetParameter("firesfx", "intensity", setting)
        else
            inst.sfxprop.SoundEmitter:KillSound("firesfx")
        end
    end
end

 

Ideally, the chandeliers should not play the ambience sound at all, and should let their sfxprop entity handle things (just ensure that enttiy sleep status is accounted for, to not play sounds when off screen).

And cave lights and book lights should finally have their sound corrected to use the muffled forest ambience sound, as a burning sound really makes no sense.

Maybe play no sound for book lights in the forest shard because, well, that's already in the forest shard, or maybe let a different unique sound play for these in both shards, or let them be the only exception where the burning sound is used instead? Just throwing some ideas for that one.


Steps to Reproduce

Chandeliers:

  • Walk near one, even if it's off.
  • Notice how they always play some subtle forest ambience sounds.
  • Also notice how their sfxprop entity will play the actual chandelier burning sounds separately, but even when asleep/unloaded.

Cave lights and book lights:

  • Walk near one.
  • Notice how they play the same chandelier burning sound that chandeliers have when they're on, rather than the likely more intended muffled forest ambience.



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Just bumping this to point out a little issue that got introduced since this got addressed, for booklights.

The kill task now properly calls the FadeOut function instead of just instantly removing the entity, but this function doesn't actually remove the entity, and it'll persist until the server is stopped. I'm also unsure if this can eventually crash due to some of the values going up or down infinitely, and being applied to the light.

local function FadeOut(inst)
    local radius = 3
    local intensity = 0.85
    local falloff = 0.3

    inst.AnimState:PlayAnimation("off")
    inst.persists = false

    inst:DoPeriodicTask(FRAMES, function()
        radius = radius - (3/21)
        intensity = intensity - (0.85/21)
        falloff = falloff + (0.3/21)
        inst.Light:SetRadius(radius)
        inst.Light:SetIntensity(intensity)
        inst.Light:SetFalloff(falloff)
    end)

    --inst:DoTaskInTime(7 * FRAMES, inst.Remove)
end

If the unused 7 * FRAMES removal doesn't look smooth, you could make the periodic task itself check for when to remove maybe? Once radius reaches 0 or a certain value, disable the light and stop tweaking its values, then after a few more frames, remove the entity?

Also the FadeOut function itself could just remove the entity immediately if asleep.

 

Also, even smaller, but I noticed there's no point in keeping the OnEntityWake and OnEntitySleep functions. You could keep them there, but commented out for reference.

local function OnEntityWake(inst)
    -- Don't play any sound. This is a 'fake' opening.
    --inst.SoundEmitter:PlaySound("dontstarve/AMB/caves/forest_spot", "loop")
end

local function OnEntitySleep(inst)
    inst.SoundEmitter:KillSound("loop")
end

But don't set them in the prefab constructor as they basically don't do anything.

    inst.OnEntitySleep = OnEntitySleep
    inst.OnEntityWake = OnEntityWake

This also makes me think that a SoundEmitter might not even be needed for this entity if it won't play sounds anymore.

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...