A weapon safety is a hack. A cure for a symptom.
It is used to work around a
broken implementation of friendly fire. Needless to say, I
wrote one myself for X3, where the implementation
is broken. =)
The problem is not in X3's concept of friendly fire tolerance. That works perfectly fine. You have to do "considerable damage" to an actor before it gets angry with you.
Alas, this behaviour is erratic. Sometimes a few stray hits will "turn a station red". Then it's a major hassle to apologise for your mistake because you have to hunt down a military capital ship of that race to do it or find a pirate station (or rare "mission" in TC) to make amends with a station. With some objects you can never apologise. It's a mess of patchwork features that has grown over a decade of expansions to one basic game engine.
The result is that the player has a lot of work to do just to "fix" the mistakes of his AI controlled wingmen or automated turrets.
As always, there is not just
one way to solve a problem - especially when the problem people complain about is not the actual problem.
Sometimes there is no solution to a particular problem, though. Then you change the problem. =)
- Disable friendly fire.
Radical approach but works.
Only things you have "on target" can be hit by your guns. In a space setting this makes far more sense than you might think because the chance to accidentally hit something is tiiiiiiny.
Friendly fire also doesn't occur often in X3. It's the great annoyance caused by a tiny fraction of those thousands and millions of bullets that make the problem "big".
It would also do awesome things for FPS if a bullet / missile didn't have to check collision with everything in the vicinity but only the one target object.
Occasionally you would see your bullets flying through another target but it won't happen very often.
The upside is that the player could not exploit the system by "accidentally" hitting something with manual fire when he doesn't have it targeted. =)
With this approach you can have full friendly fire consequences.
- Limit the range of projectiles to x meters past the calculated point of impact.
The lifetime of every projectile is adjusted either at the time of firing or when the collision detection routine determines that it has flown past the intended target. Then it self-destructs.
This isn't a full solution but takes care of a common (X3) problem where you fight near a station and your 6.6 km ranged PPC bullet flies past the fighter you were aiming at... only to hit the station 4 km behind it.
- Friendly fire by (your) AI ships:
- Non-hostile ships damaged or destroyed by AI ships do not affect faction relations.
- Ships destroyed by friendly fire do not drop loot.
The player has no direct control over their shooting and should not be punished for their artificial stupidity.
- Friendly fire by the playership:
- Only the destruction of ships through friendly fire hurts faction relations
- Ships destroyed by friendly fire do not drop loot.
Simple, huh? This removes the motivation behind the "accidental" friendly fire.
In a game world, this sort of consequences is acceptable. Or do you want to model hearings and lawsuites ingame?
- Aggro list system.
Like in an MMO, every actor who does damage is tracked on the target's aggro list.
When the target is destroyed, whichever faction has done the most damage "gets the kill" and the faction relation adjustments that go with it.
2nd or 3rd place factions don't get any so stray hits while actually defending the target are not going to ruin your relations with it.
Any bounty could be shared between the top two factions who did damage based on the amount of damage done.
There is no "I" in Tea. That would be gross
.