Skip to content

Conversation

ahasasjeb
Copy link

@ahasasjeb ahasasjeb commented Aug 26, 2025

[SOMESW]              ; SuperWeaponType
Music.Theme=          ; Soundtrack theme ID from thememd.ini (such as GodsendOne)
Music.Duration=0      ; integer, game frames; 0 or below means do not auto-stop,with the game speed set to 4, 15 frames equal 1 second.
Music.AffectedHouses= ; owner|allies|enemies|all (default all)
  • Music.Theme selects the soundtrack theme by its ID defined in thememd.ini (such as GodsendOne).
  • Music.Duration sets how long to keep playing, in game frames. 0 or below means no auto-stop.
  • If a different theme is already playing, it will be replaced when the superweapon fires.
  • When the timer completes, the theme is stopped only if the currently playing theme still equals the configured Music.Theme; if music was changed during the countdown, it will not be altered.
  • Music.AffectedHouses determines which houses will hear and be affected by the superweapon music on their client: owner, allies, enemies, or all (default). Playback and auto-stop are applied only for those houses.

@TaranDahl
Copy link
Contributor

Perhaps a flag should be added to control which houses will be affected.

@fagonghaiwo
Copy link

where is dll?

Copy link

github-actions bot commented Aug 29, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Copy link
Contributor

@TaranDahl TaranDahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add docs in CREDITS.md

@ahasasjeb
Copy link
Author

Should add docs in CREDITS.md

done

@TaranDahl TaranDahl added Needs testing ⚙️T1 T1 maintainer review is sufficient labels Aug 30, 2025
@ahasasjeb
Copy link
Author

I accidentally synced with the latest branch, but it should be restored now.

@Coronia
Copy link
Contributor

Coronia commented Sep 2, 2025

I'm not sure if Music.Duration is a reasonable design. It can easily be interrupted by Esc screen, which will make the theme always play regardless of duration unless getting back to the game, and you can also switch music there. But on the other hand, it adds another per frame check which needs to loop check all houses' owned SWs which is bad for performance. Personally I would like to remove this tag and the related logic, but I'd like to hear if others have such demand

@likemcplayer
Copy link

I'm not sure if Music.Duration is a reasonable design. It can easily be interrupted by Esc screen, which will make the theme always play regardless of duration unless getting back to the game, and you can also switch music there. But on the other hand, it adds another per frame check which needs to loop check all houses' owned SWs which is bad for performance. Personally I would like to remove this tag and the related logic, but I'd like to hear if others have such demand

I am making a small mod myself, and I really need this feature.

@Coronia
Copy link
Contributor

Coronia commented Sep 2, 2025

If we're keeping this feature then it'd better be done in a way like AutoDeath and TransportReloader, which is making a global vector to store the superweapon entity and only iterate it instead of looping all houses + all SWs. That would require a proper InvalidatePointer modification tho

Another idea is to only store a timer in HouseExt, which will be set once such SW is fired, and checking if it's completed in the same hook for music reset. This could at least decrease the complexity of checking every SW. It'll change the behavior a bit tho: if the original superweapon is gone (by building destruction or such), the music will still be reset once the time meets

@Metadorius
Copy link
Member

I'm not sure if Music.Duration is a reasonable design. It can easily be interrupted by Esc screen, which will make the theme always play regardless of duration unless getting back to the game, and you can also switch music there. But on the other hand, it adds another per frame check which needs to loop check all houses' owned SWs which is bad for performance. Personally I would like to remove this tag and the related logic, but I'd like to hear if others have such demand

In my opinion, this feature is somewhat "arbitrary". To me it sounds like there should be a basic dynamic music system, with ability to designate idle/combat/special event tracks, and this should be a part of it.

@fagonghaiwo
Copy link

maybe Music.AffectedHouses could use (owner/self|allies/ally|team|enemies/enemy|all) , just like other features whitch affect houses. At least, team is different from ally.

@fagonghaiwo
Copy link

and when
[SWA]
Music.Theme=MUSICA
SW.next=SWB
[SWB]
Music.Theme=MUSICB
, it plays MUSICA when use SWA.
I dont know if its expected.

@TaranDahl
Copy link
Contributor

I'm not sure if Music.Duration is a reasonable design. It can easily be interrupted by Esc screen, which will make the theme always play regardless of duration unless getting back to the game, and you can also switch music there.

I don't think it matters. Some maps in StarCraft 2 have similar designs. As far as I know, no one thinks this is a problem that needs attention.

But on the other hand, it adds another per frame check which needs to loop check all houses' owned SWs which is bad for performance. Personally I would like to remove this tag and the related logic, but I'd like to hear if others have such demand

If you are worried about performance, we can add the affected HouseClass to an additional vector of ScenarioExt and then loop through that vector. Also, HouseClass::Array is a relatively small array. I guess looping through it shouldn't incur much additional overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs testing ⚙️T1 T1 maintainer review is sufficient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants