Mob collisions (#34580)

* Conveyor optimisations

- Optimise movement for moving stuff. Better flags + less resolves + slapped parallelrobustjob on it.
- Sleeping for entities getting conveyed into walls.

* Blocker version

* Finish

* Final

* Mob collisions

* impulses

* Collision smoothing

* Locked in

* 30tps working

* r

* fixes

* Best

* Fixes + CVars

* CVars in place

* Pushies

* Opt attempt 1

* Revert "Opt attempt 1"

This reverts commit 5ccd72dcbea09261a992aa1f7f05df169a1ce676.

* Fix mispredicts

* Ready-ish

* better

* Cleanup

* Fix conveyor power mispredict

* Forgetting to actually do deltas

* Fix buckle pushes

* Bagel save

* Revert "Bagel save"

This reverts commit 1b93fda81fb852d89b89b0beae0b80f8a61165f2.

* Conveyor resave

* Fix prediction

* Mob movement rewrite

* Bandaid

* Working version

* Tentatively working

* Friction to fix cornering

* More fixes

* Revert bagel

* Revert this

* Bad parity

* Working

* Fixes

* Woops

* Doc comments

* Pen cap cvar

* StandingState cleanup and sub

* Fix downed mobs

* fish

* client

* Disable pushing on tests

* More variables

* Movement mods

* Mass diff

* 1 more tweak

* Cvar
This commit is contained in:
metalgearsloth
2025-04-05 00:33:52 +11:00
committed by GitHub
parent ba2a89ecfc
commit 593804b517
18 changed files with 631 additions and 25 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Hands.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Physics;
using Content.Shared.Rotation;
using Robust.Shared.Audio.Systems;
@@ -16,6 +17,29 @@ public sealed class StandingStateSystem : EntitySystem
// If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited.
private const int StandingCollisionLayer = (int) CollisionGroup.MidImpassable;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StandingStateComponent, AttemptMobCollideEvent>(OnMobCollide);
SubscribeLocalEvent<StandingStateComponent, AttemptMobTargetCollideEvent>(OnMobTargetCollide);
}
private void OnMobTargetCollide(Entity<StandingStateComponent> ent, ref AttemptMobTargetCollideEvent args)
{
if (!ent.Comp.Standing)
{
args.Cancelled = true;
}
}
private void OnMobCollide(Entity<StandingStateComponent> ent, ref AttemptMobCollideEvent args)
{
if (!ent.Comp.Standing)
{
args.Cancelled = true;
}
}
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
{
if (!Resolve(uid, ref standingState, false))