dybal wrote: ↑Thu Dec 17, 2020 3:06 pm
another_commander wrote: ↑Thu Dec 17, 2020 1:38 pm
2. Why is it proposed as a core change, when an expansion pack can already be created to achieve the same goals? What is earned by having it in the core instead of the Expansion Pack Manager?
The events that would allow an OXP to be aware that the core game made a NPC bail out due to player attacks and distinguish it from an abandonShip called by any other script, priorityAI included, aren't there.
I encounter plenty of derelicts. Probably the majority are created by OXPs I use. Towbar OXP includes an optional equipment that reduces laser damage for several seconds after a pilot ejects, which helps avoid destroying a derelict accidentally. Norby's Laser Cannons sometimes force the target to eject at low energy. Ship Version OXP hands out escape pods to many NPC ships. Etc. In general, I find it more realistic if opponents to try to escape if they think their ship is about to be destroyed; it's what I would do if I were in their position.
The concept of not being awarded for destroying derelicts that I had no significant role in creating (i.e., where I was not responsible for the majority of the damage, or wasn't involved at all) appeals to me. Note I am taking a somewhat nuanced position on when I want to be awarded score points. For example, I would prefer not to gain score for destroying a derelict that was whittled down by the police without my involvement aside from perhaps one or two shots at the end of the battle that happened to coincide with the pilot's ejection.
The concept of being able to gain score when a pilot ejects to escape from me is also appealing for the reason that dybal noted - not having to kill.
Of course, currently I can gain score points by destroying derelicts after the pilot ejects. The downside to destroying derelicts arises when using OXPs such as Towbar or Deep Space Dredger that provide ways to derive other value from derelicts. This presents a trade-off between gaining score points or gaining credits. Ideally, OXPs could solve this by awarding score points when derelicts are "processed" ... but to dybal's point, it is currently not possible for such OXPs to determine whether derelicts come from player action or happenstance, and awarding points for all derelicts would be excessive.
After reviewing dybal's (reopened) pull request, I have a question:
Does destroying an escape pod award a kill? I'm wondering if, with the changes proposed in the (reopened) pull request, you could get two points in another way: 1 when they eject, 1 when you destroy the escape pod. If this is the case, the core changes proposed would introduce a new way to obtain double score points for the same opponent, which is clearly not the intent.
Here is another possible way to approach the problem, as pointed out by dybal in the above quote:
Give OXPs more tools to determine the degree of responsibility the player had in the creation of a derelict, so OXPs that give other ways to dispose of derelicts can make informed decisions about whether the player deserves a score increase.
In looking at the worldscript event handlers, shipAttackedOther is only for laser damage done by the player, not other types of damage (missiles? scraping?); shipBeingAttacked only identifies the attacker, not the amount of damage; shipBeingAttackedByCloaked doesn't give any identification (can't tell if the player was involved); shipKilledOther doesn't fire if the ship wasn't actually destroyed, just left unpiloted; and there seems to be no event handler when an NPC pilot uses an escape pod (shipLaunchedEscapePod is only when the player bails out, and doesn't indicate why).
One idea is to add a JS read/write property to ships (that carries over to derelicts) that records all damage done to the ship that can be traced back to the player - for now, let's call it ship.damageFromPlayer. This would allow OXPs to make their own assessment about whether players did enough to be awarded score points when disposing of derelicts without destroying them by weapon fire.
OXPs that use the dealEnergyDamage method in a way that doesn't allow the game to determine that the player should be held responsible (i.e. OXP did not pass in the player's ship, a player-fired missile, or a subentity on the player's ship) would not have the damage amount automatically added to the property, but could manually add the damage to it if appropriate. This is one reason why I suggest the property being writable.
OXPs that cause derelicts to be created and think the player should get credit could set the property to a large value (for example, equal to the ship's max energy) as a hint to other OXPs that use it to decide whether or not to award the player with score points. This is another reason why I suggest the property being writable.
I'm not sure this is the "right" solution (it's certainly more complicated than what dybal proposed), but I do think we should continue the discussion.