Alpha Release: Last of the Events, Mob Scaling, Salvaging, Parties, penalties bonuses - Caltinor/Project-MMO-2.0 GitHub Wiki
This is the nineth alpha and brings the end to event implementations and starts on many features.
Here is everything in this release:
- Last Events (Smelt, Enchant, and Dimension Travel)
- Add client config for toggling whether met reqs should hide or not
- Parties!
- Smelting is the new cooking
- dimension and biome travel effects
- worn/held effects
- fixed xp bonus visual overlap bug
- Salvaging!
- Mob Scaling!
- You now can't be so powerful you break your skill list (kinda)
Smelt, Enchant, and Dimensional Travel Events
Exactly as they sound. you can now set SMELT and ENCHANT events in your item configurations and award xp. Under the hood, this involved completely redesigning how block placement data is stored, but was done in a much cleaner way that should help considerably with server load times.
A Note on Enchanting: Any mod that mixes into the vanilla enchanting menu can potentially break this feature.
Dimensional travel is a setting in the dimension configurations travel_req
and now works. Players who do not meet the req will not be permitted to teleport. (probably need to find a way to make that not kill people jumping into end portals)
Tooltip config setting.
Last alpha I made it so requirements that you have met disappear from the tooltip and if you met them all, the entire category disappears. There is now a client setting to turn this off. In case you like to still see all the reqs.
Parties!
you can now create, join, leave, and invite people to parties. There is a config setting in the server config that determines how close party members need to be to share XP, but all XP will be divided equally among all in range. So if i break a block worth 4 and I have 3 party members in range, we each get 1. works on all XP to include smelting.
Party commands are /pmmo party <create/leave/invite/uninvite/list>
. (Note that "accept" and "decline" appear in the list. these are internal and you won't be able to use them because of the unique parameter they require)
- create: allows you to start a party. If you are in a party, this command fails
- leave: leave your party. fails if you aren't in one
- invite: has an additional parameter for the player you want to invite. fails if you are not in a party
- uninvite: removes an invite for a player.
- list: lists all members of your party
A note on inviting:
- Anyone in a party can invite.
- Anyone in your party can uninvite.
- There is no party owner.
- You can be invited to a party even if you are in one, it will just switch your party.
- The player being invited must be online and will receive a chat message to join
The join chat message has links in the message "Accept | Decline" which will add them to the party of remove the invite when clicked. Invites do not expire, but you can uninvite. Logging out removes you from a party but does not invalidate invites, so you can rejoin
Smelting
Hey, you already talked about this! well yes, but this is important. There used to be two events SMELT and COOK. It's only smelt now. Previous versions of pmmo used logic to determine if an item was food or not. The rework removes that hardcoded distinction. If you want baked potatoes to give smithing, go for it. If you want iron ore to give cooking. go for it.
Dimension and Biome Travel Effects
{
"isTagFor":[],
"bonus": {},
"positive_effect": {},
"negative_effect": {},
"vein_blacklist": [],
"travel_req":{}
}
this is the full json for a biome or dimension. This update made "travel_req" and the effects now function. As a recap, travel reqs for dimensions determine whether you can teleport there. for biomes, it determines if you get a positive or negative effect. If you meet the req, you get the positive effect, if you do not, you get the negative. both are optional, so you don't have to have both to have one or the other.
Worn/Held Effects
this added a new section to item jsons called "negative_effect". This works just like the effects from biomes where you declare the effect by it's ID and give it a level. eg
"negative_effect": {
"minecraft:swiftness": 1
}
This is an optional field and lets you set custom effects for items when their requirement is not met.
Xp bonus visual bug
If you had an item that gave an XP bonus it would sometimes overlap with the raw XP value. this is fixed by adding a bigger size buffer
Salvaging
It works now. if you crouch right click a smithing table the item in your hand will get salvaged. This will first attempt to salvage your mainhand, and if no item is present, it will salvage your offhand. If you have an item in both, it will only salvage the mainhand (unless you rightclick again). as a recap, here is the config format for salvaging
"salvage": {
"modid:item": { //an item you want to be awarded on successful salvage.
"baseChance": 0.25, //the minimum chance, regardless of skill bonuses
"chancePerLevel": { //how much per-level each skill adds to the chance
"skill": 0.01,
"otherskill": 0.25
},
"levelReq": { //the minimum levels to get this item from salvage. (you can have multiple skills)
"skill": 30
},
"maxChance": 1.0, //the highest chance you can get. if this is set to less than 1 you can ensure there is always some risk
"xpPerItem": { //how much XP a player should get from this salvage result and in what skill
"skill": 10
},
"salvageMax": 1 //the max number of this item that can be obtained. if this is greater than 1 the chance will be tried again for each count
},
"modid:otheritem": {} //another salvage result with its own settings.
}
Mob Scaling
It still uses all players in range and averages their skills.
- Range is configurable
- Skills are configurable (and there can be more than one)
- you can set a minimum skill level before scaling kicks in
- You also set a ratio for each skill so you can set certain skills to affect scaling more than others.
Scaling now works off a formula that you can configure. like XP you can use linear or exponential formulas (c
prefix is a config setting)
- linear formula looks like
(cMinLevel - averageLevel) * cPerLevel * cSkillRatio * worldDifficulty
- exponential Formula looks like
cPowerBase ^ (cLevelMod * (averageLevel - cMinLevel)) * cSkillRatio * worldDifficulty
that formula is used for each skill and their outputs are added together to get the final bonus
So if we used
[HP_SCALE]
combat=0.05
endurance=0.001
we would get the average level in combat and endurance for each nearby player and run each through the formula and add the outputs to get our final mob scaling value. It is also possible to use negative values to create counterbalancing skills.
Note: read the tooltips in the config for how to set your values. Some ratios work different than others
So OP it borks
There is a current bug where the max level can be higher than the maximum possible level base on the formula. The limiting factor is the size of a long
variable. If your formula increases level thresholds at such a high rate that you get to Long.MaX_VALUE
in XP before your level reaches the configured max_level, then it used to crash the skill list. I made it not crash the skill list now, but you still can set max_level greater than the formula. You now get a level of "NaN", which will remain until I can fix the formula calculator to scale off of max level.
Testing Notes
- Parties need testing. I am one person, so it's hard to test group features.
- Please give feedback on default settings. I put arbitrary values into the configs that are not usually balanced. Any feedback on balance is appreciated.
- Just test the new stuff and make sure it works as intended.