Hey, I have a quick question about a concept for a mobile game I am working on. The concept involves using button/sound sequences to open a door. Each door has a unique sequence of tones attached that must be played in order to for the door to be opened.
-
Each button has an audio source attached to it which is by default empty(no sound file attached to it).
-
Below the buttons is a list of tones/sounds (sort of like when you dial on a phone and each number has a different tone)
-
You click the tone that you want to use and it is loaded into the buttons audio source.
-
Now the once empty audio source on the button is loaded with a tone.
-
the player then presses a record button and begins tapping the sound button trying to unlock the door.
-
I would like for the player to be able to press stop once he/she played a sequence and play it back.
-
In harder levels the doors would require maybe 2 tones be played at once the the user must play one sequence and then play back the other while recording the second.
Is this possible? Any Examples? I am going to use dial tones in order to minimize space usage.
The option for pay is available if someone is able to script this. I pay as fast as you finish!!
While possible, I think you’ll find that it’s easier to store data representing which buttons were pushed and produce the sounds purely for the player. In other words, don’t try to process the sounds… Just process and store the raw button-push information. Then use what buttons were pushed to play sounds for the player as needed.
Also, it sounds like you’re making a puzzle game, and I heartily approve of that.
The world needs more puzzle games.
I’m a novice at Unity and super busy right now with life events… But if you can’t find someone else to work on this, it seems like an interesting problem and I might be able to come up with a solution that would work for you.
I am always interested in working with others so you are at the top of my list so far lol.
As far as processing the sounds. I want to have a list of tones and the player can scroll and find a tone and drag it to the empty button, which then in turn fills the audio source on the button. Although I am working on a way to do like you said.
So, for starters say I have 2 buttons on the screen both with sounds already attached, If I tap them it plays the tone each time tapped. ow would I playback the sequence played.
I would have the ‘recording’ consist of a list of what sounds were on what buttons, and what order the buttons were pushed in. (And if you want to get really complicated, the timing for the pushing of the buttons.)
So if you have an interface with 2 buttons, and 5 sounds, and the user presses 6 times, your data might look like (JSON-ish):
{
sounds: {
3,
4
},
buttons: {
1,
1,
0,
1,
0,
0
}
}
Then you’d know to play sound 4 twice, 3 once, 4 once, then 3 twice whenever the you want to replay what the user did. If you want to record when and how long they pushed the buttons, that’s more complicated, but not too bad. Playback gets more complicated, too.
That doesn’t handle the final example well, though. To record 2 tracks of sound, you’ll want to duplicate the buttons info for as many tracks as you want. Knowing that’s in the cards ahead of time, I’d probably just include it from the start.
Heh. I’m actually wishing I had time to work on this right now. This weekend is absolutely solid, though. Freaking crazy weekend.
Thanks for the replies fellas. Now say that the user records the sounds and is able to play them back. If I wanted to save the replay and open the program later and access it and play it back whats the best way?
Simple string combination and PlayerPrefs.SetString(). Sound 1, 1.5 second wait, Sound 2, 3 second wait, Sound 3, would look like this when processed: “1-1.5,2-3,3-0”
This mockup is just for you guys to visualize what I want.