Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have missiles disengage once you bribe a faction #2277

Closed
Amazinite opened this issue Mar 19, 2017 · 20 comments · Fixed by #6266
Closed

Have missiles disengage once you bribe a faction #2277

Amazinite opened this issue Mar 19, 2017 · 20 comments · Fixed by #6266
Labels
mechanics Things dealing with the mechanics & code of how the game works
Milestone

Comments

@Amazinite
Copy link
Collaborator

A problem I've noticed right now with bribing is that if you (or the enemy) use missiles (and some slower firing projectile weapons) then once you bribe them, the missiles will continue to track their target and eventually do damage if they hit (and projectiles will do damage as well if they are aimed right at a ship that just became friendly). This causes two problems.

  1. If it's the enemy using the missiles and slower moving projectiles, then it can kill you or ships in your fleet after you've bribed the enemy to become friendly.
  2. If you're the one using missiles, then bribing the enemy while missiles are still flying can cause them to become hostile again if any of them hit, requiring you to bribe again, but in that time more missiles were fired, so sometimes it becomes a perpetual loop where you're unable to bribe the enemy to stop attacking you.

Given this, it would be helpful if missiles disengaged their targets and projectiles would no longer collide with what were enemies (or your own ships) after they've been bribed, or at least have the enemies not become hostile to projectiles that were fired before the bribe.

@ReimeiSky
Copy link
Contributor

ReimeiSky commented Mar 19, 2017

Yeah, I've noticed the second one several times with some weapons (note: not missiles, I hate using missiles) while attempting to bribe pirates in Durax.

@Lorantine
Copy link
Contributor

Lorantine commented Mar 19, 2017

all projectile weapons in general (non-beam weapons), no matter the speed:
once I bribed a pirate like 100x for fun because they kept becoming angry & loaded game when I got bored

@LocalGod79
Copy link
Contributor

or you could tap "u" so that your fleet stops shooting missiles before you try to bribe...

@ReimeiSky
Copy link
Contributor

Again, that is just for missiles and other limited ammo weapons. It still exists with other weapons.

@Amazinite
Copy link
Collaborator Author

Amazinite commented Mar 20, 2017

And usually when I'm bribing, it's in a situation where I'm close to death, so I don't have the time to stop my fleet from firing then wait for all the missiles to hit or run out of lifetime, and then bribe. This issue was mainly brought up for the first point anyways, which the player has no control over (aside from constantly reloading the save every time this occurs).
I enter a system in my little Star Barge, I see a pirate ship fire a few torpedoes, I bribe him so we're friendly, but then the torpedoes still chase and eventually hit me, killing me, despite me having bribed the pirate.

@endless-sky
Copy link
Collaborator

That would only make sense if all projectiles were somehow remotely controlled by your ship, which they're not. If a missile is in the air, it's going to keep trying to do what it was originally told to do.

@endless-sky endless-sky added the mechanics Things dealing with the mechanics & code of how the game works label Mar 23, 2017
@Amazinite
Copy link
Collaborator Author

Amazinite commented Mar 23, 2017

Then at the very least could they not become hostile when hit with projectiles that were fired before the bribe? If missiles can not be disengaged after being fired then whoever you've bribed would likely understand this and not become hostile when hit with a missile (or other projectile) that was fired before you bribed them.

(Not exactly sure how things work, but I imagine that one could use the lifetime of a projectile and see how much was left once it hit its target, and then backtrack to find out if the projectile was fired before a bribe. e.g. missile lifetime of 1000. Hits when it has 200 lifetime left. Bribe occurred 500 frames ago. 200+500 = 700 < 1000, therefore the missile would not cause hostilities.)

@MessyMix
Copy link
Contributor

Surely a ship can send a "disengage" command to any fire-and-forget missiles. This is the 31st century, after all. That's assuming that all the missiles in the game are fire-and-forget, too.

Regardless, I would say this is a gameplay-over-realism change, and it would greatly improve the quality of gameplay, so even if it does take a leap of imagination, it's worth it.

@Lorantine
Copy link
Contributor

real-life missiles have a self-destruct function, should missiles that were fired at a target you bribed self-destruct then?
as for non-missile projectiles: idk, I'll go w/ Amazinite's thing then (although I feel like it can be exploited in a way)

@Amazinite
Copy link
Collaborator Author

That would be an expensive exploit.
(Fire some missiles, bribe, they all hit, you're safe to recharge your shields if needed and probably at a faster rate than your enemies, then make them hostile again, fire another volley of missiles, repeat.)

@Lorantine
Copy link
Contributor

as I thought
maybe it could be like the next .1s you can still damage w/o making them hostile, since I remember a lot of beam weapons also make them hostile when ya bribe

@endless-sky
Copy link
Collaborator

The real point is that the game does not keep track of what ship fired each missile, and tracking that would introduce a lot of overhead (either maintaining a list of missiles for every ship and clearing out the ones that die, or sorting through every single projectile, checking if it's target is of the bribed government, and clearing its target if so).

Plus, your suggested change would allow you to fire a bunch of missiles at a ship, then bribe it, then have your missiles damage it without it becoming hostile again.

@Lorantine
Copy link
Contributor

Lorantine commented Mar 24, 2017

ya have a point; big battles can lag (try Earth tribute)
if the game would track every missile & what ship fired it, imagine dozens of Rainmakers, Cruisers, Carriers etc. firing them every second
I prefer to keep my PC below 400 degrees

@MessyMix
Copy link
Contributor

MessyMix commented Mar 24, 2017

I really don't see why we can't just disengage the missiles. Apart from the fact that it can be justified using lore, gameplay>realism, and this is a big gameplay addition, so I would support it.

@gunqqer
Copy link
Contributor

gunqqer commented Mar 24, 2017

@MessyMix a reason we can't is that it would take too much computer power to track all the missiles

Performance killing things aren't worth slightly better gameplay

@MessyMix
Copy link
Contributor

I thought @endless-sky was referring to @Amazinite's proposal, but in that case I get it.

@zwparchman
Copy link
Contributor

Is efficiency the main motivator behind not having this? If so an intrusive doubly linked list would remove most of the overhead. Missiles can remove themselves from the list without a reference to the "master" list and the ship could walk the list to disable missile guidance before the bribe panel is allowed to exit.

@tehhowch
Copy link
Collaborator

tehhowch commented Aug 1, 2017

Walking the projectile list upon bribing a faction seems like the least expensive method to do this, and builds on the inherent fact that only the player can bribe pirates.
I had thought a possible alternative was to change this line:

But this change
if(!target || !target->IsTargetable() || target->GetGovernment() != targetGovernment)

into this line

if(!target || !target->IsTargetable() || !target->GetGovernment()->IsEnemy(targetGovernment))

or any check of IsEnemy, would make it so that you could not begin hostilities by firing missiles (as they would not track until you somehow injured your target). Obviously, you should be able to provoke a target by firing a homing missile at it.

Re: @zwparchman 's idea:
Without testing, we'd need to add a method to the Engine class (DisableTracking(govA, govB) ? )that would walk the existing list of projectiles to call a similarly named Projectile::DisableTracking() method that sets a "do not track" bit on homing projectiles of a certain government. Rather than clearing their target, this bit would simply turn off the missile's acceleration - and thus the missiles would still damage or provoke their target if it didn't get out of the way, but they wouldn't chase their target.

The tough bit (for me) is getting HailPanel to call that Engine method upon bribing (right now HailPanel has no clear way to interact with the instantiated game engine). One thought I have is to have a reference to MainPanel's engine instance (MainPanel calls HailPanel), and in a custom destructor for HailPanel, check if a bribe was done, and if so, call the needed Engine method.
This can maybe be done better or more simply / intelligently - perhaps HailPanel can make do with just a reference to the parent MainPanel, and then MainPanel calls the Engine method.

@Amazinite Amazinite reopened this Aug 1, 2017
@Amazinite
Copy link
Collaborator Author

Make this part of the AI overhaul? :)

@Amazinite
Copy link
Collaborator Author

Amazinite commented Nov 16, 2019

An alternative solution would be to have a period of time after bribing a faction where you can't provoke them again. Say something short like 3 or 5 seconds to allow in-flight projectiles to impact or die out. This would be easier then trying to calculate if a projectile was fired before or after the bribe, I'd think.

Given that this solution or any other such solution to avoid instantly making the government you just bribed angry again is somewhat exploitable, how about we then make it so that subsequent bribes on the same day increase the bribe amount by some percentage. Say the first time you have to bribe a pirate it costs you 50k, then if you have to bribe pirates again on the same day it's now 75k ,and it keeps increasing by 50% for each bribe until you land or leave the system. This means that exploiting the system would be expensive.

And if anyone exploits the system and is still able to make a profit (i.e. within the 3 to 5 second window they always disable the ship they're attacking, allowing them to gain more money than they're spending on bribes), then at that point you really have no need to exploit the system in the first place, as you probably already have a powerful ship or a big enough fleet to pull that off.

@Amazinite Amazinite added this to the 0.9.15 milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mechanics Things dealing with the mechanics & code of how the game works
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants