Page 1 of 1

Undocumented skills and behaviours

Posted: Fri Nov 09, 2012 8:57 pm
by shark
Hi,

I'm sure you all noticed that there is alot of commented out stuff in blueprints.xml that, when uncommented or built-upon still produce functional, desirable behaviour.

One such behaviour is raising the Teleporter max level from 3 to 5, result of which will be that lvl5 string upgrade will actually say "cloak 25 seconds" but will reduce time properly.

Raising cloaking or artillery requires new image assets to be made but works as expected; cloaking will never display timer properly after level 4 (but will work as described in the upgrade screen) up until level 8; i made icon sets from _4 to _8 containing same sprites to avoid UI confusion and inconsistencies and they're still sometimes buggy (using a lvl1 button on a lvl3 'base')

Raising artillery with a broken string may seem inconsistent with other upgrades but is visually and effectively consistent once upgraded.

Raising "weapons" or "drones" maxLevel to 10 produces desirable expected behaviour. Making a 10-level upgrade table was useless since i couldn't find the actual text fields' sizes and adjust them accordingly (and add extra two)

Raising "engines" to level 10 produces undesirable behaviour and reduces dodge to 0 on level 9.

etc...

I'm wondering about the commented passives, namely the ones that transport your crew if you destroy the ship; what would happen if I uncommented those? Where would I look for their assets?

Please shed some light on this or discuss potential research leads :)
//curious modder

Re: Undocumented skills and behaviours

Posted: Mon Nov 12, 2012 4:08 pm
by shark
So, I PM'd Justin a few questions, because he seemed like the right man to ask (his name is all over TODOs in the files)

Here's a formatted version:

Question (shark):
1. I saw alot of commented abilities in the files. Uncommenting them does nothing. Are their hooks hardcoded?
1.1. If yes, are there plans to externalize the augmentation token system?
1.2. How does for example ROCK_ARMOR "know" to give "20% hull resistance" ? Or SCRAP_ARM to give +10% scrap?

Answer (Justin):
1. I'm not sure what you mean commented abilities, but all of the effects of weapons, augmentations, drones, traits of aliens, etc are hard coded. The only thing that you can manipulate is the amount of the trait. i.e. you can make the scrap arm give you a higher % of bonus scrap, for example.
1.1 We don't have plans to make the game more moddable, no.
1.2 Hardcoded except the quantity of % which is the <value> amount.

Question (shark):
2. Building up on some skills yields expected results; expanding shields/weapons/drones to level 10 results in correct behaviour; however the UI won't advance past level 8.
2.1. I could not find how to set tooltils for levels 9 and 10, or adjust the size of the textfield/label used to display them; I did however find the level_grid file which i adjusted for 10 levels accordingly but that just looks weird. Can you tell me how to change the tooltip size so that I can fit 10 of them?
2.2 How do these skills know what to do?

Answer (Justin):
2. The UI wasn't designed for >8, no way that'll work.
2.1 It's not designed to go past 8. I'm surprised it doesnt just crash on you.
2.2 I have no idea. Probably does nothing since they're hardcoded.

Question (shark):
3. More of a buildup on the last one, extending engines to level 10 starts giving 0 dodge on level9 and 10. Why doesn't it know how to advance properly?
3.1. Artillery uses "Cloaking 25 seconds" for it's level5 tooltip, however it works properly once supplied with a right asset; button_artillery_5.png and even it's timer works right. How to change this tooltip?

Answer (Justin):
3. Because the amounts are hardcoded and nothing was included for >8
3.1 A lot of tooltips are hardcoded (sensing a trend? :/ )

Question (shark):
4. Extending cloaking to level 8 provides the most satisfying UI experience; the tooltips are displayed correctly, the skill advances properly and works as expected once provided with proper assets - button_cloakingX_*.png; but there is a catch - even when I use the same sprites as for button4 - which displays it's timer properly - after level4 the timer isn't displayed at all. Is this a bug or there's something I missed to do? Or should I just be glad that it works at all? :D

Answer (Justin):
4. Frankly I'm surprised it works at all.

Question (shark):
5. How does one make a crewmember? I tried supplying proper people/* assets along with a <crewBlueprint/> but that didn't do anything; i still got humans instead of my new classes. Can I make custom crewmembers?
5.1 What all must I do to make a crewmember?
5.2 If hardcoded, are there plans to externalize the crew token parser to a XML file? :)
5.3. Crewmember abilities .... ?
5.4. Setting crewmember initial skills ... ?
5.5. "ghost" - is this an internal unit or can I mess with it ?

Answer (Justin):
5. All data regarding people are hardcoded, like everything else. Making these factors accessible would require a large rewrite to the whole game (and is therefore extremely unlikely)
5.5 Ghosts are just another 'alien'. They have 50% hp and move through doors I think.

Question (shark):
6. Which unit does BOARDING drone use? I'm talking about the robot guy.
6.1. How do I change that unit?
6.2. How do I change which unit my custom boarding drone uses? In case I want faster or stronger robots.

Answer (Justin):
6. Not sure what you mean "use", it's the same as a battle drone it just gets shot onto the enemy ship. I don't think you can change the stats at all.


Summary:
- we learned thru experiments that we can induce desirable, but undefined behaviour in the program. This makes me wonder about the safety of pushing skills after level 8; moreover it could be exploited as an attack vector against the game. but that's kinda off the point.

- we can mod augmentations!!! Augmentations MKI, MK II and MK III incoming :)

- there is no point insisting on UI consistency as it's not designed to be changed at all. Focus should be shifted to maximizing the utility of what we can change, which ain't alot UI-wise.

- no robot crewmembers, no different boarding drones, no crew training and no new crew, period.

Re: Undocumented skills and behaviours

Posted: Tue Nov 13, 2012 4:38 pm
by alextfish
Thanks for posting this.

I'm not very surprised to hear that all that is hard-coded. I am somewhat surprised though that they don't plan to release a version with it more customisable.

It would do amazing things for the game. The more moddable FTL is, the more of a community will keep playing more variations on it, and the longer it'll remain popular, and the greater the chance of some mod going particularly viral and attracting hundreds more players.

Re: Undocumented skills and behaviours

Posted: Tue Nov 13, 2012 6:31 pm
by shark
What it means is that, eventually, we'll have to go lower with our mods. Patching the executable binary and such. Not on a HOMM3:WoG kinda scale, but enough to push a few things thru.

Re: Undocumented skills and behaviours

Posted: Tue Nov 13, 2012 6:59 pm
by Vhati
Here's how drones work in saved games:

On the source ship, there's a drone system that tracks the armed state, power usage, and all the stats of local repair and anti-personnel drone bodies (they can't get XP by the way). The stats of boarding drone bodies are not present, because they're not on that ship.

On the attacked ship, boarding drones are actually crew with a boolean flag that, when set, also sets their playerControlled flag to false* and changes their race to 'battle'. And since it's technically crew, if a boarding drone racks up lots of kills on a single ship, it can gain XP, but afterward it'll all be lost when the drone body disappears.

If you edit the saved game to set that flag on your own crew member, it'll turn into a hostile robot. Merely setting race to 'battle' doesn't work and you get a human instead.


* Edit: playerControlled gets set to be the opposite of whichever ship the drone appears in. Player-launched drones can't be saved normally because they don't survive after combat. But dronifying someone on an enemy ship to yields a playerControlled boarder.
** And by playerControlled, I mean owned. You can't give direct orders to drones.

Re: Undocumented skills and behaviours

Posted: Fri Nov 16, 2012 7:11 pm
by ThomasRK
However such hardcoded limitations simply do not make sense as they only selectively apply.
Question (shark):
2. Building up on some skills yields expected results; expanding shields/weapons/drones to level 10 results in correct behaviour; however the UI won't advance past level 8.
2.1. I could not find how to set tooltils for levels 9 and 10, or adjust the size of the textfield/label used to display them; I did however find the level_grid file which i adjusted for 10 levels accordingly but that just looks weird. Can you tell me how to change the tooltip size so that I can fit 10 of them?
2.2 How do these skills know what to do?

Answer (Justin):
2. The UI wasn't designed for >8, no way that'll work.
2.1 It's not designed to go past 8. I'm surprised it doesnt just crash on you.
2.2 I have no idea. Probably does nothing since they're hardcoded.

Question (shark):
3. More of a buildup on the last one, extending engines to level 10 starts giving 0 dodge on level9 and 10. Why doesn't it know how to advance properly?
3.1. Artillery uses "Cloaking 25 seconds" for it's level5 tooltip, however it works properly once supplied with a right asset; button_artillery_5.png and even it's timer works right. How to change this tooltip?

Answer (Justin):
3. Because the amounts are hardcoded and nothing was included for >8
3.1 A lot of tooltips are hardcoded (sensing a trend? :/ )

For the sake of testing and amusement I have decided to push FTL beyond its breaking point set by Justin (power > 8 ) by testing what others have found/discovered. The following was the result of memory editing via Cheat Engine 6.2. The below should come as no surprise to anyone as such values are stored as 4 bytes (32-bits / DWORD).

Oxygen level 10 works.

The oxygen system is one of the first aspects of the game that I observed to go past the 8 > limit. Examples such as this drew my suspicion. Why is it that almost everything else is hard coded but this is not? This applies to the medbay too! It would seem that the developers intentionally either left some aspects not hardcoded or intentionally hardcoded most aspects. Why?

Level 30 Oxygen, BRB oxygenating space!


Medbay up to 10 works

Here is a fun fact not shown in this video, it is actually possible to have your medbay upgraded so far that you don’t need oxygen. OPEN ALL THE DOORS! The rate of health loss due to suffocation is less than the rate of health gain. Add Engi Med-bot Dispersal and then you can have an entire ship crew of perpetual:

Image

And the best part is that the crew can still operate the ship’s systems.

Graphical glitches occur when artillery is given more than 4 bars of power but it works.


Artillery gone wild.avi
Give artillery 8 or more power bars and it won’t stop firing due to the countdown timer having either 0 or a negative value. *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM* *BEEEM**BEEEM* *BEEEM* *BEEEM*


Engines past 8 = 5% chance to dodge
Sadly giving the engines past 8 power bars only reduces your ship’s chances to dodge 5%.

Re: Undocumented skills and behaviours

Posted: Fri Nov 16, 2012 7:19 pm
by shark
I don't think doing this via CheatEngine is the way to go mainly because cheat engine might poke a real variable in charge of say, dodge instead of engine level.

however your results do match with mine so I have no reason not to believe you.

the way I see it, they aren't hardcoded selectively.

The way I see it...

Code: Select all


int getEngineBonusAtLevel(int level)
{
   int retVal = 5;
   switch(level)
   {
       case 1: retVal = 5; break;
       case 2: retVal = 10; break;
       case 3: retvAl = 15; break;
       ...
       case 7: retVal = 35; break;
       case 8: retvAl = 38; break;
       default: break;
   }
   return retVal; //dumb progression
}

int getWeaponsBonusForLevel(int level)
{
    return level; //one per level
}

int getCloakingBonusForLevel(int level)
{
   return 5*level;  //5 secs per level
}
EDIT:
Also, giving engi Med Bey nanobots with medbay 10 works just the same as with medbay 1; it doesn't scale with MedBay power at all, it's referent to base unit (medbay 1). So it really works like 1/4 of a medbay.

The things they didn't hardcode seem to be the things they were lazy-elegant about. The rest of the game clearly states a design decision of having level8 be the absolute max. Some things just ended up working outside that scope :)