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

Character flipping enhancements #14673

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TheNinjaScout
Copy link

@TheNinjaScout TheNinjaScout commented Sep 21, 2024

Added "flipcharacter" status effect command to make a character flip. Mainly only useful for non-humanoids, for example, to make them spawn already flipped through some conditions.

Made "spawncharacter" status effect command and husk infection spawn the new characters already flipped if the target character is also flipped.

Made corpses spawned throughout the level have a 50% chance to spawn flipped.

Made changes to networking to properly sync characters' flipped state in a multiplayer server

Made player controlled monsters not turn in the direction of the mouse or turn instantly in multiplayer, instead they will need to walk in the opposite direction and wait for the animation's flip timers before turning around.

Added "flipcharacter" status effect command to make a character flip. Mainly only useful for non-humanoids, for example, to make them spawn already flipped through some conditions.

Made "spawncharacter" status effect command and husk infection spawn the new characters already flipped if the target character is also flipped.
@PanmanS
Copy link

PanmanS commented Oct 7, 2024

Very coolio PR

Copy link
Collaborator

@Regalis11 Regalis11 left a comment

Choose a reason for hiding this comment

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

I think the fix here is flawed, see comments

@Regalis11
Copy link
Collaborator

I went ahead an implemented a fix to the flipping syncing bug in our private repo.

Fixed flipping monsters behaving inconsistently in multiplayer when controlling a monster: other clients saw the monster facing in the position of the cursor, even if it hadn't turned at all at the end of the client controlling it. There were two issues here:

Character.Control set the target dir based on the cursor position, disregarding if the character is a humanoid or a monster.
The client controlling the monster reported the TargetDir of the monster to the server, but it doesn't do anything at the clients' end unless the monster moves. I think we can just report the actual direction the monster is facing as opposed to the direction it "wants to face".

@TheNinjaScout
Copy link
Author

I went ahead an implemented a fix to the flipping syncing bug in our private repo.

Fixed flipping monsters behaving inconsistently in multiplayer when controlling a monster: other clients saw the monster facing in the position of the cursor, even if it hadn't turned at all at the end of the client controlling it. There were two issues here:
Character.Control set the target dir based on the cursor position, disregarding if the character is a humanoid or a monster.
The client controlling the monster reported the TargetDir of the monster to the server, but it doesn't do anything at the clients' end unless the monster moves. I think we can just report the actual direction the monster is facing as opposed to the direction it "wants to face".

Can I reduce the contents of this PR to just the additions rather than fixes then? Namely, making a spawned character spawn already flipped if the character triggering the status effect or husk infection transformation is also flipped, as well as a status effect command to manually flip a character, in case we want to flip them in certain occasions, such as when spawning in.

@Regalis11
Copy link
Collaborator

That sounds good, those seem like useful additions and I can't see any major problems in those changes.

@TheNinjaScout TheNinjaScout changed the title Character flipping fixes and enhancements Character flipping enhancements Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants