[WIP] MonoGame Terraria - Terraria for Linux

Discussion in 'Released Mods' started by Deathmax, Dec 25, 2011.

  1. Deathmax Demon Eye

    A port of Terraria to MonoGame, allowing Linux users to play the game.

    I may or may not be updating this to 1.1.2, we will see in a week or 2.


    Known Issues
    • There are a few rendering issues.
      • Liquids don't render out properly
      • Text is glitchy
    • Performance randomly takes a hit at times.
    • Window resizing does not work
    • Some issues with running Terraria for some people.
    • Networking is still, a little buggy.
    Working
    • Everything else (Including Multiplayer!)
    • Audio now works. Including Music. Thanks to espes for his source to MacTerraria
    [IMG]


    Installation Instructions
    1. Grab the Content folder and Terraria.exe from Steam. (Either via wine or a Windows install)
      • Check the exe hashes at the bottom
    2. Extract the downloaded binaries archive somewhere.
    3. Run bspatch to patch Terraria.exe with the .patch file included in the archive.
    4. Run mono Terraria.exe
    Notes
    • Dependencies
      • Mono 2.8+ (Tested and built against 2.10.5)
      • OpenAL (must have libopenal.so.0, or link the .1 lib)
    • Music does not work unless you follow the extra steps.
    • Will work regardless of having a proper GPU.
    Music Instructions
    1. Make sure you have ffmpeg, python and perl installed.
    2. Extract the music conversion archive into the Content folder.
    3. Run perl xactxtract2.pl -x "Wave Bank.xwb"
    4. Run convertmusic.sh
    5. Run python MakeXwb.py "Wave Bank.xwb"
      • Make sure the file list outputted is in order.
    6. Music should now work. (albeit with a 80MB Wave Bank with uncompressed PCM data)
    Downloads
    Server
    Check out the TShock project.

    Hashes
    • v1.1
      • Original : 0f3f1f05ec4d218776feaa92551f6c11
      • Patched : 5a40b82d457d5008eba6fa88f0565a44
    • v1.0
      • Original : 388d594d52b5cfe513ede8c4df32fbd8
      • Patched : e32862654e9bffd77c8e8bc4295e80c1
    Changelog
    • v1.1
      • Compile against Any CPU
      • Update to 1.1.1 santa hotfix
  2. oreo Lava Slime

    Although I'm not a linux user, I'd like to say thanks.
    Now all people who want to play Terraria, can.
    Wingzero007 likes this.
  3. Deathmax Demon Eye

    Released. Mods, could you change the thread title tag to Released please?
  4. oreo Lava Slime

    You have to report it and then ask for a name change in the report.
  5. Acidic Green Slime

    Could you go more in depth on how to install it? I have terraria.exe but could not find a .diff file in the archive. How do I go about installing?
  6. l0ser140 Green Slime

    Great work, but I have a problem.
    Code:
    [loser@loser terraria]$ mono Terraria.exe
    
    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Terraria.Netplay ---> System.TypeLoadException: Could not load type 'System.Configuration.Internal.ConfigurationManagerInternal, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
      at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool)
      at System.Type.GetType (System.String typeName, Boolean throwOnError) [0x00000] in <filename unknown>:0
      at System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission (System.String typeString) [0x00000] in <filename unknown>:0
      at System.Configuration.ConfigurationManagerInternalFactory.get_Instance () [0x00000] in <filename unknown>:0
      at System.Diagnostics.DiagnosticsConfiguration.Initialize () [0x00000] in <filename unknown>:0
      at System.Diagnostics.DiagnosticsConfiguration.get_Sources () [0x00000] in <filename unknown>:0
      at System.Diagnostics.TraceSource.Initialize () [0x00000] in <filename unknown>:0
      at System.Diagnostics.TraceSource.get_Switch () [0x00000] in <filename unknown>:0
      at System.Net.Logging.InitializeLogging () [0x00000] in <filename unknown>:0
      at System.Net.Logging.get_On () [0x00000] in <filename unknown>:0
      at System.Net.Sockets.TcpClient..ctor (AddressFamily family) [0x00000] in <filename unknown>:0
      at System.Net.Sockets.TcpClient..ctor () [0x00000] in <filename unknown>:0
      at Terraria.ClientSock..ctor () [0x00000] in <filename unknown>:0
      at Terraria.Netplay..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Terraria.Netplay ---> System.TypeLoadException: Could not load type 'System.Configuration.Internal.ConfigurationManagerInternal, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
      at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool)
      at System.Type.GetType (System.String typeName, Boolean throwOnError) [0x00000] in <filename unknown>:0
      at System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission (System.String typeString) [0x00000] in <filename unknown>:0
      at System.Configuration.ConfigurationManagerInternalFactory.get_Instance () [0x00000] in <filename unknown>:0
      at System.Diagnostics.DiagnosticsConfiguration.Initialize () [0x00000] in <filename unknown>:0
      at System.Diagnostics.DiagnosticsConfiguration.get_Sources () [0x00000] in <filename unknown>:0
      at System.Diagnostics.TraceSource.Initialize () [0x00000] in <filename unknown>:0
      at System.Diagnostics.TraceSource.get_Switch () [0x00000] in <filename unknown>:0
      at System.Net.Logging.InitializeLogging () [0x00000] in <filename unknown>:0
      at System.Net.Logging.get_On () [0x00000] in <filename unknown>:0
      at System.Net.Sockets.TcpClient..ctor (AddressFamily family) [0x00000] in <filename unknown>:0
      at System.Net.Sockets.TcpClient..ctor () [0x00000] in <filename unknown>:0
      at Terraria.ClientSock..ctor () [0x00000] in <filename unknown>:0
      at Terraria.Netplay..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
    
    Code:
    [loser@loser terraria]$ mono -V
    Mono JIT compiler version 2.10.6 (tarball Wed Oct 19 06:33:45 UTC 2011)
    Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
        TLS:          __thread
        SIGSEGV:      altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)
    Code:
    [loser@loser terraria]$ md5sum Terraria2.exe
    388d594d52b5cfe513ede8c4df32fbd8  Terraria2.exe //source file
    [loser@loser terraria]$ md5sum Terraria.exe
    e32862654e9bffd77c8e8bc4295e80c1  Terraria.exe //patched file
  7. Deathmax Demon Eye

    Its a .patch file sorry.

    Could you run mono with --debug and have the Terraria.exe.mdb file with Terraria.exe?
  8. Hawkflight Green Slime

    Okay, this is cool, but it didn't work for me.

    I extracted the files to the Terraria folder, and patched Terraria with 'bspatch Terraria.exe Terraria.exe Terraria-1.1.1-Mono-1.0.patch'. Then, after running the 'mono Terraria.exe' command, I got this:

    Code:
    root@hawkflight-G74Sx:/home/hawkflight/.local/share/wineprefixes/steam/drive_c/Program Files/Steam/steamapps/common/terraria# mono Terraria.exe
    WARNING: The runtime version supported by this application is unavailable.
    Using default runtime: v1.1.4322
    The assembly mscorlib.dll was not found or could not be loaded.
    It should have been installed in the '/usr/lib/mono/1.0/mscorlib.dll' directory.
    root@hawkflight-G74Sx:/home/hawkflight/.local/share/wineprefixes/steam/drive_c/Program Files/Steam/steamapps/common/terraria#
    
    So I went to '/usr/lib/mono/', and found no 1.0 folder, but I did find the indicated file in 'mono/2.0'. So I tried renaming '2.0' to '1.0' and ran 'mono Terraria.exe' again, and this is what I got:

    Code:
    root@hawkflight-G74Sx:/home/hawkflight/.local/share/wineprefixes/steam/drive_c/Program Files/Steam/steamapps/common/terraria# mono Terraria.exe
    WARNING: The runtime version supported by this application is unavailable.
    Using default runtime: v1.1.4322
    
    ** (Terraria.exe:30159): WARNING **: The following assembly referenced from /home/hawkflight/.local/share/wineprefixes/steam/drive_c/Program Files/Steam/steamapps/common/terraria/Terraria.exe could not be loaded:
         Assembly:   System    (assemblyref_index=2)
         Version:    4.0.0.0
         Public Key: b77a5c561934e089
    The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/home/hawkflight/.local/share/wineprefixes/steam/drive_c/Program Files/Steam/steamapps/common/terraria/).
    
    
    ** (Terraria.exe:30159): WARNING **: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
    
    Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
    
    Help?
  9. Deathmax Demon Eye

    You need atleast Mono 2.8 to run this.
  10. 2Ben Green Slime

    I have the exact same error message as l0ser140.

    I'd like to help but "Could you run mono with --debug and have the Terraria.exe.mdb file with Terraria.exe? " isn't really clear (mono n00b here).
    I did run mono --debug=mdb-optimizations Terraria.exe but it didn't seem to generate any Terraria.exe.mdb file.
  11. Deathmax Demon Eye

    The archive should have a Terraria.exe.mdb file. Running mono --debug Terraria.exe should give me more information on where is the issue occurring.
  12. 2Ben Green Slime

    Hi,

    No the archive doesn't contain Terraria.exe.mdb (maybe that's the issue ?). Here is the content :

    GamepadBridge.dll
    Lidgren.Network.dll
    Lidgren.Network.dll.mdb
    MonoGame.Framework.Linux.dll
    MonoGame.Framework.Linux.dll.mdb
    OpenTK.dll
    OpenTK.dll.config
    Tao.Sdl.dll
    Tao.Sdl.dll.config
    Terraria-1.1.1-Mono-1.0.patch
  13. Hawkflight Green Slime

    I do have Mono 2.8.
  14. Deathmax Demon Eye

    Are you by any chance running on x64?
  15. Dieterhatn Green Slime

    I even get another error:
    Code:
    ~/Programme/terraria$ sudo mono Terraria.exe
    Unhandled Exception: System.TypeLoadException: Could not load type 'Terraria.Main' from assembly 'Terraria, Version=1.0.4.0, Culture=neutral, PublicKeyToken=null'.
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Terraria.Main' from assembly 'Terraria, Version=1.0.4.0, Culture=neutral, PublicKeyToken=null'.
  16. Hawkflight Green Slime

    I am, yes.
  17. Deathmax Demon Eye

    Could you try the latest version 1.1?

    (Keep in mind you need the latest exe from today)
  18. Momoka Green Slime

    Hello. Something is wrong here but I am unsure what.
    Code:
    $ md5sum Terraria.exe
    388d594d52b5cfe513ede8c4df32fbd8  Terraria.exe
    
    $ bspatch Terraria.exe Terraria_mono.exe Terraria-1.1.1-Mono-1.1.patch
    
    $ md5sum Terraria_mono.exe
    1c15b68706bcfeca93e108b1a256950c  Terraria_mono.exe
    
    $ mono Terraria_mono.exe
    Cannot open assembly 'Terraria_mono.exe': File does not contain a valid CIL image.
    
    $ mono --debug Terraria.exe
    Unhandled Exception: System.TypeLoadException: Could not load type 'Terraria.Main' from assembly 'Terraria, Version=1.0.4.0, Culture=neutral, PublicKeyToken=null'.
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Terraria.Main' from assembly 'Terraria, Version=1.0.4.0, Culture=neutral, PublicKeyToken=null'.
    I'm using latest in steam yet it has the 1.0 hash. What am I doing wrong?
  19. Deathmax Demon Eye

    Are you sure you have the latest? There was an update on the 31st.
  20. Dieterhatn Green Slime

    After updating I got the same error with a different version number
    Code:
    mono Terraria.exe
    
    Unhandled Exception: System.TypeLoadException: Could not load type 'Terraria.Main' from assembly 'Terraria, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null'.
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Terraria.Main' from assembly 'Terraria, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null'.
    

Share This Page