Тёмный

How to make a Rhythm Game In Unity (using MIDI) 

SkyanSam
Подписаться 632
Просмотров 45 тыс.
50% 1

Опубликовано:

 

28 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 120   
@ponysonic
@ponysonic 2 года назад
other than your pronounciation of MIDI as "my-die" vs. "mid-dee" lol, this is great!
@helrebekahharper4090
@helrebekahharper4090 Год назад
that threw me too... I was like "whats a mydie file? then it clicked
@PigNotFound
@PigNotFound 3 года назад
Nice! literally yesterday i began a rythm game and this helped me a lot! Thanks
@DarkMatterOfHeaven
@DarkMatterOfHeaven 2 года назад
Never heard MIDI pronounced as Mad-Eye before
@SkyanSam
@SkyanSam 2 года назад
Yeah I pronounced it incorrectly, sorry about that
@NoStupidItsManbearpig
@NoStupidItsManbearpig Год назад
Thank you. This is the best method iv seen for making a rhythm game especially since you have full control over the midi file. The Ui stuff could do with some work but a really great starting point for any project :)
@rendered3090
@rendered3090 3 месяца назад
What an incredible tutorial man Hats off
@Jacman8
@Jacman8 Год назад
Thank you so much! Made a rhythm game for a school CS project and this tutorial saved me
@PhantomCatTGOB
@PhantomCatTGOB 2 года назад
Yo that was such a good tutorial! Keep going!
@vesania6768
@vesania6768 3 года назад
Hey, amazing tutorial! I've been able to create a bare-bones rhythm game following your code and setup. I've also made some minor modifications like adding an outline for the notes when they're within the tap window. However, I'm having some trouble with spawning the first notes. For some reason, I find that the first few notes are being bunched up together. My guess is that the initial spawn is already too late for some notes in my chart, so they end up spawning all together and hitting noteTapY at around the first second, regardless of their note timestamp. I'm still working this out, but would you know a way to somehow adjust the initial position of the first notes such that they hit noteTapY at their expected time? EDIT: I've found that the issue was with the notes' timeInstantiated variable. Ideally, timeInstantiated would be equal to (assignedTime - noteTime), such that the note would be instantiated at the top of the screen so it would travel across (for the duration of noteTime) and reach the target at exactly assignedTime. If the assignedTime is less than noteTime, then that would mean timeInstantiated should be negative, which is impossible since timeInstantiated is set from the audio source time (minimum 0). I've worked around this by setting (timeInstantiated = assignedTime - noteTime) at the notes' Start method, so timeInstantiated wouldn't be set necessarily to the time it was instantiated, but rather the time we want it instantiated for it to hit the tap location after noteTime has passed. Not sure if this would impact something else in the code, but it works. Haha.
@BrokenPuzzle03
@BrokenPuzzle03 2 года назад
Life saver, this fixed the issue for songs that start early and also for higher note times. The issue I'm running into now (At least for my preference) is that the notes spawn in the middle of the screen. I prefer if the notes spawned outside the screen view and the song started after the songDelayInSeconds variable from songmanager script.
@Aisuwuwu
@Aisuwuwu 3 года назад
Hi, great tutorial. I want to ask tho, how would you go about adding hold/long notes?
@officalwmii
@officalwmii 2 года назад
Also wondering here! I would love to implement this feature.
@SkyanSam
@SkyanSam 2 года назад
@@officalwmii Alright I'll work on a follow up tutorial for hold notes
@officalwmii
@officalwmii 2 года назад
@@SkyanSam Oh wow Much appreciated!
@999dunkins
@999dunkins Год назад
Thot spotted
@ShiroCh_ID
@ShiroCh_ID Год назад
@LyingTurkey thats unfortunate also i whoukd like to uses something like .osb format from osu or .sm and .ssc from stepmania for compatibity reason since theres not much thing we can use in midi(unless you go full length into .bms rabbit hole from Bemani)
@Blessy4543213
@Blessy4543213 3 года назад
I needed to know how to make a rhythm games for a job to be done, thanks, without you I think I would never have succeeded, it's not easy
@SkyanSam
@SkyanSam 3 года назад
You're welcome, I'm glad i could help :)
@WahRizz
@WahRizz 3 года назад
this is a really good idea! Plus ialready know a bit about lmms. So thank you :))
@njohnnyc
@njohnnyc 3 года назад
Amazing. Great job!
@SkyanSam
@SkyanSam 3 года назад
Thank you!
@jaydenlee1651
@jaydenlee1651 3 месяца назад
ur the goat bro this helped so much come back to youtube
@SkyanSam
@SkyanSam 3 месяца назад
Thanks! I'm trying to come back but every time I plan a video I feel like a perfectionist 😅
@1mmy
@1mmy 7 месяцев назад
hey i dont know if youre still active but im getting an issue where unity cant actually find the midi file. its trying to use a path that doesnt work. for example if the actual path is D:\X\Y\Z, unity is trying to use D:\X\Z. i am not a coder in any way shape or form, im using this video for my college project which is arts focused, but i need to do all the development too
@majelislaguanakindonesia2106
@majelislaguanakindonesia2106 3 месяца назад
very cool bro
@wtfizgingon
@wtfizgingon 3 года назад
Using the "My-Die" format lol its "Mid-E" bro
@surrealducks
@surrealducks 11 месяцев назад
Super helpful tutorial, many thanks. Question at 14:50 -- why are we using Vector3 when the game is 2D?
@flofdev
@flofdev 10 месяцев назад
The Unity game engine always has three directions. In a 2D template, this is just not shown because the scene view is in 2D mode and the camera is orthographic. The third z-axis is always there though.
@surrealducks
@surrealducks 10 месяцев назад
@@flofdev ah I see. Thank you for explaining!
@simw7409
@simw7409 7 месяцев назад
Great tutorial for a base of a rhythm game! I'm trying to do one on mobile, but how would you implement different types of notes such as long note or flick note?
@everybodylmao
@everybodylmao 2 года назад
Did you ever find out how to make long notes?
@centigames
@centigames 3 года назад
Thank you so much for this great tutorial! I participated in the rhythm jam and made a pretty decent game thanks to you! I also uploaded a video on my channel about it if you're interested :)
@SkyanSam
@SkyanSam 3 года назад
I'm glad I was able to help you make your game. I'll check out your devlog! :)
@BludPanda
@BludPanda Год назад
Idk if you're still answering questions, but my application of this code causes the note times to be a higher tempo than the actual song. My test shows the note being played nearly 2x speed compared to the song. Do you have any idea why this could be? I am using notes from multiple octaves that have chords [so some overlap of notes].
@BludPanda
@BludPanda Год назад
So it is in time now I think since I multiplied the time conversion by 4 [idk why that works] but now I am noticing that it is totally skipping over certain notes in the song. My hypothesis is that it is notes on the same key overlapping somehow.
@BsetXOXO
@BsetXOXO 2 года назад
For over a decade now I've been calling these files "mid-ee" files and am a musician - I am afraid to find out if I have been wrong for so long now that I am questioning my pronunciation.
@SkyanSam
@SkyanSam 2 года назад
No mid-ee is the correct spelling. I actually got the pronounciation messed up. I wont mess up next time hehe sorry
@piwupi9016
@piwupi9016 3 года назад
Hello SkyyanSam, thank you very much about this tutorial, I have a question about this video in 3:05 , you press the button to record, I want to know that the track automatically recorded by the software ,or you press keys on your keyboard while recording? I am sorry that I know nothing about music...thank you and looking forward to your reply...
@SkyanSam
@SkyanSam 3 года назад
You press your keys on your keyboard while recording
@kenteastwood1
@kenteastwood1 2 года назад
How do you know where to place the white line? is there math behind when the beat is due and where to place the line or is it just trial and error adjusting the line according to the audio?
@BTN4
@BTN4 2 года назад
Amazing tutorial! I used this to upgrade my charting system in my rhythm game. I do have one question, though. How could I add long notes? I already have long note prefabs set up and everything. I just don't know how to go about programming it in the script.
@SkyanSam
@SkyanSam 2 года назад
Glad you found the tutorial helpful. I've been working on a footnote to this tutorial on implementing hold notes but other circumstances have been slowing me down. If you wanted to check if a note is a hold note you could get note.Length and use TimeSpan to convert it to metric format (seconds). If the length in metric format is greater than a certain value, then its a hold note, else it is a regular note.
@BTN4
@BTN4 2 года назад
@@SkyanSam Okay, thank you so much for explaining it to me!
@TheVonWeasel
@TheVonWeasel 2 года назад
hearing it pronounced "my die" rather than "mid ee" was quite the shock
@ojd2678
@ojd2678 7 месяцев назад
Hey, so I made a rhythm game with similar functions for the buttons, but right now I am trying to figure out how to let the player choose their own key binds. If you could lead me in the right direction, I would greatly appreciate it.
@Orioxified
@Orioxified 6 месяцев назад
I just did this in my game not long ago, I will say it was a ridiculously stupid endeavor that I somehow was able to get working! However my code is definitely not the best... I wanted three different control schemes rather than a keybinding method. There are tons of different tutorials out there for keybindings in unity, but for my set control schemes route I set up three enums, then had 3 buttons in a control settings screen set to select between those schemes. and the selected schemes read off three different dictionaries of keycodes... It is a nasty set up that i don't recommend, but until someone recommends something better I'm stickin with it lmaoooo. I wish you luck
@yahyaayyash3851
@yahyaayyash3851 3 года назад
Thank you for the tutorial, really helpful. However, I found out the notes movement is very choppy, is there any fix for that? Also, how do you make a long notes? Thanks
@ManishMistry-iq8wc
@ManishMistry-iq8wc Год назад
and how do you create those notes are those created randomly by tapping on keyboard ?
@ManishMistry-iq8wc
@ManishMistry-iq8wc Год назад
how you created those notes are those notes created randomly by tapping ?
@helrebekahharper4090
@helrebekahharper4090 Год назад
This is great for more intermediate unity devs but is there a tutorial that uses drywetmidi for beginners does anyone know? sorry this probably isnt the place to ask! I enjoyed watching this though!
@sw4gLEe
@sw4gLEe 2 года назад
Now I'm learning from this video. Great tutorial!! Could you give me some advice? If I wanna change the starting direction of the notes from Y (Up) to X (Right) or -Y (Down). What should I do? (I never made a game ;)) Thank you, sir.
@SkyanSam
@SkyanSam 2 года назад
If you want the notes to appear coming from the bottom instead of the top just make sure TapY is greater than spawnY. You could just switch the values of tapY and spawnY and in theory everything should work since the position formula is based on leaping. For changing it so the notes come from the right, you could edit Note.GetPosition() and switch position.y and position.x. What you could do is something like this var temp = pos.x; pos.x = pos.y; pos.y = temp; You could also directly edit the vector in Note.GetPosition(). Hoped this helped! :)
@sw4gLEe
@sw4gLEe 2 года назад
@@SkyanSam Thanks a lot man. I'll try this, sensei. 👍👍👍
@quark8514
@quark8514 Год назад
Next video when? 🤨
@nanintudiosindiegamesandmusic
@nanintudiosindiegamesandmusic 2 года назад
how would you go about changing songs?
@wendef3956
@wendef3956 2 года назад
This tutorial really helps me a lot. 👼I really appreciate this!
@katiesoden6394
@katiesoden6394 2 года назад
Would you have any advice on how to slow down the arrows a bit so they don't scroll down as quickly? They pop up on the screen a bit too quick for me.
@SkyanSam
@SkyanSam 2 года назад
You can increase the noteTime variable of SongManager.cs
@katiesoden6394
@katiesoden6394 2 года назад
@@SkyanSam Thanks for the help!
@sakawijaya2911
@sakawijaya2911 Год назад
how can I find out how many notes are in one music?
@possqueenvivvie
@possqueenvivvie 3 года назад
Not sure exactly what I'm doing wrong, but note movement is very choppy which makes it impossible to tell if it's reading the midi correctly
@possqueenvivvie
@possqueenvivvie 3 года назад
looked into it, apparently the issue is the song time is only incrementing every other beat?
@SkyanSam
@SkyanSam 3 года назад
Thats odd since the notes use a lerp function that takes in the time from SongManager.GetAudioSourceTime() Maybe try and print SongManager.GetAudioSourceTime() in update and see if there is/isnt a difference
@trlcdhck
@trlcdhck 2 года назад
Hi, I followed along your tutorial, but the project only works with your example MIDI file and not anything I made. My MIDI is also made with LMMS, and the only difference I can think of is that I used only two notes (A and B) for simplicity. I know this is a broad question, but do you have any leading theories on where I could have gone wrong in making/exporting the MIDI?
@assassin1074
@assassin1074 9 месяцев назад
is it generate notes by its on or your pressing keys?
@SkyanSam
@SkyanSam 9 месяцев назад
Notes are created in the game based on the MIDI file you use. I'm pressing notes to create the MIDI in LMMS/FL because thats what I've found intuitive when creating a beatmap.
@Orioxified
@Orioxified 6 месяцев назад
If anyone can help me out it would be greatly appreciated! I have an existing rhythm game project I'm working on and I'm ready to add in a note spawner. I was recommended this tutorial and honestly it works great!! However there are many elements of it that seem way more complicated than I'm ready for and go into topics I simply don't need. I already have my songs, notes, buttons, logic for all of them, scoring, the absolute only thing I want to carry over to my project is the Note Spawning from MIDI mechanic... I can just manually place them in position but I feel that's a poor way to do it, and I'm sure there are array spawning methods, however I'm not experienced enough with coding to know how to do that without introducing possible lag or timing offsets... Would love any advice!!
@SkyanSam
@SkyanSam 6 месяцев назад
The only thing that you'll need for your project most likely is all functions that work with midi in SongManager.cs and in Lane.cs, intheory you should be able to put those in your project and then use the array of timestamps and the array of the midi note types to spawn notes from, if you have any more questions feel free to join my discord and I'd love to help you out 👍
@mtc
@mtc 2 года назад
How would I go about changing the input to WASD instead of the arrows?
@monkeyrobotsinc.9875
@monkeyrobotsinc.9875 2 года назад
Stop making games
@everybodylmao
@everybodylmao 2 года назад
Stop making games
@kornelhavasi9597
@kornelhavasi9597 Год назад
just set the input variable on the lane scripts to WASD
@InfiniteRailFan-zv9zc
@InfiniteRailFan-zv9zc 2 года назад
it says could not find a part of path. how do i fix this?
@youngjunkong7187
@youngjunkong7187 2 года назад
hello sir, thanks to you, i am learning how can i make the rhythm game well, i am so thankful that, btw i can not know what is melanchall drywetmidi it is, and where can i find it, and how can i put in my project of unity, and i am re-thankful that yout efforts, thank you sir
@santiromero7057
@santiromero7057 2 года назад
ik it doesn't matter but as a music nerd hearing you say "mydy" instead of "midee" is killing mee
@jefflim69
@jefflim69 2 года назад
Thank you for share , But does it works on Android Device ? I tried this build but not shows Note .
@SkyanSam
@SkyanSam 2 года назад
For it to work on android devices you likely want to use Input.GetTouch(0) and then use the position to determine what lane the screen touch corresponds to.
@shashurimagrease2890
@shashurimagrease2890 2 года назад
@@SkyanSam No, I have encountered the same issue, for some reason it seems not to be reading the Midi files because it works for the editor just fine too. That is the game doesn't start at all and no sound is being played after the build.
@dstails_4599
@dstails_4599 Год назад
I've been following along to try and figure out how to make a Rhythm game myself, and it's been very helpful! However I'm confused about something that's happening with my notes, namely that they're not moving smoothly with lerp. Maybe I made a mistake with the code but the value of t in the notes jumps up by .5 every second and as a result the notes are just moving slowly. Do you know what this could possibly be? Thanks in advance! EDIT: I realised the mistake I made! Turns out I forgot to cast the result of GetAudioSourceTime as double, so it was probably being returned incorrectly
@SkyanSam
@SkyanSam Год назад
Glad you were able to figure it out!
@shadowsabre703
@shadowsabre703 2 года назад
for some reason the StreamingAssets folder just doesnt show up in my editor
@SkyanSam
@SkyanSam 2 года назад
I forgot to mention this. You have to add the folder manually in the assets folder if it is not there. You can do this in Unity or file explorer.
@rauchgal
@rauchgal Год назад
god bless u
@asdfish82
@asdfish82 3 года назад
I'm trying to make a unity vr guitar hero like game, using the maps from frets on fire, i don't know why but adapting your code the tempo of the song and the tempo of the midi don't match
@SkyanSam
@SkyanSam 3 года назад
Ah, if you are using a custom map it may use a different tempo that might not map up with the seconds of the song. I'm guessing if you load the custom midi from the frets on fire map into LMMS, the midi song time will be different than what the song time should be. Maybe you don't want to get the tempo from time, but you want to get the tempo from time signature. I think there is a function in the DryWetMidi documentation that allows you to do that
@asdfish82
@asdfish82 3 года назад
@@SkyanSam awesome thanks, will look into that!
@omaraguayo5843
@omaraguayo5843 3 года назад
HELP! I don't know if I'm doing something wrong but whenever I place the Song Manager script, I don't have the options to Have Audio Source, I just get a Greyed out "Script SongManager" and nothing after that Idk why :( (I'm completely new to this so it would help alot if someone could help!
@SkyanSam
@SkyanSam 3 года назад
Are your variables public? If not your audiosource should be defined like so "public AudioSource audioSource;" If they are public then something else seems to be causing the issue, restarting Unity may also help
@mohangupta9496
@mohangupta9496 Год назад
Great tutorial, it's been super helpful! I've created my own guitar hero like game with it. I've added a feature so that users can adjust the the BPM of the midi file playback. However, I'm running into an issue where at lower BPMs, the screen will wipe all of the notes off the screen before ending the song. It's totally fine at say 120 BPM but not at 85 BPM for example. I'm pretty stumped on why this behavior is occurring and haven't been able to figure out what's causing it through debugging since it's not throwing any errors. Here's the code I used to change the tempo map based on user selected BPM (speed). Any help would be greatly appreciated! midiFile.ReplaceTempoMap(TempoMap.Create(Tempo.FromBeatsPerMinute(speed)));
@t404_null
@t404_null 3 года назад
What Do I hear? I hear Camellia.. no, I hear a song of Dachitrax's member...
@t404_null
@t404_null 3 года назад
But thanks to a part of your video, I'm trying to make my rhythm game now :D
@JerryOhh
@JerryOhh 2 года назад
Can you make keyboard mania from arcade into mobile phone (para hindi na ako gagawa at magiisip pang ng mga design)
@chengkunli226
@chengkunli226 2 года назад
DryWetMidi version?
@kazimthagoat4337
@kazimthagoat4337 Год назад
I find making the notes for the music way too hard, any tips?
@kazimthagoat4337
@kazimthagoat4337 Год назад
To be specific charting the song on LMMS.
@suphamongkolnounjun7253
@suphamongkolnounjun7253 2 года назад
How to change notename > note c#2
@ericktellez7632
@ericktellez7632 3 года назад
Midi is pronounced “Me Dee”
@gdskulll4875
@gdskulll4875 2 года назад
WE HAVE THE SAME SUBSCRIBER COUNT
@SkyanSam
@SkyanSam 2 года назад
WOW THATS PRETTY COOL :D
@gdskulll4875
@gdskulll4875 2 года назад
@@SkyanSam Woah youre still alive wtf
@walney2008
@walney2008 2 года назад
please tutorial games tiles hope, tiles piano, guitar hero ?
@zdrett
@zdrett Год назад
I got tons of errors, even by getting the source code in Unity...
@SkyanSam
@SkyanSam Год назад
What Unity version are you using?
@PokeProfSunny
@PokeProfSunny 9 месяцев назад
Its helpful to watch this video at .75 speed
@crow_craft6094
@crow_craft6094 3 года назад
First jinxed you got jinxed
@joybreegaming8781
@joybreegaming8781 3 года назад
that doesn't even make sense
@crow_craft6094
@crow_craft6094 3 года назад
@@joybreegaming8781 context jinxed said that they are gonna be the first to comment
@joybreegaming8781
@joybreegaming8781 3 года назад
@@crow_craft6094 ah lol
@999dunkins
@999dunkins Год назад
I can't understand a THING
@xavieracaling6866
@xavieracaling6866 3 года назад
i don't do rhythm games dev, this made me confuse for somehow or probably im just lazy.
@Lightspeed6
@Lightspeed6 3 года назад
"My-Die file" .-.
@wtfizgingon
@wtfizgingon 3 года назад
You say My Die so much bro you need to reupload how did you not learn how to say midi correctly haha
@SkyanSam
@SkyanSam 3 года назад
I probably could reupload but too much effort and its only a minor error xD Someone commented on that too earlier I'll keep that in mind if i do something similar like this again
@dietalarmclock2607
@dietalarmclock2607 3 года назад
@@SkyanSam just play it off like its how millenials say it
@dietalarmclock2607
@dietalarmclock2607 3 года назад
@@SkyanSam yo, but you say whav not wave...hmmm
@whatever7338
@whatever7338 4 месяца назад
MADA file
Далее
The Secret To Good Rhythm Games
15:50
Просмотров 149 тыс.
Making a RHYTHM Game in 2 Days!
5:55
Просмотров 151 тыс.
На самом деле, все не просто 😂
00:45
What Makes Good Rhythm Game UX?
16:10
Просмотров 135 тыс.
SYNC YOUR UNITY GAME TO THE BEAT
15:00
Просмотров 16 тыс.
A guide to our alphabet
20:08
Просмотров 219 тыс.
I Made a Rhythm Game About Hot Dogs (Devlog)
11:13
Просмотров 8 тыс.
3 Months of Developing a Rhythm Game in Unity
5:04
Просмотров 55 тыс.
How I Beat The Password Game
39:53
Просмотров 1,7 млн
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 722 тыс.
C++ Developer Learns Python
9:26
Просмотров 2,7 млн
How To Make a Rhythm Game #1 - Hitting Notes
22:21
Просмотров 228 тыс.
Complete Godot Rhythm Game Tutorial
23:02
Просмотров 67 тыс.
На самом деле, все не просто 😂
00:45