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

Attributes determined via Level Trees #316

Open
UltimaOath opened this issue Oct 30, 2021 · 2 comments
Open

Attributes determined via Level Trees #316

UltimaOath opened this issue Oct 30, 2021 · 2 comments
Assignees
Labels
priority: normal Normal priority status: confirmed Confirmed by a maintainer type: improvement Add or adjust a feature
Milestone

Comments

@UltimaOath
Copy link
Collaborator

All of this was listed here in the Discord:
https://discord.com/channels/752310043214479462/757933745620779033/904041595983253605

It was in response to the idea (though I have been working on something similar for my 'LM4 suggestions'
https://discord.com/channels/752310043214479462/760051505067458590/903982514119516200

apply-settings:
  multipliers:
#   NEW - SECTION ONE
    use-exact-values: true

    max-health: 150
    movement-speed: 0.3
    attack-damage: 20
    ranged-attack-damage: 10
    creeper-blast-damage: 3 #Might need special since unique?
    follow-range: 0
    item-drop: 3 #Unique since LM specific
    xp-drop: 5 #Same as above
    armor-bonus: 15 #Max is 30
    armor-toughness: 10 #Max is 20
    attack-knockback: 2.5 #Max is 5.0
    knockback-resistance: 0.35 #Max is 1.0
    zombie-spawn-reinforcements: 0.3 #Max is 1.0

#   NEW - SECTION TWO
  constructed-multipliers: #Personally would call something alongside 'constructed attributes' just two-cents.
    1-2:
      max-health: 3
    3-4:
      max-health: 5
      attack-damage: 2
    5:
      max-health: 20
      movement-speed: 0.05
      attack-damage: 5
      ranged-attack-damage: 1
      creeper-blast-damage: 1
      item-drop: 2
      xp-drop: 1.5
      armor-bonus: 3 #Max is 30
      armor-toughness: 2 #Max is 20
      attack-knockback: 0.5 #Max is 5.0
      knockback-resistance: 0.1 #Max is 1.0
      zombie-spawn-reinforcements: 0.1 #Max is 1.0
    6-9:
      max-health: 3
      movement-speed: 0.05
    10:
      max-health: 5
      movement-speed: 0.05
      attack-damage: 2
      ranged-attack-damage: 2
      creeper-blast-damage: 1
      item-drop: 2
      xp-drop: 1.5
      armor-bonus: 3 #Max is 30
      armor-toughness: 2 #Max is 20
      attack-knockback: 0.5 #Max is 5.0
      knockback-resistance: 0.1 #Max is 1.0
      zombie-spawn-reinforcements: 0.1 #Max is 1.0

-- SECTION ONE --

In this section, I have a normal multipliers section as we currently have it, however I have added the config option use-exact-values: true. If this is not included, by default we would have false and use the currently established multiplier system as default.
However, with this set to true as demonstrated above, the values listed below would use a different formula when calculating the amount added to the entity (in a similar fashion to how LM originally handled this I believe from memory).

finalValue = defaultValue + ((entityLevel / maxLevel) x configValue)

For example, if I have an entity that spawns in vanilla default with 30hp, with LM maxLevel: 25. Using the values demonstrated above, if I spawned this entity at lvl20, the final amount of health the entity at that level would have is:

150 = 30 + ((20 / 25) x 150)

The final applied HP would be 150hp.

-- SECTION TWO (PART 1) --

In addition to the above section, I would recommend the addition of the following new constructed-multipliers: system of applying attributes to entities in a structured, tiered method. This can be used as the full multiplier arrangement for all entities, or using Custom Rules, they can be limited or adjusted to needs and wants (certain entities being easier at various tiers, or perhaps biome specific levelling structures, or special types of entities at random chance, etc.). As this system was designed for my LM4 ideas, I had to restructure things a bit.

  constructed-multipliers:
    level:
    level-level:
      attribute: amount

This system would use the level assigned by the levelling strategy, and then refer to the table of attributes which are being added together tier by tier to formulate a final attribute value. Below I've copied the first half of this section for easier reference:

For the purposes of explaining how the levels override each other:

  1:
    max-health: 1
    attack-damage:
  1-4:
    max-health: 2
  1-10:
    max-health: 3

If a level has been singled out, such as 1: above, then that will take priority over any other listing of the level within a range.
If a level range fits within another level range, such as 1-4 and 1-10, then the smallest range will be processed first, IE 1-4.
Using the numbers above, the attributes would be added as follows (described in detail below):
default+1+2+2+2+3+3+3+3+3+3

-- SECTION TWO (PART 2) --

  constructed-multipliers:
    1:
      movement-speed: 0.05
    1-2:
      max-health: 3
    3-4:
      max-health: 5
      attack-damage: 2
    5:
      max-health: 20
      movement-speed: 0.05
      attack-damage: 5
      ranged-attack-damage: 1
      creeper-blast-damage: 1
      item-drop: 2
      xp-drop: 1.5
      armor-bonus: 3 #Max is 30
      armor-toughness: 2 #Max is 20
      attack-knockback: 0.5 #Max is 5.0
      knockback-resistance: 0.1 #Max is 1.0
      zombie-spawn-reinforcements: 0.1 #Max is 1.0

As this is arranged, a level 0 entity, or unlevelled, would be considered default vanilla attributes with no change by LM.

For the purposes of this section I will be using a fake entity with the following vanilla attributes:

  • (anything not listed, presume zero/default)
        max-health: 30
        movement-speed: 0.2
        attack-damage: 2.5
        follow-range: 16
        armor-bonus: 0
        armor-toughness: 0
        attack-knockback: 0
        knockback-resistance: 0

On the first line of the constructed-multipliers:, I am specifying that all level 1 entities will be given a movement speed increase of 0.05 from their default values. Since the default for my entity is 0.2mvs, then my new movement speed is 0.2mvs+0.05.

From there we have a tier that includes level 1, even though I have already listed this level. However, since I do not have movement-speed listed within this tier of attributes, there's no worry of conflict. If I had it listed within this range, the override rules would take effect, and the single level would win out on the application of the attributes.

In the ranged 1-2: section:
With Level 1, I would take the entity's default attribute and refer to the table. I only have the max-health: attribute listed, so using the values above, I will take the entity's default attributes and add 3. That means the LVL1 entity has 30hp+3. It would still retain the increased movement-speed: from the prior increase as well.

With Level 2, since it's in the same range, I do the same steps as before. However, I now need to take any prior addition into account. So far all that's been changed was the health. A level 1 entity has 33hp, so a level 2 entity would have 33hp+3. It would still retain the increased movement-speed: from the prior increase as well.

With Level 3, we have our first new tier of constructed attributes. Now we have two attributes to modify: the health and attack damage. Since nothing else has been changed, that means we're still using the default values for those attributes; except for the movement-speed, which was altered previously. We will use the most recent alteration as the added amount.

  • A level 2 entity has 36hp, so a level 3 entity would have 36hp+5, since this tier increases the hp by 5 points per level listed.
  • Since we haven't edited the attack damage until now, we're still rolling with the default value. Since our default was 2.5atk, and this tier adds 2, that means a level 3 entity would have 2.5atk+2.
  • With movement-speed, we are still using the increased amount from the first level increase in the first tier. So that means we are currently still with 0.2mvs+0.05.

With Level 4, we are repeating the same steps once again since it's in the same range. We're going to modify the health and damage again, retaining the movement-speed from prior edits, and any remaining are still at the default values.

  • A level 3 entity has 41hp, so a level 4 entity would have 41hp+5, since this tier increases the hp by 5 points per level listed.
  • Since we increased the attack damage last level, we are now using 4.5atk. Since this tier adds 2, that means a level 4 entity would have 4.5atk+2.
  • With movement-speed, we are still using the increased amount from the first level increase in the first tier. So that means we are currently still with 0.2mvs+0.05.

From here, Level 5 is the same as all the prior steps before, just with even more multipliers. This is getting quite lengthy so I won't bore with this part. Anything not previously established would use the default value, anything that has been established would use the cumulative amount on top of default.

I have an excel spreadsheet that helps explain this, and have included a screenshot with a demonstration of how this would apply over 25 levels with an imaginary set of alterations made. On the left are those constructed-multiplers:, and on the right would be the final amount that the imaginary entity would have at each level, to help demonstrate the effect.

Chart Demonstrating A Constructed Multiplier Being Applied Over 25 Levels

@UltimaOath UltimaOath added the type: improvement Add or adjust a feature label Oct 30, 2021
@lokka30 lokka30 added priority: unknown Needs triage status: on hold Other things need to be resolved before progress can continue status: unassigned target version Needs a future version assigned to it status: unconfirmed Needs confirmation status: waiting for approval Waiting for approval from maintainers labels Jan 9, 2022
@lokka30
Copy link
Member

lokka30 commented Jan 15, 2022

I think achieving the final product of this system is possible in LevelledMobs 4 due to the custom attributes system. It isn't as easy to configure however as this system, as you would need a separate custom rule for each different level gap you want to create. But I think implementing this system might cause bloat and/or confusion. Any thoughts?

@UltimaOath
Copy link
Collaborator Author

UltimaOath commented Jan 16, 2022

LM4 Discussions on formatting:

      attribute-formulas:
        adjust-max-health-multiplier:
          description: 'Changes the max health of levelled mobs'
          entities:
            exclusive-list: ['ENDERMAN', 'WITHER_SKELETON']
          attributes:
            inclusive-list: ['GENERIC_MAX_HEALTH']
          multiplier-formula: '%level-attribute-tree%'
          limits:
            min: 1.0
          level-attribute-tree:
            0-2: '0'  # +0 HP from NoLevel to L2
            3-5: '3'  # +3 HP from each L from 3-5 (Total +9)
            6-10: '5'  # +5 HP from each L from 6-10 (Total +29)
            11-15: '10'  # +10 HP from each L from 11-15 (Total +79)
            16-20: '15'  # +15 HP from each L from 16-20 (Total +159)
            21-25: '20'  # +20 HP from each L from 21-25 (Total +259)

Note from Lokka: https://discord.com/channels/752310043214479462/921225221082611752/932253814260641802

@lokka30 lokka30 added status: confirmed Confirmed by a maintainer priority: normal Normal priority and removed status: unconfirmed Needs confirmation status: unassigned target version Needs a future version assigned to it status: on hold Other things need to be resolved before progress can continue priority: unknown Needs triage status: waiting for approval Waiting for approval from maintainers labels Jan 18, 2022
@lokka30 lokka30 self-assigned this Jan 18, 2022
@lokka30 lokka30 changed the title Constructed Level Multipliers/Attributes Attributes determined via Level Trees Jan 18, 2022
@lokka30 lokka30 added this to the v4.3 milestone Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal Normal priority status: confirmed Confirmed by a maintainer type: improvement Add or adjust a feature
Projects
None yet
Development

No branches or pull requests

2 participants