Quick modding question

Discuss and distribute tools and methods for modding. Moderator - Grognak
Sehnsucht
Posts: 2
Joined: Thu Sep 20, 2012 7:07 am

Quick modding question

Postby Sehnsucht » Thu Sep 20, 2012 7:16 am

Does anyone tried to create a new race ?

I don't seem able to find any info on those "special perks" each race has (except for the descriptive text seen in game located in blueprints.xml)
I fear they are harcoded, but maybe somebody else has tried and succeed (someone with better eyes than me :lol: )

Greetings!
English isn't my native language.
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: Quick modding question

Postby swixel » Thu Sep 20, 2012 7:26 am

Sehnsucht wrote:I fear they are harcoded, but maybe somebody else has tried and succeed (someone with better eyes than me :lol: )


They are. There's a wonderful function in the binary which uses "lea" (load effective address) and then performs std::string comparisons ... you'll need the HumbleStore Win32 binary for this next bit to make sense, but here you go (comments are mine):

Code: Select all

FF 85 10 F7 FF FF
83 85 0C F7 FF FF 04
83 BD 10 F7 FF FF 10
0F 85 28 FD FF FF
C7 85 BC F6 FF FF 04 00 00 00
8D 85 63 FF FF FF
89 44 24 08
C7 44 24 04 D2 96 6A 00 ; "human"
8D 85 20 F8 FF FF
89 04 24
C7 85 18 F7 FF FF 3A 00 00 00
E8 A3 61 0E 00
C7 85 BC F6 FF FF 03 00 00 00
8D 85 64 FF FF FF
89 44 24 08
C7 44 24 04 88 99 6A 00 ; engi
8D 85 24 F8 FF FF
89 04 24
C7 85 18 F7 FF FF 39 00 00 00
E8 6F 61 0E 00


We could easily sigscan that out because of the strings (we could easily find it again from a disasm run), but that's one of many points it's done in...
Sehnsucht
Posts: 2
Joined: Thu Sep 20, 2012 7:07 am

Re: Quick modding question

Postby Sehnsucht » Thu Sep 20, 2012 7:35 am

Thx for the quick reply, even if it's bad news :(

I was pretty sure of the answer anyway.

So I have to give up (or at least delay) my ideas of "elite crew members (replace crew member with same race but better perks on level up)" and new races.
English isn't my native language.
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: Quick modding question

Postby swixel » Thu Sep 20, 2012 7:58 am

No problem. I'm not saying it's impossible ... hell, it's even on my wishlist for the devs to fix some of this. I'd even be happy to help with suggestions on how to load/unload things. The easiest way is to take the perks as modifiers of %, dump them into an XML file, then load it from a master race list. Same with ships. Then we'd be cooking.

I'd also query why it's XML and not Lua (the library is lighter and cross platform and just plain *nice* in comparison), but that's more or less off topic at this point.

I'd start poking around more for you, but given cross platform versions + GOG + Steam stuff messing with binaries, the work is just over the top for now (unless the devs want to start not stripping symbols? :P)
AtillaBosma
Posts: 56
Joined: Tue Sep 18, 2012 3:51 pm

Re: Quick modding question

Postby AtillaBosma » Thu Sep 20, 2012 9:10 am

Hmm, there are some entries in the Blueprint.xml file that show you information about thedifferent races, but there is no way to actually give them specific powers due to that not being named in the Blueprint.xml file.

Maybe it takes the powers from someone else, but I don't know where they get their attributes from.
swixel
Posts: 80
Joined: Mon Sep 17, 2012 6:08 am

Re: Quick modding question

Postby swixel » Thu Sep 20, 2012 9:20 am

AtillaBosma wrote:Hmm, there are some entries in the Blueprint.xml file that show you information about thedifferent races, but there is no way to actually give them specific powers due to that not being named in the Blueprint.xml file.

Maybe it takes the powers from someone else, but I don't know where they get their attributes from.


There are seven nearly identical virtual table references in the binaries which are clearly damage. The mantis (for instance) is 1.5 (can be clarified by another vtable lookup which relates to repair speed). Engi is also easy to work out, rock and crystal are easy too (health mods); as is energy (Zoltan). Human and Slug are the last ones ...

There's also a check for special powers (e.g. lockdown). Also virtualtabled.

Again: there are string comparisons in the binary which appear to handle this.