Skip to content

Alpha Release: Basic Experience and Configuration

Caltinor edited this page Jan 13, 2022 · 1 revision

This first release contains a lot of features despite doing very little in-game. However, this version drastically changes how xp_value_x configurations are set up as well as the values used in all configurations.

First, a technical note. This version of PMMO officially uses long as the xp storage type, and eliminates any usage of double as an xp value. this means that 1.25 is no longer a valid amount of experience. Modifiers, however, are still doubles. Take note though, that these are flat multipliers in most cases, so 1.1 = 110% of value. and 0.9 = 90% of value. Before, you would have had to use negatives to reduce xp, now you just fraction it.

The New Overarching Structure

In order to make PMMO more accessible for addons and give the core structure some additional flexibility, the core mechanic of PMMO (xp gain), now looks as follows:

In the above diagram, the following features are staged, but not implemented in this alpha release:

  • any API references (reqs, xp awards, events, and perks)
  • Auto-Values
  • Anti-Cheese

What this leaves behind is a few very core features upon which pmmo 2.0 will be built on:

  • Award Events
  • Skills and XP Values
  • Modifiers

Award Events

are all of the conditions upon which pmmo watches and awards experience. Currently there are 58 planned. In this alpha, only one is implemented BLOCK_BREAK. A note about this event as it pertains to this implementation. There is an upcoming event BREAK_SPEED which happens before the block is broken. This event will, when implemented, intercept the block break requirement and notify the player before they spend 45 seconds trying to break obsidian only to find out they aren't allowed. In the current alpha, the block simply doesn't break. This is test behavior.

Requirements

tool and armor requirements are not in this alpha. only block break requirements. Tool reqs will be checked in the BREAK_SPEED event once implemented. However, there has been not change, to how requirements are structured to date. The format below remains in place.

"modid:item": {
  "skill": 1234
}

note that only req_break.json is being checked at this stage. Another point is that players without skills now have level 0 (zero). when setting up cnofigs, if you want to make something accessible to all players, zero now works. before, 1 was the lowest level.

one final note, while this structure has not changed to-date, it is very likely it could be changed to match the format of the XP awards in the next section. this will entirely depend on how granular req configurations end up needing to be.

XP Awards

this is probably the biggest change and the real reason this alpha is being released with so few features. the old xp_value_x.json structure has been replaced. Because we now have 58 events that you can hook into, it meant we would have a massive folder with 58 files that you would have to build and validate. Instead, we now have 3 files value_block, value_item, and value_entity. Their structure is also new to account for this inversion of the event/object relationship. new entries now follow the following structure.

{
  "modid:object": {
    "BLOCK_BREAK": { 
      "skill": 1 
    },
    "ANOTHER_EVENT": {
      "skill": 20
    }
  },
  "#forge:stone": {
    "BLOCK_BREAK": {"mining": 10},
    "BLOCK_PLACE": {"building": 1}
 }
}

the basic format is in the first entry and a real example is the second (bracketing formats are purely preference)

Tags still work, so you can still use them in this version.

As more events are enabled, you can add extra entries according to what you want captured by that item/block/entity when the associated event fires.

XP Formula

this is located in the server config. (more in final notes at bottom of page) Please test changing these settings live. There is a small feature where I recalculate the levels using this setting after it is changed, and I would like to see if it works as people expect it to.

XP Modifiers

As noted before, anti-cheese is not implemented, but bonus_biome, bonus_held, bonus_word, and bonus_dimension are. Technically multiplier_entity is implemented to, but since there is no damage event yet, it doesn't do anything.

The format for this config has remained the same "modid:object": {"skill":1.1} however, the values have changed. Recall at the beginning of this page I mentioned that double values are flat modifiers. Here is where that becomes important. suppose you want a piece of armor to give 20% to mining. your entry should be "mining": 1.2. likewise you can lower gains. for example if you want an armor to give combat but cause the player to suffer mining, you could do

"modid:item": {
  "combat": 2.0,
  "mining": 0.1
}

which would double their combat gains but reduce their mining gains to 10% of what it was before.

Testing Notes

for those of you eager to test this alpha, here are the things you need to know about the build

  1. There is only one temporary command implemented /mystats which will display your current skill levels
  2. There is no display of modifiers or XP in game (ie tooltips). this is a much later feature as I have a really performant means I want to implement
  3. no /pmmo reload so you will have to reload the world. note, not the game, just the world. the configs are read on server/world load
  4. MsLoggy is a new logging control feature that allows you more control over what shows in your logs, including detailed printouts of your registered configs. if you turn this setting in pmmo-common to true, you can see in your log if your setting actually loaded. I found this useful when I tried to use "#forge:dirt" only to find out forge removed it because MC has its own "#minecraft:dirt"
  5. forge configs: As much as Harmony dislikes them, I did decide to return to using forge configs. Therefore, there will be 3 places that you can find your config settings. those that affect only your client, are in pmmo-client under the root config folder. pmmo-common is located in the same place. Server settings however, are located in worldname/serverconfig/pmmo-server.toml. note that the server config has the xp formula settings.
Clone this wiki locally