Currently, all ambient sounds (music tracks) are either bound to one planet or to all space platforms (and space map). For surfaces which don't have an associated planet or space platform, there is a fallback to play Nauvis-bound tracks on them.
This is not very flexible and not at all friendly towards modded surfaces, especially those created on-the-go.
Since surfaces have names I would like to propose a way to bind ambient sounds to surfaces using their names (alongside the current planet/space platform bindings).
There would be a new property of AmbientSound, something along the lines of surfaces or surface-names, an array of strings. If the current surface's name would contain any of these strings as a substring, the ambient sound could play.
To match this multi-surface binding, the existing planet binding would be extended to accept multiple planets.
I would like to hear from you if this sounds reasonable and/or if there is a use-case this would not cover. And your thoughts in general.
AmbientSound surface binding
-
thesixthroc
- Fast Inserter

- Posts: 126
- Joined: Wed Apr 29, 2020 9:53 pm
- Contact:
Re: AmbientSound surface binding
This would not cover cases such as Pirate Ship islands in which surfaces are generated on-demand, which would be sad for this API. The number of possible surface names in the mod is I think ~1k.
Perhaps new surfaces can have a planet_music string assigned instead?
Perhaps new surfaces can have a planet_music string assigned instead?
Re: AmbientSound surface binding
How are the island surfaces named? Or more like, how would you like the music to be bound to those surfaces?
If you know what the planet_music string would be, can't you just incorporate that into the name of the surface?
My assumptions was that such surfaces created on demand would be named something like "island-<number>", "<size>-island". That way a music track could be bound to all of them by setting surface_names = {"island"}
Is it that those names are "actual" names, visible and come into gameplay?
If you know what the planet_music string would be, can't you just incorporate that into the name of the surface?
My assumptions was that such surfaces created on demand would be named something like "island-<number>", "<size>-island". That way a music track could be bound to all of them by setting surface_names = {"island"}
Is it that those names are "actual" names, visible and come into gameplay?
Re: AmbientSound surface binding
Another thing, AmbientSound::play_on_all_surfaces property could be useful.
Re: AmbientSound surface binding
For my use case , i think it would be nice if players can decide on which surface they want the music contained in my mods, so if they play a new mod that adds a surface and i'm lagging behind for compatibility, they can (while playing/run time per player setting ideally) change the allocation as they like.
Now for generated surfaces like the pirate islands i have no idea how it should be handled nor what is realistic. I don't expect other modders to add some compatibility in their mod for my music either.
Sounds like play_on_all_surfaces could be used for the purpose of making an association between music and those "unknown surfaces". If it's a property of ambient sound, i understand it as for "non-thematic music", i would add this to sound that "could go in pirate island" for example. I imagine it will be possible to avoid playing those sound on the space age planets, if necessary by always playing other song and not those with such property so as to make them reserved for "surfaces without explicit rules". That would be good for me.
Made me think of a mod that would have a button or a shortcut, that player can press when hearing a music, and it would allow them to set up the surface association for this song, from "remove it i don't want to hear that one again" to "put it on every location i love it". I thought maybe a dropdown menu with the surfaces could do, but feature creep is difficult to avoid if you want a song to only be played on 7 out of the 9 surfaces your modpack have ( and it has pirate islands) it sounds tricky to provide the interface for such precision.
I will try to use what is made available anyway
Now for generated surfaces like the pirate islands i have no idea how it should be handled nor what is realistic. I don't expect other modders to add some compatibility in their mod for my music either.
Sounds like play_on_all_surfaces could be used for the purpose of making an association between music and those "unknown surfaces". If it's a property of ambient sound, i understand it as for "non-thematic music", i would add this to sound that "could go in pirate island" for example. I imagine it will be possible to avoid playing those sound on the space age planets, if necessary by always playing other song and not those with such property so as to make them reserved for "surfaces without explicit rules". That would be good for me.
Made me think of a mod that would have a button or a shortcut, that player can press when hearing a music, and it would allow them to set up the surface association for this song, from "remove it i don't want to hear that one again" to "put it on every location i love it". I thought maybe a dropdown menu with the surfaces could do, but feature creep is difficult to avoid if you want a song to only be played on 7 out of the 9 surfaces your modpack have ( and it has pirate islands) it sounds tricky to provide the interface for such precision.
I will try to use what is made available anyway
Check out my latest mod ! It's noisy !
Re: AmbientSound surface binding
Looking at the Pirate Ship mod specifically, the surface names are created as <crewid>-<destination_index>-<type>-<subtype>, where type can resolve to "Sea", "Island", etc., so it should be straight forward to bind tracks to specific surface types/subtypes using my proposed surface_names binding. Correct me if my understanding is wrong.
Per player runtime surface binding sounds like a massive feature creep which I don't particularly like.
Although it made me wonder if surface binding by specifying planets/surface names to exclude would be useful.
Per player runtime surface binding sounds like a massive feature creep which I don't particularly like.
I'm not sure what do you mean here. A track with play_on_all_surfaces - true could play everywhere, including space age planets.I imagine it will be possible to avoid playing those sound on the space age planets ...
Although it made me wonder if surface binding by specifying planets/surface names to exclude would be useful.
Re: AmbientSound surface binding
This isn't meant for me right ? Because i couldn't correct anything thereDonion wrote: Fri Nov 14, 2025 11:35 am Looking at the Pirate Ship mod specifically, the surface names are created as <crewid>-<destination_index>-<type>-<subtype>, where type can resolve to "Sea", "Island", etc., so it should be straight forward to bind tracks to specific surface types/subtypes using my proposed surface_names binding. Correct me if my understanding is wrong.
I understand, i tried to keep it short last time, i feel it's a can of worm that as soon as you try a little something you feel like you need a lot more for it to be polished. I was only thinking of something very minimal at first, like the ability to "skip" or "play next" , if the player has a setting active that would "unbind" a song about to be played, or hide it. Indirectly i thought it could provide a way to have custom binding for songs that players can fiddle with without restarting the game.Donion wrote: Fri Nov 14, 2025 11:35 am Per player runtime surface binding sounds like a massive feature creep which I don't particularly like.
I think yes, a "not-hacky" exclusion method would be useful. In my mind, beyond UI consideration, i imagined it like a grid, where all songs are one axis, all surfaces on the other, so that makes a table and each tile is 1 or 0 for wether the song/surface association is or isn't active. I was thinking of a little logic that would play at run time, after a song is finished, to trigger the next song, or when a play_sound occurs, that would overwrite a song and try to play another one if the player has a setting against this song on the surface it is located / looking when it occurs.Donion wrote: Fri Nov 14, 2025 11:35 amI'm not sure what do you mean here. A track with play_on_all_surfaces - true could play everywhere, including space age planets.I imagine it will be possible to avoid playing those sound on the space age planets ...
Although it made me wonder if surface binding by specifying planets/surface names to exclude would be useful.
I thought of a play_on_all_surfaces - true as a piece of enabler for this because currently you have to explicitly speficy planet/music bindings. Whereas with play_on_all_surfaces - true, you have a way to play a song on every surface, to make the game aware of the extent of the previously mentionned table.
I thought that for space age planets, at least, their name being known, it would be possible to use play_on_all_surfaces - true, and disable "some surface", the space age planets, using their name, for some songs in particular. So that those would always be overwritten and never heard on those planets, leaving them available only for surfaces of "other mods" with unknown names.
Maybe it's just my imagination and there are some misconceptions in there. I feel like a newb that does mostly rubber-banding when i code, but i'm eager to learn
Check out my latest mod ! It's noisy !

