Page 1 of 5

IronHide OXP

Posted: Sat Jul 31, 2010 1:00 pm
by Thargoid
The Ships Systems Department of the Aquarian Shipbuilding Corporation introduce their latest development - IronHide armour. This is a simple but effective technology which applies a special treatment to the hull of the customer ship which helps to strengthen it against combat and physical damage in collaboration with the ships shielding.

In practice the armour helps to absorb damage that would affect the shields, although if a truly concentrated attack occurs then localised penetration and energy damage may still occur. This is especially true of missile attacks, which can still cause internal damage and equipment failure due to concussion effects. The current strength of the armour can be viewed on the ships manifest (F5-F5) screen, and any damage can be repaired at a suitably high-tech station.

The armour itself is available from all good tech 5 locations, for a recommended retail price of just 750 credits for each section (forward and aft sections are installed separately due to ships mass and shielding interaction requirements). These stations should also be able to quote for repairs to damaged shields. It should also be noted that insurers class armour as a combat consumable, and so its replacement is not included as part of the insurance for equipment such as escape pods and lifeboats.

A special enhanced upgrade for military uses has also been developed, and may be available to customers at tech 10 systems (the upgrade requires an undamaged civilian-grade installation). The upgrade doubles the effectiveness of the regular armour.

- - = = Download IronHide OXP Here = = - -

With thanks to ClymAngus for the original discussion and inspiration, and to Caracal and UK_Eliter for beta-testing.

And to save comments, yes ideally shields should go before armour, but code-wise that isn't possible to do without the armour supporting things like ECM and cloaking as well, which would just be odd ;)

Posted: Sat Jul 31, 2010 1:40 pm
by Cmdr Wyvern
Yay, more iron on me ass. :) Just what my mechanic ordered.

Posted: Sat Jul 31, 2010 4:05 pm
by Smivs
All very nice, but does it repel trumbles? :twisted:

Posted: Sat Jul 31, 2010 4:18 pm
by Cmdr Wyvern
Smivs wrote:
All very nice, but does it repel trumbles? :twisted:
I don't think that's likely, but it does a good job of repelling lasers.

So the old rule still applies: When Lord Murphy tosses trumbles your way, break out the grill and make trumbleburgers.

Posted: Sat Jul 31, 2010 5:26 pm
by Smivs
Cmdr Wyvern wrote:
Smivs wrote:
All very nice, but does it repel trumbles? :twisted:
I don't think that's likely, but it does a good job of repelling lasers.
Only kidding :) Looking forward to trying it at the next TL1 Anarchy I visit.
Will we come across any armored NPCs, by the way?

Posted: Sat Jul 31, 2010 5:29 pm
by Thargoid
NPCs don't have shields, so it's a bit difficult to armour them ;)

At the moment this is a player-only OXP, as for NPCs it would just involve giving them an energy boost, and would be non-locational (they have no forward/rear in this sense).

And it would also mean associating a script with the NPC ship, which could cause complications.

Posted: Sun Aug 01, 2010 2:54 pm
by Thargoid
Just found a minor glitch in the script, where a variable was set up as a script variable that needed to be a mission variable (to be available across save games).

So OXP is updated to v1.01 to correct this. It should self-correct your save game without any modification needed other than the OXP update.

Posted: Mon Aug 02, 2010 4:27 pm
by Switeck
Will this make missile hits more survivable?

Posted: Mon Aug 02, 2010 4:31 pm
by Thargoid
Not of themselves as they do so much damage that they tend to penetrate the armour and/or damage things by concussion (see the readme ;) ). But if the missile itself doesn't kill you, then you will be in a better position to survive subsequent attack whilst your energy recharges.

And code-wise it's not possible to differentiate energy loss from damage from that due to ECM usage or cloaking device operation (and other things), hence I didn't even try to counter missile strikes. The equipment is more proof against laser fire.

Posted: Fri Oct 08, 2010 10:18 am
by Lone_Wolf
I tried the ironhide hoping it would give better protection against missile hits, but found the ironhide gets damaged before the shields are depleted.

The oxp description states ironhide is intended as a hull stengthening technique, so i looked at the script.

I believe the reason for the wrong behaviour is in the damage applying parts of the script

Code: Select all

if(player.ship.forwardShield < player.ship.maxForwardShield)
		{ // if we have forward shield damage
		this.damage = player.ship.maxForwardShield - player.ship.forwardShield;
		this.shield = missionVariables.ironHide_ForwardStrength * (missionVariables.ironHide_forwardPercentage / 100);
		if(this.damage < this.shield)
			{
			player.ship.forwardShield = player.ship.maxForwardShield;
			missionVariables.ironHide_forwardPercentage -= Math.floor(100 * (this.damage / missionVariables.ironHide_ForwardStrength));
			}
		else	
			{
			player.ship.forwardShield += this.shield;
			missionVariables.ironHide_forwardPercentage = 0;
			}
		}
Below is code that i think will have the effect that ironhide will only be damaged AFTER the normal shield has been depleted.

Code: Select all

if(player.ship.forwardShield < player.ship.maxForwardShield)
		{ // if we have forward shield damage
		this.shield = missionVariables.ironHide_ForwardStrength * (missionVariables.ironHide_forwardPercentage / 100);
		if(player.ship.forwardShield < this.shield)
			{
			missionVariables.ironHide_forwardPercentage -= Math.floor(100 * (player.ship.forwardShield / missionVariables.ironHide_ForwardStrength));
			}

Posted: Fri Oct 08, 2010 3:58 pm
by Thargoid
The problem is that after shield strength is zero, damage comes straight from energy banks. But unfortunately so do other things such as ECM and cloaking device.

Hence if you are in combat, have your shields reduced to zero and then either cloak or hit ECM, the drain from those will come out of the Iron Hide. This is of course nonsensical, even more so than the current situation.

Basically having the IH drain before the shields do is currently the lesser of the two evil ways of doing it. I have put in a request for a new event to trigger when the ship takes damage, but as yet it has not been implemented (and there is no information that it will be).

If I read your code correctly, all that will now happen is that both the shields and Iron Hide will deplete at the same time, making IH effectively do nothing at all.

Posted: Fri Oct 08, 2010 5:19 pm
by Lone_Wolf
Thargoid wrote:

Hence if you are in combat, have your shields reduced to zero and then either cloak or hit ECM, the drain from those will come out of the Iron Hide. nothing at all.
I have to agree with that, but feel it might not be applicable.

If i've read the ironhide code correctly, what it does is increase the shield strength with 200/400 (civilian , military).

suppose shield strength without ironhide is 1600 , and a player has the military ironhide, raising shield strength to 2000.

an example of how things do work imo :
Shield 2000
lasers and missiles hit for 1700 damge to shield = 300 left
this is below ironhide level, so ironhide gets damaged for 100 points.
total ironhide strength is now 300
Max shield strength is now 1900

shields are recharged to 1200, then damage for 1100 = 100 left
ironhide was 300 points, is now reduced by 200 points to 100.
max shield strength : 1700

shields are recharged to 900, damage for 1100
shield left : -200 , ironhide is gone completely now
the remaining 200 will be taken from energy banks.

In short : the shields are only reduced to zero AFTER ironhide is gone.

Posted: Fri Oct 08, 2010 6:54 pm
by Thargoid
You can't raise shieldStrength above maxShieldStrength, (or increase maxShieldStrength at all) from script. The former is clamped and the latter read-only.

What IronHide does is check if shieldStrength is below maxShieldStrength, and if it is it increases shieldStrength up to maxShieldStrength, and deducts the same amount from itself (think of it like a shield boost reservoir). When the IronHide reaches zero, it is destroyed and no more compensation occurs - shields and then energy drain as normal when further hits are taken.

Hence why IH goes before shields do. As mentioned before if the request for a function triggered by ship taking damage (with the level of damage being returned as a parameter) then it can be done properly as we can tell when energy is drained from damage rather than anything else.

As I said before, once shields are gone then further hits drain energy. But so do other things, and as the two cannot currently be told apart the IH would end up being drained by ECM and cloak (and other OXP things possibly) if they are used at times when the shields are at zero.

But by all means please try the code in your local copy, and if you can figure out a way to do it without the requested function that can differentiate energy drains from combat from those by other equipment then I'll gladly merge it into IH and give you co-author credit.

Posted: Fri Oct 08, 2010 7:59 pm
by Lone_Wolf
Thanks for the explanation, it makes things a lot clearer.

I'm interested in the damage model oolite uses, and will search further.

Posted: Fri Oct 08, 2010 8:29 pm
by Lone_Wolf
Thargoid wrote:

As mentioned before if the request for a function triggered by ship taking damage (with the level of damage being returned as a parameter) then it can be done properly as we can tell when energy is drained from damage rather than anything else.
After a search in forum and sourcecode i think the function you requested is already present, just not accessible for scripts .

In src/Core/Entities/PlayerEntity.m

the functions takeEnergyDamage and takeScrapeDamage are defined and appear to give the data needed.

They should be accessible through the log , if player.ship.damage logging is enabled.

Note :
Co-authorship is not needed, if ironhide can become a hull strengthening equipment (or function like it) that's enough reward.
(with my playing style i could really use that )