I.K.E.M.E.N GO on Raspberry Pi 4 [Now with an Install Guide!]
-
@joamjoamjoam Nice work! Really interesting that a single constant value was all that it took to break (and now fix) palettes, kinda makes me wonder how exactly that bit of code came about in the first place. Once again, a massive thank you for your help!
Also, I just now finished my first draft of the scriptmodule:
#!/usr/bin/env bash # This file is part of The RetroPie Project # # The RetroPie Project is the legal property of its developers, whose names are # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. # # See the LICENSE.md file at the top-level directory of this distribution and # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md # rp_module_id="ikemen-go" rp_module_desc="I.K.E.M.E.N GO - Clone of M.U.G.E.N to the Go programming language" rp_module_licence="MIT https://raw.githubusercontent.com/Windblade-GR01/Ikemen-GO/master/License.txt" rp_module_help="Copy characters, stages, screenpacks, etc. to $romdir/ports/ikemen-go" rp_module_section="exp" function depends_ikemen-go() { getDepends golang-go libgl1-mesa-dev xinit xorg xorg-dev libopenal1 libopenal-dev libgtk-3-dev libasound2-dev freeglut3-dev } function sources_ikemen-go() { gitPullOrClone "$md_build" https://github.com/Windblade-GR01/Ikemen-GO.git } function build_ikemen-go() { go clean go mod tidy make TAGS='-tags al_cmpt' linux # grabs default screenpack and content required for the game to run; note that the screenpack has a CC-BY-NC 3.0 license make elecbyte md_ret_require="$md_build/Ikemen_GO" } function install_ikemen-go() { cp 'elecbyte/LICENCE.txt' 'ScreenpackLicense.txt' mkdir save sound md_ret_files=( 'Ikemen_GO' 'License.txt' 'ScreenpackLicense.txt' 'data' 'save' 'sound' 'font' 'external' 'elecbyte/chars' 'elecbyte/stages' 'elecbyte/data' 'elecbyte/font' ) } function configure_ikemen-go() { mkRomDir "ports/ikemen-go" addPort "$md_id" "ikemen-go" "I.K.E.M.E.N GO" "XINIT:$md_inst/ikemen-go.sh" moveConfigDir "$md_inst/chars" "$romdir/ports/ikemen-go/chars" moveConfigDir "$md_inst/stages" "$romdir/ports/ikemen-go/stages" moveConfigDir "$md_inst/data" "$romdir/ports/ikemen-go/data" moveConfigDir "$md_inst/external" "$romdir/ports/ikemen-go/external" moveConfigDir "$md_inst/font" "$romdir/ports/ikemen-go/font" moveConfigDir "$md_inst/sound" "$romdir/ports/ikemen-go/sound" moveConfigDir "$md_inst/save" "$configdir/ports/ikemen-go" cat >"$md_inst/ikemen-go.sh" << _EOF_ #!/bin/bash export MESA_GL_VERSION_OVERRIDE=2.1 xterm -g 1x1+0+0 -e 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO' _EOF_ chmod +x "$md_inst/ikemen-go.sh" chown -R $user:$user "$md_inst" }
As you can see there's still some weirdness that should be sorted out (specifically the wall of
moveConfigDir
s could probably be reduced,chown -R $user:$user "$md_inst"
may be over-scoped, andmake elecbyte
probably should go in agame_data_
function), but this is still good enough to install IKEMEN GO in a way that works well with RetroPie's file structure.If you know how to install a scriptmodule into RetroPie manually, this should be testable! Just in case you don't though, here's a super-quick rundown of the procedure:
- If you haven't already, enable SSH on RetroPie.
- Open up whatever SSH program you prefer (I use PuTTY) and log into your Pi.
- Navigate to
/home/pi/RetroPie-Setup/scriptmodules/ports
using thecd
command. - Start up a text editor with elevated priveleges using
sudo nano ikemen-go.sh
. - Paste the contents of the scriptmodule above (in PuTTY, this can be accomplished by first copy-pasting the scriptmodule's contents in this post, and then simply right-clicking the PuTTY window), then press:
Ctrl-X
, thenY
, thenEnter / Return
to save the file and exitnano
. - If done correctly, there should be a new file called
ikemen-go.sh
present (You can verify this by runningls ikemen-go.sh
). You can now exit your SSH program. - From here, you can access and run the scriptmodule like any other; by going into RetroPie Setup and going to "Manage Packages". IKEMEN GO will be under "Experimental".
Addendum: Just for funsies, I made a launching.png image in the style of the Pixel theme's launching images, themed after the default screenpack in IKEMEN:
-
@superfromndso I'm gonna test this soon.
Installing now . Would love to have side by with my mugen -
Yeah it had to do with hoe precise, or imprecise, floating point operation were on the pi vs x86. It wasn't all unselfish either lol I wanted some MUGEN on piCade.
I tried installing the screen pack but was greeted with a permission error on start up.
something about save/stats.json. the ports/ikemen-go folder was missing the save folder also. even after copying a working save folder from my dev branch i got the same error.
let me know if there anything you want me to try. feel free to reach out on discord too.
Also on an unrelated note, I saw your video on the discord and your sound was working perfectly. on my pi4 the sound is garbled and terrible. I'm glad its not a real issue and did you do anything special to fix it?
-
@joamjoamjoam Ah, I see! The
save/stats.json
error happens whenever IKEMEN is unable to write to thesave
folder (this is also why thechown
command is there).I set it up so that IKEMEN GO symlinks the save folder to the
/opt/retropie/configs/ports/ikemen-go
directory since that's where configs typically go in RetroPie; it's possible that some write permissions might be preventing it on your side and I simply didn't realize this due to my permissions possibly being set up non-standard (I use a USB stick to store my ROM collections, and I achieved it by manually symlinking on RetroPie to point to it; I think I might'vechmod -R 777
'd my configs folder and forgot about it).This could probably be fixed really easily; as in just changing it to redirect to the
roms
location instead. Not a huge loss!# the line in question: moveConfigDir "$md_inst/save" "$configdir/ports/ikemen-go" # the (very simple) fix: moveConfigDir "$md_inst/save" "$romdir/ports/ikemen-go/save"
As for the sound thing... I have no idea actually! It just worked flawlessly whenever I installed it, though it was noticeable quiet (I ended up manually boosting the audio volume, both in IKEMEN's config.json and in post using MAGIX Vegas).
-
@superfromnd ah I see let me set the permission correctly in there and then I’ll try reinstalling the scripts with that change for the romdir.
The pi has a really bad sound system and it’s most notable in the volume outputted. If you get a usb sound card like this one on Amazon it makes it a lot better.
Sabrent USB External Stereo Sound Adapter:
Sabrent USB External Stereo Sound Adapter for Windows and Mac. Plug and Play No Drivers Needed. (AU-MMSA) https://www.amazon.com/dp/B00IRVQ0F8/ref=cm_sw_r_cp_api_glt_fabc_J3BVS30PKHX1RQX2MP17?_encoding=UTF8&psc=1Heres the permission for the configs directory if your interested:
So a chown and chgrp to pi on the ikemen folder /opt/retropie/configs/ports worked perfectly and it matched what other ports were doing so I think adding in those will work a charm.
The audio issue is still there however so it might be an issue with my HDMI display and getting sound out of it. I see you were using composite audio out. I grabbed my bluetooth speaker and plugged it into the pi and voila perfect sound. Theres probably some HDMI audio issues with Alsa when using openAL or some configuration I might need to do.
So I think the three outstanding issues are
- add a chown and chgrp to pi for ikemen config folder
- add joystick support (i think we need to pipe DInput into Ikemen but im not sure how the joysticks work on the pi). Ill handle this one and see if i can get my fight stick up and running
- Maybe add a basic config.json file for the pi since it defaults to being windowed 640x480. I had to manually set the fullscreen option to get it full screen for my 1080p display (which I think is unfortunately more common than CRTs these days.) We could use the opputunity to set the default audio volume a little higher for the pi too.
-
@joamjoamjoam
The permissions thing could be sorted out really easily, something like this:function configure_ikemen-go() { mkRomDir "ports/ikemen-go" addPort "$md_id" "ikemen-go" "I.K.E.M.E.N GO" "XINIT:$md_inst/ikemen-go.sh" moveConfigDir "$md_inst/chars" "$romdir/ports/ikemen-go/chars" moveConfigDir "$md_inst/stages" "$romdir/ports/ikemen-go/stages" moveConfigDir "$md_inst/data" "$romdir/ports/ikemen-go/data" moveConfigDir "$md_inst/external" "$romdir/ports/ikemen-go/external" moveConfigDir "$md_inst/font" "$romdir/ports/ikemen-go/font" moveConfigDir "$md_inst/sound" "$romdir/ports/ikemen-go/sound" moveConfigDir "$md_inst/save" "$configdir/ports/ikemen-go/save" cat >"$md_inst/ikemen-go.sh" << _EOF_ #!/bin/bash export MESA_GL_VERSION_OVERRIDE=2.1 xterm -g 320x240+0+0 -e 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO' _EOF_ chmod +x "$md_inst/ikemen-go.sh" chown -R $user:$user "$configdir/ports/ikemen-go/save" }
I might have to tweak it a little bit (maybe using
mkRomDir
to create the folder with user-owner permissions instead of using a secondchown
command), and admittedly I haven't tested this fix yet, but that should do it, I think.That's really interesting that you mentioned fullscreen; for whatever reason whenever I tried to set the fullscreen parameter in IKEMEN to true, it just crashes out entirely, no error log or anything. Maybe it's because I'm not using a window manager like
matchbox
? That might also explain why my IKEMEN window isn't centered when running on a CRT, resulting in accidental underscan.I don't think a default config is really necessary here; a quiet volume is rather easy to remedy by the end user anyways, and adding a custom "default" config might cause issues down the road.
-
@superfromnd i just installed and got the json error as well. Permission denied ... I see you are working on a fix. Greatly appreciated
Would love to have this next to mugen . -
@superfromnd looks good . I think the chown needs to for the /opt/retropie/configs/ports/ikemen-GO folder to be safe. then since ikemen runs as the pi user anything it creates should have the right permissions.
About the default config i agree its better to not make assumptions on what people want I'm sure they can figure out how to use the ikemen settings. I would suggest that we set he fullscreen mode by default but it sounds like it may not work for everyone. I know that retroie has some built-in underscan/overscan options that might need to be applied.
Fullscreen does work for me using HDMI and booting it straight from Emulation Station. If you find anything else about this let me know and i can take a look in the code to see if we need to fix something there.
-
@troopaking In case your wanting a quick fix until Super can get the scriptpack out all you need to do is
sudo chmod 666 /opt/retropie/configs/ports/ikemen-go
chown pi /opt/retropie/configs/ports/ikemen-go
chgrp pi /opt/retropie/configs/ports/ikemen-go
mkdir /opt/retropie/configs/ports/ikemen-go/save -
When I have some time, I can make a "IKEMEN GO Pi" logo if anyone wants it.
After all, this version is very specifically tweaked.
-
Okay, status update: turns out that you DO need to
chown
the entire/ports/ikemen-go
directory, as otherwise IKEMEN crashes due to not being able to writeIkemen.log
as well as saving screenshots. I've moved thesave
folder to a subdirectory in theconfig
folder anyways since that just looks nicer.My current scriptmodule looks like this, tested and confirmed to install IKEMEN GO correctly:
#!/usr/bin/env bash # This file is part of The RetroPie Project # # The RetroPie Project is the legal property of its developers, whose names are # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. # # See the LICENSE.md file at the top-level directory of this distribution and # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md # rp_module_id="ikemen-go" rp_module_desc="I.K.E.M.E.N GO - Clone of M.U.G.E.N to the Go programming language" rp_module_licence="MIT https://raw.githubusercontent.com/Windblade-GR01/Ikemen-GO/master/License.txt" rp_module_help="Copy characters, stages, screenpacks, etc. to $romdir/ports/ikemen-go\n\nNOTE: Both IKEMEN GO and this module are W.I.P and may not work fully yet, if at all. Use at your own risk!" rp_module_section="exp" function depends_ikemen-go() { getDepends golang-go libgl1-mesa-dev xinit xorg xorg-dev libopenal1 libopenal-dev libgtk-3-dev libasound2-dev freeglut3-dev } function sources_ikemen-go() { gitPullOrClone "$md_build" https://github.com/Windblade-GR01/Ikemen-GO.git } function build_ikemen-go() { go clean go mod tidy make TAGS='-tags al_cmpt' linux # grabs default screenpack and content required for the game to run; note that the screenpack has a CC-BY-NC 3.0 license make elecbyte md_ret_require="$md_build/Ikemen_GO" } function install_ikemen-go() { cp 'elecbyte/LICENCE.txt' 'ScreenpackLicense.txt' mkdir save sound md_ret_files=( 'Ikemen_GO' 'License.txt' 'ScreenpackLicense.txt' 'data' 'save' 'sound' 'font' 'external' 'elecbyte/chars' 'elecbyte/stages' 'elecbyte/data' 'elecbyte/font' ) } function configure_ikemen-go() { mkRomDir "ports/ikemen-go" addPort "$md_id" "ikemen-go" "I.K.E.M.E.N GO" "XINIT:$md_inst/ikemen-go.sh" moveConfigDir "$md_inst/chars" "$romdir/ports/ikemen-go/chars" moveConfigDir "$md_inst/stages" "$romdir/ports/ikemen-go/stages" moveConfigDir "$md_inst/data" "$romdir/ports/ikemen-go/data" moveConfigDir "$md_inst/external" "$romdir/ports/ikemen-go/external" moveConfigDir "$md_inst/font" "$romdir/ports/ikemen-go/font" moveConfigDir "$md_inst/sound" "$romdir/ports/ikemen-go/sound" moveConfigDir "$md_inst/save" "$configdir/ports/ikemen-go/save" #MESA_GL_VERSION_OVERRIDE works around an OpenGLES version detection bug cat >"$md_inst/ikemen-go.sh" << _EOF_ #!/bin/bash export MESA_GL_VERSION_OVERRIDE=2.1 xterm -g 1x1+0+0 -e 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO' _EOF_ chmod +x "$md_inst/ikemen-go.sh" #required so IKEMEN doesn't crash when trying to write log file chown -R $user:$user "$md_inst" chown -R $user:$user "$configdir/ports/ikemen-go/save" }
I still need to write a
remove_ikemen-go
function since right now it doesn't do anything, and maybe movemake elecbyte
into agame_data_ikemen-go
function, but other than that it seems mostly good.Also, if it's possible, I'd like to figure out how to get IKEMEN GO to display centered; right now it just displays itself in the top-left corner of the screen (which is probably due to a lack of window manager running). On HDMI you can just use a video mode override to force 640x480, but you can't do that on Composite which is fixed ever-so-slightly off, at 720x480.
ADDENDUM 8/6/2021 10:13PM: I figured out that this
ikemen-go.sh
configuration allows IKEMEN GO to run inmatchbox
:#!/bin/bash export MESA_GL_VERSION_OVERRIDE=2.1 xset -dpms s off s noblank matchbox-window-manager -use_titlebar no & xterm -g 1x1+0+0 -e 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO'
Curiously though, instead of starting the window centered like one would expect, instead it runs the game in the bottom-left corner, not the top-left. Fullscreen also doesn't crash the engine anymore, though it also doesn't work properly as the viewport ends up offsetting itself vertically. (The effect can be reduced by switching the game's resolution to 720p, but it doesn't fix it.)
This at least proves it's possible to run the game with
matchbox
, but hilariously it seems to actually do nothing at all to improve the IKEMEN GO experience on RetroPie. -
@superfromnd Yeah i thought i saw someone in the discord talking about having it center by default. The initial window position is handled in the code by glfw. Interestingly on the desktop version of raspbian it was always starting in bottom right corner lol.
I think the better fix for this situation would be to use fullscreen since that matches what every other retropie port/emulator does so I think its what the average retropie user would expect. We could probably add the window start position to the options but we would have to submit a feature request and get it approved.
-
I thought I had a lead to fixing the fullscreen bug; turned out to not be anything but I thought it was worth mentioning here anyways:
When starting IKEMEN GO in Matchbox, this warning would pop up briefly:
WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown
I thought that this was somehow related, and a quick Google search lead me to find that installing
at-spi2-core
fixes this warning. Unfortunately, that's all it does, as it doesn't affect IKEMEN GO whatsoever (the warning didn't affect IKEMEN GO at all, whether it was there or not).It also seems like fullscreen in general is just kinda wonky in IKEMEN GO, at least for me: toggling fullscreen on and then off causes the IKEMEN GO window's viewport to be offset a bit, at least on Windows 7:
I'll report this as a bug on their Github, and hopefully fixing this will also fix fullscreen stuff in Matchbox.If all else fails, we can at least just tell folks to use the video mode override in RetroPie to "force" full-screen (although this wouldn't work on composite out due to it using a fixed 720x480 resolution.) My own workaround for composite is just deliberately configuring the Pi to have an offset overscan:
# /boot/config.txt settings I use for IKEMEN GO on CRT # Note that these are only grouped here for visual convenience # In the actual file, search for these lines and uncomment/adjust accordingly enable_tvout=1 disable_overscan=1 overscan_scale=1 overscan_left=30 overscan_right=-10
-
I'm new to the topic so apologies of this is a tired question. But what exactly is the compatibility for MUGEN titles on IKEMEN? Can this basically play most MUGEN games on the pi, or do they need to be recompiled for IKEMEN specifically?
-
@duiz IKEMEN GO is fully backwards compatiable with MUGEN stuff, pretty much the exact same file structure (with the only big difference being a lack of mugen.cfg, with config.json taking that functionality).
I actually tested Hyper Dragon Ball Z over here on Twitter, and it pretty much worked with near-zero hassle (the only thing I had to modify was a single line in
system.def
to fix a broken file path). -
@superfromnd Interesting. Has anyone tried that Justice League vs TMNT to see if that works?
-
@duiz Not to my knowledge, but theoretically it should work just fine.
-
Im having reproducing the fullscreen lets call it wonkiness that you saw on Windows 7. I have .97 release on windows 10 (a brand new laptop actually) and i can toggle fullscreen on and off without issue. What Ikemen version are you using?
I also installed a fresh retropie distro on a fresh sd card and was able to run the og scriptpack with the manual permissions fix without issues. Setting fullscreen on that also worked as intended on a 4k TV via HDMI.
I wonder if the issues you are seeing are related to overscan and running on your super fancy CRT. The fullscreen and resolution options are handle by a well tested graphics library (GLFW) so i wouldn't suspect that there is something wrong in the Ikemen source. It doesn't handle overscan natively as digital video outputs do no use overscan (usually) so that could explain why your video is offset. If there was anything that might be needed to be handled buy Ikemen it would be the sset your screen size stuff that games do where you have to shrink the screen until you see the arrows but that is done under the hood by just chaninging the resolution on the screen.
You can do this in the config.json by setting a custom resolution to see if it resolves the screen being off center.
Just for clarity the fullscreen bug you mention is the screen being off center leaving black bars on the screen or cutting off the screen etc? If so is this only on a CRT or does this also affect a screen using hdmi or other digital output?
-
I just added TMNT to my arcade last night and it converted to Ikemen just fine. Its as simple as taking all the Mugen files and copying them on top of the Ikemen files. Then you have to start Ikemen once to generate a config.json file in the save folder. After that copy the motif setting from data/mugen.cfg to the motif field in save/config.json.
-
@joamjoamjoam I just now re-tested fullscreen (using the regular launching script, not
matchbox
) and it seems to work on HDMI now, strangely enough! Previously it would just instantly crash the second I toggled it on, but I guess at some point that got fixed on RPi. Or maybe the crashing was always fixed on HDMI, and it only crashed when trying to run fullscreen on composite... actually that probably IS the reason.You can indeed just set a custom resolution (720x480) on IKEMEN to fill the screen on composite (though that's not ideal for me since that results in slightly upscaled sprites, which looks a little weird; it's something that can always be fixed later down the line though). Admittedly I spend almost all of my RetroPie time on HDMI anyways; the CRT I used to record demos was purely for looks (as MUGEN/IKEMEN running on a CRT just looks plain awesome).
The bug I was running into via
matchbox
was very different; the screen would be correctly set to the given resolution, but when trying to fullscreen,matchbox
would crop itself to the top-left corner and not adjust itself to the position of the game, resulting in most of the game's screen being cropped off:
I'm assuming that this is because of OpenGL fundamentally using the bottom-left corner as its basis instead of the top-left. Since the fullscreen crashes I was getting earlier have apparently fixed themselves,matchbox
won't be needed anyways, but it's still pretty odd. The main reason I was trying to use it was hope that it would center the IKEMEN window (which would solve my CRT display problems), but for whatever reason that doesn't seem to be the case.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.