Waystones

Waystones

123M Downloads

XP Cost Rework

BlayTheNinth opened this issue ยท 2 comments

commented

XP Cost options are currently too confusing for users while simultaneously not offering enough flexibility.

  • When we charge points as xp cost, teleports will always cost the same amount (i.e. we can make an equivalent of 1 creeper killed = 1 teleport)
  • When we charge levels as xp cost, teleports get significantly more expensive as the player reaches higher levels (i.e. it would take a lot more creepers killed to teleport at higher levels)
  • It's unclear whether the current cap options apply only to distance-based xp or total xp
  • It would also be nice if there was more control over how dimensional teleport or leashed animals alter the cost (right now dimensional teleport is always fixed and can not be distance-based, which tbh with the coordinate ratios would be difficult either way but might still be worth looking into)
  • The UI is currently limited to 3 levels max and would not be meaningful when charging points
  • ...
commented

Not sure if overkill or genius:

To allow for maximum flexibility while avoiding a full-on expression engine and keeping the end-user view simple, we could allow datapacks to define xp cost expressions as json that can then be referenced in the config:

data/waystones/waystones_cost/distance_based_xp.json

{
    "type": "xp_cost",
    "op": "multiply",
    "src": "block_distance",
    "default_value": 3
}

data/waystones/waystones_cost/dimensional_add_levels.json

{
    "type": "level_cost",
    "op": "add",
    "default_value": 3,
    "condition": {
        "type": "waystones:is_dimensional_warp"
    }
}

data/waystones/waystones_cost/global_multiply_xp.json

{
    "type": "xp_cost",
    "op": "multiply",
    "default_value": 0,
    "condition": {
        "type": "waystones:target_waystone_is_global"
    }
}

data/waystones/waystones_cost/max_xp.json

{
    "type": "xp_cost",
    "op": "clamp_max",
    "default_value": 27
}

waystones-common.toml

enableWaystoneCost = true

waystoneCost = [
"waystones:distance_based_xp",
"waystones:dimensional_add_levels=1",
"waystones:global_multiply_xp",
"waystones:max_xp"
]

where

  • these will be applied in order
  • dimensional_modifier_levels value is being overridden to 1 instead of the default 3
  • both levels and xp cost can be present simultaneously, being combined (i.e. a warp may cost 3 full levels and 20 xp)

Then set a sane default, and use the boolean config on whether any cost should be enabled at all (because mostly people either care about it costing or not costing, and if they care about the details they can take the time to understand the system).

This would also be open enough to allow for other forms of cost. In theory would allow for items or advancements to be a "cost" and create a waystones progression in which certain sharestones become available, or travel becomes free, etc.

commented

Final format:

costModifiers = [
    "[is_not_interdimensional] scaled_add_xp(distance, 0.01)",
    "[is_interdimensional] add_xp(27)",
    "[source_is_warp_plate] multiply_xp(0)",
    "[target_is_global] multiply_xp(0)",
    "min_xp(0)",
    "max_xp(27)
]

No datapack stuff, but conditions and modifiers can be extended through the API.