warzone2100 icon indicating copy to clipboard operation
warzone2100 copied to clipboard

Fix big angle misses

Open chainlito opened this issue 2 years ago • 5 comments

Fixes for the issue https://github.com/Warzone2100/warzone2100/issues/1241 I don't think this will solve the problem perfectly, but it will make miss angles more smooth

chainlito avatar May 06 '22 13:05 chainlito

I think the only way to have a peaceful coexistence between the weapon balance and a realistic graphical miss aspect would be to shoot the projectile sharply upwards into the sky (down into the dirt if AA weapon) if an obtuse angle of whatever requirements is detected (shooting backwards basically or to the extreme side). There would need to be a flag that turns the projectile into a ghost that won't hit the original target collision sphere area too. Also, the source simply ignores damage if the weapon can't truly ever hit it. So a Heavy Cannon can't hurt a VTOL and a Sunburst rocket can't hurt a tank and so on in the hypothetical scenario.

I think the miss spread is fine. The community already likes it. The issue at hand is for weapons with super low accuracy (<= ~20%... none of which exist), or just being very close to the target.

BTW, I don't agree this is a good "first" issue though feel free to pursue it if you want to.

KJeff01 avatar May 12 '22 20:05 KJeff01

The community already likes it.

If those magic values will be changed we would have to re-calibrate everything and it will wreck balance that was polished over the years

maxsupermanhd avatar May 12 '22 23:05 maxsupermanhd

I know. Maybe my last post was unclear. I was merely thinking about how to handle the backwards shots in a realistic way which is really the only thing we need to care about graphically. I agree we shouldn't touch the magic miss spread for the foreseeable future for non-backwards misses (as those misses are pretty much guaranteed to not hit an enemy object, hence shoot into the sky for tank/cyborgs, and into the ground for AA weapons).

KJeff01 avatar May 13 '22 00:05 KJeff01

Just out of curiosity, how do other games handle this case, does anyone have an idea? "Blanc bullet" which don't do damage? Or something else?

gantsevdenis avatar Jun 05 '22 10:06 gantsevdenis

@gantsevdenis I'll look into a few more games if desired but StarCraft 1 had a % chance that a shot counts as a miss if a unit is obstructed behind a tree or other object but I don't recall a difference in appearance/sound that results and just damage is not done. StarCraft 2 didn't calculate a percent chance of miss. Misses resulting in the projectile still hitting where it should if due to a unit vanishing (goes into a transport/building, teleport, etc). One exception was the Raven's seeker missile which would fizzle out and fall to the ground if a target ran too far away during its flight.

Mindustry has shots travel and hitbox determines if impact happens or not. A better chance of a miss was usually an erratic projectile flight or trajectory angle from its initial shot but not as a precalculated miss.

First person shooters that I know of normally have either instant bullets or some kind of a hitbox mechanic. In multiplayer the hitbox calculation has to be decided 'somewhere' which usually leads to how many games are implemented leaving either the attacker or defender not satisfied because a calculation on the attacker's side, defender's side, or at the server are not all showing the same thing at the same time so the bullet and player locations vary at each location. Only solution I know to that issue that doesn't leave someone dissatisfied with the hit calculation is to delay players seeing the simulation so everyone can watch the same game at the same time on every screen with inputs made earlier but that has an undesired laggy feel.

I'd say if we want to have precalculated misses, shooting over/under target could lead to 1 type of displayed response; in real life a shot from a gun has a firing pin activate a primer in the case which activates the powder which pushes the bullet down the chamber. If mistakes happen like very little or no powder then you may get a malfunction which if bad enough is a bullet that travels a few feet or even gets stuck in the barrel. There are other failures like primer not going off or a gun having any number of jams. A puff of smoke and maybe a different quieter bang or even some strange metal clank sounds might work to indicate failures. Some types of shots could just hit a well armored surface at a bad angle and graze off of it. We could also have something like a cooldown bar with a longer timer (which spoils the upcoming event) or goes resets but goes orange and proceeds again.

An alternative would be to merge the chance of miss into fire rate (direct equivalent) and/or fire rate (indirect results as damage per shot scaling is 'complicated'). Rebalancing then can be more consistently done and gameplay becomes more of a 'fair' event that "competitive gamers" usually like to see (examples of disliked 'variables' in competitive RTS: hunting for randomly placed/roaming animals in Age of Empires or StarCraft 2 has some vespane geyser resources that units need to mine which are up to 4% slower with the standard 3 miners due to the angle relative to the main base). I can give more examples if needed though I like having a game where all interactions aren't necessary always a precalculated equal balance; many disagree sometimes 'strategy' is fun when different people get to use different strategies from each other to play the round because their starts aren't directly equivalent.

Thank you to the developers who take the time to look over and try to fix this silly graphics glitch; it helps give it a more professional touch when unintended sillyness can be worked through.

mirror176 avatar Sep 19 '23 07:09 mirror176