1. For issues you find with the Console 1.3 release, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
    A FAQ with notes and workarounds can be found HERE. Please check this first to see if this helps your issue.

tModLoader Split Screen Mod

Discussion in 'Released' started by Ilyaki, Jun 16, 2018.

?

Add multiple mice + keyboards?

Poll closed Jul 9, 2018.
  1. Yes

    70.0%
  2. Don't care

    30.0%
  3. No

    0 vote(s)
    0.0%
  1. Ilyaki

    Ilyaki Terrarian

    UPDATE 2.0.0: Multiple keyboard/mice support. See the parts in green for the added instructions. Please note that 2.0.0 only works on Windows - Mac/Linux users must use 1.0.1
    • The method I used in this version is very low-level and may(unlikely) cause your anti-virus to think it is a keylogger, which will probably kill Terraria the moment Split Screen loads. If this happens, you could add an exception for Terraria/tModLoader/SplitScreen or you could install version 1.0.1 if you do not want to use multiple keyboards/mice

    Play with up to unlimited players in split-screen with multiple gamepads and/or multiple keyboards/mice.

    [​IMG]
    [​IMG]
    [​IMG]

    Installation
    1. Install tModLoader : https://github.com/blushiemagic/tModLoader
    2. Download Split Screen from the Mod Browser(recommended) or directly here: javid.ddns.net/tModLoader/download.php?Down=mods/SplitScreen.tmod
      • If you download the SplitScreen.tmod directly, go to Terraria main menu -> Mods -> Open Mods Folder and place the .tmod file there
    3. (Optional) Install x360ce: https://github.com/Ilyaki/TerrariaSplitScreen/wiki/(Optional)-Setting-up-x360ce
    4. (Optional) Setup a fake higher resolution: https://github.com/Ilyaki/TerrariaSplitScreen/wiki/(Optional)-Setting-up-a-virtual-super-resolution

    How to play
    1. Go to your Terraria installation folder, e.g. C:\Program Files (x86)\Steam\steamapps\common\Terraria and launch Terraria.exe as many times as you need
    2. Resize your windows however you like*. Press F6 to toggle the window borders
    3. On one window, go to Multiplayer -> Host & Play -> Select a character -> Select a world
    4. On the other windows, go to Multiplayer -> Join via IP -> Select a character -> Enter localhost as the IP and 7777 as the port
    5. On each window, click Next as many times as you need to change its gamepad. (If one player wants to use a keyboard+mouse, select NONE). Then click OK
      1. If you want to use a keyboard+mouse instead of a gamepad, select NONE as the gamepad index and click OK. I would recommend setting up the gamepad windows first, then the keyboards+mice
      2. Next, hold any three keys on your desired keyboard
      3. On the Lock mouse? menu, select Yes if this is the LAST window you are setting up. Otherwise select No
      4. Click the attach mouse button with your desired mouse
    6. Done. Remember to Save & Exit when you want to quit, not press Alt+F4. The window that hosted the game should quit last.

    Tips
    • Use a different character for each window, or you may break your save
    • If you experience any bugs with controllers, it is recommended to install x360ce
    • Running multiple instances of Terraria can be very taxing on your computer. If you have poor performance, follow these steps
      • Toggle Frame Skip in video settings. See what works best for you.
      • Turn Quality in video settings down.
      • Set Lighting in video settings to Retro.
      • Set multithreading lighting as high as possible (Very important)
    • If you crash on launch, make sure to install the latest .NET Framework: https://www.microsoft.com/en-us/download/details.aspx?id=55170
    • Terraria may crash if you try to mod reload from within the game. I highly recommend restarting Terraria fully after enabling/disabling mods.
    • *If you don't have enough screen space to resize the windows, try setting up a virtual super resolution: https://github.com/Ilyaki/TerrariaSplitScreen/wiki/(Optional)-Setting-up-a-virtual-super-resolution

    (A lot of the code for this mod was based off of my Stardew Valley split screen mod: https://www.nexusmods.com/stardewvalley/mods/2139)
    Leave any feedback or bug reports below :)
     
    Last edited: Jul 17, 2018 at 5:23 PM
  2. QubeTown

    QubeTown Spazmatism

    While I have no use for it, this seems like a very interesting mod. Can't wait to see what comes of it
     
  3. Unftf

    Unftf Terrarian

    that looks like a nice mod. Something which Terraria misses at PC. Multiple mice + keyboards would be nice. You already did this? Did some research many years ago. Could not find any way doing that. Also don't know any current game which supports two mice or two keyboards (only different buttons at keyboard or different gamepads working). The last game I remember which supported that was The Settlers II from 1996.
     
    Last edited: Jun 16, 2018
  4. Striderr

    Striderr Spazmatism

    Very nice. This mod will be very useful for many people.
     
  5. Washedredt

    Washedredt Terrarian

    I downloaded this mod and the tmod loader crashes as it’s initializing the mod, is there anyway to fix this?
     
  6. Ilyaki

    Ilyaki Terrarian

    I used two libraries that allow you to read raw input, and differentiate between mice/keyboards. To stop the mouse cursor moving and clicking on windows, I used AutoHotKey.

    https://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard
    http://jstookey.com/arcade/rawmouse/
    --- Double Post Merged, Jun 17, 2018, Original Post Date: Jun 17, 2018 ---
    Can you try with all other mods disabled?
    Also, what specs are you using: e.g. operating system, 32bit/64bit?
     
  7. Unftf

    Unftf Terrarian

    Thanks for those links. After some quick look (detailed later) those where made for windows XP. There might be some problems with win10, mac, linux or newer version. Also you need to care about Licenses.
     
  8. Ilyaki

    Ilyaki Terrarian

    Works fine on windows 10 from all my testing. It uses specific windows libraries so it will definitely not work on linux/mac.
     
  9. Washedredt

    Washedredt Terrarian


    I tried with all other mods disabled And the same error still occurred as for specs;

    Windows 7 OS
    Intel core i7 4790k
    Radeon r9 280x
    64 bit
     
  10. Ilyaki

    Ilyaki Terrarian

    Can you copy-paste the error log when it crashes here?
     
  11. Chiefrocka

    Chiefrocka Terrarian

    Thanks for this mod, i always wanted to play this game with my little brother with splitscreen, i really appreciate your work!!

    But i'm getting this error when i open terraria.exe
    terraria_error.jpg

    I have no other mod installed, this is a fresh install and i followed your install instructions.

    And i can't click anything on the screen either like the log thing, so i posted the screenshot
     
  12. Washedredt

    Washedredt Terrarian



    I’m getting the same thing


    The game has crashed!

    The type initializer for “SplitScreen.PlayerIndexController” threw an exception.

    at SplitScreen.PlayerIndexController.get_Index()

    at SplitScreen.GamePad_GetState_Patcher.Postfix(GamePadState g, PlayerIndex playerIndex, GamePadState __result) in C:\Users\Ylias\Documents\My Games\Terraria/ModLoader\Mod Sources\SplitScreen\Patchers\GamePad_GetState_Patcher.cs:line 15

    at GetState_Patch1(PlayerIndex playerIndex, GamePadDeadZone deadZoneMode)

    at Terraria.GameInput.PlayerInput.GamePadInput()

    at Terraria.GameInput.PlayerInput.UpdateInput()

    at Terraria.Main.DoUpdate_HandleInput()

    at DoUpdate_Patch1(Object gameTime, GameTime )

    at Terraria.Main.Update(GameTime gameTime)
    --- Double Post Merged, Jun 20, 2018, Original Post Date: Jun 20, 2018 ---

    Here it is

    The game has crashed!

    The type initializer for “SplitScreen.PlayerIndexController” threw an exception.

    at SplitScreen.PlayerIndexController.get_Index()

    at SplitScreen.GamePad_GetState_Patcher.Postfix(GamePadState g, PlayerIndex playerIndex, GamePadState __result) in C:\Users\Ylias\Documents\My Games\Terraria/ModLoader\Mod Sources\SplitScreen\Patchers\GamePad_GetState_Patcher.cs:line 15

    at GetState_Patch1(PlayerIndex playerIndex, GamePadDeadZone deadZoneMode)

    at Terraria.GameInput.PlayerInput.GamePadInput()

    at Terraria.GameInput.PlayerInput.UpdateInput()

    at Terraria.Main.DoUpdate_HandleInput()

    at DoUpdate_Patch1(Object gameTime, GameTime )

    at Terraria.Main.Update(GameTime gameTime)
     
  13. Ilyaki

    Ilyaki Terrarian

    Can you try updating your .NET Framework version: https://www.microsoft.com/en-us/download/details.aspx?id=55170
    Thanks :)
     
  14. Chiefrocka

    Chiefrocka Terrarian

    Ilyaki likes this.
  15. alepagliaccio

    alepagliaccio Terrarian

    Hi, it's been 3 days that I'm using your mod I really enjoy playing split screen but ive found a real issue, the screen that uses the controller lags really a lot making it so frustrating, my pc has good specs I think the real issue is that windows detects only 1 terraria as an active window if you know what I mean, and so the other one gets a decresed performance, do you know any possible fix for this?
     
  16. Ilyaki

    Ilyaki Terrarian

    In the settings menu for each terraria instance, make sure multithreaded lighting is set to the maximum it can be.

    In Task Manager(Press Ctrl+Shift+Esc to open) -> Details, you can set the priority for each Terraria instance to High.

    Also, in Task Manager -> Performance -> CPU -> Right click the graph -> Change graph to -> Logical processors.
    You should have all graphs at 100%, or your CPU is wasting potential. If they are not at 100%, go back to Details and click Set Affinity for each Terraria process. Try disabling cores that are 100% for some processes, until the CPU graphs are all maxed at 100%
     
    LinaNfinE likes this.
  17. alepagliaccio

    alepagliaccio Terrarian

    Thanks you saved my terraria experience, I did everything and now I can play it normally!
     
  18. nameless00

    nameless00 Terrarian

    will multiple keyboard and mouse support be added?
     
  19. Ilyaki

    Ilyaki Terrarian

    Yes
     
  20. Tokengut

    Tokengut Terrarian

    Hey, so I've been trying to use your mod, but when I start a game, the menu doesn't show up at all, even with all other mods disabled