FlyDangerous icon indicating copy to clipboard operation
FlyDangerous copied to clipboard

Look into threading the terrain generation in MacOS (M1 only?) and Linux

Open jukibom opened this issue 2 years ago • 2 comments

Map Magic 2 supposedly supports OSX but fails (at least according to #102 on an M1 Mac) when utilising the native terrain gen flag. Apparently the C++ source is included with the asset but I haven't dug into it yet - this is becoming a pretty big pain point so some time really needs dedicating to this.

This can be "fixed" (#85) by disabling the native handlers but the result is single-threaded terrain tile generation which is PAINFULLY slow and halts the main thread which is clearly not acceptable.

jukibom avatar Oct 08 '21 13:10 jukibom

AHA looks like the source code isn't in the package but is available here:

https://gitlab.com/denispahunov/tools/-/tree/master/.NativeSources

Intel macs are supported, M1 is not.

jukibom avatar Oct 15 '21 09:10 jukibom

https://forum.unity.com/threads/unity-awards-nominee-mapmagic-2-infinite-procedural-land-generator.875470/page-39#post-8124386

PAAAAAIN

jukibom avatar May 13 '22 07:05 jukibom

Adding this here for posterity

Linux build instructions:

  • Open Matrix.cpp and #include <limits> to the includes
  • Open MatrixOps.cpp and #include <limits> to the includes
  • Use the following command to compile: clang++ -std=c++14 -target x86_64-pc-linux-gnu -shared -undefined dynamic_lookup -fPIC -O3 -o x64/libNativePlugins.so *.cpp

libNativePlugins.so will be in the x64 folder.

note: gcc does not seem to work

jukibom avatar Apr 04 '23 15:04 jukibom

apple+linux.zip

This has now been resolved with a custom build of the native libs for apple silicon and linux, tested on Steam Deck, WSL, M1 macbook 🥳

Will update the README with links to this thread for those looking to build locally.

jukibom avatar Apr 05 '23 19:04 jukibom