Page 1 of 1

BeatFever Mania -- An osu! CtB reimplementation on RPi

Posted: Tue Jan 19, 2016 7:54 pm
by Sulunia
Image

Hello guys!

As I said some time ago, me and a friend were working on a rhythm game on the Raspberry Pi.
After some rough development and many shed tears, we finally managed to cough something up that works (quitting crashes it, but meh, it works!)

And now, we're proudly releasing all the source code on github, so you can cringe while reading thousands of pun jokes and non commented python code. learn something with it. :lol:

How to run it tough?
- Grab the files on github. You'll need to install pi3D in order to run then.
- Grab an osu! beatmap. Unzip its files (.osz is actually a zip file!) in a folder, rename the folder to your liking.
- Rename the .mp3/.ogg file to Song.mp3 and the desired difficulty to DataNew.osu (ONLY ONE DIFFICULTY PER FOLDER!)
- Create multiple folders for multiple difficulties.

Then, just launch the Launcher.py file and stuff should automagically happen.
Ingame performance is 60 FPS 24/7 on a RPi 2. I believe the RPi B+ would need some overclocking, not sure.
Requires Full HD screen! hardcode perks I guess.

Known bugs
- Some songs will play at an incorrect speed. Blame pygame on this one.
- I think there was a bug with Unicode characters in .osu file parsing. (workaround: remove japanese characters from any .osu files)
- Rarely, an alsa underrun may occur. Again, I believe pygame is the one to blame.
- Some songs may begin before the game window is rendered.
- No red fruits, some jumps are impossible (10/10 would impossibru again)
- Possible fruit timing problems (fruits end after another pops in)
- Bananas randomly disappear in bonus sections.
- Sliders only partially implemented (Repetitions)
- No real way of setting up latency. Needs code tweaks depending of screen. (Really sorry about it)
- Beatmaps with subdirectories crash the launcher (thanks paddyg)

There is probably a bit more i just forgot, since it's been 5 months the game was "released" (we presented the faire). I'll update this thread as we work on fixing these.

Final thoughts
We really apologize the sort of unfinished software here, but we're getting back on the tracks. I won't promise fixing everything, but I'll try my best. Doing this sort of rhythm game thing was kinda of an achievement, especially since it's on a RPi.
I'd like to give a huge thanks to paddyg for helping us out when we were first developing this (a bunch of smileys lagging down the screen).
Also, there is added GPIO support for ingame events, such as picking fruits, music BPM sync and Kiai Time mode. If anyone is trying to build a custom arcade that flashes stuff accordingly, this can be done.
The character ingame is a property of peppy, owner of osu!.

Allright, feedback/pull requests is appreciated, other bug reports are also appreciated. I will also help anyone out with troubles running the game/understading the code in this thread.

You can also hit Daniel on github as well, he will help out so long no one has nerfed warlock on WoW. :lol:

Project Link: https://github.com/danielpontello/beatfever-legacy

Re: BeatFever Mania -- An osu! CtB reimplementation on RPi

Posted: Tue Jan 19, 2016 8:00 pm
by segfaultd
Hello everyone! I'm the other developer for the project (mainly on the 'ugly hacks' department). I don't check this forum often, but feel free to ask anything about the project here.

Re: BeatFever Mania -- An osu! CtB reimplementation on RPi

Posted: Fri Jan 22, 2016 10:27 am
by paddyg
Hi, I've got round to having a look at this at last.

The most important thing is that I did manage to get the program running on the Raspberry Pi with some randomly selected osz files downloaded from the internet (with limitations see below). So well done for that.

My comments, in descending importance:

1. Mixing space and tab indents is a really bad idea. It makes it almost impossible for anyone else (or yourself a few months later) to edit the code. Specifically nota.py line 18 didn't work on my computer.
2. Launcher.py and OsuPi.py have a lot of duplicated code which is always bad for maintenance and finding bugs (or hacking to get it to run as in my case - I don't have sufficient pixels so had to change the pygame initialisation to (0, 0))
3. Couldn't you scale everything, including the bowl speed, to match the screen size?
4. Without reading through the code it was hard to figure out from your description what to do with the extracted osu beatmap directory. You have to create a new directory 'songs' inside beatfever-legacy. It would be good if you included this on your github repo with a really simple osu beatmap inside it that you knew worked.
5. Some beatmaps I tried failed at OsuPi line 58 with a unicode decode error. I could fix this by

Code: Select all

with open("songs/" + song + "/DataNew.osu", "r") as file:
  data = file.read()
  file.seek(0)
  fileLines = file.readlines()
but there might be a nicer way.
6. Some beatmaps had subdirectories with images in that crashed as the directory walking went down into them and couldn't find Song.xxx or DataNew.osu
7. There didn't seem to be a file beatfever-legacy/click.wav (I hacked the code to point to one of the other wav files.)
8. In exchange for my contributions would you mind changing the name of the list variable in Launcher around line 57?

Re: BeatFever Mania -- An osu! CtB reimplementation on RPi

Posted: Fri Jan 22, 2016 5:43 pm
by Sulunia
Well, this is called "coding stuff almost falling asleep at 3 AM two days before due" and "two coders not deciding whter to use spaces or tabs".

Allright, explanations:
1- Midnight coding. We'll fix it surely!
2- As a weird fact, Launcher was made before the game itself, and since we had little time to do everything, we recycled code. Awful. We'll rewrite the launcher tough.
3 - We started doing it this way, so the game would work with whatever resolution. Then, time constraints happened, besides the fact we struggled a lot with pi3d running at first. So we decided to keep everything hardcoded for a resolution. Again, will be fixed.
4 - We didn't include an osu beatmap with the game because we don't know if we can without getting in trouble.
5 - Known bug. Fix soon! (and thanks for the suggestion)
6 - Huh. I guess we'll have to look into that. Thanks for reporting.
7 - Click.wav was, again, something we had to test out game sync and BPM sync. We removed it once we got timing right.
8 - Eh, fixed. Sorry about it.