FTL Ship Selector (removes player ship limits)

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
TaxiService
Posts: 204
Joined: Mon Dec 23, 2013 6:04 pm
Location: 4154313 1227347
Contact:

Re: FTL Ship Selector (removes player ship limits)

Postby TaxiService » Tue Sep 01, 2015 9:32 am

Thanks y'all!

As R4V3-0N said, player ships are hard coded, which is why this was a total pain in the butt to make.

@R4V3-0N
Possibly, I'm only mildly familiar with regular FTL modding, and I haven't reverse engineered any of the code that deals with that stuff.

My main focus right now is trying to add multiplayer. If someone who knows a lot about modding wants to help me out, that would be awesome. Preferably, someone who's worked on mod tools and actually understands FTL's underlying resource formats (.DAT files, all the XML files, etc).

@Sleeper Service
I'm well aware of those rules, which is why it's distributed as a 300 byte patch file. I'm not distributing a copy of the FTL exe in any form.
As TaxiService said, it's just a patch file, which is used to modify a user's existing FTL exe.

I didn't actually decompile the game.
I've spent the last month or two reverse engineering FTL for the purpose of writing a multiplayer mod. This mostly consisted of running the game in various debuggers, and trawling through a stupid amount of x86 assembler code.
So, I wrote a DLL in C/C++ (with bits of inline assembler where needed) that's injected into the game. The DLL modifies the game's compiled code at runtime.
I'm drawing on the screen by intercepting calls from the game to OpenGL (more specifically, the call that's made when FTL is done drawing the current frame).
I disabled the buttons by disabling bits of code in memory.
The "previous" and "next" buttons work by intercepting mouse clicks and modifying the code that selects a random ship.

The patch file just makes FTL load my DLL so users don't need to use any dodgy injectors.

I seriously think you are a hero. :P Do you know if your code could be adapted to be used by unix-based operative systems as well?
ImageImageImageImageImage
BFrizzleFoShizzle
Posts: 16
Joined: Sun Jul 19, 2015 3:43 am
Location: New Zealand

Re: FTL Ship Selector (removes player ship limits)

Postby BFrizzleFoShizzle » Tue Sep 01, 2015 9:40 am

TaxiService wrote:Do you know if your code could be adapted to be used by unix-based operative systems as well?

It's possible, but I'd have to completely re-write it. Debugging tools in Linux (and probably Mac) are nowhere near as advanced as windows ones, and the programming environment for doing the kind of low-level stuff that's required for this mod is completely different.
User avatar
5thHorseman
Posts: 1669
Joined: Sat Mar 02, 2013 2:29 am
Location: On the bridge of The Potential
Contact:

Re: FTL Ship Selector (removes player ship limits)

Postby 5thHorseman » Tue Sep 01, 2015 10:09 am

First off, this is really cool. Secondly, as a modded ship builder I'm wondering how much this will affect me? Should I update my ships to not overwrite player ships? If I do so, will those who don't use this mod be able to play my ships?

At a quick blush, it appears that I should not modify my ships because they'll work with both regular FTL and with this mod. If I modify them, they'll only work with one of those two. So, is this mod relegated to being good only for large packs, like if CE wants to give the player even more choices?

Although, a huge mod with hundreds of ships sounds kinda cool :D
My Videos - MY MOD HUB
Simo-V - The Potential - Automated Scout - "Low O2" Icons
The Black Opal - The Asteroid - The Enforcer - The Pyro

"Every silver lining has a cloud..."
BFrizzleFoShizzle
Posts: 16
Joined: Sun Jul 19, 2015 3:43 am
Location: New Zealand

Re: FTL Ship Selector (removes player ship limits)

Postby BFrizzleFoShizzle » Tue Sep 01, 2015 10:34 am

5thHorseman wrote:as a modded ship builder I'm wondering how much this will affect me? Should I update my ships to not overwrite player ships? If I do so, will those who don't use this mod be able to play my ships?


It's only worth using this if you have an actual need for adding ships without replacing existing ones.
By using this in your mod, it would effectively mean only Windows Steam users with this mod could use it.
It may be worth considering releasing two versions of your mods, as modifying a ship replacing mod to use FTLSS shouldn't be too difficult in most cases, as it should only require changing your ships name/id.
User avatar
Chrono Vortex
Posts: 266
Joined: Thu Jun 25, 2015 8:51 pm

Re: FTL Ship Selector (removes player ship limits)

Postby Chrono Vortex » Tue Sep 01, 2015 4:12 pm

BFrizzleFoShizzle wrote:My main focus right now is trying to add multiplayer.

How would that work? I mean, how would you structure the interactions between multiple players? It seems like it would require the removal of the pause button for starters, and then you would have to come up with a way for one ship to jump into a beacon while another ship is already there. I suppose jumping could be turned into something turn-based, where nobody jumps to the next beacon until everybody has chosen which beacon to jump to. This is all assuming multiplier entails multiple people having their own ships, is that what you intend to do? And if not, what are you planing to do?
Image
BFrizzleFoShizzle
Posts: 16
Joined: Sun Jul 19, 2015 3:43 am
Location: New Zealand

Re: FTL Ship Selector (removes player ship limits)

Postby BFrizzleFoShizzle » Tue Sep 01, 2015 9:20 pm

Chrono Vortex wrote:How would that work? I mean, how would you structure the interactions between multiple players? It seems like it would require the removal of the pause button for starters, and then you would have to come up with a way for one ship to jump into a beacon while another ship is already there. I suppose jumping could be turned into something turn-based, where nobody jumps to the next beacon until everybody has chosen which beacon to jump to. This is all assuming multiplier entails multiple people having their own ships, is that what you intend to do? And if not, what are you planing to do?

I'm almost certainly going to disable the pause button. I saw someone mention an interesting idea in another thread: making the game pause for a constant time every X seconds. That might work if no pausing is too chaotic, while also being relatively simple to implement, and maintaining balance.
I haven't 100% decided how encounters will work. I was originally thinking that when jumping to a new location, if another player also jumped to that location within a certain amount of time, an encounter would happen. In order for that to work well, there would likely need to be many players on the server. My second idea is just making encounters happen when someone jumps to the location you are currently at, but that would be harder to implement.
The mod will definitely be multiple people with their own ships. I'm also thinking of having a factions system, so you could trade with allies. Battles will only be 1v1. From what I can tell, it would be stupidly difficult to get the FTL engine to do more than that.

*edit* also, for those that are interested, I've added a link to the source in my original post.
User avatar
R4V3-0N
Posts: 1289
Joined: Sun Oct 06, 2013 11:44 am
Location: Last Federation Fleet
Contact:

Re: FTL Ship Selector (removes player ship limits)

Postby R4V3-0N » Wed Sep 02, 2015 2:01 am

Some other ideas - maybe slow down the game a little bit? rather it be overall or increase ship load times and weapon firing times (weapon stuff is easy- shields not so much)
also you got UI problems to fix- for instance I do not think that some player ships will fit nicely in the enemy screen UI box thing.

Another thing to think about - maybe make no sensors shows you nothing in terms of where enemy systems are, level 1 sensors may give you all the system locations or maybe just a few ones like piloting, and then level 2 is everything, level 3 is see inside, and then rest goes on as normal.


Btw you are a saint. There is a few people who is trying to rewrite most of the game to be mod friendly but you instead put it in a bite size piece as a patch- I really wish this hapepned with other people so that we can have ion beams and all sorts of cool stuff.
R4V3-0N, a dreamer.
User avatar
Shrooblord
Posts: 32
Joined: Wed Jan 09, 2013 7:02 pm

Re: FTL Ship Selector (removes player ship limits)

Postby Shrooblord » Fri Sep 04, 2015 10:32 am

Wow, incredible! Too bad I'm a Mac user - but from what I can tell from your descriptions, fantastic work!
Good luck with your multiplayer project. Hope it works out.
User avatar
mr_easy_money
Posts: 619
Joined: Fri May 29, 2015 9:05 pm
Location: A galaxy far, far away

Re: FTL Ship Selector (removes player ship limits)

Postby mr_easy_money » Thu Sep 29, 2016 1:48 am

when I try to run FTLGame.exe after using install.bat which then prompts me to allow bspatch.exe, the game crashes on me. here is the crashlog (if it means anything):

Code: Select all

Version =  1.5.13

Stack Trace:

1 - 0x65261e46 ayyLmao
2 - 0x65261fba ayyLmao
3 - 0x0062cabe
4 - 0x0065da28
5 - 0x00751b5b
6 - 0x004010fd
7 - 0x77bf0609 RtlSubscribeWnfStateChangeNotification
8 - 0x77bf05d4 RtlSubscribeWnfStateChangeNotification

As you can see, the version of the game is correct. Furthermore, I am using the Steam version of the game, I've tried launching through Steam, double clicking on the desktop shortcut, and going to the folder in steamapps to no avail.

I've tried redownloading the ".rar" file to make sure it wasn't a corrupt download and I've tried uninstalling and reinstalling to no avail either.
User avatar
Auron1
Posts: 224
Joined: Thu Sep 01, 2016 7:34 pm

Re: FTL Ship Selector (removes player ship limits)

Postby Auron1 » Thu Sep 29, 2016 9:34 am

BFrizzleFoShizzle wrote:I'm almost certainly going to disable the pause button. I saw someone mention an interesting idea in another thread: making the game pause for a constant time every X seconds. ...


Whenever you, random player, reach a new waypoint, there is a 10 sec. pause period: if during that period another player jumps right there → you have a PvP encounter.
That's what I'do... :roll:
Has anyone ever considered a Warhammer 40,000 Mod for this game? It would be awesome!

Who is online

Users browsing this forum: No registered users and 20 guests