ekolis / FrEee

An open source clone of the classic 4X game Space Empires IV.
http://edkolis.com/freee
48 stars 13 forks source link

Port game to Xamarin #13

Open ekolis opened 5 years ago

ekolis commented 5 years ago

Xamarin runs on a variety of platforms and it would be cool to have a mobile version of the game! Oddly Xamarin doesn't run on Linux though...

ekolis commented 5 years ago

I believe this would require converting FrEee.Core to a .NET Standard library; I've tried this in the past and run into issues, but maybe it won't be as problematic with newer versions of .NET Standard?

ekolis commented 5 years ago

I think I found a way to run Xamarin on Linux - you need to create a GTK# app: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/other/gtk?tabs=windows

I tested this with an app I was working on for my job and I was able to create a GTK# app that runs on Windows; haven't tested it on Linux yet...

ekolis commented 5 years ago

OK, I tested my work app on Linux and I get an error...

https://stackoverflow.com/questions/58068286/filenotfoundexception-when-running-a-gtk-app-in-mono-on-linux

https://stackoverflow.com/questions/57997705/error-cs0234-after-changing-the-net-framework-version-of-my-xamarin-gtk-app

ekolis commented 5 years ago

We might need to port the game to .NET Core #20 first in order to port it to Xamarin?

KarbonKitty commented 4 years ago

If the goal is to get multi-platform GUI going, it seems that there are a couple of alternatives that should be better when targeting desktop (as Xamarin seems to be mostly focused on mobile apps at the moment). Two that I found are Eto.Forms (https://github.com/picoe/Eto) and AvaloniaUI (https://avaloniaui.net/), both of which are open source at work across Windows, Linux and Mac.

From what I gather, the WinForms code is reasonably well decoupled from the back-end, and thus it should be relatively easy to port the game to one of those platforms, which should have enough capabilities to handle it.

ekolis commented 4 years ago

Hmm. I've heard of Avalonia; I had issues trying it out because the forms designer was broken or missing or something like that. Never heard of Eto; I'll have to look into that. There's also Blazor, which is supposedly going to be expanded to support not only web apps but desktop and mobile apps as well, but that doesn't sound like it will be happening until next year.

ekolis commented 4 years ago

Now that we have the game converted to .NET Core, I tried creating a Xamarin project for it. All went well, until I tried to link in the FrEee core project; it needs to be a .NET Standard project in order to be linked from Xamarin, but .NET Standard is missing some certain APIs (such as scripting) that we need. I suppose this will all be sorted out with the release of .NET 5, unifying all the various .NET platforms?