Proposed fix drop zen in party#778
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a discrepancy in zen (money) drops between solo and party play. Previously, party members received significantly less money because the experience calculation used for drops excluded server-side experience rates. The changes normalize the experience calculation for money drops regardless of party status and introduce a fair distribution mechanism to split the dropped money among party members. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adjusts money and experience calculations for NPC drops when the killer is in a party, aiming to make party drops more consistent with solo play. However, several issues were identified: dividing physical money drops by party size penalizes groups since only one player can collect the item, and there is a potential NullReferenceException when accessing player attributes. Additionally, the experience calculation logic is duplicated from other classes and should be refactored into a shared utility to prevent future maintenance issues.
|
/gemini summary |
Summary of ChangesThis pull request addresses an imbalance in the game's economy where party members received significantly less zen (money) than solo players due to differences in how experience-based drops were calculated. By refactoring the experience calculation logic and updating the money pickup system, the changes ensure that zen drops are consistent with server rates and that wealth is distributed equitably among party members. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Activity
|
Party Zen Drop Fix
Problem
When a player killed a monster in a party, the zen (money) drop amount was
dramatically lower than when playing solo. With a high experience rate server,
a solo player could get ~1,000,000 zen per kill, while a party member would
only see ~3,000 zen. Additionally, the zen was not shared among party members.
Root Cause
The zen drop amount is calculated as
gainedExperience + BaseMoneyDrop (7)inDefaultDropGenerator.GenerateItemDropOrMoney. ThegainedExperiencevaluecomes from
AttackableNpcBase.OnDeathAsync, which uses different formulas forsolo and party play:
Solo:
player.AddExpAfterKillAsync()→ baseExp * gameRate * personalRate * mapMultiplier * random
Party:
party.DistributeExperienceAfterKillAsync()→ baseExp * count * 1.05^(count-1) * mapMultiplier * random
The party formula does NOT include the game rate (e.g. 100x) or personal
experience rate bonuses, making the zen amount orders of magnitude smaller.
Changes
Three files modified on branch
zen-drop-party-fix:src/GameLogic/Player.cs— newCalculateExpAfterKill()methodExtracts the experience calculation logic from
AddExpAfterKillAsyncintoa separate public method that returns the calculated value without applying
it to the character.
AddExpAfterKillAsyncnow calls this shared method.This avoids duplicating the experience formula when it's needed for other
purposes (like zen calculation).
src/GameLogic/NPC/AttackableNpcBase.cs—DropItemAsync()When the killer is in a party, uses
player.CalculateExpAfterKill(this)to get the correct experience value for zen calculation instead of using
the party-distributed value (which lacks game rate and personal bonuses).
Also uses null-conditional access for
Attributesinstead of!.src/GameLogic/DroppedMoney.cs—TryPickUpByAsync()When a player in a party picks up money from the ground, it is now
distributed equally among all eligible party members (same map, not in
safezone). Solo pickup behavior is unchanged.
Result