#AuraMobs ideas (and a little AuraSkills)

1 messages · Page 1 of 1 (latest)

warm glade
#

For performance

  • I don't think BigDecimal is required here. You can use basic math to round/setScale a number to have 2 decimal places if necessary.
  • ExpressionBuilder has variables. Instead of replacing the strings directly and always creating a new ExpressionBuilder, you can use its variable system.
  • That PlayerMoveEvent for mob name display range is hurting me. World#getNearbyEntities will select the chunks based on the range and will loop through every entity in those chunks. Any other solution would be better I think. Like storing the mobs for every chunk in a Map and based on player from/to positions and range, only get those mobs. Now you are not checking for a million cows when a player just farming or a million random dropped entites. I'm not sure how taxing getNearbyEntities is, but I have my worries when it comes to calling it every player move, which, well, happens kind of frequently. Maybe I'm just overreacting and this would never reach to a point where it becomes a performance issue, I don't know, it needs testing for sure.

Gameplay

  • Why do you exclude bosses from leveling? I think it would be fun. If you max out your skills, a zombie shouldn't be harder than a wither boss.
  • It would be great, if these AuraSkills loot pools could support items from external plugins. Either via first party support or/and through the AuraSkills API. Not just for mobs, but for the other things as well, I think the API solution is preferable, since many plugins already add or may add support for AuraSkills, and circular dependency loading is really not a good thing to have, it is such a pain.

If you like any of these ideas and you need any help, I'm able to help in most of these when I got some free time. If you don't want/need help, I can also just write addon plugins for the loot tables using the API (if you update it) to add support some third party plugin items.

serene coral
#

I actually didn’t write most of AuraMobs lol it was transferred over to me so I know how bad the expression performance is. The only thing I did was rewrite the config and message loading and make it work with AuraSkills 2.0. My plan was to change the expression library to EvalEx to match AuraSkills but idk if it still doesn’t work with variables containing curly braces.

warm glade
#

Yeah I didn't want to blame you. My primary language is not english, sorry if it came through like that.

#

EvalEx supports variables. I didn't heard from it before, only used exp4j. Is it better?

serene coral
#

I know you can create the expression object once and reuse it for evaluation

#

not sure if it’s actually faster though

#

Also for the custom items in loot idk if you know about the item registry with /sk item register? You do have to do it manually in game but that means it can support any item.

warm glade
#

Yes I'm aware, but I thought it would be just way more easy to just write:

  • plugin:itemid in the config.
    It is also more resilient for nbt changes if a plugin just decides on using a new format or if you just change that item in the other plugin and it gets new nbt. Then you don't need to reregister it.
serene coral
#

yeah I see the benefits and had thought of first party item support before. Which plugins are the most popular for that? I know of ExecutableItems

warm glade
#

I think MythicMobs/MythicCruciable and MMOItems for sure. ExecutableItems also. Maybe EcoItems (I'm not a fan of eco plugins though, but it doesn't really matter). Oraxen/ItemsAdder for sure.
(MMOItems for example and eco already depends on AuraSkills or AureliumSkills for now)

#

I know people doesn't like multiple jar files, but I'm very much certain, they doesn't like circular dependency loading issues as well. And the latter one is also the one that the developers doesn't want to deal with as well.

serene coral
#

Skills and loot tables are loaded after all plugins load so I don’t think circular dependencies will be a problem bc I don’t need to soft-depend

#

Even then I can defer ItemStack construction to drop time like I do now to support EcoEnchants

warm glade
#

it is great then

#

Oh, and to add something more to the suggestion, if mob loot tables chance could vary based on the killed mob level, that would be very great. This way you can delay stronger items and it isn't just based on the luck. An avg level 1 player shouldn't get some way too powerful weapon/armor/item

#

Sorry, not vary the chance. I meant that you can lock certain loot pools if the killed mobs didn't reach a required level

#

I mean, yes, it is possible to add a skill requirement to the item

serene coral
#

would probably have to add an event like LootPoolSelectEvent for that so there isn’t a circular dependency

warm glade
#

yes

#

but if you add that event, you created even more chance for other plugins to be compatible

#

which is great, if you put all the info in the event

#

and you can create or use the existing extra drop event to notify everybody the extra drop from the lootpool. (if you don't do this already)

snow crystal
#

To add on to the entity side of what was mentioned here, yes you should definitely change the getNearbyEntities, that will kill large servers for sure if it’s called more then a tiny bit.

Similar to what they said you could introduce a cache system, add mobs to the cache on either a chunk load event or something similar, and remove them from the cache when they unload/die/get removed from the world.

Typically these kinds of caches are made using the uuid and using Bukkit#getEntity when you need the entity.

If you need any help with it I’ve worked on and rewritten multiple systems to use caches instead of loops like that so I could help

serene coral
#

Help on optimizing the MoveEvent would be great, idk how many edge cases would need to be accounted for for mob spawning/despawning and mobs moving around

snow crystal
#

I’ll have to look at what it actually does

warm glade
#

Same optimization when mobs are spawning would be nice as well. Since that is an even bigger radius, although it is way less frequent

serene coral
warm glade
serene coral
#

yeah but we can't use the Paper API for it to be allowed on SpigotMC

warm glade
#

Does anybody even use spigot anymore? I mean, why would anybody not just use paper instead

serene coral
#

I mean to be able to be listed on spigotmc.org, then I would have to take the resource page down, which would reduce the visibility of the plugin

warm glade
#

PacketType.Play.Server.REL_ENTITY_MOVE from ProtocolLib might help then, but it will be significantly harder I think.