Author Topic: Aurora C# for Linux?  (Read 26709 times)

0 Members and 1 Guest are viewing this topic.

Offline Bughunter (OP)

  • Bug Moderators
  • Rear Admiral
  • ***
  • Posts: 929
  • Thanked: 132 times
  • Discord Username: Bughunter
Aurora C# for Linux?
« on: March 28, 2019, 11:35:16 AM »
I guess Steve doesn't care about this but, but who knows after C# he might decide he wants to learn Linux next.

Winforms which would be the main Windows specific dependency (could be others I wouldn't know about) has now been implemented in Mono. So this could make a cross-platform Aurora possible.
https://www.mono-project.com/docs/gui/winforms/

Edit: For running Aurora natively on Linux check later posts in this thread: http://aurora2.pentarch.org/index.php?topic=10320.msg122543#msg122543
« Last Edit: April 20, 2020, 12:13:42 PM by Bughunter »
 

Offline Myvar

  • Leading Rate
  • *
  • Posts: 10
  • Thanked: 17 times
Re: Aurora C# for Linux?
« Reply #1 on: March 29, 2019, 12:21:47 AM »
Unless Steve used some strange lib's or pinvoked the windows api's it should just work, with mono as is.
 

Offline Bughunter (OP)

  • Bug Moderators
  • Rear Admiral
  • ***
  • Posts: 929
  • Thanked: 132 times
  • Discord Username: Bughunter
Re: Aurora C# for Linux?
« Reply #2 on: March 29, 2019, 02:31:21 AM »
Could still be something like file paths if file system differences are not handled in a cross-platform way, but yes hopefully nothing major.. or even nothing at all.
 

Offline lupin-de-mid

  • Petty Officer
  • **
  • l
  • Posts: 25
  • Thanked: 1 times
Re: Aurora C# for Linux?
« Reply #3 on: March 29, 2019, 10:15:47 AM »
But I think that Aurora C# is WPF?
 

Offline Steve Walmsley

  • Moderator
  • Star Marshal
  • *****
  • S
  • Posts: 11649
  • Thanked: 20349 times
Re: Aurora C# for Linux?
« Reply #4 on: March 29, 2019, 10:35:37 AM »
But I think that Aurora C# is WPF?

No, its Windows Forms.
 
The following users thanked this post: lupin-de-mid

Offline lupin-de-mid

  • Petty Officer
  • **
  • l
  • Posts: 25
  • Thanked: 1 times
Re: Aurora C# for Linux?
« Reply #5 on: March 29, 2019, 10:47:32 AM »
Than it should work out the box
like
Code: [Select]
mono AuroraCsharp.exe
 

Offline clement

  • Pulsar 4x Dev
  • Sub-Lieutenant
  • *
  • c
  • Posts: 137
  • Thanked: 13 times
Re: Aurora C# for Linux?
« Reply #6 on: March 29, 2019, 06:55:20 PM »
If I remember correctly, Steve is using the .net framework which would have to be run using wine.

.Net Core works on both Windows and Linux and supports winforms. If in the future Steve wanted to, it is very easy to upgrade to .net core. It is mostly updating package references.
 

Offline Myvar

  • Leading Rate
  • *
  • Posts: 10
  • Thanked: 17 times
Re: Aurora C# for Linux?
« Reply #7 on: March 30, 2019, 02:16:33 AM »
. net core only supports windows forms in windows, better of using mono. 
 

Offline lupin-de-mid

  • Petty Officer
  • **
  • l
  • Posts: 25
  • Thanked: 1 times
Re: Aurora C# for Linux?
« Reply #8 on: March 30, 2019, 06:04:24 AM »
Latest mono could run net. core.  Probably it is possible to run net core winform apps under mono
 

Offline sublight

  • Pulsar 4x Dev
  • Captain
  • *
  • s
  • Posts: 592
  • Thanked: 17 times
Re: Aurora C# for Linux?
« Reply #9 on: March 30, 2019, 08:58:51 AM »
I don't believe it. That's the same Mono/Winform page from 2015, and at the time their "complete support" only meant "will probably compile." From my experience Mono is primarily intended to make programs developed on Linux easy to port to Windows, but trying the reverse is a quick way to discover that some functions behave differently or worse are just placeholders that throw runtime exceptions on execution.

Maybe things are better in Mono 5.x, but even if Aurora C# had compatible winform coding the map rendering code would probably still need to be ported.

In summery anyone who thinks Mono is an easy transition to other OSs should join the Pulsar 4X project. The original group broke apart partially over system incompatibilities, and those continuing have been asking for fresh blood. Granted, half our problems were OpenGL compatibility issues rather than cross-platform WinForm/Mono issues, but still.
« Last Edit: March 30, 2019, 09:10:49 AM by sublight »
 

Offline QuakeIV

  • Registered
  • Commodore
  • **********
  • Posts: 759
  • Thanked: 168 times
Re: Aurora C# for Linux?
« Reply #10 on: March 30, 2019, 04:20:08 PM »
Aurora will run with WINE or it will not, thats probably pretty much going to be the end of it for now.
 

Offline lupin-de-mid

  • Petty Officer
  • **
  • l
  • Posts: 25
  • Thanked: 1 times
Re: Aurora C# for Linux?
« Reply #11 on: March 31, 2019, 03:38:21 AM »
My experience is slightly better than you
Quote from: sublight link=topic=10320. msg113521#msg113521 date=1553954331
I don't believe it.  That's the same Mono/Winform page from 2015, and at the time their "complete support" only meant "will probably compile. " From my experience Mono is primarily intended to make programs developed on Linux easy to port to Windows, but trying the reverse is a quick way to discover that some functions behave differently or worse are just placeholders that throw runtime exceptions on execution.
At work we  have small software developed with winforms.  It was developed under windows and works nicely under mono 4. 8 in linux.

Quote from: sublight link=topic=10320. msg113521#msg113521 date=1553954331
Granted, half our problems were OpenGL compatibility issues rather than cross-platform WinForm/Mono issues, but still.
We use OpenTK   (https://opentk. net/) for  OpenGL for both . net/win and mono/linux.  No problems with mono.  Problems only with Intel Integrated Video Card performance  :)
 

Offline Myvar

  • Leading Rate
  • *
  • Posts: 10
  • Thanked: 17 times
Re: Aurora C# for Linux?
« Reply #12 on: April 01, 2019, 12:54:36 AM »
The map code is just Drawing on the background of an control using something like OnPaint(o, args) or CreateGraphics(); or its just drawn on the image of a picture box, so no opengl, it should just work with mono.
 

Offline Rastaman

  • Azhanti High Lightning
  • Sub-Lieutenant
  • ******
  • R
  • Posts: 144
  • Thanked: 8 times
Re: Aurora C# for Linux?
« Reply #13 on: April 12, 2020, 08:40:59 AM »
It runs!  :D

Ubuntu 18.04.4 LTS 64bit

sudo apt install unrar

unrar x AuroraV100.rar

sudo apt install wine64

sudo apt install winetricks

sudo winetricks dotnet45


This installs .net 4 and then 4.5 automatically, you just have to say yes to everything. There are a lot of error messages in the terminal, ignore them. From what I have seen, Mono is automatically uninstalled in the process. I was not able to install dotnet 47 (newest version?) this way.

Launch with command
wine Aurora.exe
while in the Aurora folder

No guarantees, as my Linux knowledge is limited. I tried mono, didn't work. Good luck!
« Last Edit: April 12, 2020, 09:28:27 AM by Rastaman »
Fun Fact: The minimum engine power of any ship engine in Aurora C# is 0.01. The maximum is 120000!
 
The following users thanked this post: Bughunter, sisso, JuergenSchT

Offline lupin-de-mid

  • Petty Officer
  • **
  • l
  • Posts: 25
  • Thanked: 1 times
Re: Aurora C# for Linux?
« Reply #14 on: April 12, 2020, 09:55:58 AM »
Under mono it necessary to install native version of libSQLite.Interop.so
Than we found problem with windows path separators
Probably Steve use something like
Code: [Select]
"Flags/flags" + i+".jpg" if someday Steve change all this this place to something like
Code: [Select]
"Path.Combine("Flags","flags"+i+"jpg");
So use wine its easy.
 
The following users thanked this post: sisso