Logo

Announcer + Crowd cues in Gameplay

Register Log In Back To Forums

Post #1 · Posted at 2019-06-24 06:10:48am 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12


Last updated: 2019-06-24 06:12am
I noticed in DDR that the announcer and crowd have cues to comment in game play.




Is it possible to code in StepMania, If so can someone post below? Thanks!
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #2 · Posted at 2019-06-24 01:12:24pm 4.7 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
I'm a bit confused with what you're asking for here? Announcer packs will play comments and crowd noises during songs automatically depending on what's happening in game. Or is it something else you're asking about?
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #3 · Posted at 2019-06-24 01:26:51pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

I meant there’s a code somewhere in ddr for both the announcer and the crowd to cue in the song. I put both comparisons of max 300 to show how the announcer and the crowd cue in separately in gameplay in different ddr mixes. This applies with every song as well, hope that makes sense.
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #4 · Posted at 2019-06-24 01:41:45pm 4.7 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Oh so you want to be able to change the timing/frequency of the announcer comments/crowd sounds?

I know you can call announcer comments/other files using Lua but I'm not sure it'd work well in game play as SM will still auto play the announcer files it finds. Plus if you want it different per song, that would be quite the task to check where the song is up to and then play the correct file for what's happening in game for each different song.

You might notice that packs with more files in the comments will play the comments more frequently (like the X to A20 announcer) whereas the MAX to SN2 announcer will comment less due to fewer files that are in that pack. So if you want it more frequent, add more copies of the comments into the folders or if you want less frequent comments, remove some files.

Hope that helps.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #5 · Posted at 2019-06-24 02:31:19pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Correct, I'm certain you could make a separate folder for the announcer and the crowd and set the comments to a 0 value and just call them in a LUA folder for a song. I'm not good at this but an example could be like:

if GAMESTATE:Comment() then
SOUND: PlayAnnouncer("comment")
end;

if GAMESTATE:Crowd() then
SOUND: PlayAnnouncer("crowd")
end;


something like that..
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #6 · Posted at 2019-06-24 05:09:41pm 4.7 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30


Last updated: 2019-06-24 05:12pm
I think you were just using the code above as an example, but I'll clarify for others that the GAMESTATE singleton doesn't have Comment() or Crowd() methods.

You can see the list of methods that GAMESTATE does have in SM5.1-beta2 here: http://dguzek.github.io/Lua-For-SM5/LuaAPI#Actors-GameState

------

As far as playing Announcer files from themeside Lua goes, there aren't many methods available. You can see by going here http://dguzek.github.io/Lua-For-SM5/LuaAPI and typing "announcer" into the search field.

There's the ANNOUNCER singleton, which you can use to manage the engine's Announce via

ANNOUNCER:DoesAnnouncerExist(string sAnnonucer)
ANNOUNCER:GetAnnouncerNames()
ANNOUNCER:GetCurrentAnnouncer()
ANNOUNCER:SetCurrentAnnouncer(string sNewAnnouncer)

You're probably looking for something more like the SOUND:PlayAnnouncer(string sPath)
The API doc comment for that method suggests that it Plays a sound from the current announcer.

...and that's about it.

------

If you want your theme to have more control over sounds that are played during Gameplay, you'll probably have better luck by taking audio files for an announcer, including them in your theme like any other audio file, and loading into your ScreenGameplay code as Sound actors.

There is some example code on using Sound actors here http://dguzek.github.io/Lua-For-SM5/Def.Sound. It might be enough to get you started, but you're going to have write your own logic for determining when to play each file.

Post #7 · Posted at 2019-06-24 05:14:59pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Quote: dbk2
I think you were just using the code above as an example, but I'll clarify for others that the GAMESTATE singleton doesn't have Comment() or Crowd() methods.

You can see the list of methods that GAMESTATE does have in SM5.1-beta2 here: http://dguzek.github.io/Lua-For-SM5/LuaAPI#Actors-GameState

------

As far as playing Announcer files from themeside Lua goes, there aren't many methods available. You can see by going here http://dguzek.github.io/Lua-For-SM5/LuaAPI and typing "announcer" into the search field.

There's the ANNOUNCER singleton, which you can use to manage the engine's Announce via

ANNOUNCERBig GrinoesAnnouncerExist(string sAnnonucer)
ANNOUNCER:GetAnnouncerNames()
ANNOUNCER:GetCurrentAnnouncer()
ANNOUNCERConfusedetCurrentAnnouncer(string sNewAnnouncer)

You're probably looking for something more like the SOUNDTonguelayAnnouncer(string sPath)
The API doc comment for that method suggests that it Plays a sound from the current announcer.

...and that's about it.

------

If you want your theme to have more control over sounds that are played during Gameplay, you'll probably have better luck by taking audio files for an announcer, including them in your theme like any other audio file, and loading into your ScreenGameplay code as Sound actors.

There is some example code on using Sound actors here http://dguzek.github.io/Lua-For-SM5/Def.Sound. It might be enough to get you started, but you're going to have write your own logic for determining when to play each file.


Where would I add for the SongPath in the code + Where to time the Announcer and Crowd to play in that current song? Also the announcer has different states in what the player is in [Danger/ Good/ Hot]
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #8 · Posted at 2019-06-24 05:26:15pm 4.7 years ago

Offline dbk2
dbk2 Avatar Member
332 Posts
Not Set
Reg. 2012-04-30


Last updated: 2019-07-06 06:58pm
Quote: NekoNekoMata
Where would I add for the SongPath in the code

You could try adding Sound actors to your ./BGAnimations/ScreenGameplay overlay.lua file. As I mentioned, there is some example code on using Sound actors here: http://dguzek.github.io/Lua-For-SM5/Def.Sound but I'll readily admit that the examples are not very good or helpful (and I'm the one who authored them).


Quote: NekoNekoMata
Where to time the Announcer and Crowd to play in that current song?

Again, you'd have to create own system using Lua, probably in your ./BGAnimations/ScreenGameplay overlay.lua file.

It looks like SongPosition objects have a GetMusicSeconds() which might help you determine how far into a song a player currently. http://dguzek.github.io/Lua-For-SM5/LuaAPI#Actors-SongPosition-GetMusicSeconds

I've never used this method, however, and am not sure.


Quote: NekoNekoMata
Also the announcer has different states in what the player is in [Danger/ Good/ Hot]

In your mind, yes, the announcer has these different states, and that's a good start! If you can imagine how it is supposed to work, you can eventually learn the code needed to make it reality.

Post #9 · Posted at 2019-06-24 05:34:05pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Quote: dbk2
Quote: NekoNekoMata
Where would I add for the SongPath in the code

You could try adding Sound actors to your ./BGAnimations/ScreenGameplay overlay.lua file. As I mentioned, there is some example code on using Sound actors here: http://dguzek.github.io/Lua-For-SM5/Def.Sound but I'll readily admit that the examples are not very good or helpful (and I'm the one who authored them).


Quote: NekoNekoMata
Where to time the Announcer and Crowd to play in that current song?

Again, you'd have to create own system using Lua, probably in your ./BGAnimations/ScreenGameplay overlay.lua file.

It looks like SongPosition objects have a GetMusicSeconds() which might help you determine how far into a song a player currently. http://dguzek.github.io/Lua-For-SM5/LuaAPI#Actors-SongPosition-GetMusicSeconds

I've never used this method, however, and am not sure.


Quote: NekoNekoMata
Also the announcer has different states in what the player is in [Danger/ Good/ Hot]

In your mind, yes, the announcer has these different states, and that's a good start! If you can imagine how it is supposed to work, you can eventually learn the code needed to make it reality.

EXTREMELY helpful! I know It's possible to add In stepmania indeed, but It seems advanced for someone who knows how to code StepMania 5 very well.
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #10 · Posted at 2019-07-06 06:38:50am 4.7 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
I'm responding to your PM here as this could be useful for others.

It is possible to do what you're asking, but the thing is, you'd be just recreating what's already there and have to deal with the system that's already in place. There are already announcer calls for:

Quote
gameplay comment hot
gameplay comment danger
gameplay comment good

Those are three folders that are work in an Announcer pack. What you're wanting to do is pretty much recreate the exact same announcer system that's already there from what I've read you want to do. I know that the timing can be slightly different to the arcade timings (mainly due to the fact that the timing can be random - both in the arcade games code and SM's code for the calls). Both code bases use pretty much the same methods of saying "what's the players life position like", "where in a combo are they" etc. Then the programs play an announcer comment according to those states.

I'm not going to list all the possible announcer folders as it'd take up too much space but you can have the following folders in an announcer pack for gameplay:
Quote
gameplay 100 combo
gameplay 200 combo
gameplay 300 combo
gameplay 400 combo
gameplay 500 combo
gameplay 600 combo
gameplay 700 combo
gameplay 800 combo
gameplay 900 combo
gameplay 1000 combo
gameplay cleared
gameplay combo overflow
gameplay combo stopped
gameplay comment danger
gameplay comment good
gameplay comment hot
gameplay comment oni
gameplay failed
gameplay here we go extra
gameplay here we go final
gameplay here we go normal
gameplay ready

Honestly, from how you're explaining what you want, it seems like you're trying to re-invent the wheel by making your own calls.

If you make your own system, you'd have to mute the baked in system during gameplay otherwise you might get overlapping announcer comments. Also, if you do try making your own system, you should keep the folder names of the standard available announcer folders when you make the announcer comment calls. So if someone uses another announcer pack, their files would work with your system.

I think if you were able to do it on a "broad" scale - as in have one system work for all songs, that'd be fine, but if you're wanting to do the checks on a per-song basis (as you're asking in the MAX 300 example above), that'd be really difficult as you'd need to know what the users have named their song directories so you can check for the correct song. They'd also need to have the same length song files as you do so when your system checks the GetMusicSeconds() it'd be at the correct position etc.

I don't think you need to make a custom system to get the effect that you're after but you can do it - I'd just advise against it as there's a lot of what you're after already built in there for you. I can link you to things you'd need, but as I say for the amount of benefit you'd get, I think it'd be outweighed by the dramas you'd have.

Not trying to put your idea down, just speaking from experience/knowing what would be involved I'm trying to save you the hassle.

If you're still keen I can point you to code to look at/some calls and you can go from there.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #11 · Posted at 2019-07-06 02:15:19pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Quote: leadbman
I'm responding to your PM here as this could be useful for others.

It is possible to do what you're asking, but the thing is, you'd be just recreating what's already there and have to deal with the system that's already in place. There are already announcer calls for:

Quote
gameplay comment hot
gameplay comment danger
gameplay comment good

Those are three folders that are work in an Announcer pack. What you're wanting to do is pretty much recreate the exact same announcer system that's already there from what I've read you want to do. I know that the timing can be slightly different to the arcade timings (mainly due to the fact that the timing can be random - both in the arcade games code and SM's code for the calls). Both code bases use pretty much the same methods of saying "what's the players life position like", "where in a combo are they" etc. Then the programs play an announcer comment according to those states.

I'm not going to list all the possible announcer folders as it'd take up too much space but you can have the following folders in an announcer pack for gameplay:
Quote
gameplay 100 combo
gameplay 200 combo
gameplay 300 combo
gameplay 400 combo
gameplay 500 combo
gameplay 600 combo
gameplay 700 combo
gameplay 800 combo
gameplay 900 combo
gameplay 1000 combo
gameplay cleared
gameplay combo overflow
gameplay combo stopped
gameplay comment danger
gameplay comment good
gameplay comment hot
gameplay comment oni
gameplay failed
gameplay here we go extra
gameplay here we go final
gameplay here we go normal
gameplay ready


Honestly, from how you're explaining what you want, it seems like you're trying to re-invent the wheel by making your own calls.

If you make your own system, you'd have to mute the baked in system during gameplay otherwise you might get overlapping announcer comments. Also, if you do try making your own system, you should keep the folder names of the standard available announcer folders when you make the announcer comment calls. So if someone uses another announcer pack, their files would work with your system.

I think if you were able to do it on a "broad" scale - as in have one system work for all songs, that'd be fine, but if you're wanting to do the checks on a per-song basis (as you're asking in the MAX 300 example above), that'd be really difficult as you'd need to know what the users have named their song directories so you can check for the correct song. They'd also need to have the same length song files as you do so when your system checks the GetMusicSeconds() it'd be at the correct position etc.

I don't think you need to make a custom system to get the effect that you're after but you can do it - I'd just advise against it as there's a lot of what you're after already built in there for you. I can link you to things you'd need, but as I say for the amount of benefit you'd get, I think it'd be outweighed by the dramas you'd have.

Not trying to put your idea down, just speaking from experience/knowing what would be involved I'm trying to save you the hassle.

If you're still keen I can point you to code to look at/some calls and you can go from there.

I’m still interested at the code and I could start with a simple song that deals with less announcer timing and work my way up. Etc 5.1.1
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #12 · Posted at 2019-07-06 03:27:47pm 4.7 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
How many songs are you wanting to do this to out of interest?
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #13 · Posted at 2019-07-06 03:52:27pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Probably 100, but if We do this one song I can work my way around the rest
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #14 · Posted at 2019-07-06 04:00:08pm 4.7 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Well good luck! Let me know how you go, should be an interesting learning experience for you Smile I'm interested to see how it turns out/what difference it'll make. If you've got questions, feel free to ask, I'm sure one of us on here might be able to point you in the right direction.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #15 · Posted at 2019-07-06 04:14:33pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Quote: leadbman
Well good luck! Let me know how you go, should be an interesting learning experience for you Smile I'm interested to see how it turns out/what difference it'll make. If you've got questions, feel free to ask, I'm sure one of us on here might be able to point you in the right direction.

Oh jeez I thought you were gonna help me out with the one song and when we figured that out I would do the rest? XD
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #16 · Posted at 2019-07-06 05:09:21pm 4.7 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Quote: dbk2
Quote: NekoNekoMata
Where would I add for the SongPath in the code

You could try adding Sound actors to your ./BGAnimations/ScreenGameplay overlay.lua file. As I mentioned, there is some example code on using Sound actors here: http://dguzek.github.io/Lua-For-SM5/Def.Sound but I'll readily admit that the examples are not very good or helpful (and I'm the one who authored them).


Quote: NekoNekoMata
Where to time the Announcer and Crowd to play in that current song?

Again, you'd have to create own system using Lua, probably in your ./BGAnimations/ScreenGameplay overlay.lua file.

It looks like SongPosition objects have a GetMusicSeconds() which might help you determine how far into a song a player currently. http://dguzek.github.io/Lua-For-SM5/LuaAPI#Actors-SongPosition-GetMusicSeconds

I've never used this method, however, and am not sure.


Quote: NekoNekoMata
Also the announcer has different states in what the player is in [Danger/ Good/ Hot]

In your mind, yes, the announcer has these different states, and that's a good start! If you can imagine how it is supposed to work, you can eventually learn the code needed to make it reality.

Have a look at what dbk2 has said in this post and have a go at doing some of these things to get the ball rolling. Have a look at the StepMania github - https://github.com/stepmania/stepmania as I've always found it to be a good resource to learn from.

In terms of things to check out/work from, you can call an announcer file by using something like:
Quote
SOUND:PlayAnnouncer("gameplay comment hot")

You could check for the time by using:
Quote
SecondsToMMSS(song:MusicLengthSeconds()) == "XX:XX"

You might want to look into using:
Quote
HealthStateChangedMessageCommand
This is what might help to get the correct comments to play.

You can check out how the default health bars work with that here:
https://github.com/stepmania/stepmania/blob/27fdfb38718474253aeb33e9f9c7fd1a91ed823a/Themes/default/Graphics/ScreenGameplay%20lifebar_bar.lua
This could give you a better understanding of how the above message command works.

These enums could be helpful too for you to check for different states:
https://github.com/stepmania/stepmania/blob/master/Docs/Luadoc/Lua.xml#L2351-L2356

Hopefully that helps you get going. Have a read of dbk2's site and see how Sound Actors work and also have a read of the rest of his site too as there are plenty of useful things in there.

I'd really suggest you have a go at this yourself first as it'd be a great thing to learn a lot of SM5's/Lua coding. As rough as that sounds, it's the best way to learn as that's how dbk2 taught me a while back and I'm grateful that he made me work out things myself as it really helped me advance in Lua coding/SM5 theme coding - I'm able to write themes almost from scratch now because I learnt this way.

I know all the things I mentioned are all over the place, I was just writing them down as I thought of them and it's really late here so I'm kind of out of it after work haha. Sorry about that.

Have a go and post up what you come up with and I'll help point you in the right direction if I can.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #17 · Posted at 2019-07-06 05:48:54pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Thank you so much, I’ll keep you updated on what I do so stay tuned Smile
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #18 · Posted at 2019-07-07 07:35:34am 4.7 years ago

Offline ZTS
ZTS Avatar Member
138 Posts
Not Set
Reg. 2015-01-13

"But enough talk! Have at you!"
Adding to what leadbman said (cuz he told me to check out this post), you can add labels to a song in the StepMania editor and then get them using the GetLabels() function.

So you could write a function that iterates through the labels, checks the beat, if it matches the beat and a label then play a certain announcer cue.

You'd also have to have a function that updates every beat, maybe it's possible with SetUpdateFunction but I haven't looked into it.
Get Rave It Out! https://sites.google.com/view/riodevs/home
Want your theme made? I take commissions, PM for details.

Post #19 · Posted at 2019-07-07 01:32:11pm 4.7 years ago

Offline NekoNekoMata
NekoNekoMata Avatar Member
130 Posts
Not Set
Reg. 2017-02-12

Quote: ZTS
Adding to what leadbman said (cuz he told me to check out this post), you can add labels to a song in the StepMania editor and then get them using the GetLabels() function.

So you could write a function that iterates through the labels, checks the beat, if it matches the beat and a label then play a certain announcer cue.

You'd also have to have a function that updates every beat, maybe it's possible with SetUpdateFunction but I haven't looked into it.

So would that be added into the song sm file??
http://i.imgur.com/eYGl2fY.png
Credit: Aegis

Post #20 · Posted at 2019-07-07 02:49:11pm 4.7 years ago

Offline ZTS
ZTS Avatar Member
138 Posts
Not Set
Reg. 2015-01-13

"But enough talk! Have at you!"
Quote: NekoNekoMata
Quote: ZTS
Adding to what leadbman said (cuz he told me to check out this post), you can add labels to a song in the StepMania editor and then get them using the GetLabels() function.

So you could write a function that iterates through the labels, checks the beat, if it matches the beat and a label then play a certain announcer cue.

You'd also have to have a function that updates every beat, maybe it's possible with SetUpdateFunction but I haven't looked into it.

So would that be added into the song sm file??
They're SSC only as far as I know, but yes. It's another timing segment.
Get Rave It Out! https://sites.google.com/view/riodevs/home
Want your theme made? I take commissions, PM for details.
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 7% · Database: 4% · Server Time: 2024-03-28 14:53:09
This page took 0.013 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language