# Factorio on FreeBSD



## jbo (Feb 23, 2022)

Just wondering... did any of you manage to get Factorio running on FreeBSD? I'm talking about the actual game, not the headless server.


----------



## Alexander88207 (Feb 24, 2022)

You can try it with linux-steam-utils or using Steam with Wine via Suyimazu.


----------



## Profighost (Feb 24, 2022)

That's exactly what I am trying to do, too: Get factorio running under FreeBSD. 
1. I'll try to get the Linux-version running.
2. I'll try to get it running under wine (problem her so far, either you have to use 32 or 64bit version of wine, not both)
I would be happy if I could live without this steam-cr#p.


----------



## Alexander88207 (Feb 25, 2022)

Profighost said:


> 2. I'll try to get it running under wine (problem her so far, either you have to use 32 or 64bit version of wine, not both.



That problem don't exist anymore.


----------



## sidetone (Feb 25, 2022)

Profighost said:


> I'll try to get it running under wine (problem her[e] so far, either you have to use 32 or 64bit version of wine, not both)





Alexander88207 said:


> That problem don't exist anymore.


emulators/i386-wine


> port deleted on 2021-11-19
> REASON: Removed: obsolete, emulators/wine provides i386 support


It looks like you were the maintainer of the old port.


----------



## Alexander88207 (Feb 25, 2022)

sidetone said:


> emulators/i386-wine
> 
> It looks like you were the maintainer of the old port.



Yep, i was the last maintainer.


----------



## Profighost (Feb 25, 2022)

That's good to know. 
Thanks.
So I don't have to decide to use 32bit-wine for the very old stuff (such as Master of Orion II [I still play it, because I love it - there actually is nothing like it]) and newer ones?
Everything that would ran beyond 32bit wine runs under the 64 version, now?


----------



## Alexander88207 (Feb 25, 2022)

Profighost said:


> Everything that would ran beyond 32bit wine runs under the 64 version, now?



Many. I was able to play Borderlands 3, Deep Rock Galactic, Sea of Theives, Elder Scrolls Online (Before a new launcher bug appeared) and many more.


----------



## jbo (Feb 25, 2022)

Alexander88207 I was actually hoping you'd chime in on this thread. I assume if you'd be able to test whether Factorio is running on FreeBSD (eg. via steam/proton) you'd have done so?

I've been glancing over the various gaming threads here for a couple of months now regarding getting steam up & running but I didn't find time to go that route yet. It seems like efforts are not negligible although as I understand it's constantly improving.


----------



## Menelkir (Feb 25, 2022)

Profighost said:


> Everything that would ran beyond 32bit wine runs under the 64 version, now?


I need 3 applications to work that needs wine, they're not too much complicated but the point is that one is 32bit and two are 64bit. In the past you had to choose one, isn't an issue anymore. Also, I was able to run a couple of games under FreeBSD that are 64bit-only, for example, Control that is considered a heavy AAA was able to run (of course, it needs some extra chimichangas, specially because I don't have a 2022-AAA-capable machine).


----------



## Profighost (Feb 25, 2022)

Thanks. That gives me lot of hope.
After all 32bit compatibilty is standard today; but of course I'm not that deep into wine to understand why, what, and what why not.
But however what you are writing sounds promising. 
After all besides games, which are not really important, I also have two applications only I need and I don't get to run under FreeBSD directly. 
For those both I have anothe machine with Linux, that also will be exchanged in the next couple of weeks by a raspberrie 4 (you see, they do not need actual power  - I will try to experiment something with forwarding X....)

Risking to kill this thread totally by becoming completely offtopic (sorry, JB  ) since wine does not solve all issues and the problem with VirtualBox under FreeBSD is the not implemented expansion pack, is QEMU an actual alternative?


----------



## Menelkir (Feb 25, 2022)

Profighost said:


> Thanks. That gives me lot of hope.
> After all 32bit compatibilty is standard today; but of course I'm not that deep into wine to understand why, what, and what why not.
> But however what you are writing sounds promising.
> After all besides games, which are not really important, I also have two applications only I need and I don't get to run under FreeBSD directly.
> ...


Bhyve?


----------



## Alexander88207 (Feb 25, 2022)

jbodenmann said:


> Alexander88207 I was actually hoping you'd chime in on this thread. I assume if you'd be able to test whether Factorio is running on FreeBSD (eg. via steam/proton) you'd have done so?



I do not own/play this game.


----------



## Profighost (Feb 25, 2022)

Menelkir said:


> Bhyve?


Oh, yeah, I forgot. That also could be an alterntive. Thanks.


----------



## Menelkir (Feb 26, 2022)

grahamperrin said:


> What's that?











						AAA (video game industry) - Wikipedia
					






					en.wikipedia.org


----------



## Echo8 (Mar 1, 2022)

It's been years since I've tried, but I'm pretty sure the Linux version runs without issue with the linuxulator.


----------



## grahamperrin@ (Mar 1, 2022)

Echo8 said:


> It's been years since I've tried, but I'm pretty sure the Linux version runs without issue with the linuxulator.



With the downloaded demo: 


```
% pwd
/usr/home/grahamperrin/Applications/factorio/bin/x64
% ./factorio
./factorio: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by ./factorio)
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #4 main-n253343-9835900cb95-dirty: Wed Feb 23 00:14:15 GMT 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400053 1400053
%
```


----------



## grahamperrin@ (Mar 1, 2022)

When `winefile` (Wine File Manager) is used to open the executable:



– setup does not begin, then (a more general bug) the content of the pane behaves as if I have scrolled away, or clicked on something else.


A command line approach to setup appears to succeed:


– however, opting to run at the finish leads to an error:







Spoiler: wine ./Setup_FactorioDemo_x64_1.1.53.exe





```
% cd Downloads
% wine ./Setup_FactorioDemo_x64_1.1.53.exe
002c:fixme:ntdll:get_firmware_info info_class SYSTEM_FIRMWARE_TABLE_INFORMATION
002c:fixme:ntdll:get_firmware_info info_class SYSTEM_FIRMWARE_TABLE_INFORMATION
002c:err:winediag:WS_getaddrinfo Failed to resolve your host name IP
0024:fixme:process:SetProcessDEPPolicy (1): stub
00f4:fixme:process:SetProcessDEPPolicy (1): stub
00f4:fixme:win:DisableProcessWindowsGhosting : stub
00f4:fixme:graphics:ShutdownBlockReasonDestroy (00010086): stub
00f4:fixme:graphics:ShutdownBlockReasonCreate (00010086, L"Installing"): stub
00f4:fixme:msg:ChangeWindowMessageFilterEx 00010092 c077 1 00000000
00f4:fixme:msg:ChangeWindowMessageFilterEx 00020092 c077 1 00000000
00f4:fixme:win:WINNLSEnableIME hwnd 000100A0 enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100A0 enable -1: stub!
00f4:fixme:rstrtmgr:RmStartSession 0050A008, 0, 0050A00C stub!
00f4:fixme:graphics:ShutdownBlockReasonDestroy (00010086): stub
00f4:fixme:graphics:ShutdownBlockReasonCreate (00010086, L"Installing Factorio."): stub
00f4:fixme:msg:ChangeWindowMessageFilterEx 00030094 c077 1 00000000
00f4:fixme:msg:ChangeWindowMessageFilterEx 00040094 c077 1 00000000
00f4:fixme:msg:ChangeWindowMessageFilterEx 0002009A c077 1 00000000
00f4:fixme:msg:ChangeWindowMessageFilterEx 0003009A c077 1 00000000
00f4:fixme:shell:SHAutoComplete stub
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:rstrtmgr:RmRegisterResources -559038737, 1, 01567BD0, 0, 00000000, 0, 00000000 stub!
00f4:fixme:rstrtmgr:RmGetList -559038737, 0073F314, 0073F318, 01567BD0, 0073F310 stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100B8 enable 0: stub!
00f4:fixme:explorerframe:taskbar_list_SetProgressValue iface 00E65D30, hwnd 00010086, ullCompleted 0, ullTotal 352 stub!
00f4:fixme:sfc:SfcIsFileProtected (00000000, L"C:\\Program Files\\Factorio\\unins000.exe") stub
00f4:fixme:win:WINNLSEnableIME hwnd 000100B8 enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100B8 enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100B8 enable -1: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100B8 enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100B8 enable -1: stub!
00f4:fixme:explorerframe:taskbar_list_SetProgressState iface 00E65D30, hwnd 00010086, flags 0 stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable 0: stub!
00f4:fixme:win:WINNLSEnableIME hwnd 000100BA enable -1: stub!
00f4:fixme:rstrtmgr:RmEndSession 3735928559 stub!
00f4:fixme:graphics:ShutdownBlockReasonDestroy (00010086): stub
% 0084:err:rpc:I_RpcReceive we got fault packet with status 0x1c010003

% date ; pkg info -x wine
Tue  1 Mar 2022 17:32:41 GMT
wine-6.0.2_1,1
wine-proton-6.3.2_3
winetricks-20210825
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #4 main-n253343-9835900cb95-dirty: Wed Feb 23 00:14:15 GMT 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400053 1400053
%
```


----------



## Alexander88207 (Apr 27, 2022)

Hello,

i have tested the demo and it requires only d3dcompiler_47 from emulators/winetricks to run.


----------



## jbo (Apr 28, 2022)

Alexander88207 said:


> i have tested the demo and it requires only d3dcompiler_47 from emulators/winetricks to run.


awesome - I'm looking forward giving this a try then.
As I haven't used wine before: is `d3dcompiler_47` some setting that needs to be enabled somewhere or is it an extra package or, ... ?


----------



## Alexander88207 (Apr 28, 2022)

jbodenmann said:


> awesome - I'm looking forward giving this a try then.
> As I haven't used wine before: is `d3dcompiler_47` some setting that needs to be enabled somewhere or is it an extra package or, ... ?



First try without any tweaks to confirm that was not only an issue on my side. 

If you run into the shader compiling error that i had you only need to: `WINEPREFIX=/usr/home/$USER/prefix winetricks d3dcompiler_47`, the WINPREFIX example have to be replace with the path where the windows environment have been set.

If you dont have set one, its $USER/.wine by default.


----------



## Profighost (Jun 2, 2022)

Factorio runs on my system. Under Wine. 


My first try was to get it run under linuxulator - I daresay: Not a chance!
As others also tested it without success it's in the "A non-exhaustive list of games tested on FreeBSD with Linux emulation" as "crashing at start".
That's exactly what it does under linuxulator.
Maybe sometimes.... ??

However, under wine it runs.
What not works - yet, so far - is the connection from the game to the internet for downloading mods & upgrades and probably multiplayer (but I'm not interested in this neither.)
This maybe is "just" a problem about wine config?
The important finishing touch is what Alexander88207 posted:


Alexander88207 said:


> d3dcompiler_47


must be installed.
(How do you figure out such things?! )


But now I will enjoy what I am waiting for a while: 
A nice round of factorio 
...and will see, if it still smoothly runs when my plant and train network grows big (I love to use such games for indulging riotous gigantism [aka megalomania] )

Thanks to all here. Your inputs and especially Alexander88207's input was crucial to make it happen.


----------



## stratact (Jun 8, 2022)

When gaming on Wine, emulators/winetricks should be considered something part of your toolkit for Windows gaming on Posix platforms. Different games require different versions of Direct3D to play them and occassionally different combinations of DLLs. Interestingly enough, Windows games bought from GOG.com provide the necessary D3D libraries as well as the Visual C++ runtime libraries to be able to play them out of the box.


----------



## Profighost (Jun 8, 2022)

stratact said:


> GOG.com provide the necessary D3D libraries as well as the Visual C++ runtime libraries to be able to play them out of the box.


That's interesting indeed.

For me also interesting are the questions:
How do one figure out which library is needed/missing?
Winetricks offers a buttload of libraries. Even if there is a way to install them all at once instead of doing the checkbox scrambler, I'll bet that would be a bad idea, because many of them conflict and rule out each other (?)
Is there under Windows something like Linux' ldd command?
And what to do if one has no Windows no more?

But way more important I find the question, why developers who offer their software for Linux
(a look into factorio's directory it smells stronlgy as it was developed under Linux, like many others [of course, unix-like OS are predastinated for software development)
do not offer it for FreeBSD directly, too?

I may be completely wrong, but as far as I understand, if the source was developed under Linux in the first place it should be way easier to port software from Linux to FreeBSD instead of Windows.
The licenses can't be the reason (For Windows you have to pay or your users get those "evil darkware warning", right?)
I can see concerns porting software from FreeBSD to Linux, OK, but not vice versa. Any developer, especially for commercial closed code, who spent just five minutes on reading a bit about GPL and the FreeBSD license would prefer FreeBSD,...


----------



## stratact (Jun 8, 2022)

Profighost said:


> How do one figure out which library is needed/missing?


These are my strategies for this:

Run the affected game in a terminal emulator and observe Wine's output and look for any `04XX:fixme:foo:bar-baz` errors that seem related to running the game. Then DDG/Google for those errors for any solutions.
Lookup the game in the AppDB and see if anyone has posted about the same problems for the game and their solutions to them if any.
Experiment as much as you can, even with winetricks.
If you're able to load inside the game, take advantage of every option inside the game provided to you. Adjusting the right setting(s) in the game can fix it from being non-playable in Wine. This is how I solved a "stuttering" problem when I was playing Grim Dawn because there were too many enemies I was attacking in the screen. And it was definitely not related to its video settings either...

Update:


Profighost said:


> Winetricks offers a buttload of libraries. Even if there is a way to install them all at once instead of doing the checkbox scrambler, I'll bet that would be a bad idea, because many of them conflict and rule out each other (?)


I just had an epiphany for this. As an idea for avoiding library conflicts, how about installing and isolating each game installation in their own WINEPREFIX? This way each prefix would contain only the required libraries to run the game they each contain.


----------



## sidetone (Jun 15, 2022)

Opensource clones of Factorio:

https://mindustrygame.github.io/



			Jactorio
		

Edit: for novelty, for convenience, and for others who read the thread and don't have it.


----------



## Profighost (Jun 15, 2022)

Thanks, sidetone.

I've played mindustry. It's no factorio clone at all. I know, it's named so on several sites, but it's not.
Calling mindustry a clone of factorio is like you call baseball a clone of icehockey... 
It's a complete other game of it's own. (yeah, I know ... they're both games containing two teams hitting a small ball with a stick... )
Mindustry is very promising - when it will be finished, some day.
I checked it out several times:
- under ubuntu it's free
- under Windows you need Steam, which charges you 6,- for it, and it didn't run (another brownie point for steam)
- no ports/sources seen for FreeBSD, yet so far

A peek at Jactorio's site brings up the question:
Why even try some "attempt at recreating", if I have the original already running on my machine?


----------

