cedricvdg wrote: ↑Mon Aug 13, 2018 8:50 am
mop, post: 55050, member: 6967 wrote:Nice!!!
Was wondering how you found the the values for Summon Freighter Battle (searching for 1/0's for systems with battles), Always S Class/spawning ship stuff, and Glyphs. Basically how you went about searching for them?
Glad you're enjoying the features.
For the Summon Freighter Battle I thought it wasn't random, but instead was on a Timer or based on the number of warps (both ended up being true). So I started by checking for access on the total warps address and this got checked every warp and I could just overwrite that check to always resolve to true.
The Glyphs I found by debugging at a portal and known glyphs page, it ended up working just like inventory slots (binary flags).
Both of these variables are part of PlayerStateData, which is part of the save data in memory. I could expose the Freighter Battle Timer/Warps variables in the Player Pointer script, but I decided that was not really useful.
The ship spawning features are a little bit more complex. After researching the code I figured out there's an internal scripting engine being used based on XML. The scripting engine provides all the universe global settings and behaviours. I decompiled the scripts and found the references to the spawn handling data. Here are some excerpts:
Code: Select all
<Property value="GcAISpaceshipWeightingData.xml">
<Property name="CivilianClassWeightings">
<Property name="Freighter" value="0" />
<Property name="Dropship" value="100" />
<Property name="Fighter" value="50" />
<Property name="Scientific" value="50" />
<Property name="Shuttle" value="100" />
<Property name="PlayerFreighter" value="0" />
<Property name="Royal" value="1" />
</Property>
</Property>
Code: Select all
<Property name="ClassProbabilityData">
<Property name="Wealthy" value="GcInventoryClassProbabilities.xml">
<Property name="ClassProbabilities">
<Property name="C" value="30" />
<Property name="B" value="40" />
<Property name="A" value="28" />
<Property name="S" value="2" />
</Property>
</Property>
</Property>
Knowing that these XML files have to reside in (non-writable) memory when the game is running I started doing 'group-scans' for them.
e.g. f:100 f:50 f:50 f:100 f:0 f:1 for the weighting data.
This got me the global data base pointer and the ability to check the S-class checks.
Hopefully this somewhat explains it, otherwise don't hesitate to ask more
p.s. access to the global variables means we could theoretically change the entire universe behaviour