Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make defining sound_event json files optional #117

Open
bchantech opened this issue Aug 23, 2023 · 4 comments
Open

Make defining sound_event json files optional #117

bchantech opened this issue Aug 23, 2023 · 4 comments
Labels
A: Game Data Issue with game data. D: Change/Suggestion A change to an existing feature. D: Organization A change that will not impact the end-user, but may be helpful for simplifying/documenting the code.

Comments

@bchantech
Copy link
Contributor

Currently, sounds are specified via sound_event, however, most if not all of the time it only contains path containing the sound file of the same name.

When the game plays a sound event that is not defined, it should try to play the sound file of the same name using the default parameters.

Example:

/sound_events/sound1.json is specified in UI

If sound_events/sound1.json is not present, it should create a new sound_event with the following info:

{
	"path": "sounds/sound1.ogg"
}

If the game cannot find the sound, then path will not be included.
If the game can find the sound, and detects it is stereo, flat will be set to true.

@jakubg1
Copy link
Owner

jakubg1 commented Aug 23, 2023

I will consider this during the sound event overhaul (#95). This might make resource handling more complicated though (passing sound files directly instead of sound events means that all class configs will have to check whether it's a sound or an event; on the other hand, specifying deliberately nonexistent sound event files might be too unintuitive).

ResourceManagers may be able to create sound events on the fly when a path to the sound file is passed in a :getSoundEvent() call, though.

@jakubg1 jakubg1 added D: Change/Suggestion A change to an existing feature. D: Organization A change that will not impact the end-user, but may be helpful for simplifying/documenting the code. A: Modding Issue which will impact modders if worked on. Potentially a breaking change. labels Aug 23, 2023
@jakubg1 jakubg1 added A: Game Data Issue with game data. and removed A: Modding Issue which will impact modders if worked on. Potentially a breaking change. labels May 19, 2024
@bchantech
Copy link
Contributor Author

I'm closing this since with ff71f34 sounds can be placed in any directory so we can't assume that they will be present in the /sounds folder.

@bchantech bchantech closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
@jakubg1
Copy link
Owner

jakubg1 commented Jun 4, 2024

Reopening since providing a path to a sound file whenever a Sound Event is expected should generate an implicit Sound Event to avoid creating unnecessary boilerplate Sound Event files of which the only purpose is to exist - as a QoL for modders so that they need to change/create one file less.
This part has nothing to do with the resource placement, as you need to provide a full path to any resource anyways.

@jakubg1 jakubg1 reopened this Jun 4, 2024
@jakubg1
Copy link
Owner

jakubg1 commented Jun 4, 2024

Also, relates to #123 and is a part of a bigger plan to iron out all inconsistencies in the way expressions are defined, resources are referred (#103), etc. that will be carried out throughout the rest of the Beta 4.x cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Game Data Issue with game data. D: Change/Suggestion A change to an existing feature. D: Organization A change that will not impact the end-user, but may be helpful for simplifying/documenting the code.
Projects
None yet
Development

No branches or pull requests

2 participants