HW-PlayersPatch / Development

Players Patch development repository
7 stars 2 forks source link

DoK-like autorepair for HW1 support ships #46

Closed Echo1707 closed 6 years ago

Echo1707 commented 6 years ago

Taking a cue from how repairs work in DoK, would it be possible to add an area of effect (I know, yet another TO) that increases the repair speed of nearby friendly units? Of course only frigate-sized ships and up will be affected. Take this as a buff to offset the repair targeting bug. And of course the main cannon repair speed could be reduced a bit to offset. What are your thoughts on this?

cloaked2222 commented 6 years ago

Can you elaborate on the repair targeting bug your speaking to?

Echo1707 commented 6 years ago

Here is a video: https://vimeo.com/276512078 I started recording after some time, but this is what happened before I started recording: 1) Frigates where doing their business regularly 2) A corvette that was targetted to be repaired by a frigate died 3) That frigate started freaking out 4) I selected all frigates, hit S (hotkey for Stop), then Y-band-boxed again a lot of units 5) All frigates freaked out 6) Started recording; after a very short while they got back to normal (was it because that swarmer died?)

It is a bug that sometimes comes when you order repair corvettes or support frigates (it might apply to HW2 collectors too) to repair a bunch of firendly units using the hotkey Y and dragging a box around them. The repair ship may change its target to repair very rapidly between 2 damaged units, effectively making it stops on its traks, nor moving toward nor healing either of the damaged ships. I don't know what conditions cause this (presence in the selection box of units that can not be repaired like fighters? Presence in the selection box of enemy ships? Two or more ships ends up with the same healing priority while the script to determine the target to be repaired is running? More repair units that compete for who should repair what? Does the bug manifests only when simultaneously ordering more than one ship to repair other units?)

cloaked2222 commented 6 years ago

Look at any .lua scripts in the ship folders. Wonder if anything can be done to fix. (Look at 2.205 files)

Echo1707 commented 6 years ago

The only .lua file I found in the kus_supportfrigate folder is kus_supportfrigate\deathmatch\tags\gbx.lua

cloaked2222 commented 6 years ago

wow @ video -_- I don't think we're gonna be able to fix that bug.

Plz add that bug to the bug thread here: https://forums.gearboxsoftware.com/t/hwr-bugs-solutions/1639765/1

Rather not add some area of affect healing just for a rare? bug. Rather see repair/support frig healing beams simply buffed as need, when repairing swarm/frigs.

Echo1707 commented 6 years ago

Seems like in HW1C the range of support frigates repair beam was higher: https://youtu.be/6daz2H-ighU?t=8m41s from 0:08:41 to 0:09:33. Their beams were also continuous. I'll try to pull this off, but I'll wait Fear's opinion before changing the healing/s value.

cloaked2222 commented 6 years ago

Ya increasing the range, and going to a continuous beam would be desirable. See what you can do, then we can tweak the heal rate as needed. I think artillery-whore did this in his mod, I'm thinking it should just be a .wepn change.

Novaras commented 6 years ago

Supp frig range is already higher in v8, check it out. HP/s is also fine imo for all values, although I buffed it a little for frigates.

I didn't up the range of repair corvettes although I think they could also go up a small amount.

I'd be extremely cautious about buffing them against heavy armour since in a well-microed fight HW1 can keep cruisers alive to the point where they survive many times longer than hw2 can... don't forget they can also heal hw2 units such as destroyers etc.

If you want the beam to be continuous just increase the fire rate and change the damage applied so the dps is unchanged

Echo1707 commented 6 years ago

Repair ships approach their target till its distance is 400 m, so increasing the healing gun range isn't going to make repair ships stay safe behind.

Current repair corvettes heal gun has a range of 890, that applying the same +25% as frigs becomes 1112.5 m.

Unfortunately making the beam contninuous wasn't as simple as it sounds. Quoting from hw2wiki.net StartWeaponConfig function reference:

  1. fWeaponFireLifetime: Duration of the projectile, in seconds. Used for beam weapons, only.
  2. fFireTime: Delay between shots, in seconds.
  3. fBurstFireTime: Duration of a burst, in seconds. Divide this value by to determine how many shots are fired per burst.
  4. fBurstWaitTime: Delay between bursts, in seconds.

Current "relevant" stats are: 5,5,5,1,-17 (with "relevant" meaning the 9th, 15th, 16th and 17th arguments and the last value being the damage applied in the AddWeaponResult function).

I opened a random ion cannon .wepn to see how continuous beam fire was achieved and noticed that both bursts values were set to 0. So I changed weapon stats to: 5,5,0,0,-17.

While testing, I noticed that the heal beam blinks out every five seconds, so I increased ever so slightly the first value to compensate (decreasing the second value works too, but the first shouldn't change the overall heal/s value while the second should). So now the values are 5.05,5,0,0,-17 and I could leave them as they are. However, if you order a repair ship to stop and move away at the beginning of a 5 seconds cycle, the ship will keep shooting its beam at nothing for a few seconds. So maybe it's fine setting the stats at 1.01,1,0,0,-17 (with the first value at 1.01 the beam pulsates every second, with 1 it blinks out every second). Note that I didn't change the damage applied value. Probably should be -17 * 5/(5+1) = 14.17.

I made the Repair-Beams branch, but I tested only the Kushan Repair Frigate and didn't change the damage applied value. I'll test the other 3 ships tomorrow.

As a side note, the arguments for setAngles function differ for Kushan and Taiidan support frigs. Are both of them correct?

cloaked2222 commented 6 years ago

Great work!

Just test in game to make sure heal dps is the same as before.

Some kus/tai differences are intended, while sometimes gbx updated kus and forgot to update tai. Seems like kus/tai should be the same for support frigs, as they don't have unique turrets or anything.

Has anyone checked hw2 coll repair rate vs hw1 repair rates? I've wondered how they compare, but never checked.

Echo1707 commented 6 years ago

Created pull request #58

About collectors:

addAbility(NewShipType,"RepairCommand",0,500,9,0,"",{SuperCap="18"},{Flagship="18"});

hw2wiki.net "RepairCommand" ability reference (scroll down or Ctrl+F repairc).

Video: Repair units comparison

Keep into account that Support Frigate healing gun has 1.5 penetrationin against medium armour.

cloaked2222 commented 6 years ago

Looks good. Thanks for the compare, prolly fine to leave hw2 coll repair rate as is for now.

Just to confirm, you tested in game to make sure healing a frig took the same amount of time before and after your changes correct? Looks like you changed their heal negative damage here: https://github.com/HW-PlayersPatch/2.3/pull/58/commits/56fe6831b45e1b1546c50e97743b75e571997885

Echo1707 commented 6 years ago

Yes, I tested them, both frigates and corvettes. Both frigates and corvettes healing damage should be multiplied by 5/6 because they fired a burst of 5 s (fBurstFireTime) then stopped for 1 s (fBurstWaitTime). I forgot to mention this (should have done it earlier, apologies for that), but the first time I modified the beam duration from 5 s to 1 s, I also multiplied the damage by 1/5 (I threated it as if it was a standard bullet weapon), but during the following test the repairs were going awfully slow. So at first I was unsure what I did wrong. While typing two messages above, I thought that maybe that wasn't damage-per-shot, but already damage-per-second (or per-tick, whatever that is; and you probably are familiar with rubber duck debugging). So that's where that number and the corvette's one come from :)

I made a video for the frigates, where the Kushan one is using the new values while the Taiidan one the old values: https://vimeo.com/277432096 The same principle apply to the corvettes too.

The pulsating beam might be a bit annoying. The solution to that would be increasing the fWeaponFireLifetime and fFireTime to some magical numbers that make the beam play nice without pulsating or blinking out of existance, but that would also mean that the beam won't cease for a longer period of time even if the ship ordered to stop and move away.

cloaked2222 commented 6 years ago

Pulsating actually looks cool imho. I think were done here!

Echo1707 commented 6 years ago

Good, then you or Fear please merge it, I can't do that myself :)