Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 7

Author Topic: SoundSense-RS: SoundSense clone, written in Rust  (Read 40702 times)

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #45 on: February 27, 2020, 12:53:36 am »

What version of Windows/MacOS are you using? What are your machine's specs?
How did you profile the cpu usage? Does it use the cpu at 100% all the time, or some of the time?
How are you opening DF? Which version of the soundpack are you using? Could you upload the gamelog.txt somewhere?
If possible, could you open an issue on the github repository?
« Last Edit: February 27, 2020, 01:03:27 am by prixt »
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

thurin

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #46 on: February 27, 2020, 01:11:35 am »

What version of Windows/MacOS are you using? Does it use the cpu at 100% all the time, or some of the time?
How are you opening DF? Which version of the soundpack are you using?
If possible, could you open an issue on the github repository?

MacOS is Catalina 10.15.3.  I've tried with both the 1.4.5 that's included in the Lazy Mac Pack alpha and downloaded 1.4.6 from github.  I've also cloned it from github and run it via cargo.  It hits 100% as soon as it fires up and is constant.  It works, at least until the fans kick in and drown out the sound.  I've tried both opening DF from the LNP and running ./dfhack from terminal and starting soundsense-rs from LNP and from terminal as well.

Windows 10.  I'm not at that system so can't get specifics on version but see the same constant 100%
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #47 on: February 27, 2020, 01:59:28 am »

Just released v1.4.7
This should reduce CPU usage. Guess running two loops in parallel constantly does that :P
Thank you for bringing this issue up!
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

thurin

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #48 on: February 27, 2020, 02:06:53 am »

Just released v1.4.7
This should reduce CPU usage. Guess running two loops in parallel constantly does that :P
Thank you for bringing this issue up!

I grabbed the commit and it's tons better!  Thanks!
Logged

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #49 on: February 27, 2020, 05:10:50 am »

Probably doesn't matter any more, but the high CPU usage started with v1.4.4 release. (1.4.4 alpha 5 was normal CPU usage.)
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #50 on: February 27, 2020, 08:04:50 am »

Yeah, that makes sense. Previously I've been using a crate(library) to monitor whether the gamelog was altered, which created a bottleneck.
I've replaced it with a simple buffered reader. This made things faster, but apparently made the sound loop run constantly without break...
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

Alatun

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #51 on: February 27, 2020, 02:40:29 pm »

SoundSense RS is working pretty well for me so far. Maybe an idea for improvement:

What I noticed: each time a save it being loaded the same music file gets played. Because I'm saving at the beginning of each season (and loading this save immediately), this means I don't ever hear the sounds associated with each season. It also get a bit annoying to always hear the same sounds.

Perhaps an idea for getting some variation into playing sounds. I don't know how SoundSense works internally. So I'm just guessing: Each time SoundSense starts it collects information from the XML files and depending on certain events written to the game log a sound is chosen and being played. Probably there are sounds associated with "short events" (an animal gets butchered, poults are hatching, ...) and "longer events" (season spring has started) these sounds may be played simultaneously.

Perhaps it would be possible to track, which of the files for "longer events" have been played during this session and choosing a sound that has not been played (or has been played less often) during the current session. With "session" I mean the time SoundSense is running. Maybe it's also possibly to detect if a sound for a "longer event" got interrupted and this file can be resumed (happens when saving and loading this save).

Logged

jecowa

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #52 on: February 27, 2020, 03:34:58 pm »

As a workaround, you could write a shell script for each season that writes the season change message to your gamelog.txt. After saving the game, reload the save, pause it (if it isn't already), and run the script for the appropriate season to start the music.
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #53 on: February 27, 2020, 05:30:32 pm »

I think DFHack already does that; on load, it checks the latest season and weather and writes it into the game log, so SoundSense plays seasonal music.

I'll see what I can do when playing 'vanilla' DF.
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

Alatun

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #54 on: February 28, 2020, 06:13:21 am »

Thanks for taking a look. I'm using dfhack already. Do you need to configure something in dfhack to enable the mentioned feature? Or should it work "out of the box"? I just copied the alpha of dfhack into the DF directory and renamed the example config file and I'm experiencing the behavior noted above.

Logged

Nopenope

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #55 on: February 28, 2020, 09:22:28 am »

A lot of the "new" gamelog announcements don't have sound effects at all ("new" is used loosely, since there haven't been any additions since 2016). This includes modified announcements, like completed strange moods where the dwarf "claims it as a family heirloom" and such. What are some good sources of CC/public domain sound effects to add? It would be nice to put together an updated soundpack for the current game.
Logged

prixt

  • Bay Watcher
  • has been taken by a fey mood.
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #56 on: February 28, 2020, 09:45:39 am »

I'm currently using PerdaxisErrant's Starter Pack preview. Think previous versions of the Starter Pack also had this functionality.
Not sure about non-Windows Starter Packs.
And I'll still look into handling this in vanilla DF. I believe the SoundCense(C#) had this function...
Logged
SOUNDSENSE-RS - SoundSense alternative written in Rust

Alatun

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #57 on: February 28, 2020, 02:16:45 pm »

I think DFHack already does that; on load, it checks the latest season and weather and writes it into the game log, so SoundSense plays seasonal music.

I'll see what I can do when playing 'vanilla' DF.

I think I found what you were talking of: http://expwnent.github.io/dfhack/docs/Scripts.html#soundsense-season

But it seems this script is missing:
Quote
[DFHack]# soundsense-season
soundsense-season is not a recognized command.

I also checked my old installation (0.44.12) which is based on the LNP pack. It's the same there. Probably the documentation on the website is outdated or the script was destroyed by some mighty creature ;-)
Logged

thurin

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #58 on: February 28, 2020, 02:43:14 pm »

Writing season to log on save load (and other things) is now handled by the modtools/extra-gamelog script and is enabled by default in the dfhack.init-example

# write extra information to the gamelog
modtools/extra-gamelog enable
Logged

thurin

  • Bay Watcher
    • View Profile
Re: SoundSense-RS: SoundSense clone, written in Rust
« Reply #59 on: February 28, 2020, 03:42:28 pm »

And I guess I should confirm that this is working in soundsense-rs with the dfhack script enabled.  Saved a game when it was in rain.  Loaded the save file.  Season and Rain get written to the gamelog and rain sound is playing.
Logged
Pages: 1 2 3 [4] 5 6 7