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