As originally a java kid, Iāve never had much trouble with making any of my programs work on Windows, Linux and Mac. With Java, all you have to do is make a jar and then tell people to install Java on their machine. Thatās it. But oh boy, am I getting hit in the face hard now that Iām making a game with MonoGame and .NET Framework.
The story, with all its horrible parts #
Imagine youāre me. Imagine youāre just happily making a game and eventually you decide that you want to distribute it to testers.
The documentation #
So you check the documentation of the framework youāre using: MonoGame, in my case. It advertises itself as being amazing at cross-platform, so I look around to find a simple tutorial on what to do to get my game working on Mac and Linux.
Mono is where itās at. Okay. An open source implementation of .NET (or something like that) that works on Linux and Mac. Great! Now I just need to find out how to easily package that with my game, so that people on those operating systems donāt have to install it on their own.
Mono Kickstart #
So thereās a project on GitHub with a MonoGame fork (meaning they should work together flawlessly!) called Mono Kickstart. It says that you can just add the files to your project, rename a couple of them, change one or two lines in a bash script and then your game will run smoothly on Linux and Mac without having to install Mono.
Yea, no. Some random issue about System.Runtime.dll
not being found, no trace of the issue online, no tutorials anywhere, the Kickstart repository doesnāt have an Issues tab for some reason. Dead end.
mkbundle #
Searching some more online, I found a tool contained in Mono called mkbundle, that, apparently, you can use to bundle standalone applications for Windows, Linux and Mac by just running a simple command. Seems easy enough.
Yea, no. Installing Mono on Windows is a huge pain. mkbundleās target downloading doesnāt work on Windows, so I have to go into some obscure folders, download some obscure zips, rename them, move them around until it finally works.
Hah. For some reason, mkbundle now requires me to install Visual Studio. So I install their commandline build tools that, after asking in my Discord, are apparently what mkbundle wants to use for something.
So then it finally works, and I have aā¦ yea, no. Apparently now, mkbundle canāt find System.Runtime.dll
, just like Mono Kickstart couldnāt before. So I search around in some folders and notice that that dll is in a sub-folder instead of the main folder it tries to look for it in, so I tell mkbundle that itās in that subfolder through a long and annoying addition to the command, and now it finally works.
Yea, just kidding. Now it crashes because it canāt find stdint.h
. Itās neither telling me where itās trying to look for it, nor why it even needs it, what it is or really anything of use at all. Dead end.
.NET Core #
After some more looking, I find that .NET Core is basically a better version of .NET Framework (itās actually a lot different, but that doesnāt matter in the scope of this post) that actually runs on multiple platforms natively.
So I go through the process of upgrading my game project from .NET Framework to .NET Core, and everything finally works. I can really easily use my IDE (Rider) to publish packaged builds of the game for Windows, Linux and Mac that donāt even need the user to have .NET Core installed.
Except that it doesnāt run on my Laptop for some strange reason. It runs fine on my PC, and it runs fine on my boyfriendās computer and his Linux VM, but my Laptop has some obscure issue about MonoGame not being able to load the shaders it requires. There are also no traces of the issue online, and after some looking around, I realize that MonoGameās .NET Core implementation is, according to the repository, just a hack that also hasnāt been updated in over a year. Dead end.
(Also, I had a weird issue where, with the newest version of MonoGame for .NET Core, my game would randomly stutter, and while the MonoGame Discord was unhelpful and one person was frankly unreasonably rude in my opinion, I found out that it isnāt the fault of my code (after plenty of profiling) and that the issue is easily fixed by downgrading to an earlier version. Why? Who even knows at this point.)
So I guess Iāll just force the user to install Mono themselves then #
I tested around a bit after going back to .NET Framework and it turns out that installing Mono on Linux isnāt actually that bad, and after you installed it, you donāt even have to run a special command to get the game to run. All you have to do is go into a terminal and run the gameās normal exe, and apparently mono figures itself out without needing to specifically call it. So thatās great!
Except that, on Mac, it seems to be a whole nother story altogether. The one person I asked to try it on Mac installed Mono, but then the system didnāt seem to realize that it was actually installed, as the mono
command didnāt work, and just running the gameās exe directly also didnāt work.
Other stuff I tried #
Because itās so fun, hereās a list of other stuff that I tried to use:
- Some obscure NuGet package thatās supposed to make an easy
msbuild
command to bundle the game. Also didnāt work, but at least I submitted an issue to the projectās GitHub repository. Weāll see what happens, maybe this will be the saving grace. - Some obscure program from three years ago, with outdated packages and outdated dependencies, that was supposed to make it really easy to bundle projects for all operating systems. It had the same
System.Runtime.dll
issue, but because it was so outdated anyway, I didnāt even bother investigating why.
Conclusion? #
Honestly, I donāt know what to do at this point. After finding out how horrible it is to make anything work cross-platform, Iām genuinely considering just rewriting the entire game using libgdx (which is a game framework for Java), or something.
Thereās no real conclusion to this, other than that it took me a whole lot of my time and energy and that it made me buy and eat way too many tubs of Ben & Jerryās ice cream, which is way too expensive, by the way.
Also, the Multiplayer debacle #
As a little side note, I recently added Online Multiplayer to the game in question, using the C# networking library Lidgren.
Its UPnP implementation doesnāt seem to be with my router (or my something else), so I have to manually forward ports as if it were 2003.
Also, one of the testers has a completely different issue about incomplete packets that I have no idea about, and frankly, my energy to work on anything is so low at this point that I might as well just not care about it.
Conclusion #
If youāre thinking about becoming an indie developer, youāll have to deal with this sort of stuff. And honestly, itās going to bring you down. Quite a lot.
A couple weeks ago, I picked up this project again after taking a long break from it out of lack of motivation, and after picking it back up, I was so happy and energized. I reworked the art to make it look really great, I added more sounds, I hired a music artist, I started implementing online multiplayer, I set a personal roadmap for release on itch.io later this year.
And then this whole thing happened, and now my motivation is back to zero. Itās just extra frustrating to me because I was so excited about finally getting back the motivation that I had previously lost.
So yea. Thanks for reading, I guess. <3