Re: NPC shields (proof-of-concept OXP)
Posted: Tue Mar 29, 2011 4:33 pm
Maybe it's possible to emulate Shield Boosters or even the Military Shield Enhancement on certain npc ships?
For information and discussion about Oolite.
https://bb.oolite.space/
May I quote myself from the first post of this thread?The Black Albatross wrote:Maybe it's possible to emulate Shield Boosters or even the Military Shield Enhancement on certain npc ships?
The point is not simulating it on certain NPCs. The point is that NPCs already have Shield Boosters and Military Shield Enhancement, at least since Oolite 1.65. The code gives them more energy banks for these equipments (and a higher energy recharge for the MSE). Therefore giving them more shields as well would reward them twice for the same equipment.Commander McLane wrote:All NPC shields will absorb 128 points of energy damage, just like basic player shields. It is possible to raise that strength for NPCs with shield boosters or a military shield enhancement, and in fact the code for that is already included, but it is currently de-activated, because it may make NPCs just too tough.
...
Hence I am reluctant to give ships with boosters a higher shield strength, because the shield boosting equipment is already reflected in the ship's max energy.
The operational method is exactly the same as IronHide (except the recharge, which I deliberately omitted), although you are quite correct that in the player case it is a third element rather than a second one. I think your logic is the same as mine was but slightly in reverse, in so far asCommander McLane wrote:I was thinking of it as basically shields for NPCs. Inasmuch as IronHide adds another (the third after energy banks and shields) protective deplorable layer around player ships, it can be said that NPC shields are the next step in the arms race in order to balance out the advantage IronHide is giving to the player.
(EDIT: It seems that NPC shields are still weaker than IronHide. I forgot to mention that above, but I've set their strength to half the ship's max energy, but capped at 256. I'm even thinking about making it a universal 128 (equalling unmodified player ship shields). IronHide gives either 200 or 400 extra protection.)
To be honest, I didn't even think about IronHide before (I don't have it and wasn't really aware of it when I had the idea). It just struck me yesterday evening that the newshipTakingDamage
handler can be put to good use, and that the newishshipSpawned
world script handler is very convenient for amending ship scripts with minimal invasive technique. From there on the few lines of code developed rather naturally.
The little stroke of genius—if I may say so—however was to use the ship temperature for an optical effect. I had experimented with creating shield-absorbs-energy effect before by using a single red flasher bigger than the ship. But that never took off. Even now that we can add and remove subentities on the fly it wouldn't work very well. Multiple hits in quick succession (military laser salvo) wouldn't look realistic, not to mention how ships with other flashers would blink in a silly way.
I'm still waiting for more feedback. Do you like it? How should it be tweaked? In my version I have already added one more line of code in order to prevent 'overusing' the shields. If 23 damage are inflicted, and only 16 shield strength are left, the difference of 7 goes into energy damage now. In the released version even the 'insufficient' shield still gives complete protection.
shipTakingDamage
was implemented by Ahruman from my feature request, specifically to make IronHide work properly as it now does (to work after player shields rather than before it). So what you've done is (completely independently) run my thinking backwards, albeit to the NPCs rather than the player. Which in itself is no bad thing, as you say shipSpawned
is most convenient for this kind of thing, which again didn't exist when I originally wrote IH.But these pieces of equipment have nothing to do with energy banks and recharge! Why not change that?Commander McLane wrote:May I quote myself from the first post of this thread?The Black Albatross wrote:Maybe it's possible to emulate Shield Boosters or even the Military Shield Enhancement on certain npc ships?The point is not simulating it on certain NPCs. The point is that NPCs already have Shield Boosters and Military Shield Enhancement, at least since Oolite 1.65. The code gives them more energy banks for these equipments (and a higher energy recharge for the MSE). Therefore giving them more shields as well would reward them twice for the same equipment.Commander McLane wrote:All NPC shields will absorb 128 points of energy damage, just like basic player shields. It is possible to raise that strength for NPCs with shield boosters or a military shield enhancement, and in fact the code for that is already included, but it is currently de-activated, because it may make NPCs just too tough.
...
Hence I am reluctant to give ships with boosters a higher shield strength, because the shield boosting equipment is already reflected in the ship's max energy.
Ah, I must have missed that. Thanks. So does the energy bank increase give NPCs the exact same increase in damage absorbed as SBs and MSE does for the player? If so, then I agree that it is redundant to also simulate a shield increase for these equipments, though it may be marginally more "elegant" to revise the system as Zirael says so that it works the same across the board for both PC and NPC ships. Then you won't have to worry about equipment that boosts energy recharge also incorrectly boosting the recharge of what is supposed to stand for the shields of NPC ships, as (if I'm guessing correctly) energy bank recharge rate is supposed to be independent of shield regeneration rate.Commander McLane wrote:May I quote myself from the first post of this thread?The Black Albatross wrote:Maybe it's possible to emulate Shield Boosters or even the Military Shield Enhancement on certain npc ships?The point is not simulating it on certain NPCs. The point is that NPCs already have Shield Boosters and Military Shield Enhancement, at least since Oolite 1.65. The code gives them more energy banks for these equipments (and a higher energy recharge for the MSE). Therefore giving them more shields as well would reward them twice for the same equipment.Commander McLane wrote:All NPC shields will absorb 128 points of energy damage, just like basic player shields. It is possible to raise that strength for NPCs with shield boosters or a military shield enhancement, and in fact the code for that is already included, but it is currently de-activated, because it may make NPCs just too tough.
...
Hence I am reluctant to give ships with boosters a higher shield strength, because the shield boosting equipment is already reflected in the ship's max energy.
Because that's how the core game simulates NPC-shields. Shields are treated as an extension of energy banks, which is the logical, albeit simplified way to treat them; for the player ship the Shield Booster gives it an extra 'shield bank', and the MSE another extra 'shield bank' and faster shield recharge; therefore it's logical to translate that into energy banks and energy recharge for NPCs.Zireael wrote:But these pieces of equipment have nothing to do with energy banks and recharge! Why not change that?Commander McLane wrote:The point is not simulating it on certain NPCs. The point is that NPCs already have Shield Boosters and Military Shield Enhancement, at least since Oolite 1.65. The code gives them more energy banks for these equipments (and a higher energy recharge for the MSE). Therefore giving them more shields as well would reward them twice for the same equipment.
I agree on the point of equipment working identically or at least similarly. However, achieving this requires a change in the core game code. That's why NPC-shields are on the wish list for Oolite 2.The Black Albatross wrote:In my opinion it's ideal that equipment works identically for NPC and PC ships both, but if it doesn't change gameplay in any apparent way, then I understand if you don't consider it worth the effort.
I think there is a misunderstanding here. Shader usage is beyond my capabilities. Thus I came to the idea to simply use the temperature in order to simulate a glow effect.Thargoid wrote:The shader usage is a nice idea, not one I can do as my laptop doesn't support them. Might one suggest perhaps using a different colour than red to indicate the visual scattering of the laser energy rather than as a temperature rise.
I don't know. Personally I don't have IronHide installed, but still like to have NPCs with shields. Other people may not want NPC shields, but at the same time may want to use IronHide. Combining the two would make that a little complicated, I think. For me they offer separate functionalities, even if on the scripting side they look similar.Thargoid wrote:One other thought, maybe we should combine the two OXPs together as they're doing very analogous things and make it a co-OXP?
Couldn't you use OXP Config to turn parts of the OXP on or off. Reducing the number of OXP's is a good thing in my world. (Sorry for meddling)Commander McLane wrote:I don't know. Personally I don't have IronHide installed, but still like to have NPCs with shields. Other people may not want NPC shields, but at the same time may want to use IronHide. Combining the two would make that a little complicated, I think. For me they offer separate functionalities, even if on the scripting side they look similar.Thargoid wrote:One other thought, maybe we should combine the two OXPs together as they're doing very analogous things and make it a co-OXP?
I don't have OXP Config installed, either.Gimi wrote:Couldn't you use OXP Config to turn parts of the OXP on or off. Reducing the number of OXP's is a good thing in my world. (Sorry for meddling)
This is my view also... I don't wish or need to harden my ship, only the npc ships.Commander McLane wrote:Personally I don't have IronHide installed, but still like to have NPCs with shields.
I feel misunderstood now . These OXP's are related in functionality, and thus in my view combining them wouldn't be a bad thing. Now personally I would NOT want them combined if I was unable to disable one or the other. On the other hand, when it comes to NPC shields, this in my view is also something that probably belongs in the core game in the future, while Iron hide probably does not, so maybe combining is not a good idea.Commander McLane wrote:I don't have OXP Config installed, either.Gimi wrote:Couldn't you use OXP Config to turn parts of the OXP on or off. Reducing the number of OXP's is a good thing in my world. (Sorry for meddling)
And I don't think that reducing the number of OXPs is a goal. OXPs are all about choice. They're non-necessary enhancements of the game. The whole point of them is to allow each player to decide which of them they want to use, and which not. By far the easiest way of deciding that is to download and install exactly those OXPs you want to use.
As I wrote above, NPC-shields and player-ship-armour are two separate things IMO. I don't see why they should be combined into one single OXP. I equally don't see why for instance the KleptoHUD, Missile Analyzer, Deep Space Pirates, Random Hits, Tionisla Orbital Graveyard, and Deposed should be combined into one single OXP, and then the player be forced to fiddle with JS code in order to select only those of the mix which they actually want. Just downloading and installing exactly what you want seems a lot more convenient to me.
Sorry. I didn't mean any offence.Gimi wrote:I feel misunderstood now .
Here we simply disagree. I don't think they're related in functionality, because they impact on different aspects of the game. Therefore I don't find a combination a logical step.Gimi wrote:These OXP's are related in functionality, and thus in my view combining them wouldn't be a bad thing.
As I said, IMO the easiest way of disabling one or the other is to only install one or the other. Thus they shouldn't be combined in the first place.Gimi wrote:Now personally I would NOT want them combined if I was unable to disable one or the other.
Fully agreed. For me this OXP is only the (imperfect) short-term solution, until NPC-shields get implemented in the game itself.Gimi wrote:On the other hand, when it comes to NPC shields, this in my view is also something that probably belongs in the core game in the future,
Thanks for the compliment!Gimi wrote:Anyway (compliment coming), what I really like is that this is one of very few OXP's that alters the balance of the game in the favor of NPC's without interfering with the core game design/concept. Well done .
Another Commander is correct - no shader capabilitiy here. As for DSP OXP, It is version 1.3. There were no pirates but like I said that may have been just a fluke. Sorry for not replying sooner but my account was suspended for awhile. My fault and I'm very happy to be back.Commander McLane wrote:Could you be a little more precise? 'Doesn't work' or 'doesn't function' isn't really helpful for understanding what's wrong.CaptSolo wrote:This OXP doesn't work for me but am sure it is not the OXP. Also, although I should test it some more, it seems DeepSpacePirates doesn't function with NPC Shields.
Do you mean there were no pirates, or they were there but didn't fight you? Also, which version of DSP have you installed?CaptSolo wrote:I flew around for quite a long time without getting into the usual dogfight.
Do you mean yesterday, CaptSolo? The forum was down, not your personal account.CaptSolo wrote:Sorry for not replying sooner but my account was suspended for awhile.