Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Linux version #9

Open
Ape opened this issue May 14, 2015 · 130 comments
Open

Linux version #9

Ape opened this issue May 14, 2015 · 130 comments

Comments

@Ape
Copy link

Ape commented May 14, 2015

Is it possible to port this game to Linux?

@Ape
Copy link
Author

Ape commented May 14, 2015

The game seems to have several binary dependencies in the 3rd folder. These would need a Linux version, too.

RakNet, SharpDX, and SteamSDK are available for Linux already. I'm not sure about HavokWrapper. Is that required or just optional or is there a way to replace it? I guess VRage.Native is made by the same developers as SpaceEngineers itself. Is the sources for that available?

@Spartan322
Copy link

Well first, Havok has (in the past at least) been on Linux (and other Unix-based systems) before though not sure of the most recent versions (btw, it is a somewhat expensive license to get), and you can not replace that Havok Wrapper, it is kind of what makes the physics work.

@crosbymichael
Copy link

I think a good first step is to get the dedicated server working on linux. I plan on trying to get this to work over the weekend and if anyone feels like joining in that would be great.

@OndrejPetrzilka
Copy link
Member

We can provide VRage.Native code, that's the smallest problem.
We cannot provide HavokWrapper code (licensing). Also we cannot provide HavokWrapper.dll/so for linux, because the wrapper is mixed mode assembly (written in C++/CLI) and mono does not support mixed mode assemblies. It seems it would be necessary wrap Havok in different way (I'm not even sure how at the moment), we cannot use SharpDX way of wrapping, because Havok is not COM object (DirectX is).

We're open to suggestions and happy to provide support.

@mccorkle
Copy link

@crosbymichael I'm considering working on the same. Direct message me.

@mccorkle
Copy link

@OndrejPetrzilka Is HavokWrapper the only thing stopping a native Linux compile? Havok still claims to support Linux in their marketing message on the bottom of http://www.havok.com/physics/.

Would you guys be interested in adding someone at Valve's SteamOS team to this conversation? SteamOS is Linux based (http://store.steampowered.com/steamos), and the success of this work would define whether Space Engineers could be sold on SteamOS based machines.

@Ape
Copy link
Author

Ape commented May 14, 2015

I wrote above that SharpDX would be available for Linux, but now that I read it I don't know where I got that. DirectX may be really problematic here.

@mccorkle
Copy link

It also looks like Wine runs the client at "silver" status, as reported by the community:
https://appdb.winehq.org/objectManager.php?sClass=version&iId=30180

I'll be trying that out on my rig first, the trying to wine wrap the game to run on SteamOS. With the source, I should be able to trace back to anything that Wine can't deal with and post that if anyone else is interested.

@Spartan322
Copy link

uh DirectX is a Microsoft-only product, it was made to erase the non-MS products from gaming so, the problem is to start using OpenGL (which I feel would be a better option anyway, it appears to work faster then DirectX IIRC), which requires a major rewrite (even though they kind of both support the same stuff, even if though it takes DirectX a lot longer to get advanced features that OGL already got years ago)

@mccorkle
Copy link

@Spartan322 Perhaps Valve's DirectX to openGL converter (which they open sourced) could help with that.

https://github.com/ValveSoftware/ToGL

It isn't 100%, and only supports DX9, so there might be some more effort needed over on that project to catch up with DX11. What are your thoughts?

@Ape
Copy link
Author

Ape commented May 14, 2015

One possibility is to replace SharpDX with MonoGame (and use it also on Windows). Porting any low-level DirectX is going to require a lot of effort.

@OndrejPetrzilka
Copy link
Member

Writing OpenGL render should possible, because render is separate project and communicates only by sending messages. (You can even try to switch to DirectX11 render, it's probably one line somewhere in MyProgram)

@Spartan322
Copy link

@mccorkle I'd suggest converting it by hand, while that is great and all, that could create a bit of overhead, which we seriously don't need in SE (or VRage, simple it isn't ready for it) plus we need to convert every single DLL (by that I mean we need to hope most DLL owners of the 3rd Parties here are willing to produce .so files) we also have to massively change how the game does 90% of the things it does (most of the game is center on using Windows only libs or parts)

P.S: Wouldn't mind making a repo devoted to reworking this for Unix systems but I would like permission from Keen before doing so (also I'm more of a C++ developer, so I wouldn't be as active on it plus I prefer C and C++, C# is kind of ridiculous to me)

@fabian-marquardt
Copy link

I am also very interested in a Linux port, especially for the dedicated server. If someone is working on it and needs help, please message me.

@elmat0
Copy link

elmat0 commented May 15, 2015

Likewise. I looked at space engineers many months ago and saw it was windows only and moved on. Unfortunately there isn't much I could contribute to a porting effort, though would certainly appreciate any efforts to this effect.

@sjsoft2015
Copy link
Contributor

will surely show all possible assistance in porting dedicated server

@bfosberry
Copy link

Super excited about this!

@admalledd
Copy link

Ryan Gordon did a talk a while ago about starting with linux game porting/development. Decent place to try and wrap heads around how to approach the problem.

https://www.youtube.com/watch?v=Sd8ie5R4CVE

My recommendation would be two approaches side-by-side:

  1. People with windows machines, focus on moving to cross-platform libraries (OpenGL, re-do parts of the Havok wrapper?). Some one with more knowledge on the current pain points willing to write a bit on what possible replacements/migration paths there are? My understanding is that all of the current pain points besides DirectX has direct linux versions to look at, can we get confirmation on that and what they are? Licensing?
  2. People with only linux machines, focus on the mantra "When in doubt stub it out", your/our goal is to get the game building on linux, even if it never can run. This lets us find the problematic areas for the windows devs to look at, as well as the starting point for replacing with linux/platform specific libraries and code paths.

Thoughts?

@Spartan322
Copy link

@admalledd The worst problem is that half the used libraries for SE is windows-only (or the Unix/POSIX versions are super outdated and are very bad to use today) also seeing as SE (and VRage) seem to never been built to adapt (I think KSWH need to slow down some development btw, they rush things and some of the code is a little sloppy) itself, which means we need to directly break parts to convert it to Linux. The issue is they built this without abstraction of anything, which would make this job of easy translation to Unix (Mac and Linux + more, this is what this really is) much easier. I would do this if I were a C# developer and had the time but both things are not true (I know a good amount of C# but I barely have the time to waste on this alone and I see C#, in my eyes, as dirty, just me)

@syberphunk
Copy link

"Also we cannot provide HavokWrapper.dll/so for linux, because the wrapper is mixed mode assembly (written in C++/CLI) and mono does not support mixed mode assemblies. It seems it would be necessary wrap Havok in different way (I'm not even sure how at the moment), we cannot use SharpDX way of wrapping, because Havok is not COM object (DirectX is)."

Is this required for a linux dedicated server, though?

@Spartan322
Copy link

@syberphunk Kind of, it depends on how intimate the server gets with the clients, and lets not forget that the server being cross-platform needs to send and receive information without the OS messing with it (which may be a little more difficult then it should)

@syberphunk
Copy link

@Spartan322 Raknet handles network communication cross platform really easily. The OS will not be 'messing with it'. Usually all data is changed into 'network byte order' and then back to be uniform.

The problem I foresee is whether or not the server needs to calculate the physics using Havok and then communicate that to the client, or if it's done client side and the data's just thrown through the server. If it's the latter then that's not really an issue if the server doesn't have to calculate it, it just has to pass on the data.

@Spartan322
Copy link

Well, we can't actually talk about Raknet yet though, we can only really deal with the current system for now, when we get Raknet implements 100%, then we can talk about it.

@cryptiklemur
Copy link

That seems counter intuitive @Spartan322. We should definitely be talking about the future system. No point writing something that big, that will just need to get rewritten in the next few months.

@Spartan322
Copy link

@aequasi The issue is we are not sure how Keen plans to do everything, which means we have to wait for them to implement it, unless given inside info and an interface for it. Otherwise we have no choice but to wait.

@cryptiklemur
Copy link

The point of having a discussion here, is to get their input on it too, not just the implementation.

@Spartan322
Copy link

I'm just pointing out an issue with discussing it like this, plus this is talking about implementation, this isn't just a discussion, so that's why I am saying this, if anything, we shouldn't really discuss anything other then the implementation here, the other stuff should be on the forums.

@cryptiklemur
Copy link

I can't really see why this shouldn't be discussed here. Its a more technical discussion than is normally seen on the forums.

My 2c

@Spartan322
Copy link

Github issues are not made for this type of discussion, you should only use github for discussion on code and implementation or problems, the forums should be used otherwise

@cryptiklemur
Copy link

While i dont entirely agree, I went ahead and set up a chat room for more real-time discussions.

http://forum.keenswh.com/threads/modding-chat-room.7359969/

@parasyte
Copy link

It is also prudent to report that most games that run on SteamOS, in fact, do not use Wine.

@edelcat
Copy link

edelcat commented Nov 16, 2016

I've somehow successfully run a " quite good performance" private server for friends with ubuntu ,Virtualbox, windows 2008r2 64bits guest

the host is
Ubuntu 16.04.1 LTS, 4.8.4 kernel
8Go
Intel(R) Core(TM) i3-2130 CPU @ 3.40GHz

@NishaYume
Copy link

News about supporting linux?

@mccorkle
Copy link

mccorkle commented Mar 2, 2017

@NishaYume Nothing that I've heard of recently. I (personally) have accepted the fact that I have to keep a Windows machine around for gaming for right now. I'd still prefer get the dedicated server on Linux, but even that requires the Windows only physics libraries -- so that is a no go until someone can get a license to Havok Physics for Keen (or someone proves a large enough potential new market for them to justify the purchase of it).

To make things worse, Microsoft purchased Havok back in late 2015 :-/

@bfosberry
Copy link

bfosberry commented Mar 2, 2017 via email

@PhuriousGeorge
Copy link

PhuriousGeorge commented Mar 2, 2017 via email

@mccorkle
Copy link

mccorkle commented Mar 2, 2017

@bfosberry If you are building from scratch and are willing to spend the time tweaking for all three platforms, then yes, Unity is awesome -- but it can't do what SE (or ME) does right. For the record, I'm a unity developer who runs linux servers by day, so I'm all for this happening one day, but I don't really see happening until well after some kind of version 2 of space engineers comes out.

@ericwomer
Copy link

Why does everyone mention Unity, but forget there is UnrealEngine4?

@PhuriousGeorge
Copy link

PhuriousGeorge commented Mar 2, 2017 via email

@ericwomer
Copy link

@PhuriousGeorge How many of those on Linux?

@mccorkle
Copy link

mccorkle commented Mar 2, 2017

@salamanderrake Because UE4 had a very indie-developer-unfriendly license for a long time -- so a lot more people went over to the Unity platform based on their perception be being more free (and more able to keep their money that their game would earn). UE4 hasn't changed those people's minds yet. UE4 is great though. Beautiful graphics engine -- solid VR support -- but I learned on Unity, and it would take me months to get back up to speed on a different IDE and platform.

Also, check out the SteamOS game list for a good list of Linux games:
https://steamdb.info/linux/

SteamOS is based on Debian last I heard.

@ericwomer
Copy link

@mccorkle I mean, how many Havoc engine based games are on linux. As for the license of UE4, its because people want something for nothing. As for the royalty, its not really that bad. 5% of gross income for a game you sell above $3,000.00 per quarter isn't that bad for source access to the engine. You could make $12,000.00 per year and not have to pay anything. Lets say your making $1,000,000.00 a quarter thats $50,000 you pay to epic. That may seem a lot, but that is after grossing a million dollars.

@mccorkle
Copy link

mccorkle commented Mar 3, 2017

@salamanderrake I'd have no idea how many of those games use Havok without some serious homework -- just wanted to share a list of games that do run on linux.

In response to paying a license per sales, if you were Keen and you built SE on UE4 -- at about 2 million copies sold at an average of $15... doing some quick math means that Keen would have paid Epic $1,500,000. That buys a LOT of copies of Unity, and a LOT of developer hours (particularly in Prague).

Now, with that said, I'm WAY off topic, so I'll stop here :-)

Linux is awesome. I don't expect this version of Space Engineers to ever run on Linux unless the Wine and Mono projects get upgraded to be 64bit. That doesn't mean that Keen won't release the next generation of Space Engineers on Linux (or Mac, or VR, or iOS ... or whatever), just that this generation of VRAGE and SE are too tightly bound to Windows libraries and tool chain.

Now go buy more games on SteamOS to justify more game devs to take Linux more seriously as a gaming platform.

@yaomtc
Copy link

yaomtc commented Mar 3, 2017 via email

@ericwomer
Copy link

ericwomer commented Mar 3, 2017

@mccorkle How much does a Unity Source License cost? Also that is $1,500,000.00 out of $30,000,000.00.

@Krienas
Copy link

Krienas commented Mar 3, 2017

https://store.unity.com @salamanderrake

@Progdrasil
Copy link

Why would Keen switch engines when they spent so much time and money developing their own? (VRAGE 2.0) Although I would love to see a Unix port of SE This would also make my life much easier for less time spent to dual boot.

@ElSaico
Copy link

ElSaico commented Apr 24, 2017

A possible solution for a Linux version of HavokWrapper is Mono's CppSharp: https://github.com/mono/CppSharp

This probably takes a lot of effort anyway, but seems to be the easiest path so far.

@Trinexx
Copy link

Trinexx commented Apr 25, 2017

The fact that their only targeted platforms right now are XB1 and Windows, I think it's safe to say that Keen are firmly a Microsoft dev outfit.

I'd love to be proven wrong, but I'm not going to hold my breath. They shot themselves in the foot from the very beginning by using Windows-only libraries.

@costeastefan
Copy link

costeastefan commented Aug 4, 2017

Space Engineers is the only reason I'm keeping a Windows machine. I would really love to have a GNU/Linux port of the game.

@JJRcop
Copy link

JJRcop commented Aug 4, 2017

Keen should talk to Havok about getting a Linux wrapper, because they have one.

@AlonzoTG
Copy link

AlonzoTG commented Aug 4, 2017

The showstopper issue is the rendering engine. So therefore about a year ago I made some noises about porting it to Vulkan but I got overwhelmed by the fact that the rendering engine is implemented as a bizzare super-class that's split among about 15 different files... Is there a way to extract an interface definition from that mess?

@LunaSquee
Copy link

Still hoping and waiting for this to happen..

@ChipWolf
Copy link

For everyone, I have today's latest patch working on wine64 in Docker for Linux.
You can run SE servers under Linux now
https://github.com/ChipWolf/se-server

@Dessix
Copy link

Dessix commented Jun 19, 2019

That's step one- next is the client 👍

@ChipWolf
Copy link

@Dessix if you follow the Dockerfile, it should work for the client too.

@ChipWolf
Copy link

@Dessix can confirm, Space Engineers client works just fine with the same method

@SaphireLattice
Copy link

How many features are broken/missing in "works fine" though? Apparently it was running for some before, but with quite a few visual things missing.

@theCalcaholic
Copy link

@ChipWolf Did you get planets to work correctly? I had some issues with the heightmaps being messed up

Other than that it worked for me - not extremely smooth, but playable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests