SWBFGamers

Gaming for the Original SWBF1 and SWBF2/other games => Star Wars Battlefront 2 (2005 Original) => Topic started by: SleepKiller on October 23, 2016, 11:22:37 PM

Title: SWBFII Split Screen Toolkit
Post by: SleepKiller on October 23, 2016, 11:22:37 PM
This is a little something I have been working on for fun recently. It enables people to play Star Wars Battlefront II in a split screen mode on PC.

[spoiler=Image](https://www.swbfgamers.com/gallery/1581_24_10_16_12_10_54.png)[/spoiler]

Requirements
   As many XInput compliant controllers as you wish to have players. PS3 or PS4 controllers will work fine if you use something like SCP Toolkit (https://github.com/nefarius/ScpToolkit).

   At least Windows 7, though I haven't tested it provided you have the runtimes below it should work.

   Non-Steam Version of SWBFII, the Steam version will not work unless you replace BattlefrontII.exe with the SWBFSpy version of the client.

   If you're lazy and on Windows 10 only bother downloading them if you get a "Runtime error" or something to that effect, the operating system may very well take care of getting dependencies for you.

   The core application requires Visual C++ Redistributable for Visual Studio 2015
   https://www.microsoft.com/en-nz/download/details.aspx?id=48145

   And the GUI requires .NET Framework 4.6.1 which you can get here.
   https://www.microsoft.com/en-nz/download/details.aspx?id=49981

   Optionally you can also install the SWBFII dedicated server software and use that for lower loading times.
   http://www.swbfgamers.com/index.php?topic=10619.msg106046#msg106046

Installation
   Copy all the contents of zip to the directory where your BattlefrontII.exe is.
   This is usually "C:\Program Files (x86)\LucasArts\Star Wars Battlefront II\GameData"

   Do not get BattlefrontII.exe confused with LaunchBFII.exe, if you don't see BattlefrontII.exe you're in the wrong place.

Usage
   Once installed simply start Split Screen GUI to configure and launch your play session. All the controls should have tooltips to inform you what they do.
   
   The map list supports common Windows controls like Double Clicking to add a single map, holding Control to select multiple items and drag-droping selections.

   The tool uses a pre-created profile to give you controls almost identical to the console version of the game. If you want to rebind them you'll have to set a player's name to SplitScreen using the GUI, or commandline tool, and rebind the controls using that player's screen. Once you've got them how you want exit and start the split screen session again to update the controls across all players.

Technical Overview
[spoiler]The backend console program works to enable splitscreen through a mixture of commandline arguments, memory editing and function hooks.
   
The first thing it does is create a game process in a suspended state to enable hooking and editing of it's memory before the game executes any code.

From there it changes the name SWBFII will use for the window classname and mutex SWBF uses to prevent multiple instances starting up. (Normally a useful safety measure for a program to have but in this case it is holding us back.)

Then it injects a DLL into the process to hook various WinAPI functions. There are three ones of note. The first one hooks RegisterClass to redirect WindowProc to our own callback to filter out loss of focus messages, stopping the Scoreboard coming up when the game loses focus in Multiplayer.

The second hook is one for DirectSound, the main sound buffers created by the game will have global focus enabled on them. Enabling audio for our process to play in the background.

The final hook of major note is the most complex. So far we've taken care of the game's perception of focus and audio focus, leaving us with input focus. DirectInput does have support for background input but due to the API's age setting which controller the game was using was something I didn't want to deal with.

So instead when the game enumerates controllers we supply only one option, a virtual interface mimicking IDirectInputDevice8. This virtual interface uses XInput to present a single connected controller that we can determine to the game. Since XInput has no concept of focus the problem of getting input to the game is solved.
      
After that the process is resumed/started properly, we wait for it to create it's window and once it's done that we set it as a foreground window, putting it above everything else on the desktop, including the taskbar. Although pressing Start + D when not focusing a foreground window will minimize them.

There is more the toolkit does but that is a general overview of how it enables split screen play in SWBFII.
[/spoiler]

Change Log
[spoiler]1.0.1
   -Stopped being lazy and updated Window Classname handling and Mutex Name handling to be dynamic through hooks.
   -Switched over to xinput9_1_0 after mistakenly forgetting to do so.
   -Various bits of refactoring to enable the above change.
1.0.2
   -Fixed a bug preventing SWBFII from correctly configuring the thumbsticks of a controller. As a result controls are much smoother now.
   -Thumbstick deadzone can now be customized from SWBFII as well.
   -Mouse and keyboard support has been disabled for now due to conflicts it was creating with controllers.
1.0.3
   -Removed "Keyboard Player" GUI element as I lack the time to max the changes to support it.
   -Removed XInput controller checking from the GUI due to inconsistent behaviour expressed by the tool due to it.
   -As a result of the above change people are now responsible for making sure the correct number of XInput controllers are connected to the PC.

1.0.4
   -Fixed a potential race condition in the creation and hooking of the game.
[/spoiler]

Download it here! (Current Version 1.0.4) (https://www.dropbox.com/s/f7629rggsbr0vvc/SWBF2%20Split%20Screen%20%281.0.4%29.zip?dl=0)

If you do use it be sure to let me know how it goes and feel free to ask questions, especially if you encounter strange behaviour.
Title: Re: SWBFII Split Screen Toolkit
Post by: FuzzyQuills on October 24, 2016, 03:37:50 AM
Hey, this looks good!
I'm happy to do some testing of my own if you like.
Does this work by exploiting the localhost IP? Or does it use multiple BFII instances?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on October 24, 2016, 04:09:50 AM
If you want to test it go ahead, it would be nice to know that it works on PCs other than my own.

To answer your question it works by creating multiple instances of the game (one for each player) and positioning their windows accordingly. It optionally also supports creating and managing a server for players to connect to. Bringing the total instance count of the game up to (Number of Players + 1).

Regrettably I didn't seem to be able to get auto-joining for LAN working so players must still navigate through the Multiplayer menu to find the server. But SWBFII has no issue locating and joining servers running on the same machine once you are there, it can just take a few seconds for the server to load the map.

A user can pick if the server it creates is hosted by using the client executable or if installed the server executable. Both more or less functionally identical but the dedicated server executable does load smaller game files so it is preferred.
Title: Re: SWBFII Split Screen Toolkit
Post by: Led on October 24, 2016, 04:18:50 AM
Very nice SK!

Thanks for thinking of us  :cheers:
Title: Re: SWBFII Split Screen Toolkit
Post by: Rookie 1 on October 24, 2016, 11:17:28 AM
Great work! I'm going to have to try this with some friends. Now we just need a way to activate two player galactic conquest on the pc.
Title: Re: SWBFII Split Screen Toolkit
Post by: Rayce on October 24, 2016, 11:49:00 AM
Awesome job, man!

Also, you're back!!
Title: Re: SWBFII Split Screen Toolkit
Post by: William on October 24, 2016, 01:18:45 PM
SO many people have requested this on Steam. Do you mind if I post a link to this topic on there?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on October 24, 2016, 06:25:07 PM
Quote from: Jean on October 24, 2016, 01:18:45 PM
SO many people have requested this on Steam. Do you mind if I post a link to this topic on there?
Yes and no. I would love to support the Steam version of the so that people can use this tool regardless of the version of the game they own. But I have no way to verify compatibility with it myself. I would request that before you do post anything about it you test it to make sure it works for people not running with the SWBFSpy executable (http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1384). (That part is very important, be sure to test using the original Steam executable.)

In the likely event the game crashes then you can still post about it if you want, you would just have to include SWBFSpy as a requirement for it. Something I personally find ugly which is why I didn't reference it in the original post, I would much rather add support for the Steam version directly. But since I don't own it that may be a ways off. (Unless any of you are feeling particularly generous and have a spare copy kicking about.)
Title: Re: SWBFII Split Screen Toolkit
Post by: William on October 25, 2016, 12:13:33 AM
I tried it and got error messages saying missing XINPUT1_4.dll
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on October 25, 2016, 03:08:51 AM
Quote from: Jean on October 25, 2016, 12:13:33 AM
I tried it and got error messages saying missing XINPUT1_4.dll
Ah thanks for testing it. That's the kind of mistake it's easy for me to miss, XInput 1.4 is only included on Windows 8 and above. It is also what Visual Studio links to by default. I had intended to link against the Windows 7 version (XInput 9.1.0) but I completely forget. A new version is in the main post that should address this issue.
Title: Re: SWBFII Split Screen Toolkit
Post by: Ltin on October 25, 2016, 08:51:05 PM
Would this be more taxing on graphics cards then too?
Yes i know this shouldn't be a problem for anyone, but hey you never know.
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on October 27, 2016, 07:02:38 AM
Quote from: Ltin on October 25, 2016, 08:51:05 PM
Would this be more taxing on graphics cards then too?
Yes i know this shouldn't be a problem for anyone, but hey you never know.
A simple answer is yes it probably will be more expensive than running a single instance of the game. That said SWBFII is eleven years old so in the unlikely event someone encounters a performance problem turning down the video settings by editing the SplitScreen profile outside the tool would in all likely hood be all that is needed to make it run smoothly. (Just a quick related note for anyone reading this, do not edit controls outside the tool the buttons the virtual control presents to the game are different from the ones DirectInput presents. If you want to change the controls set Player #1's name to SplitScreen and do it from their screen. Once you're done exit from their screen and restart the session.)

In other news a new version has been posted fixing bugs with thumbstick behaviour.
Title: Re: SWBFII Split Screen Toolkit
Post by: flyingDutchman on November 20, 2016, 11:05:30 AM
Hey, first off this is awesome!

I'm trying to get it to work with the steam version, so far I can't get it to work. Right after I set up the map and hit play I get a generic windows error "Split Screen Gui has stopped working". I've installed all the files you listed in the first post. Any other ideas? (windows 8.1 + steam version)

Thanks again!
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on November 20, 2016, 05:43:49 PM
I put an update in the main post removing some functionality in the GUI relating to XInput that was causing problems. The checkbox for Keyboard Player was also removed as I do not have the time currently to implement keyboard support.

As for Steam support thanks to Dark_Phantom I was able to look into it. And regrettably looks like it doesn't want to work, since circumventing DRM is far beyond the scope of this toolkit I will not be looking into it further. However you should be able to replace Steam's BattlefrontII.exe with the SWBFSpy one (http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1384) and have it work. (You have to rename "BattlefrontII - SWBFSpy.exe" to "BattlefrontII.exe" and replace Steam's version of the executable.)

Much less clean and simple than I would like but it is what it is.

Quote from: flyingDutchman on November 20, 2016, 11:05:30 AM
Hey, first off this is awesome!

I'm trying to get it to work with the steam version, so far I can't get it to work. Right after I set up the map and hit play I get a generic windows error "Split Screen Gui has stopped working". I've installed all the files you listed in the first post. Any other ideas? (windows 8.1 + steam version)

Thanks again!
Hm, I haven't encountered that. The console application should catch most errors and provide some useful form of feedback.

There are a couple things you can do. First is to make sure the entire contents of the "SWBF2 Split Screen" were copied into the directory BattlefrontII.exe lives in. The GUI will fail ungracefully if it can't find "SWBF Split Screen++.exe", which in turn will fail if it can't find the two DLLs it depends on.

If you're sure everything is installed correctly you can try right clicking on the Play button and clicked "Play (Debug)" and see if you get any useful output. (If you do get some form of output other than a generic windows message just take a screen shot and post it for me to look at.)

Hope one of those can help solve it for you!
Title: Re: SWBFII Split Screen Toolkit
Post by: flyingDutchman on November 21, 2016, 04:32:06 PM
progress!

I noticed you mentioned SWBF Split Screen++.exe which wasn't in the folder I downloaded, did some digging around looks like avast was auto deleting it must be a false positive. I added it to the exclusions and I can now run without a generic windows error, but after running it it just opens and closes,

here the error it shows for the debug (ive attached it)

Thanks for the help! this is going to amazing if I can get it to work  :cheer:
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on November 21, 2016, 07:42:41 PM
Quote from: flyingDutchman on November 21, 2016, 04:32:06 PM
progress!

I noticed you mentioned SWBF Split Screen++.exe which wasn't in the folder I downloaded, did some digging around looks like avast was auto deleting it must be a false positive. I added it to the exclusions and I can now run without a generic windows error, but after running it it just opens and closes,

here the error it shows for the debug (ive attached it)

Thanks for the help! this is going to amazing if I can get it to work  :cheer:
Ah yeah makes sense that it would trip some AV scanners. In the eyes of the AV software it is doing some things that it might expect applications of less than noble intent to be doing. (Editing another processes memory, injecting code into that process, etc.)

As for your current startup problem I've posted a new version in the main post fixing a possible race condition with starting the game processes, from your console output it looks like it may fix the problem you're having. (I hope. If it doesn't just let me know and I'll try to find time to look into it more.)
Title: Re: SWBFII Split Screen Toolkit
Post by: Antstafer on January 31, 2017, 01:11:08 PM
Would this be possible to replicate with the first battlefront? The possibilities....
That being said, this toolkit works surprisingly well. Had some issues with my antivirus but after that I couldn't believe my eyes!

I do however want to point out that it only works if both players are on the same team. If one player chooses the opposing team, the spawn timer goes into a 10-15 second loop for them, and keeps timing out.
Title: Re: SWBFII Split Screen Toolkit
Post by: gamewiz198 on February 22, 2017, 10:37:33 AM
I got this error. It starts to work but crashes soon after. I downloaded the newest version and it still doesn't work. Can I have some help?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on March 16, 2017, 07:32:15 PM
Sorry about such a long time in between your posts and my replies guys. I often forget or don't have time to check up on this site. If either of you are still wanting to get this working I'll help where I can.

Quote from: Antstafer on January 31, 2017, 01:11:08 PM
Would this be possible to replicate with the first battlefront? The possibilities....
That being said, this toolkit works surprisingly well. Had some issues with my antivirus but after that I couldn't believe my eyes!

I do however want to point out that it only works if both players are on the same team. If one player chooses the opposing team, the spawn timer goes into a 10-15 second loop for them, and keeps timing out.
That is very strange. I've personally used the tool multiple times without any such issues. I can't promise anything since what time I spend on programming is spent on other projects currently but if you can attach a screen shot of the settings you use I might be able to take a look at it.

Quote from: gamewiz198 on February 22, 2017, 10:37:33 AM
I got this error. It starts to work but crashes soon after. I downloaded the newest version and it still doesn't work. Can I have some help?
Hm, what version of Windows and game version are you using? (By game version I mean Steam, GoG, Disc or SWBFII Spy patch.)
Title: Re: SWBFII Split Screen Toolkit
Post by: tbare598 on March 29, 2017, 07:58:43 PM
SleepKiller,

Would you be so kind as to share the code that you used to create the program? I would love to dive into that code, and see if I can't re-use parts of it, to get other games working as split screen games. I've had luck getting some games to work as split-screen, but this SWBF2 has eluded me.
Title: Re: SWBFII Split Screen Toolkit
Post by: Led on March 29, 2017, 08:11:41 PM
tbare958--you might want to PM him directly, as Sleepkiller is an infrequent visitor here these days.   :cheers:
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on April 03, 2017, 07:31:37 PM
Blast I subscribed to the topic for e-mail notifications so I would stop missing replies and it went to Spam. Oh well at least I'm not as late at replying as I have been.

Sorry about the following wall of text, I've tried to thoroughly explain as much as possible so as to be as helpful as possible to anyone else finding this as well. If you just want the source code it is at the bottom of the post.

I'm happy to assist you in your goal of split screen gaming (as it is a goal I share). So onto a description of my code and why I haven't released it. (until now that is) So briefly my front end Gui is in C# but that simply launches a commandline C++ program that does all the heavy lifting, I say C++ but the reason why I haven't released it is I'm so downright ashamed of the quality of code in it that it is effectively (badly written) C with Classes. 

I know I can and should do better so I started rewriting the program from the ground up to support more games, have better structure, etc. Then I started writing a WinSock2 implementation for local communication for the games when I hit a game that needed it and then I decided "Why limit this to Windows? There games on Linux to!" so I started to re-structure the code yet again... See where this is going?  Bottom line I am still working on it but I haven't got really any of the code into a fit for release state. (That is one where I won't want to crawl into a cave in shame from others seeing it.)

Anyway none of that really matters it is just a disclaimer. If you want the source code with all it's flaws you are most certainly welcome to it if you feel it will help you. I'll post a link to it at the end of this post. First I'll give you a hopefully useful overview of what SWBFII needs in order to run multiple instances and have them all get input.

Firstly and this is the simple one both SWBF and SWBFII create a mutex called PlayBF. My tool renames it for each instance when they go to create it by using a hook, but killing it should work as well. nucleuscoop's previous version (Split Screen Tool, I believe) took the route of killing the mutex for L4D.

The game then implements a fairly common convenience measure to also (in an effort to help the user) prevent multiple instances opening. When the game is started it searches for a window with the window class (https://msdn.microsoft.com/en-us/library/windows/desktop/ms632596%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396) called "Star Wars Battlefront II" (I think it's that, the source code of my tool will say for certain). If it finds a window with that class it maximizes that window, focuses it (after all the user wanted SWBFII and it's already running no need to run two instances) and then exits.

Beating this is fairly simple, you can create the game's process in a suspended state and edit the string used for the class name in the game's memory. (This would also work on mutex names) That isn't very generic however so you can also hook RegisterClass (https://msdn.microsoft.com/en-us/library/windows/desktop/ms633586) and change it there, or the simplest one would be hook FindWindow (https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499) and return a not found message.

Then, there is yet another problem caused by the game being clever and useful. "When I'm not the focused Window there is no need for me to be working as hard." SWBFII checks is thankfully simple in this regard, simply using the window messages, WM_KILLFOCUS (https://msdn.microsoft.com/en-us/library/windows/desktop/ms646282), WM_ACTIVATE (https://msdn.microsoft.com/en-us/library/windows/desktop/ms646274) and WM_ACTIVATEAPP. It's been a while but looking at my source code now all I am doing is installing my own [url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms633573]WindowProc (https://msdn.microsoft.com/en-us/library/windows/desktop/ms632614) in place of SWBFII's, always handling these messages (so returning 0) and then passing any other message onto SWBFII's WindowProc. I did this by hooking RegisterClass but the subject of Window hooking always confused me so there are very possibly better ways.

After all this there still exist two problems. One of which I do not think is necessary if you hook all the Window's the game's process creates and stop them from getting lost focus messages. And that is that the game's sound mutes itself when it is in the background, this is handled automatically by DirectSound , this is something I can not remember much about but I do know I solved it by adding DSBCAPS_GLOBALFOCUS (https://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.reference.dsbcaps) to the sound buffer created (https://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.idirectsound8.idirectsound8.createsoundbuffer) by SWBFII. Once again I used hooks but for this problem I'm sure there are better, simpler solutions out there.

Finally the last problem. SWBFII offers no way to select a controller it will either use the system mouse and keyboard and the first DirectInput8 controller it finds. So this is probably the most complex part, somehow you need to make SWBFII use a controller you set and it should always use that controller.

Now when I did the method I did I knew very little about COM (https://msdn.microsoft.com/en-us/library/windows/desktop/ms680573). I still know very little, but I know enough to hopefully help point you in the right direction. So DirectInput is just a collection of COM classes right? This means that if you're know what you're doing (or feel like learning it!) it should be possible to write you're own COM classes for it to use instead, in whatever language you like. Then hook the game's call to get DirectInput objects (https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.directinput8create) and pass it your's instead. Other methods would be patching the virtual function table of the classes you wanted to hook or what I did (since Visual C++'s vtable's and COM are ABI compatible) simply write C++ classes to implement the class without touching COM. See my code for a (poor) example of doing this.

Any of those options would give you away to always get the game to use any input device you wanted.

So all that will give you a working implementation, there are however two more things I do to deal with oddities/nuisances of SWBFII. So the first is the game has no built in borderless window mode. However changing a window to borderless is fairly trival so I won't go into details like the style flags used. I did however do it in a CreateWindowEx (https://msdn.microsoft.com/en-us/library/windows/desktop/ms632680) hook so it would happen as soon as possible.

The final thing is SWBFII likes to centre it's window when a new map loads. I hooked SetWindowPos (https://msdn.microsoft.com/en-us/library/windows/desktop/ms633545) and just never let the game change window positions. There are of course other very simple ways of dealing with this. (Monitoring the window position and changing it if it ever isn't what you want being one of them.)

So here is the source code for anyone interested https://www.dropbox.com/s/1j4vfkv0e3y6yza/SWBF%20Split%20Screen%2B%2B.7z?dl=0 (https://www.dropbox.com/s/1j4vfkv0e3y6yza/SWBF%20Split%20Screen%2B%2B.7z?dl=0), if you have VS2015 or VS2017 it should be ready to build. I have neglected putting a license on it, partly because the quality of the code is so poor that I don't think anyone should re-use large portions of it directly. (If you want or require one for it just let me know and I'll do it.)  That said feel free to use any code from it if it is useful to you; attribution is nice but under no circumstances required. If something there I've made is useful to you then I am pleased to have been of service.

Feel free to contact me if I've left something out, you want something explained better or if you just encounter any issues with something I've said here.
Title: Re: SWBFII Split Screen Toolkit
Post by: tbare598 on April 04, 2017, 05:37:18 PM
SleepKiller,

Thank you so much for the detailed explanation and the link to the code. I'll look through it, and I'll let you know if it comes as any help.

It's funny that you mention nucleuscoop, because I've been working on a fork of that project. I attempted a few methods of getting hold of the author to get some changed pulled in, but I've had no luck.

As for the project, I haven't worked with hooks before, so I've been looking around for some beginning to end examples of how to install and release hooks from applications(as I learn best with examples), so I'm sure that the code that you provided will be really helpful for me.
Title: Re: SWBFII Split Screen Toolkit
Post by: xMichael on May 09, 2017, 08:59:23 AM
When I try to join server with 2nd player, it fails because of cdkey error.
Title: Re: SWBFII Split Screen Toolkit
Post by: Ltin on May 09, 2017, 10:41:21 AM
what is your specific error code?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on May 09, 2017, 07:48:36 PM
Quote from: xMichael on May 09, 2017, 08:59:23 AM
When I try to join server with 2nd player, it fails because of cdkey error.
Are you trying to join an Internet server? If so this tool won't work because your game install only has one CD key and Internet servers require each client have a unique key.

If you're trying to join a LAN game and it isn't working then I might be able to help, but I'll need to know more about your game install first.
Title: Re: SWBFII Split Screen Toolkit
Post by: xMichael on May 12, 2017, 04:05:54 AM
Yeah I thought so. It was internet server.
Title: Re: SWBFII Split Screen Toolkit
Post by: MacMillan11 on May 26, 2017, 01:01:23 AM
del
Title: Re: SWBFII Split Screen Toolkit
Post by: Eagleninja32 on March 15, 2018, 02:06:47 PM
I am not sure if anyone will still post or respond to this. However I have hope. Anyways,  I have installed everything and it all runs. However the problem is getting each screen to recognize proper controllers. I can get into split screen at the main menu and jump around and get all screens into the game but then there is no way to have the screens be controlled at the same time. Additionally while in game I can't aim with my mouse but when accessing the menu I can clearly see and use my mouse cursor. So how do I get multiple controllers to work with this?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on March 15, 2018, 08:47:56 PM
Quote from: Eagleninja32 on March 15, 2018, 02:06:47 PM
I am not sure if anyone will still post or respond to this. However I have hope. Anyways,  I have installed everything and it all runs. However the problem is getting each screen to recognize proper controllers. I can get into split screen at the main menu and jump around and get all screens into the game but then there is no way to have the screens be controlled at the same time. Additionally while in game I can't aim with my mouse but when accessing the menu I can clearly see and use my mouse cursor. So how do I get multiple controllers to work with this?
If I remember correctly tool assigns controllers in a linear fashion. So Player 1 gets XInput(Xbox) Controller #1, Player 2 gets XInput Controller #2,  etc.  I can't think of much that would stop this from happening.

If you don't have XInput controllers you should be able to install and use this https://www.x360ce.com/ (https://www.x360ce.com/) to let the toolkit use DirectInput only controllers.
Title: Re: SWBFII Split Screen Toolkit
Post by: gabes on May 08, 2018, 02:31:00 PM
My exe opens and then quickly closes again like instantly after launching through the splitscreenGUI form. idk why. I'm using the steam version with the SWBFSpy version of the exe, all replaced and renamed properly. Windows 10.
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on May 10, 2018, 01:32:26 AM
Sorry to hear it isn't working for you! This toolkit seems to be very much hit-and-miss. I think I know why some people have been having trouble getting it working and I should be able to fix it, I'll see if I can find an afternoon this weekend to fix it and put out a new version.
Title: Re: SWBFII Split Screen Toolkit
Post by: michael554466 on August 28, 2018, 05:58:28 AM
How can I make it run in full screen 1920 x 1080? Is there a config file?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on August 28, 2018, 07:34:18 PM
I assume you mean how do you get rid of the black bars when playing with 2 or 3 players? The answer regrettably is you don't, the game doesn't support the aspect ratios needed to remove them.
Title: Re: SWBFII Split Screen Toolkit
Post by: bogeyblue on September 17, 2018, 02:02:42 PM
I can't press the launch button off screen or see it. As soon as I launch a game from the gui I'm brought to a windowed mode and at the main menu, as you can see in this screenshot the Launch button is nowhere to be seen. What am I doing wrong?
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on September 19, 2018, 06:56:59 PM
Probably nothing, the tool just doesn't seem to behave well on everyone's machine. I really need to make a new version of it, I just haven't had time to yet.
Title: Re: SWBFII Split Screen Toolkit
Post by: beachbum111111 on December 29, 2018, 04:58:51 PM
Hey I'm getting a problem. Whenever I try to 'play' the command prompt does this
"Failure injecting SplitInject.dll
Unknown error in injected assembler code."
Title: Re: SWBFII Split Screen Toolkit
Post by: Manalcola on January 16, 2019, 01:17:51 AM
Is this compatible with mods? Other than that...AMAZING JOB, THANKS!
Title: Re: SWBFII Split Screen Toolkit
Post by: longimanus1323 on January 18, 2019, 01:25:38 PM
It works great nice job! Is there any way to config it to use mods/maps like that from the conversion mod? For example playing on Bespin with kotor era.

Nevertheless impressive job!
Title: Re: SWBFII Split Screen Toolkit
Post by: talos91 on February 20, 2019, 01:12:10 PM
Wow this tool is amazing, I can not believe it is not more popular, it works perfectly even on the steam version with the SWBFSpy steam patch applied on Windows 10. Please dev make a comeback.

Quote from: SleepKiller on May 09, 2017, 07:48:36 PM
Are you trying to join an Internet server? If so this tool won't work because your game install only has one CD key and Internet servers require each client have a unique key.

Is there any workaround for this? like using a different cd key for the other windows? It would be incredibly awesome to play online with other 3 local buddies.
Title: Re: SWBFII Split Screen Toolkit
Post by: Moist_Seepage on March 03, 2019, 09:29:30 PM
I am having the same problem as beachbum in that it fails to inject the SplitInject.dll extension. I have tried on both Steam and GoG versions of the game. When I run it in debug mode it say "SplitInject.dll could not be found" when the file is clearly there. Anyone know why it is doing this or how I can fix it?
Title: Re: SWBFII Split Screen Toolkit
Post by: Led on March 04, 2019, 04:16:42 AM
Quote from: Moist_Seepage on March 03, 2019, 09:29:30 PM
I am having the same problem as beachbum in that it fails to inject the SplitInject.dll extension. I have tried on both Steam and GoG versions of the game. When I run it in debug mode it say "SplitInject.dll could not be found" when the file is clearly there. Anyone know why it is doing this or how I can fix it?

Steam and GoG are the same version now.  Try with the SWBFspy version (original non-Gog non-new steam exe).  Once the exe is recompiled, the locations of items get changed.

I believe this is it
https://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1437
Title: Re: SWBFII Split Screen Toolkit
Post by: Amon on March 18, 2019, 03:39:07 PM
Quote from: Led on March 04, 2019, 04:16:42 AM
Steam and GoG are the same version now.  Try with the SWBFspy version (original non-Gog non-new steam exe).  Once the exe is recompiled, the locations of items get changed.

I believe this is it
https://www.swbfgamers.com/index.php?action=downloads;sa=view;down=1437


I'm getting the same error but I use the disk.
Title: Re: SWBFII Split Screen Toolkit
Post by: inigohrey on March 27, 2019, 10:29:52 AM
For anyone getting the "Unknown error in injected assemble code" or other errors:

right click your battlefrontII.exe and go to compatibility, set it to run in 640x480.
Title: Re: SWBFII Split Screen Toolkit
Post by: gerbilguy123 on April 13, 2019, 09:40:58 AM
Whenever I launch it closes immediate. When running in Debug mode this appears. I have tried running as admin, compatibility mode, and changing the install location. Any help would be greatly appreciated. (I'm on windows 10 Build, i5-4460, and GTX750Ti, if that helps)

Playercount set to '2'
Player #1 name set to 'Player #1'
Player #2 name set to 'Player #2'
Server type set to 'Game Dedicated'
conreinforcements set to '100'
huntscorelimit set to '50'
assscorelimit set to '180'
ctfscorelimit set to '5'
autoexit set to '0'
Server commandline set to '/win /norender /nosound /autonet dedicated /resolution 320 240 /gamename SplitScreen /playerlimit 8 /playercount 1 /tps 30 /sideselect /noteamdamage /awards /heroes 1 /hrteam 3 /hrunlockvalue 10 /hrrespawn 90 /hrplayer 7 /bots 16 /difficulty 2 /lan /pregametime 0 /voicemode 2 /throttle 2048 /spawn 2 /netregion NA  yav1c_con cor1c_con dag1c_con dea1c_con fel1c_con geo1c_con kam1c_con kas2c_con mus1c_con myg1c_con nab2c_con pol1c_con tan1c_con tat2c_con tat3c_con uta1c_con'
Starting server process...
Attempting to inject SplitInject.dll into server process.
Library injected successfully.
Editing server memory...
Server started successfully.
Starting suspended game process for Player #1
Attempting to inject SplitInject.dll
Process started successfully.
Library injected successfully.
Waiting for process to resume..
Finding game window.
Setting game window as topmost.
Starting suspended game process for Player #2
Attempting to inject SplitInject.dll
Process started successfully.
Library injected successfully.
Waiting for process to resume..
Finding game window.
Setting game window as topmost.
Game process for Player #1 is no long running.
Calling TerminateProcess on server process.
Calling TerminateProcess on game process for Player #2.
Ending session.
Press enter to exit.
Title: Re: SWBFII Split Screen Toolkit
Post by: hyponerdic on April 23, 2019, 10:34:14 AM
Hello, I know you don't frequent this topic often so no worries but I'm also having trouble getting this to run. I renamed the new .exe but keep getting the same era after running the GUI that it can't find the file specified.

In addition to that, is there any way to get this working with the easy mod launcher? Not only would it be nice to play splitscreen BF2 again, I was hoping to do that with all the new maps, classes, etc. that the community has been able to make.

You mentioned possibly redoing this at some point to hopefully make it easier for more people to enjoy so if I could add one, uneducated request -- it's that it works with the Easy Mod Loader and addon files. I have no idea how that would work of course but yeah. Hopefully it's possible!
Title: Re: SWBFII Split Screen Toolkit
Post by: Melquiadez on April 29, 2019, 01:21:37 AM
Hola. Comparto tu deseo, hermano. Yo también me pasé horas probando de todo, pero la pantalla solo se queda en GUI; con los mandos de xbox 360 ya conectados, carga una pantalla de comandos y se cierra al instante.

Esperemos que se pronuncie el creador de esta fantástica herramienta.

Saludos
Title: Re: SWBFII Split Screen Toolkit
Post by: Melquiadez on April 29, 2019, 01:31:38 AM
Un vídeo configurándolo sería de gran ayuda.
Title: Re: SWBFII Split Screen Toolkit
Post by: protrispro on May 24, 2019, 11:46:27 AM
Please I have a problem with your patch...
When I start Split Screen GUI it's don't work.
I folow all the steps
can you help me please ??
Title: Re: SWBFII Split Screen Toolkit
Post by: Led on May 24, 2019, 12:22:44 PM
protrispro, you have been muted due to spamming this topic. 

When sleepkiller is available and wants to reply to your post, he will do so.

I will un-mute you in a week or so.
Title: Re: SWBFII Split Screen Toolkit
Post by: protrispro on May 24, 2019, 02:14:13 PM
My spam was a mistake I'm sorry.
If someone have a solution to my problem he is welcome  :)
Title: Re: SWBFII Split Screen Toolkit
Post by: Anyder on May 24, 2019, 03:53:24 PM
Quote from: Melquiadez on April 29, 2019, 01:21:37 AM
Hola. Comparto tu deseo, hermano. Yo también me pasé horas probando de todo, pero la pantalla solo se queda en GUI; con los mandos de xbox 360 ya conectados, carga una pantalla de comandos y se cierra al instante.

Esperemos que se pronuncie el creador de esta fantástica herramienta.

Saludos
Buenas tardes,

En primer lugar pediros que os comuniqueis en ingles. Este foro, aunque tiene usuarios de muchas partes del mundo, no suele usarse en otro idioma mas que ingles, con lo que por favor, haced el mayor uso posible en dicho idioma.

En cuanto pueda,escribiré a SK, el creador para pedirle un videotutorial si realmente es necesario, y se subiria a la cuenta de SWBFGamers.
Asegurate de que la herramienta es compatible con tu consola,eso si...

Un saludo
Title: Re: SWBFII Split Screen Toolkit
Post by: protrispro on May 25, 2019, 01:55:40 AM
I think I find a solution to my first problem but there is a new problem :
Have a look at my screenshoot
Title: Re: SWBFII Split Screen Toolkit
Post by: vg3chris on May 29, 2019, 09:40:03 PM
"Failure injecting SplitInject.dll
Unknown error in injected assembler code."

Any solution to that?
Title: Re: SWBFII Split Screen Toolkit
Post by: Melquiadez on June 02, 2019, 02:55:00 PM
Quote from: Anyder on May 24, 2019, 03:53:24 PM
Buenas tardes,

En primer lugar pediros que os comuniqueis en ingles. Este foro, aunque tiene usuarios de muchas partes del mundo, no suele usarse en otro idioma mas que ingles, con lo que por favor, haced el mayor uso posible en dicho idioma.

En cuanto pueda,escribiré a SK, el creador para pedirle un videotutorial si realmente es necesario, y se subiria a la cuenta de SWBFGamers.
Asegurate de que la herramienta es compatible con tu consola,eso si...

Un saludo
[/quote

Good afternoon. I'm sorry I do not know the language, so I'll use the Google translator to see how it works.

My laptop is an Acer AMD A9-9420 RADEON R5, 12 GB RAM, 520 video with 2GB Vram, Windows 10.

Honestly it would be more practical a video showing how to install and run the tool. Because the truth is that even if I can open 2 instances, taking into account that I use the SWBFII crack. I appreciate your time.
Title: Re: SWBFII Split Screen Toolkit
Post by: Melquiadez on June 02, 2019, 03:02:21 PM
Quote from: Anyder on May 24, 2019, 03:53:24 PM
Buenas tardes,

En primer lugar pediros que os comuniqueis en ingles. Este foro, aunque tiene usuarios de muchas partes del mundo, no suele usarse en otro idioma mas que ingles, con lo que por favor, haced el mayor uso posible en dicho idioma.

En cuanto pueda,escribiré a SK, el creador para pedirle un videotutorial si realmente es necesario, y se subiria a la cuenta de SWBFGamers.
Asegurate de que la herramienta es compatible con tu consola,eso si...

Un saludo

Good afternoon. I'm sorry I do not know the language, so I'll use the Google translator to see how it works.

My laptop is an Acer AMD A9-9420 RADEON R5, 12 GB RAM, 520 video with 2GB Vram, Windows 10.

Honestly it would be more practical a video showing how to install and run the tool. Because the truth is that even if I can open 2 instances, taking into account that I use the SWBFII crack. I appreciate your time.Good afternoon. I'm sorry I do not know the language, so I'll use the Google translator to see how it works.

My laptop is an Acer AMD A9-9420 RADEON R5, 12 GB RAM, 520 video with 2GB Vram, Windows 10.

Honestly it would be more practical a video showing how to install and run the tool. Because the truth is that even if I can open 2 instances, taking into account that I use the SWBFII crack. I appreciate your time.
Title: Re: SWBFII Split Screen Toolkit
Post by: protrispro on July 01, 2019, 02:10:46 PM
Quote from: vg3chris on May 29, 2019, 09:40:03 PM
"Failure injecting SplitInject.dll
Unknown error in injected assembler code."

Any solution to that?

Yes I have the same problem I sended a screenshoot.
Nobody have a solution please ??? :'(
Title: Re: SWBFII Split Screen Toolkit
Post by: Peppercorn on July 13, 2019, 03:13:28 PM
Quote from: vg3chris on May 29, 2019, 09:40:03 PM
"Failure injecting SplitInject.dll
Unknown error in injected assembler code."

Any solution to that?

I have the same problem. Not sure what to do.
Title: Re: SWBFII Split Screen Toolkit
Post by: Civilizedbug on July 21, 2019, 08:19:50 AM
Could you make a youtube vid where you show the steps needed, it just crashes when i try?
Title: Re: SWBFII Split Screen Toolkit
Post by: sk8rdie1209 on August 18, 2019, 06:54:54 PM
i got it all working and everything but i cant start the game when i add the maps and press play it starts up the game then from there wont let me continue cause there is no start button its cut out of the screen please HELP :'( :'( :'(
Title: Re: SWBFII Split Screen Toolkit
Post by: Ninjabagel01 on October 25, 2019, 11:08:18 AM
Quote from: vg3chris on May 29, 2019, 09:40:03 PM
"Failure injecting SplitInject.dll
Unknown error in injected assembler code."

Any solution to that?
I know this thread hasn't been posted on in a while but seems like there are a handful of us having this same issue more recently so maybe it's something new on steam or windows that wasn't an issue when this tool was first made. as far as I can tell I've done everything correctly (I have the steam version so I got swbfspy) and if I press play with the game dedicated option it gives this error both in regular and debug mode
Playercount set to '2'
Player #1 name set to 'Player #1'
Player #2 name set to 'Player #2'
Server type set to 'Game Dedicated'
conreinforcements set to '100'
huntscorelimit set to '50'
assscorelimit set to '180'
ctfscorelimit set to '5'
autoexit set to '0'
Server commandline set to '/win /norender /nosound /autonet dedicated /resolution 320 240 /gamename SplitScreen /playerlimit 8 /playercount 1 /tps 30 /sideselect /noteamdamage /awards /heroes 1 /hrteam 3 /hrunlockvalue 10 /hrrespawn 90 /hrplayer 7 /bots 16 /difficulty 2 /lan /pregametime 0 /voicemode 2 /throttle 2048 /spawn 2 /netregion NA  tat2c_con'
Starting server process...
Attempting to inject SplitInject.dll into server process.
Failure injecting SplitInject.dll
Unknown error in injected assembler code.

if I press play with the "none" option it launches swbf screen splitter ++ and just freezes on a black screen as unresponsive and I need to force quit.

I figure this might not get any response but if anyone does know a solution and can help it would be greatly appreciated, i'd love to be able to play battlefront 2 with my roomates without us all needing to buy something to play it on.
Title: Re: SWBFII Split Screen Toolkit
Post by: SleepKiller on October 26, 2019, 04:46:44 AM
Hey, so this just outright doesn't work with the Steam or GoG version of the game as many people have encountered.

I've been meaning to do this for a while but I have began investigating ways to rewrite the tool to be more broadly compatible across all the game's versions. I also want to add easy support for mod maps (going to be tricky this one but I want it there).

I don't have any guarantees because I might get busy and I also have several hobby projects I'm juggling. But I am looking into it and I do hope to maybe have something substantial in the next two weeks. Might end up with nothing but if it goes anywhere I'll update this topic.
Title: Re: SWBFII Split Screen Toolkit
Post by: talos91 on October 29, 2019, 01:53:35 AM
New Splitscreen Mod:
https://www.reddit.com/r/localmultiplayergames/comments/domi4s/star_wars_battlefront_ii_classic_2005_6_players/
Title: Re: SWBFII Split Screen Toolkit
Post by: SlametSobari on November 27, 2019, 04:37:03 AM
Non-Steam Version of SWBFII, the Steam version will not work unless you replace BattlefrontII.exe with the SWBFSpy version of the client.

Where I can Get SWBFSpy version? any one please give me link..
Title: Re: SWBFII Split Screen Toolkit
Post by: Led on November 27, 2019, 05:10:48 AM
Quote from: SlametSobari on November 27, 2019, 04:37:03 AM
Non-Steam Version of SWBFII, the Steam version will not work unless you replace BattlefrontII.exe with the SWBFSpy version of the client.

Where I can Get SWBFSpy version? any one please give me link..

https://www.swbfgamers.com/

look right on the front page


New Internet Multiplayer Patches Released:
See this link for details for SWBF and SWBF2


be sure to get SWBF2 patch and not SWBF1 patch
Title: Re: SWBFII Split Screen Toolkit
Post by: thankssleep on November 29, 2020, 05:08:10 AM
Sleepkiller,thank you so much man,with this tools i finally can play with my brother on the same machine just like old days,this mod is compatible with the first battlefront 1 map mod so we probably dont need the game and i dont know if this will help anyone but you can actually play one kb+m and one controller,just go in the game and shift+tab (or alt+tab,must be one of them) and then go into key bidding option,just clear any thing with mouse related on the second screen and rebind it with the controller,and then switch back to the first tab,and clear controller related biding and insert with key board keys,the important thing is the ainimg key,if you fogrot to rebind it,the second player will just auto aim up in game....anyway you must do it in the main menu,as in game i dont know how to tab out without the score screen showing up,and you had to redo the biding everytime you time you play,but none of this is possible without the co admin of this site,thanks for everything sleepkiller.
Title: Re: SWBFII Split Screen Toolkit
Post by: Geogre99 on May 01, 2021, 06:55:31 PM
Hi I know its been a while since anyone posted here but I am trying to use this program with a friend but the when I boot up the game I cannot click the button to create a multiplayer game. I have attached a image of the my screen when I have been trying to create a game. The create button is suppose to be underneath the add maps button.
Title: Re: SWBFII Split Screen Toolkit
Post by: AnthonyBF2 on May 01, 2021, 10:23:56 PM
Try installing the v1.5 r2 patch, this includes some sort of resolution fix for obscured buttons
Title: Re: SWBFII Split Screen Toolkit
Post by: Thereadone1 on July 17, 2021, 03:39:45 PM
Playercount set to '2'
Player #1 name set to 'Thereadone1'
Player #2 name set to 'Magige'
Server type set to 'Game Dedicated'
conreinforcements set to '100'
huntscorelimit set to '50'
assscorelimit set to '180'
ctfscorelimit set to '5'
Server commandline set to '/win /norender /nosound /autonet dedicated /resolution 320 240 /gamename SplitScreen /playerlimit 8 /playercount 1 /tps 30 /sideselect /awards /heroes 1 /hrteam 3 /hrunlockvalue 10 /hrrespawn 90 /hrplayer 7 /bots 16 /difficulty 2 /lan /pregametime 0 /voicemode 2 /throttle 2048 /spawn 2 /netregion NA  cor1c_con cor1g_con pol1g_con'
Starting server process...
Attempting to inject SplitInject.dll into server process.
Failure injecting SplitInject.dll
Unknown error in injected assembler code.

I'm getting this same message, and I have the original disc version. Any ideas on why that might be?
Title: Re: SWBFII Split Screen Toolkit
Post by: roachusmaximus on April 16, 2022, 12:16:43 PM
Quote from: Thereadone1 on July 17, 2021, 03:39:45 PMPlayercount set to '2'
Player #1 name set to 'Thereadone1'
Player #2 name set to 'Magige'
Server type set to 'Game Dedicated'
conreinforcements set to '100'
huntscorelimit set to '50'
assscorelimit set to '180'
ctfscorelimit set to '5'
Server commandline set to '/win /norender /nosound /autonet dedicated /resolution 320 240 /gamename SplitScreen /playerlimit 8 /playercount 1 /tps 30 /sideselect /awards /heroes 1 /hrteam 3 /hrunlockvalue 10 /hrrespawn 90 /hrplayer 7 /bots 16 /difficulty 2 /lan /pregametime 0 /voicemode 2 /throttle 2048 /spawn 2 /netregion NA  cor1c_con cor1g_con pol1g_con'
Starting server process...
Attempting to inject SplitInject.dll into server process.
Failure injecting SplitInject.dll
Unknown error in injected assembler code.

I'm getting this same message, and I have the original disc version. Any ideas on why that might be?

We keep getting this error because the name of the game's window was updated to "Star Wars Battlefront 2 (Classic, 2005) when the newer one came to Steam. This program only searches for a window named "Star Wars Battlefront 2", but it can't find it. So... yeah. I'm not good at coding so I can't fix it so if anyone can inform of this to the mod author it'd be appreciated.
Title: Re: SWBFII Split Screen Toolkit
Post by: AnthonyBF2 on April 16, 2022, 09:31:31 PM
I just tested BF2 on Steam and the window name is "Star Wars Battlefront II"
Title: Re: SWBFII Split Screen Toolkit
Post by: Bazubazu on October 17, 2022, 08:22:27 PM
Hi all! I saw this mod and was interested in making it work in order to play galactic conquest during LAN parties with my buddies.

I seemed to have succesfully installed other mods, but when I get to this mod in particular I run into an issue.

The message that appears is as follows:

Failure injecting SplitInject.dll
Unknown error in injected assembler code.

EhPortal 1.34 © 2024, WebDev