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

Sync leviathans gameplay #2106

Merged
merged 13 commits into from
Jan 5, 2025
Merged

Conversation

tornac1234
Copy link
Collaborator

@tornac1234 tornac1234 commented Jan 10, 2024

Creature sync:

  • Sync Reaper Leviathans
  • Sync Sea Dragons
  • Sync Sea Treaders

Creature behaviours:

  • Sync leviathans attacking cyclops
  • Sync leviathans attacking a player or vehicle (seamoth or exosuit)

Weapon sync:

  • Sync statis rifle
  • Sync torpedos (better than current implementation)

Other related issues:

  • Fix player vitals not showing a creative player's name
  • Fix seamoth not spawning module inventory
  • Adds an InfectedMixin and a LiveMixin on remote players to ensure they're potential targets

TODO when everything is done:
- [ ] Ensure crash fishes can target other players POSTPONED to another PR (will be short but required both this one and #2101 )

@tornac1234
Copy link
Collaborator Author

Would require some tests :)

@tornac1234 tornac1234 mentioned this pull request Jan 10, 2024
2 tasks
@tornac1234 tornac1234 added Area: player Related to player character actions Area: AI Related to state machines (as used by the fish) labels Jan 10, 2024
@tornac1234 tornac1234 changed the title Sync leviathans Sync leviathans gameplay Jan 18, 2024
@tornac1234
Copy link
Collaborator Author

tornac1234 commented Jan 18, 2024

There's still the following to be looked into (but most of the code is ready for review):

  • sometimes, move animation are chunky and you can see a small jump (FIXED)
  • when another player gets eaten by a leviathan, they broadcast the related cinematic which is played on other players so a black screen appears as if they got eaten themselves by a leviathan (but they didn't)

NitroxClient/GameLogic/AI.cs Outdated Show resolved Hide resolved
NitroxClient/GameLogic/BulletManager.cs Show resolved Hide resolved
NitroxPatcher/Patches/Dynamic/StasisSphere_OnHit_Patch.cs Outdated Show resolved Hide resolved
NitroxPatcher/Patches/Dynamic/StasisSphere_Shoot_Patch.cs Outdated Show resolved Hide resolved
NitroxPatcher/Patches/Dynamic/Vehicle_TorpedoShot_Patch.cs Outdated Show resolved Hide resolved
@tornac1234
Copy link
Collaborator Author

The latest Sea Dragons sync code wasn't tested because it's really hard without #2113

@tornac1234 tornac1234 force-pushed the sync-leviathans branch 2 times, most recently from 862ae97 to bad5975 Compare February 22, 2024 23:08
@Measurity Measurity added this to the 1.8 milestone Aug 9, 2024
Copy link
Collaborator

@Measurity Measurity left a comment

Choose a reason for hiding this comment

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

Looks good CW but I need to do in-game testing.

NitroxClient/MonoBehaviours/PlayerDeathBroadcaster.cs Outdated Show resolved Hide resolved
NitroxClient/GameLogic/AI.cs Outdated Show resolved Hide resolved
NitroxClient/GameLogic/AI.cs Outdated Show resolved Hide resolved
NitroxClient/GameLogic/AI.cs Outdated Show resolved Hide resolved
NitroxClient/GameLogic/AI.cs Outdated Show resolved Hide resolved
@dartasen
Copy link
Member

dartasen commented Jan 1, 2025

Did a playtest with Ninja & Tornac :

  • Seems to work well
  • Waiting on a commit to remove debug messages for actions
  • (Optional) Waiting on a commit for cyclops beacon death sync

…te player death, adapted code after SubnauticaNitrox#1780 (sound rework) is merged, improve movement broadcast/receive depending on simulation, add detection of cell unloading through EntityCell.Reset, added player and query debug commands to gather information more easily, fix entity cell switching
…tion to another player, fix wrong cyclops detection by leviathans (too short), persist leash position of leviathans so they don't derive away from their original spawn position indefinitely, fix leviathans not spawning when they get close to a player who has them in range
Copy link
Collaborator

@Coding-Hen Coding-Hen left a comment

Choose a reason for hiding this comment

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

Other than the one comment looks good to me

NitroxClient/GameLogic/RemotePlayer.cs Show resolved Hide resolved
Comment on lines +146 to +149
if (logInstructions)
{
Console.WriteLine(transformedIl.ToPrettyString());
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't know why this is implemented here. If I would want to debug the il-count I would add the PrettyString() / LogInstructions () method inside the desired Transpiler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's way easier to just add a true/false on the line where you transpiler test is declared (which is the definitely a better place as it is a test and tests are supposed to let you know about the insights), than to modify the transpiler to be able to access the transformed IL before returning it (while in most cases we are returning directly the whole thing)

NitroxClient/GameLogic/AI.cs Outdated Show resolved Hide resolved
NitroxClient/GameLogic/RemotePlayer.cs Show resolved Hide resolved
…ctly which of these every player has, move more stuff to use Player.CanSee
Copy link
Member

@Jannify Jannify left a comment

Choose a reason for hiding this comment

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

LGTM CW

@dartasen dartasen merged commit 9bb3664 into SubnauticaNitrox:master Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: AI Related to state machines (as used by the fish) Area: player Related to player character actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Negative CurrentStats and Players can't operate vehicles
5 participants