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

Add basic sync for PvP #2107

Merged
merged 4 commits into from
Jan 5, 2025
Merged

Conversation

tornac1234
Copy link
Collaborator

@tornac1234 tornac1234 commented Jan 10, 2024

  • Basic sync for PvP (only allowed with knifes and heatblades for now)
  • Maybe: add sync for propulsion and repulsion cannon

To be tested (and merged) upon #2106 (won't work without it)

@tornac1234 tornac1234 added the Area: player Related to player character actions label Jan 10, 2024
@tornac1234 tornac1234 force-pushed the sync-pvp branch 2 times, most recently from df9fb08 to eb16f7b Compare January 10, 2024 20:19
@ywgATustcbbs
Copy link

ywgATustcbbs commented Jan 29, 2024

is there really one who likes pvp in Subnautica? if one wants pvp, why not go ahead to play pvp games? there are tons of such games. i don't think core players of Subnautica are interested in pvp.

@NinjaPedroX
Copy link
Contributor

is there really one who likes pvp in Subnautica? if one wants pvp, why not go ahead to play pvp games? there are tons of such games. i don't think core players of Subnautica are interested in pvp.

Most multiplayer games have ways for players to damage each other. Even if it's not the main focus of the game, it gives players more options to have fun with their friends. Having a last man standing battle within a large base or picking people up and repelling them far away with the propulsion cannon is the kind of thing people (like myself) like to do with our friends. I don't think the argument of "if you want to do PvP, play a PvP game" is a good reason to stop this.

Besides, you can just turn PvP off in the configs if you don't want it.

@tornac1234
Copy link
Collaborator Author

Waiting for #2106 to be merged, then this will get some tests and will be ready to be merged

@Measurity Measurity added this to the 1.8 milestone Aug 9, 2024
NitroxModel/Packets/PvPAttack.cs Outdated Show resolved Hide resolved
NitroxModel/Packets/PvPAttack.cs Outdated Show resolved Hide resolved
{
public override void Process(PvPAttack packet)
{
if (Player.main && Player.main.liveMixin)
Copy link
Member

Choose a reason for hiding this comment

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

Would log not finding this as an error bc the damage is disappearing without the player sending a health update back to the server.

Copy link
Collaborator Author

@tornac1234 tornac1234 Jan 5, 2025

Choose a reason for hiding this comment

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

If local player isn't instantiated, or its live mixin isn't found, then it can only mean that the game is in an early loading state/in an game closing unloading state in which case it's not necessary to log the failure

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.

CW review

@Measurity
Copy link
Collaborator

Works for me so after code changes are done I'll approve.

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.

👍

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.

Tests still work so LGTM

@NinjaPedroX
Copy link
Contributor

Would it be a good idea to maybe add a /pvp on/off console command so that it can be enabled or disabled while players are in game? (Instead of having to restart the server to change the setting)

@tornac1234
Copy link
Collaborator Author

I believe a server config is not meant to be modified at play time and this kind of option should be thought about before starting a server. But I'd like to hear about others' opinions

@NinjaPedroX
Copy link
Contributor

I believe a server config is not meant to be modified at play time and this kind of option should be thought about before starting a server. But I'd like to hear about others' opinions

Isn't the gamemode config setting modified during play time with the /changeservergamemode mode command? The possible keepInventory setting would also make sense to be changeable in-game when that gets implemented

@Coding-Hen
Copy link
Collaborator

I could see an argument for both a command and not. I don't think if it's hard to add an option for it then we shouldn't but if it's going to be hard then maybe just a server setting in the config for now will do

@tornac1234
Copy link
Collaborator Author

Will add a "pvp on/off" command

@dartasen dartasen merged commit 7d2885f 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: player Related to player character actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants