Page 1 of 1

Sub-entities

Posted: Mon Feb 03, 2014 7:22 pm
by Commander Wilmot
I was thinking about sub-entities on ships in oolite, and I thought I had heard a while back on the forum that they can be set to be indestructable (where they are part of the ship and can't be destroyed) or set to frangible (where they have a certain amount of energy and are destroyed when that is drained without damaging the ship). Checking the wiki seems to confirm that information is true, which leads me to wonder why there isn't a third option.

Is there a reason why we can't have frangible subents that are connected to the ship's energy/health? What I am thinking of is that you could place subents that blow off if the ship (bonus points if they have to be physically hit by the laser) when the ship has dropped below a certain energy level and that transfer any damage received to main ship. Currently if you have subents they either can't be destroyed or are damaged independently of the ship. If this third option were available, then you could add subents that blow off reflecting the state of the ship.

So if I was flying a hypothetical Griff refitted Cobra Rapier (One of my favorite shipset authors, and one of my favorite ships) with hull paneling subents, it would develop hull gaps and laser scarring as I took hull damage, rather than it is currently; where the subent's would only be destroyed with the ship, or where they would blow off without damaging the ship and independently of any actual damage to the main ship itself. The last option could cause problems as adding subents effectively gives the ship armor, which could be good for a boss or special npc ship, but problematic if you are balancing a player ship.

It seems like an obvious option. However, I haven't heard it suggested, so I am wondering if there are reasons why it can't be done, before I put something in a suggestions topic? Is it too complicated? Are oxpers uninterested?

Re: Sub-entities

Posted: Mon Feb 03, 2014 8:09 pm
by cim
Commander Wilmot wrote:
It seems like an obvious option. However, I haven't heard it suggested, so I am wondering if there are reasons why it can't be done, before I put something in a suggestions topic? Is it too complicated? Are oxpers uninterested?
It can be done - with current features, at that - using scripting. I've not seen it done yet, but it sounds an interesting idea. (There is Smivs' shipset for retexturing on damage, which is a similar effect with a different approach)

You can call ship.subEntities[0].remove() or ship.subEntities[0].explode() even on non-frangible ships, when requested by an appropriate script trigger, and they do about what you'd expect. Alternatively, you can put a script on a frangible subentity so that when it takes damage, it checks the health of the main ship, and if that's still good, moves the damage to the main ship rather than taking the damage itself.
Commander Wilmot wrote:
The last option could cause problems as adding subents effectively gives the ship armor, which could be good for a boss or special npc ship, but problematic if you are balancing a player ship.
Since missing subents triggers a maintenance overhaul request for player ships, and that's quite expensive, there is some balancing in there already.

Re: Sub-entities

Posted: Mon Feb 03, 2014 8:26 pm
by Commander Wilmot
cim wrote:
It can be done - with current features, at that - using scripting. I've not seen it done yet, but it sounds an interesting idea. (There is Smivs' shipset for retexturing on damage, which is a similar effect with a different approach)

You can call ship.subEntities[0].remove() or ship.subEntities[0].explode() even on non-frangible ships, when requested by an appropriate script trigger, and they do about what you'd expect. Alternatively, you can put a script on a frangible subentity so that when it takes damage, it checks the health of the main ship, and if that's still good, moves the damage to the main ship rather than taking the damage itself.

Since missing subents triggers a maintenance overhaul request for player ships, and that's quite expensive, there is some balancing in there already.
Ok, thanks. I thought that it might be possible with scripting, but I don't code so I didn't know for sure; and I was also wondering if scripting it would be less efficient than having it done in the game engine even if theoretically possible. As for triggering maintenance overhaul requests, I realize that was done for turreted ships so pilots could get them repaired faster than waiting until the ship needs an overhaul, but does it affect the ship's maintenance rating or whatever it is called? Because it might be irritating to a player to have to repair cosmetic damage unless they want to misjump often.

Re: Sub-entities

Posted: Mon Feb 03, 2014 8:35 pm
by cim
Commander Wilmot wrote:
I was also wondering if scripting it would be less efficient than having it done in the game engine even if theoretically possible.
Yes, but not by enough that's likely to matter in most circumstances - at least, not for anything simple enough that we'd generally consider putting a hard-coded option into the game engine for it.
Commander Wilmot wrote:
As for triggering maintenance overhaul requests, I realize that was done for turreted ships so pilots could get them repaired faster than waiting until the ship needs an overhaul, but does it affect the ship's maintenance rating or whatever it is called? Because it might be irritating to a player to have to repair cosmetic damage unless they want to misjump often.
No, no effect on maintenance level.

EDIT: actually, yes, having subentities blown off does harm maintenance level. Sorry - I missed that bit on first look.

Re: Sub-entities

Posted: Mon Feb 03, 2014 8:47 pm
by Thargoid
The technique is used in the mission ship in Aquatics (the Kraken IV) to allow the platforms it carries to fire. I think someone (Eric?) also did a ship script where you could shoot off and disable NPC equipment like scoops.

Also Griff and I did something similar with the Cobra with external missiles.

Re: Sub-entities

Posted: Mon Feb 03, 2014 8:52 pm
by Cody
Thargoid wrote:
Also Griff and I did something similar with the Cobra with external missiles.
Wonderful stuff, that - works really well.