I Put Space Engineers on Linux (Again)

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am offloading Space Engineers from Manjaro to EndeavourOS. Let’s get started!

Short Answer

I used Glorious Eggroll’s community version of Proton [1], but the AI update this past week and now requires a blank registry key or two added to its prefix. See the section titled “GAME UPDATE!!!” down below.

EDIT 4-18-2023: The development team just released a Hotfix in update 1.202.067 fixing the issue. 2/3 of my post is out of date only 14 hours after publication.

Background

This is a follow up/update to both last week –where I finish moving into a new EndeavourOS installation– and a post I wrote on January 18, 2021 [2], where I installed Space Engineers on Manjaro Linux and go into some detail about WINE, Proton, and the lengthy struggle I went through to install it there without fully understanding what I was doing. In case the specifics help anyone, I am running Space Engineers 1.201.014 default (Most Wanted update) on Glorious Eggroll GE-Proton7-54 on EndeavourOS with an Nvidia Geforce 970 graphics card.

I know what I’m doing a little better this time around. I even got it working first try. But that doesn’t mean I understand how everything works inside. There was an update to Space Engineers some time after my 2021 post that introduced a bug related to the audio system that would crash the game after anywhere between 5 minutes to 2 hours (ballpark average of half an hour). I was never able to diagnose it beyond a since-forgotten Discord post noting that the crash is an audio-related bug, and that it can be fixed by ripping open the .exe to kill the sound system. I happen to like sounds, so I accepted it until I gradually stopped playing.

The Dotnet Tradeoff

In more recent days, a member of the community going by G3ckobot on the developers’ Discord (Keen Software House) identified this crash as related to dotnet48, which I was quite possibly using as it showed up in a guide I linked to on GitHub I tried to follow. In my new installation, I went straight for Glorious Eggroll, and while the trade-off, as G3ckobot put it, is worse performance, the improved stability using the default wine-mono is worth it. He also suggested disabling progression in world settings to fix some lag related to the “G menu” for selecting blocks for your hotbar.

Crashes aren’t the only change I’ve noticed improvements with. The main menu plays videos like it’s supposed to. “Inventory Full” doesn’t self-overlap or cut off. Even “Exit to Windows” doesn’t throw a crash anymore. On the topic of miscellaneous bugs, there’s a new hint of static sometimes when I finish welding something.

A Note About Ship Blueprints

I’ve had one long-term goal while playing Space Engineers, and that is to perform a grand tour of the Solar System map before doing much else. I want to visit every planetary body once – even if just for a touch and go. My first attempt had a worker ship I was quite fond of designing, so I went to fetch it from my old save.

Like with any long-file path file transfer, my first move was to explore the destination directory.

/home/shadow/.steam/steam/steamapps/compatdata/244850/pfx/drive_c/users/steamuser/AppData/Roaming/SpaceEngineers/Blueprints/local/

When I navigated to the counterpart on Manjaro, I found myself in the exact, same place. I even made a file using the touch command in one place and it showed up in the other! A closer inspection of my file path showed that ~/.steam/steam is actually a symbolic link. Symbolic links have no concept of being mounted into another file system, so when I followed it, I landed right back in EndeavourOS’s copy of Space Engineers. It pointed to /home/shadow/.local/share/Steam, which I had to manually follow. I had to look around to find ../steamuser/Application\ Data/SpaceEngineers/, but in the end, it imported just fine.

GAME UPDATE!!!

The AI update arrived this week, and my installation broke after I was all but done writing.

Missing prerequisites
There is missing required C++ package.
You have to accept elevation dialogs from the
Steam to install prerequisites.

Within 20 minutes, I was the first one reporting it on Discord. The server went into a flurry of activity as community members pooled skills over the next four hours. A few facts were soon apparent: there are a lot of C++ packages, no logs were of help narrowing down the missing one, beta builds were working fine with Proton right up until the update dropped. I was busy with more important matters for most of it, but by the time I came back, user opekope2 posted [3]:

HERE'S THE WORKAROUND
1. Install and run protontricks
2. Navigate to SE > default prefix > regedit
3. Under HKLM\SOFTWARE\Classes\Installer\Dependencies, create Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14

Community consensus was that an unused dependency was listed last-minute –perhaps accidentally– that wasn’t commonly included in Proton. Since the dependency isn’t actually called, it’s OK to add a fake entry in the prefix’s registry. How to get that fake entry in there can get tricky.

How to use Winetricks instead of Protrontricks

Protontricks is a version of Winetricks geared for managing Proton prefixes instead of Wine prefixes. Protontricks is in AUR but didn’t feel like installing anything from there properly. Instead, I made a symbolic link from ~/.wine to my Proton prefix and told Winetricks to load the “default” prefix. Note: I heard good things about Proton Experimental, so I switched to it from Glorious Eggroll.

AUR: Arch User Repository

cd ~
mv .wine .wineDISABLED
ln -s .steam/steam/steamapps/compatdata/244850/pfx .wine
cd .wine

Errors about .wine and “No such file or directory” can be ignored. It just means you don’t already have a default Wine prefix. If you get an error when trying to cd into .wine, that means you will have to find where Steam puts games on your distribution and change your file path accordingly.

If everything is good so far, It is a very good idea to back up your prefix if you aren’t working with a clean one or wish not to redownload it.

cp ~/Full/Proton/Path ~/.SEbackup

Ensure both Space Engineers and Steam are closed. Start Winetricks. Select “Select the default wineprefix.” The link you created and tested earlier will fool Winetricks into looking at Space Engineers’ prefix. Click OK.

Next, select “Run regedit” and hit OK.

Navigate in the registry editor to HKEY_LOCAL_MACHINE\Software\Classes\Installer\Dependencies.

You the Classes folder is long. Once you scroll down to Installer and find Dependencies, you should see two keys with the folder icon (my screenshot already has the extra key). Bring up your context menu and make a New Key and name it Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14. Do not worry about adding a value.

Space Engineers should start up now, but you may have to try a few times before you start/load a game. My record is 4. After you confirm Space Engineers is working, be sure to remove ~/.wine link and replace your original default wine prefix if you had one before!

rm .wine
mv .wineDISABLED .wine


Takeaway

I’m no stranger to easy projects expanding on me, but this was dramatic! I tried to keep up with developments in this story until the night before publication. Opekope2’s original workaround post is pinned and has been edited to include instructions for importing two keys* that will do the same job as editing the registry manually as demonstrated. As a personal experiment starting around the time this goes live, I’m adding the other key manually. I don’t expect anything to change, but as opekope2 pointed out to me, “Because that’s how it is on Windows,” [3].

* Microsoft.VS.VC_RuntimeAdditionalVSU_amd64,v14 and Microsoft.VS.VC_RuntimeMinimumVSU_amd64,v14

Final Question

Have you gotten whatever latest update of Space Engineers running on Linux? If not, I highly recommend you engage with the community on Discord [3].

As always, I look forward to hearing about your experience.

Works Cited

[1]. GloriousEggroll, “proton-ge-custom,” github.com, [Online]. Available: https://github.com/GloriousEggroll/proton-ge-custom [Accessed Apr. 17, 2023].

[2]. Shadow_8472, “Space Engineers: WINE Is Not an Emulator” letsbuildroboticswithshadow8472 Jan. 18, 2021. [Online]. Available: https://letsbuildroboticswithshadow8472.com/index.php/2021/01/18/space-engineers-wine-is-not-an-emulator/ [Accessed Apr. 17, 2023].

[3]. Keen Software House, “Linux” [Discord]. Available: https://discord.gg/keenswh [Accessed Apr. 17, 2023].

Space Engineers: Gravity is Stronger Than Thrust

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m changing my goalposts and slapping a finished sticker on last week’s project. Let’s get started!

The Design

Where to start now that I’ve “finished” this project? The hull is defined by ship’s systems, but ship’s systems have to fit inside the hull. The whole point of this craft was to make a craft that could bore in its own silhouette without as much overhead, and the simplest way to do that is some take on the cylinder.

In the interest of added visual appeal, I played around with different angles all along the length of my design. The cockpit is as close to a sphere as I can get and still have major flat regions. I added a skinny neck just because, then a larger habitation section with two decks: a multipurpose room and fuel storage/airlock. My cargo hold also houses most of the ship’s batteries, and engineering has a bunch of engines I’m basically lugging around and a tiny secondary cockpit in the very back. Each section listed above — aside from engineering and auxiliary control — is individually pressurized using doors.

When I went to start adding thrusters, I found all my fancy angled hull sections lacked adequate mount points. I adjusted my spreadsheet to find I could boost my effective thruster power by adding nine small thrusters to each big one, at the cost of an extra couple blocks footprint. I sent my new number through my spreadsheet again, and found I’d only need about ten “super thrusters” to hover.

Oversight

I totally forgot about the weight of the ship. In fact, I couldn’t figure it in because of the way the game reported my mass including the ground-based station I was attached to, as well as any ships docked to it. As a result, when I went for my first nose down test, I wasn’t able to back out of my hole, even though it was a third full, tops.

And with the power of extra thrusters comes greater draw on the power grid. I totally neglected to run the numbers before taking off, and found my batteries maxing out while accelerating upwards. I can probably hover under max load, but I’m also looking at the overall battery life. There’s also the fact that I’d like to relocate my base to a nearby mountain top for a bit more light. The air up there is thin enough to where the thrusters I’m using are not as effective.

Game Boundaries

Many games hint at their boundaries before you run into them. They may take the form of an invisible wall marking the edge of a level or a second stack of objects denoting a limited size inventory.

Space engineers has a feature that lists every intractable part of a ship or base your interfacing with. User-defined groups let you manage several parts at once so you can do turn on all the drills or toggle the lights. Maybe all the batteries need to recharge. What this feature lacks is a means to select a range of parts. (Edit in post: Feature does exist, it’s just my right shift key closes the window.) When I found myself with 300+ small engines, I had to click on every last one of them, and it wasn’t fun.

Another lacking feature as I’m finding is the inability to manually move items around. After a marginal amount of research on the official Discord server, someone introduced me to sorter blocks’ unadvertised function of pumping ships’ inventories dry of all matching items.

Takeaway

Game developers will generally have an idea of the scope of the stuff their target audience of players will be doing. Wandering off the intended set of use cases can lead to frustration, but every so often, it can lead to art.

My ship isn’t the easiest thing to look at. It’s covered in way too many engines for its own good, and it still accomplish its mission of hovering while pointed straight down under full load. It’s still more capable than my first ship, which I’m thinking will make for a nice shuttle pod later on.

Final Question

Have you ever set expectations high for a project, only to settle with something that’s still better than you presently need?

Space Engineers: How to Balance Thrust with Gravity

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I have been working on a ship in Space Engineers. Let’s get started!

Space Engineers is a game where you mine resources on planets, moons, and asteroids to build bases and ships. Over my time playing it so far, I’ve noticed many simplifications, like just how step rough terrain can be before my character slips, or the peculiar arrangement of planetary ore. The physics of moving things around, on the other hand, remains more true to life.

Early Game

For context, I’ve been playing “survival” mode: that is to say I started in the Solar System map on the Earthlike planet. It took me a couple tries before I got a self-sufficient base, but I have successfully made my in-game home in the mountains at a high elevation.

Early on, ore is carried by hand in a backpack. I eventually built a little flying truck and taught myself how to fly by trial and error. Without enough downward thrust when fully loaded, I involuntarily go bumping along the ground, and landing gear explodes, leaving scrap metal behind.

I quickly outgrew my little golf cart, so I built my first ship with an interior and equipped it with mining drills. Each time I rearranged its insides, a little more character became permanent features on the hull. I installed multiple systems I didn’t strictly need, like a Hydrogen tank and engines to generate power from an ice splitter. The trickiest of all was making the whole thing airtight and pumping in Oxygen from a tank.

My finished product was about twice as long as I expected, and quite a bit wider. In practice, I have to make multiple passes at the same area, slowly opening it up until I can reach in and get what I’m after. I’m prone to bumps and nicks, and if I drill too far in, I will catch on something, twist on my axis, and start losing control.

Just as important to an individual ship’s success is the ground station’s work. I did the math once, and found my eight little engines could hardly keep up with the power output of one of my batteries. Left to itself, in theory, it can fly roughly 1 minute for every 5 it spends recharging from an on board Hydrogen supply. If it has to split the ice itself, I could be looking at a quarter of the productivity. A well equipped base can generally top the batteries off in three minutes when I tell them to recharge.

New Ship: Concept

The game has two “grid” sizes for building: large and small. Coorisponding blocks take more components to build on larger grids. Storage blocks have much more volume; the biggest coming not quite to half a million Liters of capacity on a large grid. I want to fill one with a small grid ship. At the same time, I’m remembering when that little shovel of a vehicle I built turned upside down on me because it was overloaded. I want to fly the first time without any accidents due to skipping the math, because this ship will be a lot harder to “just unload.”

How Many Thrusters?

The actual number pulled from in-game is 421,875 L. Small grid large containers are 15,625 L, an 27 (or three cubed) fold increase. I spent some time designing a cargo bay with these numbers, and came up with a repeating design with 7 segments of 4 where I can access each container by hand if need be, leaving me with 28 containers and a cargo capacity of 437,500 L.

My experience to date is only on the Earthlike planet, so that’s where I’ll be designing it to operate. Ores can be really deep in the ground, so I’ll want enough reverse thrust to hover when pointing straight down under full load so I can back out of a hole I’m digging. The densest (and only) density among all the ores is .37 L/kg. Paying close attention to the units, I divided my earlier capacity by the density, coming up with a total cargo weight of 1,182,432.432 kg!

The real Earth has a gravitational accelleration of 9.8 M/s/s. Multiplying the weight of the cargo, I get 11,587,837.838 KgM/s/s. Force from the engines are given in Kilonewtons, but conversion is simple if counterintuitive: the Newton is equivalent to the mess of units already present and the decimal just needs to move over. A little rounding lands at 11,588 kN. The thrusters I’ll be using provide 576 kN. From here, it’s a simple matter of division to find I need a hair over 20 thrusters just to lift the payload.

Ship Layout

For this craft, I started with the cargo hold. I stuffed as many batteries as would fit in the gaps and calculated that I’d need the full output of at least 15 batteries. I already have more than that, though I may want additional units for longer battery life.

Moving forward, I have a habitation section. When building, I like to pretend there’s more going on than is mechanically present, so a living space is in order. The cargo hold was tall enough that I had enough space for a second deck, where I added an airlock for entering and exiting the ship, as well as a few ship’s systems: fuel tank, ice splitter for Oxygen and Hydrogen, Oxygen tank, several large Hydrogen tanks. I was having trouble deciding how long to make the habitation section until I took a cue from the length of the big tanks I installed for future space travel, assuming I don’t make yet another one before I blast off.

The third pressurized section is a long neck leading to the cockpit. I’m following the same general idea for a floor plan as my last ship, and this was where my batteries ended up. In this design though, it’s just there to look cool, but in theory should afford a little more leeway when digging. I’ve also included two conduit lines for moving ore back to the cargo hold in case one side gets damaged.

Up in the front is the “spherical” cockpit with a crazy number of drill heads poking out on both the top and bottom. When I took a break for my write up, I was figuring out windows for it, but they’re being a pane to put in without provision for corner blocks that aren’t just a 2D slice. I’m also looking to have redundant ship’s systems below deck. In the case I come under heavy enemy fire (I’m on peaceful for all I know) and the neck snaps, the surviving part can escape to safety and undergo repairs.

All the way in the back, I’m planning on a redundant command center. In the case I’m backing out of a hole I’ve dug or the more dire scenario discussed above, the ship won’t be without a command seat. If I’m going to have Hydrogen powered generators, here is where I’d stack them. I also need a place to stash a whole lot of gyroscopes for rotation control. The overall ship’s design is practically begging for a set of wings, and I’ve read about a so-called gravity drive I can design and build. I’ll be sure to include some connectors to attach such an apparatus if they don’t double for unloading cargo.

Takeaway

Planning a ship is serious business. I’m far from done –probably another couple full days out– but when I checked the weight from the command chair, the dry mass is lumbering in the direction of my earlier ship’s fully loaded mass of about 300,000 kg. I plugged that figure into my spreadsheet, and it told me to expect to need at least 26 engines for neutral lift capability. I’ll of course want to plug the actual number in when I get there, but such is the nature of iterative design: enough extra engines will call for more batteries, etc.

I still have much to learn, like how I’m going to automate that airlock so I don’t vent Oxygen when I go to space, or how to unload all those cargo containers when I dock with home base.

Special thanks go to my father who was there for reviewing simple Newtonian physics.

Final Question

This week was supposed to be a Raspberry Pi week, but I’m out of SD cards, and the cards on order are lost in the mail. What was the last thing the post misplaced for you?