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

Lay Down via Keybind #530

Merged
merged 10 commits into from
Jul 18, 2024
Merged

Conversation

Mnemotechnician
Copy link
Contributor

Description

Adds a way to lay down/crawl using a keybind (R by default) similarly to ss13. It has the same effects as falling down after slipping or buckling to a bed, except you don't drop items while doing so and can (very slowly) move around. This opens new gameplay and roleplay possibilities.

You can only toggle standing/laying once in 2.5 seconds (this cooldown is to prevent pro gamers from spamming it). It shows a small popup to everyone. If the attempt fails for whatever reason - being buckled, sleeping, stunned, or anything else - another popup is shown that's only visible to you.

It's been tested and made sure that the system works correctly with buckling, sleeping, being stunned, and shocked.

Media

18 mb recording won't fit on github:

https://cdn.discordapp.com/attachments/1255902264309321851/1260354667578261504/weeee-2024-07-10_00.57.23.mp4?ex=668f0441&is=668db2c1&hm=d338a3499bf47780a66b7ba96d5e8830d8cb4167064423b8983b2d0144b7aa88&


Changelog

🆑

  • add: You can now lie down and stand up at will! The default keybind for it is "R", but it can be changed in settings.

@github-actions github-actions bot added Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes any XAML files Changes: YML Changes any yml files labels Jul 9, 2024
@SimpleStation14 SimpleStation14 changed the title Laying down via a keybind Laying Down via a Keybind Jul 9, 2024
@DEATHB4DEFEAT
Copy link
Member

18 mb recording won't fit on github:

cdn.discordapp.com/...

Upload it to YouTube or use https://8mb.video to compress it.

@DEATHB4DEFEAT
Copy link
Member

Is any of this from CD?

Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
Signed-off-by: Mnemotechnican <69920617+Mnemotechnician@users.noreply.github.com>
@Mnemotechnician
Copy link
Contributor Author

Is any of this from CD?

No

@Mnemotechnician
Copy link
Contributor Author

I do have a minor remark to add:

This can seriously affect combat gameplay. By default, bullets fly over downed bodies unless the shooter targets the downed with their cursor. This opens up new combat possibilities, such as dropping on the ground to avoid enemy fire, or building a line of people lying on the ground to defend against an attacker (such as nukies). It should seriously benefit defensive tactics while not giving much advantage to offensive because of how slow crawling is.

Content.Server/Standing/LayingDownComponent.cs Outdated Show resolved Hide resolved
Content.Server/Standing/LayingDownComponent.cs Outdated Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Outdated Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Outdated Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Outdated Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Outdated Show resolved Hide resolved
Content.Server/Standing/LayingDownSystem.cs Outdated Show resolved Hide resolved
@WarMechanic
Copy link
Contributor

laying down will be a big W for disposable turrets in nukies

Mnemotechnician and others added 4 commits July 10, 2024 08:41
Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
Signed-off-by: Mnemotechnican <69920617+Mnemotechnician@users.noreply.github.com>
Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
Signed-off-by: Mnemotechnican <69920617+Mnemotechnician@users.noreply.github.com>
@Mnemotechnician
Copy link
Contributor Author

Most issues were addressed now.

Copy link
Contributor

@WarMechanic WarMechanic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug found:
laying down makes you immune to turrets

@Mnemotechnician
Copy link
Contributor Author

bug found: laying down makes you immune to turrets

Like what, do they not target you or do their bullets shoot over you?

@WarMechanic
Copy link
Contributor

WarMechanic commented Jul 10, 2024

Like what, do they not target you or do their bullets shoot over you?

their bullets shoot over because they cant target hit your corpse body

@Mnemotechnician
Copy link
Contributor Author

Mnemotechnician commented Jul 10, 2024

Should be an easy enough fix, I'll look into it later

@Mnemotechnician
Copy link
Contributor Author

Mnemotechnician commented Jul 10, 2024

That used to happen because NPCCombatSystem never updated GunComponent.Target before shooting, so theoretically you could make a turret waste all its ammo by placing a bed in front of it and laying down on it. I fixed it now. Same happened with syndicate guards and other hostile ranged NPCs.

8mb.video-Vy7-rb6Mu0va.mp4

@Adrian16199
Copy link
Contributor

I do have a minor remark to add:

This can seriously affect combat gameplay. By default, bullets fly over downed bodies unless the shooter targets the downed with their cursor. This opens up new combat possibilities, such as dropping on the ground to avoid enemy fire, or building a line of people lying on the ground to defend against an attacker (such as nukies). It should seriously benefit defensive tactics while not giving much advantage to offensive because of how slow crawling is.

just how ss13 gods intended, adding more to the combat, loving it.

However a question
Will this PR allow the keybind to be changed if needed?

@Mnemotechnician
Copy link
Contributor Author

However a question Will this PR allow the keybind to be changed if needed?

Yes. Wouldn't be much of a keybind if it didn't.

@VMSolidus
Copy link
Member

Same happened with syndicate guards and other hostile ranged NPCs.
Wizmoment. Hostile ranged NPCs are unused in Wizcode, it's something I implemented(and also present on frontier tbh, they'd probably want this fix as well).

I'll be honest, in my sleep deprived state when this appeared on my phone(Still horrendously sleep deprived, I'm hoping I can get more than 4 hours of sleep tonight), I actually had a small panic attack when I saw the phrase, "Fixed shooting over bodies", and was like, "OH GOD NO, I NEEEDED THAT FOR LAMIA".

I'm relieved you aren't removing it and are legitimately fixing an actual issue where NPCs can't target people on the ground.

Copy link
Contributor

@DangerRevolution DangerRevolution left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to test this tonight but the sauce looks good; very interesting to see this.

@github-actions github-actions bot added the Status: Needs Review Someone please review this label Jul 11, 2024
@DEATHB4DEFEAT DEATHB4DEFEAT changed the title Laying Down via a Keybind Lay Down via Keybind Jul 12, 2024
@DEATHB4DEFEAT DEATHB4DEFEAT added Size: 3-Medium For medium issues/PRs Priority: 3-Medium Needs to be resolved at some point Type: Feature Creation of or significant changes to a feature labels Jul 12, 2024
dvir001 added a commit to dvir001/frontier-station-14 that referenced this pull request Jul 13, 2024
whatston3 pushed a commit to new-frontiers-14/frontier-station-14 that referenced this pull request Jul 13, 2024
* Einstein-Engines fix

Simple-Station/Einstein-Engines#530

* Update BluespaceErrorRule.cs
@Aviu00
Copy link

Aviu00 commented Jul 14, 2024

This has some problems.

  1. When someone moves to the right while lying down, their character faces up, which looks ugly.
  2. If you are lying down, you are still moving at full speed while using a jetpack. This would make any space battle with jetpacks an absolute hell because you have to aim at the person you want to hit.
  3. If you have a shake intensity above 0 (it is 100 by default), your camera will recoil every time you shoot, making it hard to aim at lying people with high fire rate weapons. This issue is not really related to the lying system, but it would still be a huge problem if someone lies down during combat.
  4. You can lie down and hide under corpses and stuff, making it almost impossible to aim at you unless the attacker rotates their camera.

@github-actions github-actions bot added Changes: Audio Changes any ogg files Changes: Config Changes any configuration files Changes: Sprite Changes any png or json in an RSI labels Jul 17, 2024
@github-actions github-actions bot removed Changes: Audio Changes any ogg files Changes: Sprite Changes any png or json in an RSI Changes: Config Changes any configuration files labels Jul 17, 2024
@Mnemotechnician
Copy link
Contributor Author

This has some problems.

1. When someone moves to the right while lying down, their character faces up, which looks ugly.

2. If you are lying down, you are still moving at full speed while using a jetpack. This would make any space battle with jetpacks an absolute hell because you have to aim at the person you want to hit.

3. If you have a shake intensity above 0 (it is 100 by default), your camera will recoil every time you shoot, making it hard to aim at lying people with high fire rate weapons. This issue is not really related to the lying system, but it would still be a huge problem if someone lies down during combat.

4. You can lie down and hide under corpses and stuff, making it almost impossible to aim at you unless the attacker rotates their camera.

Right, I agree with the first point, but there's only so much I can do without introducing fundamental changes to standing system. I can fix the second issue by disallowing jetpacking.
I have no idea what to do with 3 and 4.

@DEATHB4DEFEAT
Copy link
Member

3. If you have a shake intensity above 0 (it is 100 by default), your camera will recoil every time you shoot, making it hard to aim at lying people with high fire rate weapons. This issue is not really related to the lying system, but it would still be a huge problem if someone lies down during combat.

4. You can lie down and hide under corpses and stuff, making it almost impossible to aim at you unless the attacker rotates their camera.

These are pretty funny and fine imo.

@VMSolidus
Copy link
Member

This has some problems.

1. When someone moves to the right while lying down, their character faces up, which looks ugly.

2. If you are lying down, you are still moving at full speed while using a jetpack. This would make any space battle with jetpacks an absolute hell because you have to aim at the person you want to hit.

3. If you have a shake intensity above 0 (it is 100 by default), your camera will recoil every time you shoot, making it hard to aim at lying people with high fire rate weapons. This issue is not really related to the lying system, but it would still be a huge problem if someone lies down during combat.

4. You can lie down and hide under corpses and stuff, making it almost impossible to aim at you unless the attacker rotates their camera.
  1. is hilariously enough how it works in SS13, so this is fine.
  2. You can subscribe to OnParentChanged to check if someone enters space, and forcibly stand them back up if that is the case. You can also check the entity's TransformComponent via Transform(EntityUid), and from there is a couple ways of determining whether or not the entity is in space, and simply prevent them from laying down if that is the case. Maybe give people a funny popup saying, "There is no Down to lay against in space". I'm sure someone would laugh at that.
  3. This is fine. I'm pretty sure it's mostly counteracted by the limited mobility you have when laying down, which in turn makes you an easy target anyway(even if they have to click on you directly). I like this because it essentially enables people to have an ability to take cover against shooters from outside of their vision range.
  4. I actually kind of expected hiding under corpses from gunfire to be a thing? I think this is pretty cool.

@Mnemotechnician
Copy link
Contributor Author

You can subscribe to OnParentChanged to check if someone enters space, and forcibly stand them back up if that is the case.

Did exactly that, seems to work.

@VMSolidus VMSolidus merged commit a2c1687 into Simple-Station:master Jul 18, 2024
11 checks passed
SimpleStation14 added a commit that referenced this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes any XAML files Changes: YML Changes any yml files Priority: 3-Medium Needs to be resolved at some point Size: 3-Medium For medium issues/PRs Status: Needs Review Someone please review this Type: Feature Creation of or significant changes to a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants