Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2012-11-22 21:38:17

S32X
Member
From: Rochester, New York
Registered: 2012-03-18
Posts: 880
Website

Manipulating Background Music with Game Events

I want the events of my boss to change when the background music gets to a certain point. The difficulty gets harder as the events change.

Like this:
Background Music

Phase 0 (No difficulty) 0:00-0:28

Phase 1 (Easy) 0:28-1:11

Phase 2 (Medium) 1:11-2:08

Phase 3 (Hard) 2:08-3:19

Phase 4 (Insane) 3:19-3:47

Phase 5 (Breakdown)3:47-4:18

Phase 6 (End) 4:18

How could I do this?


EDIT: No matter how many times you hit the boss, it won't really take any damage. Instead it blows uo after the events of breakdown. The key of the boss is just to survive. And this supposed to be really difficult.

Last edited by S32X (2012-11-22 21:43:11)

Offline

#2 2012-11-22 21:54:20

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Manipulating Background Music with Game Events

how about using on_timeout for timings? or a counter object that sends the signals


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#3 2012-11-22 23:42:02

lunarrush
Member
Registered: 2010-05-13
Posts: 278

Re: Manipulating Background Music with Game Events

You could always do it in a system like I've been planning for a while.  You have several music tracks all playing together and then just manipulate the volumes of certain tracks when an event happens through your sound mixer object.


If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Offline

#4 2012-11-24 20:43:47

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Manipulating Background Music with Game Events

We need some command to play the music in sync with eachother. More on this later.

Sorry I'm kinda stressed right now since in less than 20 minutes the creative contests will take place on Dreamhack, in which I got 3 entries. Will explain once I'm home tomorrow evening.

Offline

#5 2012-11-25 23:12:54

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Manipulating Background Music with Game Events

As I said we need the following features:

We must be able to place songs into cuelists. An example of how a cue list could look like:

SONG 1 
{
FILE: song1.ogg
CHANNEL: 1
SPEED: 0 - 10
ALTITUDE: 0 - 200
ON_GROUND: TRUE
IN_AIR: FALSE
IN_WATER: FALSE
}

SONG 2
{
FILE: song2.ogg
CHANNEL: 2
SPEED: 11 - 100
ALTITUDE: 0 - 200
ON_GROUND: TRUE
IN_AIR: FALSE
IN_WATER: FALSE
}

SONG 3
{
FILE: song3.ogg
CHANNEL: 3
SPEED: 11 - 100
ALTITUDE: 200 - 2000
ON_GROUND: TRUE
IN_AIR: FALSE
IN_WATER: FALSE
EVENT: 1
}

Events could be night fall, a twist in the plot and so on, which means that you could add a stinger effect when say the whole landscape is lit on fire (like in Sonic 3).

And so on.

Song cues should be loaded all at the same time,

LOAD_SONGCUE file.songcue <id>

Then we need to play the songs:

PLAY_SONGCUE <id>

Fading between the channels:

FADE_SONGCUE <id> <channel 1> <channel 2> <time>

There's certainly more to suggest,  but this is a start at least.

Offline

#6 2012-11-26 10:23:14

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Manipulating Background Music with Game Events

i agree with jobro. that would be nice to have, even if it is a more cosmetic feature


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#7 2012-11-26 12:34:55

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Manipulating Background Music with Game Events

This system could also be used for sound effects. Birds singing, machinery, distant speaker announcements, crowd noises and so on. All we need is to have a command to play the sounds at random intervals.

Offline

#8 2012-11-26 17:40:47

lunarrush
Member
Registered: 2010-05-13
Posts: 278

Re: Manipulating Background Music with Game Events

Correct me if I'm wrong, but all these things can be done via scripting:

Random intervals:

state "main" {
    let "$random = random(2)"
    if "$random == 0" "play_state_0"
    if "$random == 1" "play_state_1"
    if "$random == 2" "play_state_2"
}
...
state "play_state_0" {
    play_sample "0" //this is just an example
    change_state "wait"
}
...
state "wait" {
    on_timeout 1 "main" //1 can be any number
}

I'll be back from class soon and then I'll provide you more examples of how this stuff could be done using the scripting engine.  As I said, if that truely cannot be done inform me as to why it cannot.  If you need a system like that for the first Open Surge level I will begin coding the objects to handle such things later today.

Last edited by lunarrush (2012-11-26 19:16:17)


If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Offline

#9 2012-11-26 23:53:13

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Manipulating Background Music with Game Events

Yeah you can do that via scripts. I'm by far any script guru though. I'm just a musician that composes music needed for the projects, and let other heroes like Lunarrush do the coding. big_smile

Offline

#10 2012-11-29 04:51:15

S32X
Member
From: Rochester, New York
Registered: 2012-03-18
Posts: 880
Website

Re: Manipulating Background Music with Game Events

jobromedia wrote:

Yeah you can do that via scripts. I'm by far any script guru though. I'm just a musician that composes music needed for the projects, and let other heroes like Lunarrush do the coding. big_smile

lol

And I'm in the middle with music and coding. But I still am wondering something, if there was a song cue that would change the evets at "play_songcue", how would the engine know what the song cue even was? Like this?

...

track_song_time
on_song_time "1:18" "go_up_a_level"
}
state "go_up_a_level"
{
change_closest_object_state "Penultimate Mecha" "difficulty_two"
}

...

I think this would be very easy for new scripters. smile

Offline

#11 2012-11-29 18:38:59

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Manipulating Background Music with Game Events

You would tell the songcue in the level, just as you specify a song right now.

Say that we have a songcue where song 1 is when the player stands still, and song 2 is when the player has gotten up in speed. The third song is when you run as fast as you can.

You start the level with all songs faded out except the 1st song. As you start running the 2nd song gets faded in:

FADE_SONGCUE 1 1 2 2.0

Then as you get up to speed:

FADE_SONGCUE 1 2 3 2.0

Should the player stomp the brake:

FADE_SONGCUE 1 3 1 2.0

Offline

#12 2012-12-01 02:50:49

S32X
Member
From: Rochester, New York
Registered: 2012-03-18
Posts: 880
Website

Re: Manipulating Background Music with Game Events

K I get it now

Offline

#13 2012-12-01 07:02:47

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: Manipulating Background Music with Game Events

This is ofc just a theoretical example.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org