Latest Posts

Topic: Developer

andersand.net
Avatar
Topic Opener
Joined: 2024-11-12, 19:48
Posts: 12
OS: Linux
Version: Latest main branch
Ranking
Pry about Widelands
Location: Norway
Posted at: 2024-11-12, 20:42

Hello,

I made a small feature a couple days back, and I just wanted to say hello and ask about a feature I would like to see in the game - If encouraged I would like to add a basic music player that I feel is missing.

After my last small feature, so far I find the WL code base is very intuitive and I feel I could do this, although I should confess from experience that probably comes from lack of knowledge about the more intricate parts of the code face-wink.png I would have to make a window this time and extend the sound handler etc, etc. Have not started planning yet, as I will not put time into it, unless I can be pretty sure this will end up in the game if I do it right (that the effort is supported by you devs).

The idea is to make a simple player like in settlers 2, but not necessarily the exact same. It should do have the obvious playback features, like play, stop, next, previous, optional shuffle and the ability to enable/disable the tracks the player prefers. Optional shuffle and to play previous track could be postponed to a v2 of the player since this would requires more changes (playback history).

What do you guys think?
1. Is it a good idea? Is a music player wanted?
2. Is it the right time, considering the code base in its entirety? (considering which parts of the code expected to be modified, which could cause merge conflicts)
3. Any other doubts?

I plan to spend some time on this and make it work very good, but I don't want to waste time if there is no support or there is resistance to the feature, so hence this post.

Thanks!

Edited: 2024-11-12, 20:49

Top Quote
andersand.net
Avatar
Topic Opener
Joined: 2024-11-12, 19:48
Posts: 12
OS: Linux
Version: Latest main branch
Ranking
Pry about Widelands
Location: Norway
Posted at: 2024-11-12, 20:46

To expand on the idea, I think it would be neat if the music tracks were titled in the player so we don't get a list of music_01, music_02 or "Track 01", etc... Rather it would be nice to have a playlist with good names, maybe the musicians have actual names for (some of) the songs?


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2056
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-11-12, 21:00

Hi andersand.net and welcome to the forum face-smile.png

While I personally usually play without sound, I think there are probably many players who would appreciate it, no objections from my side.
I'd suggest integrating it with the existing in-game sound options menu (src/wui/game_sound_options_menu.*), below the volume controls and toggle buttons, instead of making it a separate window.
The sound handler and sound-related stuff in general get very few changes, so the chances of merge conflicts are extremely low. There are no larger refactors to UI code currently ongoing or planned for the near future.

Big +1 for displaying titles face-smile.png
ISTR that some of the more recent submissions were given informal titles in the pertinent discussions here in the forum or on GitHub/Launchpad.


Top Quote
andersand.net
Avatar
Topic Opener
Joined: 2024-11-12, 19:48
Posts: 12
OS: Linux
Version: Latest main branch
Ranking
Pry about Widelands
Location: Norway
Posted at: 2024-11-12, 21:15

Thank you Nordfriese!

Pleased to hear that you support this feature idea! Also nice that there are some song names floating around. If we decide to go for this, perhaps we could start a thread at the music subforum to gather song names informal or otherwise face-smile.png

I feel motivated to get started with this, as I think it will add a bit to the game's atmosphere with good name for the music tracks and for players like me who are picky when it comes to music, it's nice to get more control over it.


Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 485
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2024-11-12, 23:57

Most music files have embedded tags with the titles.


As for the music player window, I don't want to discourage you, but personally I can't see the point. I agree with Andy Alt on this.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2550
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2024-11-13, 00:15

tothxa wrote:

As for the music player window, I don't want to discourage you, but personally I can't see the point. I agree with Andy Alt on this.

+1


Top Quote
andersand.net
Avatar
Topic Opener
Joined: 2024-11-12, 19:48
Posts: 12
OS: Linux
Version: Latest main branch
Ranking
Pry about Widelands
Location: Norway
Posted at: 2024-11-13, 18:03

Thanks for the feedback. Andy Alt wrote that he did not see the need to allow users to play their own music by specifying a folder. I agree as well, but my idea is simply a music player for the music that comes with the game. Perhaps a picture would be useful to make it more clear what I suggest, as I understand there is support for this to be in the sound options window.

Here is a simple mockup:

https://pasteboard.co/HNjLQEcFg67J.png


Top Quote
andersand.net
Avatar
Topic Opener
Joined: 2024-11-12, 19:48
Posts: 12
OS: Linux
Version: Latest main branch
Ranking
Pry about Widelands
Location: Norway
Posted at: 2024-11-13, 22:16

tothxa wrote:

Most music files have embedded tags with the titles.

Thanks for the tip! Will have to look into how to read vorbis comment of the music files from c++

There are indeed quite a few titles, some good ones and some I recon deserve a real non-generic title.

data/music/ingame_00.ogg       TITLE=Recorder 2              
data/music/ingame_01.ogg       TITLE=Hard Time for Workers   
data/music/ingame_02.ogg       TITLE=Mountainsketch 1.2.2    
data/music/ingame_03.ogg       TITLE=Tranquilforest          
data/music/ingame_04.ogg       TITLE=Desertsketch 3          
data/music/ingame_05.ogg       TITLE=Widelands 1             
data/music/ingame_06.ogg       TITLE=Widelands-3             
data/music/ingame_07.ogg       TITLE=Widelands 6             
data/music/ingame_08.ogg       TITLE=To be in a Rut          
data/music/ingame_09.ogg       TITLE=Renaissance Village     
data/music/ingame_10.ogg       TITLE=Desertsketch 2          
data/music/ingame_11.ogg       TITLE=Desertsketch 1          
data/music/ingame_12.ogg       TITLE=Between Peace and War   
data/music/ingame_13.ogg       TITLE=Castlesketch 1.2        
data/music/ingame_14.ogg                                     
data/music/ingame_15.ogg       TITLE=Widelands_01            
data/music/ingame_16.ogg       TITLE=Widelands_02            
data/music/ingame_17.ogg       TITLE=Widelands_03            
data/music/ingame_18.ogg       TITLE=orchestralsample        
data/music/ingame_19.ogg       TITLE=Widelands Tension 1     
data/music/ingame_20.ogg       TITLE=Widelands Tension 2     
data/music/ingame_21.ogg                                     
data/music/ingame_22.ogg       TITLE=From Scotland to Rome   
data/music/ingame_23.ogg       TITLE=Silkweaver Song         
data/music/ingame_24.ogg       TITLE=Hypatia's theme         
data/music/ingame_25.ogg       TITLE=We Work in the Vineyards  
data/music/ingame_26.ogg       TITLE=Running Out of Coal     
data/music/ingame_27.ogg       TITLE=Scotty the Scout        
data/music/ingame_28.ogg

Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 485
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2024-11-14, 01:34

andersand.net wrote: Thanks for the tip! Will have to look into how to read vorbis comment of the music files from c++

Looks like SDL can do it: https://github.com/libsdl-org/SDL_mixer/blob/a37e09f85d321a13dfcf0d4432827ee09beeb623/include/SDL_mixer.h#L995C1-L1050C82


Top Quote
andersand.net
Avatar
Topic Opener
Joined: 2024-11-12, 19:48
Posts: 12
OS: Linux
Version: Latest main branch
Ranking
Pry about Widelands
Location: Norway
Posted at: 2024-11-14, 20:14

I'll look into that, thanks.

Looking at the impl strategy for the UI changes I could go one of two ways:
1. extend the SoundOptions struct and add everything new directly in there,
- or -
2. extend the GameOptionsSoundMenu struct, which would include adding a new panel (UI::Box) in the same way like SoundOptions and add that to a third panel just for grouping it with the sound_options panel.

I would say it's maybe better for the maintainability to separate these panels, but it will add a little bit extra to the resource usage with the extra panels though I don't know how much it will impact. What do you think? I could go with either way, just trying to minimize refactoring from code review.


Top Quote