-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: master
Are you sure you want to change the base?
Add basic sync for PvP #2107
Conversation
df9fb08
to
eb16f7b
Compare
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. |
Waiting for #2106 to be merged, then this will get some tests and will be ready to be merged |
[Serializable] | ||
public class PvPAttack : Packet | ||
{ | ||
public string TargetPlayerName { get; } |
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.
Why do we send the name and not the playerId? Seems unnessary to have so many bytes in the packet...
private readonly PlayerManager playerManager; | ||
|
||
// TODO: In the future, do a whole config for damage sources | ||
private static readonly Dictionary<PvPAttack.AttackType, float> DamageMultiplierByType = new() |
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.
Should be lower case
Type = type; | ||
} | ||
|
||
public enum AttackType |
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.
Would define it as a byte sized enum to reduce space.
{ | ||
public override void Process(PvPAttack packet) | ||
{ | ||
if (Player.main && Player.main.liveMixin) |
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.
Would log not finding this as an error bc the damage is disappearing without the player sending a health update back to the server.
Maybe: add sync for propulsion and repulsion cannonTo be tested (and merged) upon #2106 (won't work without it)