Skip to content

Conversation

@5Miro
Copy link
Contributor

@5Miro 5Miro commented Nov 18, 2025

Add MoneyDropRate configuration to allow independent control of money drops

This addresses the issue where increasing XP rate also increases money drops proportionally.

Adds a new MoneyDropRate property to GameConfiguration that acts as a multiplier for all money drops, allowing server administrators to balance money drops independently from the experience rate.

Changes:

  • Add MoneyDropRate property to GameConfiguration (default: 1.0f)
  • Initialize MoneyDropRate in GameConfigurationInitializerBase
  • Update DefaultDropGenerator to apply MoneyDropRate multiplier to money drops
  • Store GameConfiguration reference in DefaultDropGenerator for access to rate

Add MoneyDropRate configuration to allow independent control of money drops

Adds a new MoneyDropRate property to GameConfiguration that acts as a
multiplier for all money drops, allowing server administrators to balance
money drops independently from the experience rate.

Changes:
- Add MoneyDropRate property to GameConfiguration (default: 1.0f)
- Initialize MoneyDropRate in GameConfigurationInitializerBase
- Update DefaultDropGenerator to apply MoneyDropRate multiplier to money drops
- Store GameConfiguration reference in DefaultDropGenerator for access to rate

This addresses the issue where increasing XP rate also increases money drops
proportionally.
@gemini-code-assist
Copy link

Summary of Changes

Hello @5Miro, 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 common game balancing challenge by decoupling money drop rates from experience rates. It introduces a dedicated MoneyDropRate configuration, allowing server administrators to fine-tune the in-game economy without inadvertently affecting player progression through experience gains. This change provides greater flexibility and control over the game's core mechanics.

Highlights

  • New Configuration Property: Introduced a new MoneyDropRate property in GameConfiguration to allow independent control over money drops, separate from the experience rate.
  • Money Drop Calculation Update: Modified the DefaultDropGenerator to apply the new MoneyDropRate multiplier when calculating dropped money, ensuring the configuration is utilized.
  • Configuration Initialization: The MoneyDropRate property is now initialized with a default value of 1.0f in GameConfigurationInitializerBase.
  • Database Migration: Added a new database migration to include the MoneyDropRate column in the GameConfiguration table, persisting the setting.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a MoneyDropRate to allow server administrators to control money drops independently. The implementation is straightforward and correctly applies the new rate to money dropped from monsters. I've added one suggestion to make the calculation more robust against potential misconfiguration.

return this.GenerateRandomItem((int)monster[Stats.Level], true);
case SpecialItemType.Money:
droppedMoney = (uint)(gainedExperience + BaseMoneyDrop);
droppedMoney = (uint)((gainedExperience + BaseMoneyDrop) * this._config.MoneyDropRate);

Choose a reason for hiding this comment

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

high

A negative MoneyDropRate could lead to undefined behavior when casting the resulting negative float to uint. It's safer to ensure the value is not negative before casting. This will prevent potential issues, such as dropping a very large amount of money due to how negative floats are converted to unsigned integers.

                droppedMoney = (uint)Math.Max(0, (gainedExperience + BaseMoneyDrop) * this._config.MoneyDropRate);

@sven-n
Copy link
Member

sven-n commented Nov 27, 2025

Hi, thanks for the PR. I'd like to implement this a bit different to be even more flexible for more options in the future.

My idea is to add two collections to the GameConfiguration, like we already have in CharacterClass:

    /// <summary>
    /// Gets or sets the attribute combinations.
    /// </summary>
    [MemberOfAggregate]
    public virtual ICollection<AttributeRelationship> GlobalAttributeCombinations { get; protected set; } = null!;

    /// <summary>
    /// Gets or sets the base attribute values.
    /// For example the amount of health a character got without any added stat point.
    /// </summary>
    [MemberOfAggregate]
    public virtual ICollection<ConstValueAttribute> GlobalBaseAttributeValues { get; protected set; } = null!;

The idea is to apply both globally, for all characters, no matter which character class. With that we can easily add a ConstValueAttribute for Stats.MoneyAmountRate.

Do you think you can do that? 😅

@5Miro
Copy link
Contributor Author

5Miro commented Nov 28, 2025

Hi, thanks for the PR. I'd like to implement this a bit different to be even more flexible for more options in the future.

My idea is to add two collections to the GameConfiguration, like we already have in CharacterClass:

    /// <summary>
    /// Gets or sets the attribute combinations.
    /// </summary>
    [MemberOfAggregate]
    public virtual ICollection<AttributeRelationship> GlobalAttributeCombinations { get; protected set; } = null!;

    /// <summary>
    /// Gets or sets the base attribute values.
    /// For example the amount of health a character got without any added stat point.
    /// </summary>
    [MemberOfAggregate]
    public virtual ICollection<ConstValueAttribute> GlobalBaseAttributeValues { get; protected set; } = null!;

The idea is to apply both globally, for all characters, no matter which character class. With that we can easily add a ConstValueAttribute for Stats.MoneyAmountRate.

Do you think you can do that? 😅

Hi there!
Hmm I don't quite understand the idea, sorry, could you elaborate a bit further?

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.

2 participants