-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cogito Sittable #265
Cogito Sittable #265
Conversation
Basic implementation of the Sittable Class & Player handling of sitting First iteration and very buggy but has the basic functionality required of the Sittable Also included a icon for the Class
Disables Carryable component if found, currently checks for this at the sibling level. This option is to avoid some issues with Sittable components on physics bodies, so is set to on by default
Fixed clipping through Floor on stand up bug by disabling physics during stand up tween
Added Look angle, added (currently unused) signalling Added node & variables for look marker to define centre of vision, but couldn't get this working yet
…ignals Refactored everything so that the Sittable does not move player, only signals to player. Added displacement height to Sittable marker Bugs: Switching from 1 seat to another no longer works Interacting with Sittable while crouched causes player to be too low
…sics update Fixed - Moving between Seat. Added Sit audio, and Player location physics update Bugs - interaction text incorrect on moving between seats
Fixed label issue on move by telling the previous seat node to "stand_up" when moving seat
Added Sit area for Sittables, the interaction only shows when the player is in the sit area Couldn't get reliable behaviour for sit area using the signals directly so moved logic to physics process until I can fix that
@ac-arcana Continuing from the discussion in #255, I've tested the ladder interaction and doesn't seem to have any weirdness like that currently since on sitting, physics is disabled and the player just tweens to the sitting marker location. If you actively wanted to replicate that bug effect you'd probably have to do the movement through physics instead. |
Crouch handling + better sizes defaults Sittables
Player horizontal vision now restricted based upon Sittable settings and look marker This solution works mostly with 2 issues that need to be solved still: Player need to be looking at the Look marker at end of the sitting tween, so that player does not begin stuck sitting looking inside a invalid look region. If mouse movement is fast enough player can skip over the invalid look region. so from max left look to max right look
Tween to look marker added, which is needed so player faces the look marker on sitting down. So player is always facing within the look area now Player has to restore original neck rotation on stand up due to issues with neck remaining twisted on physics seats that are weird angles
Wanted to test some weird uses so made a Swing by just attaching a desk chair to hinge node and here's the results: cogito-swing.mp4Don't think its too bad given I hadn't even consider this case at all, but I can see what needs changing to work better Basically just need a dynamic tween if its a physics object in case it moves mid tween, also the vertical look parameters need to be defined by the Sittables axes. For performance reasons it might also be worth having a Static or Physics option for Sittables so that Static ones skip all the extra things required for Physics sittables. |
Separated Static and Physics Sittables, to avoid using unnecessary resources on static
Sittable area detection was previously done in physics process (due to weird issues with signals not working properly before). Now it's done by signals, so should improve performance as every sittable won't be checking its interactability every frame.
Tween duration wasn't fully applied before and Rotation tween duration has been added as a new export var to Sittable to control this
Vertical look handling must be separated for Sittables as Physics sittables vertical view will change on move, implemented handling solution is temporary
Added Vehicle class that inherits from Sittable, It's very basic and not looking to expand upon this much just included for demo purposes of Sittable uses. The office chair has been made into a vehicle
Sit area behaviour modes now define what the Sit area does, the modes are: MANUAL, ## Player needs to interact manually - Previously the only mode AUTO, ## Player sits automatically on entry - Could be useful for suggested use as a trap NONE ## Player can interact from outside Sit Area Reorganised the export vars Also added enable_on_sit, which can be used for enabling player sitting collision shapes or any other node
Sat on start places player on Sittable on ready, Call interact is currently just copied from switch, considering instead refactoring Switch into a more general class that both could inherit from to avoid this, this would also allow area activation to be used as switch trigger, meaning area activated switches.
Finally had a chance to check this out, and gotta say: this is pretty amazing! Everything works as I'd expect this to be and the setup of the object is very much in line with the Cogito style. The |
Added bear trap to demonstrate further uses of Sittable class, Added node hide/show, same as Switch Also added some (not yet functional) variables as more Sittable options
Thanks for the feedback, the seat to seat movement was an early consideration as the sofas being wide enough for 2 Sittables made me think it was needed. Working on implementing different options for the on leave behaviour, with the following types:
Also saw the discussion on renaming the Sittable to something more broad, but don't want to change it until a consensus is reached on what to call that really. My thought on name is that I think Sittable is also more immediately understandable than something like |
Added multiple options for Sittable leave behaviour Auto placement not yet implemented
@niefia re naming: I see your points and agree. Let's keep the naming Sittable In regards to "leave behavior": I might rename the Node option to something like Transform ? Unless there's other requirements needed/used, but Transform makes it clear as to what is being referenced. How would the Auto behavior work? |
Sittables are now working with the save system as intended without compromising on functionality. Just need to finish some things up and run some more tests, so probably going to be a bit until its finally merged |
Rotation on load was being broken by parent node rotation, fixed by accounting for this.
Added is_fallen function, called by when interacted with. Checks if the chair has fallen beyond eject_angle Entering Fallen chairs causes lots of issues so best to just prevent it entirely.
While technically possible the swing would require a lot of custom unique features to implement, and have lots of swing specific issues. Therefore decided to remove it for now, as Sittables already add a great deal of functionality. Swing would only be bloat
Added Sittables to every seat on the Lobby map Added player feedback hints when interact cancels
Vehicle had issues with the clamping around look marker Remove look angle restriction on chair_desk to avoid this handle_sitting_look will need future rewrite for vehicles, controller support & improvements
Prevent save on tween by disallowing pause menu during tween, Avoids having to deal with save/loading player coordinates mid tween which can cause weird behaviour like player clipping through the floor, as collisions are disabled during tween to allow for smooth transition.
Fixed up all the bugs that I'm aware of, and added a whole bunch of features to improve the stability of things. Would be great if somebody else is able to properly test it out before Merge, as I wouldn't want to merge such a large PR without further tests. |
Gave it a quick look and run into two thing:
|
Reintroduced the Swing with proper implementation Save the player node transforms for key nodes - Body/Neck/Head/Eyes/Camera to improve stability of save system. This is needed for swing
Replaced limit_vertical_view with vertical_look_angle Edited the comments for clarity
So I had removed the Swing, since it had a lot of unique issues that would only ever be present for a Swing. Intended to remove it entirely but hadn't got round to it. However have had another try and managed to get most things working for it. Even the things I thought wouldn't. |
Did some tests and ran into a few issues that were a bit hard to reproduce (mostly on level scene changes, one time I had all rigidbody sittables double spawn in the lobby, but couldn't reproduce, might've been a scene state file issue). One bigger issue, was able to get myself "trapped" in a sittable, here are the steps:
One suggestion in regards to saving and loading on a sittable: I'd probably just "eject" the player to the "leave" node (or general leave position depending on the placement on leave selection. That might be easier to implement. I've been playing a bit of Abiotic Factor that also has placeable and movable objects the player can ist on and AFAIK that game doesn't save/load the player's seated state. |
Save the Interactable state to avoid player being unable to interact, thus stuck in seat Fixed angle on load Also added backup collision shape when sitting to avoid instances where player does somehow still get stuck despite all above.
Not able to replicate the first issue, so can't really comment on that one. If we can get it happening again will investigate further. For the other issues I was able to solve them all, so looking pretty good to merge now unless you can find any more bugs. Oh and the sprinting issue is definitely one introduced in #283 since I've encountered it on other branches. And think I first noticed it with the fix I did after that Commit. Should be fine to keep save/load chair state, since it seems to work fine now. |
Just checked now and yeah quite a few issues with sprinting were introduced with the Trying to stop player from standing up while opening a GUI commit. All seems fine again if you revert back |
Wow, this is getting really robust. Great work! Ran into two issues:
Seriously fantastic work on this! Thank you again! |
Removed Swing Carryable component Added Sound to Sittables that were missing Sounds Added Sittable to a seat that was missing one Cleaned up comments + Statically typed some variables
Removed the Swings carriable component and fixed up a few other things Can't seem to replicate the second issue now, but think I may have encountered it previously. If it happens you can usually regain look by moving mouse side to side rapidly. |
Yeah, trying this repeatedly now and it seems to happen only at specific moments while swinging in the swing, so it might be tied to the physics tics and/or the player controller in general. Anyway, like I said, not a big issue and overall this works really well now. I'm up to merge this into main if you say it's ready. |
It's ready to merge, It's had a week of bug testing and fixes, and plays very stable. Thanks for the help with bug testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to merge!
Again, thank you so much for this.
Addition of the Cogito Sittable as proposed here #255
Still WIP with the following issues needing to be handled before implementation: