space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.68k stars 3.36k forks source link

Lock-on for combat #25637

Open metalgearsloth opened 8 months ago

metalgearsloth commented 8 months ago

This is 50% ideaguys but combat is significantly harder in ss14 than ss13 due to pixel hunting; in ss13 mobs can't occupy same tiles in most circumstances which is partially the issue but mobs in ss13 also move predictably. One way to alleviate this is giving an action that continues targeting a specific person until toggled off. To make it not completely auto-aim you could add a threshold to where it goes back to manual aiming.

Ideally we would try to implement mob pushing first before experimenting with lock-on.

PJB3005 commented 8 months ago

I mean this is what wide swings aim to solve in the first place, isn't it?

metalgearsloth commented 8 months ago

Melee's not too bad but non-predicted gun combat makes shooting close quarters largely ping based.

metalgearsloth commented 8 months ago

Right-click lock-on left-click swing could also solve it maybe, where no-lock is wide-swing and lock is click attack, though this is still months away before I'd try testing it.

Errant-4 commented 8 months ago

Some sort of lock-on could also mechanically facilitate "I am threatening you with my gun" situations, if it was telegraphed. And more relevantly, it could mean that not immediately shooting/stunning a suspected target will not completely lose you the initiative: if they suddenly attack you while you are trying to talk to them or Examine them, you could already have them targeted whereas for them to do the same could give away their hostile intent

Kadeo64 commented 8 months ago

Maybe it would be best to make it middle mouse click? (then you could maybe "scroll" through targets on-screen?)

Kadeo64 commented 8 months ago

lock-on could also be given to like, laser sights, if weapon attachment systems are ever considered

Krunklehorn commented 8 months ago

There's a line or two in gun code that adjusts the trajectory of bullets based on your strafe direction.

That either needs to go or lock-on needs to compensate for it.

metalgearsloth commented 8 months ago

There's a line or two in gun code that adjusts the trajectory of bullets based on your strafe direction.

Where?

Krunklehorn commented 8 months ago

There's a line or two in gun code that adjusts the trajectory of bullets based on your strafe direction.

Where?

SharedGunSystem.cs

var targetMapVelocity = gunVelocity + direction.Normalized() * speed;
Krunklehorn commented 8 months ago

https://github.com/space-wizards/space-station-14/assets/42424291/189771f7-7340-414c-aaf2-1fa00018df3c

If you aim where you intend the bullet to land, you actually miss 100% of the time.

QuietlyWhisper commented 8 months ago

If you aim where you intend the bullet to land, you actually miss 100% of the time.

Oh no wonder guns feel jank at times...

LordCarve commented 8 months ago

Sounds really good on paper. I really don't like how the current combat system strongly favors wide swings to the point of marginalizing targeted ones. Probably the most practical approach would be to first implement a cut-down proof of concept to see how it pans out. Looking forward to seeing how it works.

var targetMapVelocity = gunVelocity + direction.Normalized() * speed;

To me this looks like a take on Momentum Conservation Principle, which in this simple case means all projectiles inherit parent velocity prior to being propelled in the target direction.

Krunklehorn commented 8 months ago

Whether or not gunVelocity makes sense from a realism vs. gameplay perspective is it's own thread.

Regardless, a lock-on mechanic would be useless if it doesn't address momentum somehow.

Tayrtahn commented 8 months ago

To me this looks like a take on Momentum Conservation Principle, which in this simple case means all projectiles inherit parent velocity prior to being propelled in the target direction.

That's great for slow-moving projectiles, but the issue is that bullets only move as slowly as they do for gameplay reasons. If they moved at more realistic speeds, the effect of inheriting the parent's velocity would be negligible.

If you throw a baseball out a car window it definitely should land quite a bit farther forward than you aimed; but if you shoot a gun out a car window, it's not going to miss the target by several feet. The fact that SS14's bullets move at speeds more like a baseball is a gameplay concession. They probably should aim like hitscan weapons, even if the projectile movement isn't that fast.

Not sure what the right solution is here. Maybe a flag on projectiles that determines if they should inherit velocity? Feels weird disabling physical realism for gameplay, but the slow bullets are already a bit of an oddity there.

K-Dynamic commented 8 months ago

If you aim where you intend the bullet to land, you actually miss 100% of the time.

Oh no wonder guns feel jank at times...

And I thought it was just high ping

Ilya246 commented 8 months ago

making projectiles not inherit shooter velocity will make space combat worse

Krunklehorn commented 8 months ago

making projectiles not inherit shooter velocity will make space combat worse

By space combat are you referring to spaceships shooting other spaceships or people shooting each other in jetpacks?

Ilya246 commented 8 months ago

making projectiles not inherit shooter velocity will make space combat worse

By space combat are you referring to spaceships shooting other spaceships or people shooting each other in jetpacks?

both

LordCarve commented 8 months ago

if you shoot a gun out a car window, it's not going to miss the target by several feet

It is if the target's far enough and the car moves fast enough. But that's of little consequence in our case.

Your observation is correct that it is the speed at which SS14 bullets are fired that is exaggerating the issue. But between top-down view, forced zoom level and ping - making bullets fast is not something that we can change,


There is one more aspect to it: it makes firing while dodging (especially strafing) less accurate which is a tactical balancing point between offense and defense: stand still for more accuracy, or dodge to avoid some bullets.

Shooter video games often artificially introduce a mechanic that adds inaccuracy while moving / following a movement in the form of increased cone of fire or sway for exactly that purpose.

Personally I feel like SS14 of all games tries to put emphasis on the stray bullets rather than just the ones hitting their target. In shooter games missing just means you failed to hit your target. In SS14 every missed shot has the potential to blow up that plasma canister behind your target and send the whole station into chaos. Even if it doesn't, it's still: evidence for the detective (bullet hole ballistics analysis when), repairs for engineering, and gunshot wounds for medics if any bystanders got hit. It's not as much about who wins gun skirmishes as much as it is about how those gun skirmishes contribute to the game of all other players on the station. Stray bullets aren't just missed shots - they also play an important role in the game loop.

K-Dynamic commented 8 months ago

Tbh I kinda agree with lordcarve, not sure if either option would be better since there's a lot of emphasis on stray bullets and firing off-screen

I'd also examine ttk on guns but that would be off-topic and changed with surgery/woundmed

Kadeo64 commented 8 months ago

we should get dodge rolling with lock-on so we can play (insert any game with dodge rolling and lock on here, seriously there's like 30) in ss14

Tayrtahn commented 8 months ago

This means that technically we can "curve" bullets like in that movie, huh?

Good point about space combat. Tricky puzzle.

LordEclipse commented 8 months ago

Tbh I kinda agree with lordeclipse, not sure if either option would be better since there's a lot of emphasis on stray bullets and firing off-screen

I'd also examine ttk on guns but that would be off-topic and changed with surgery/woundmed

That's not me. But I think maybe lock-on melee for close range? There is a reason that a lot of people use wide swing instead of left click melee.

Jezithyr commented 4 months ago

Lock on would also solve some issues with targeting 😏 and the way I'd like to do targeting requires players to be able to "select a target". Locking on would be a good way to do that.

Jezithyr commented 4 months ago

also locking onto targets would allow us to implement different bullet scatter/hit chances for weapons depending on if you are locked on to a target or not to simulate "hipfire" vs aimed-fire. Not to mention is a nice QOL and accessibility feature that decreases pixelhunting. Hell, it'll make SS14 combat more playable on a gamepad which would be cool (Which helps disabled folks because most accessibility input devices map to gamepads NOT keyboards/mice)

K-Dynamic commented 4 months ago

also locking onto targets would allow us to implement different bullet scatter/hit chances for weapons depending on if you are locked on to a target or not to simulate "hipfire" vs aimed-fire.

VATS but SS14 :trollface: