Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - SleepKiller

Pages: [1] 2 3 ... 123
Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: May 09, 2017, 08:48:36 PM »
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.

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: April 03, 2017, 08: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 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 and change it there, or the simplest one would be hook FindWindow 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, WM_ACTIVATE and WM_ACTIVATEAPP. It's been a while but looking at my source code now all I am doing is installing my own [url=]WindowProc 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 to the sound buffer created 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. 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 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 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 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, 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.

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: March 16, 2017, 08: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.

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.

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.)

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: November 21, 2016, 09:42:41 PM »

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.)

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: November 20, 2016, 07: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 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.
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!

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: October 27, 2016, 08:02:38 AM »
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.

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: October 25, 2016, 04:08:51 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.

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: October 24, 2016, 07:25:07 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. (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.)

Star Wars Battlefront II / Re: SWBFII Split Screen Toolkit
« on: October 24, 2016, 05: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.

Star Wars Battlefront II / SWBFII Split Screen Toolkit
« on: October 24, 2016, 12:22:37 AM »
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 (click to show/hide)

   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.

   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

   And the GUI requires .NET Framework 4.6.1 which you can get here.

   Optionally you can also install the SWBFII dedicated server software and use that for lower loading times.

   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.

   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 (click to show/hide)

Change Log
Spoiler (click to show/hide)

Download it here! (Current Version 1.0.4)

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.

*All opinions are my own.

That is not our problem. It is this community who got the new masterserver working, and we want the files to be kept here. Please, change the download link or I'll report your guide.
Steady on now, you can hardly claim copyright over the patched executables. Making and distributing them is very much a legal grey area in of itself. Is there really the need to get hostile about this? He put attribution and a link to the site at the start of his guide and furthermore gave credit to everyone at the end of it. Hope you guys don't mind me making this :D
Thanks for taking the time to write this. There is value to having it there on Steam and it may help people who want to play online but don't follow any community find the way.

Tech Support / Re: External Graphics Card (or Similar)?
« on: May 25, 2016, 09:28:11 PM »
Your laptop needs to support Thunderbolt 3 in order to hook up one of the external enclosures recently announced/made. Other methods out there to my knowledge typically choke the card for bandwidth.

General / Re: My Computer Setup
« on: May 23, 2016, 09:51:04 PM »
I like the old PCs under the desk the most.

Tech Support / Re: Is javascript what I need?
« on: April 14, 2016, 10:13:34 PM »
Given how such amazing classics like Cookie Clicker are written in Javascript I would imagine it would be more than passable for your use case. Though I'm no web developer so some of the more Web-savy folk around here may have a more valid opinion.

Most laptops just can't compare even to entry level gaming GPU's.  Even if you spend big bucks for a gaming laptop, the power you can put into a laptop GPU is limited, and the GPU is going to become outdated eventually, and you can't just put in a new GPU.
Well, you'd be surprised actually Although you do have the point about how it will become outdated in a few years.

Pages: [1] 2 3 ... 123