SamuKata
magmaguy
magmaguy

patreon


Minor announcement – Custom AI (blogpost)

It seems as though there is some interest from you, the patrons, in keeping a development log of features of particular interest. As such, this blogpost comes with a vote for whether I should continue publishing these as I am or, if you would prefer, I restrict the posts on Patreon to be at least mostly about new content releases.

Today I released EliteMobs 8.4.5-SNAPSHOT-3 with the following changelog:

- [New - custom AI] Regional bosses now have AI that makes them walk back to the spawn point, increasing efficiency

- [New] The EasyMinecraftPathfinding has been renamed to EasyMinecraftGoals as it better describes what it does

- [New] The remove command can now also remove treasure chests

- [Fix] Fixed an issue where the dismiss option for hints was not getting read correctly

- [Fix] Fixed typo in magma cube configuration filename

- [Tweak] Zones that display particles now default to a .3 coverage, fixing issues where certain zones had too many particles and generally improving performance

- [Tweak] Increased the roam speed of regional bosses

Now, obviously something quite important has happened since the last blogpost – the bosses no longer just have custom pathfinding, but certain features have outright been replaced with custom AI.

The reason why I went down this rabbit hole was quickly caught on by some of you in the previous release – efficiency. The pathfinding I added in snapshot 2 was only meant to test the library integration as a whole, and once applied to the hundreds (or thousands, depending on the setup) of regional bosses, things got real slow real fast.

Fortunately, this was because it was just a placeholder implementation of pathfinding, and one that could easily be fixed. However, as I took a closer look on how to make the system truly efficient, some interesting ideas started coming to mind.

The original leash system in EliteMobs was one of the heaviest features of the plugin in terms of computing power. This is because it works against all vanilla behaviors and requires doing some mildly complex operations at a truly massive scale, depending on how many elites were loaded at any given time. It was made worse by how visible it was – every single time, without fail, bosses would just phase through everything, flying back to their original location. Minecraft isn’t the most immersive game out there, but this is something that can really take you out of the little suspension of disbelief you have.

However, after spending a combined total of probably well over 60 hours reverse-engineering how Minecraft AI is supposed to work (fun fact, there are actually 2 completely different AI systems), I knew for a fact I could get rid of the existing leash system and replace it with something far more integrated with the game and far more interesting.

So that is what I did.

Starting with this version, both the soft leash and the hard leash of mobs are now handled by custom AI that is assigned to specific types of regional bosses. I tried to take extra care to make these leashes highly efficient and as invisible as I could, although further tweaks are likely to come as I gain further knowledge about these undocumented systems and feedback rolls in from users.

This not only results in a massive efficiency gain for your servers and a much better integrated leash mechanic, but it also brings with it some improvements even for hard leashes. Whenever possible, bosses will now always prefer to run back to their spawn point instead of teleporting there. Due to several constraints, this will not always be the case, especially when some geometry is in the way or the bosses have no path back, but it is quite nice to witness when it works as intended. I plan to improve the pathfinding with my own solution very soon, which will make the bosses significantly more likely to run back instead of teleporting.

This, combined with the tweak to particle zones, should result in an overall smoother experience for both your server and the players experiencing the content.

I found the experience of creating my own AI to be really fun once I got over the initial hurdle of figuring out how to inject it into Minecraft. While working on it, I couldn’t help but to think about some old Spigot plugins I once used to create server we called Hell in which we installed only the most extreme difficulty mods.

I was particularly fond of the plugin that would modify zombie behavior so they would actually build blocks to go up or mine blocks to find their way to the players. It was insanely hard, hardly fair, the plugins were so poorly optimized TPS dropped after 4 hours and the server had to restart every 6 hours and I got spawn camped so many times I wanted to bite my keyboard. Remembering the slow scratching noises very slowly digging their way up from the underground to the floor of my base still puts me on edge – a long time was spent trying to figure out how long I had before they popped up and trying to figure out where exactly it was coming from.

It was some of the most fun I had in Minecraft, and a true survival experience as no matter the base design, no matter the materials, no matter how careful you tried to be, you would eventually die even if you just tried to hide at home.

Now that I have some experience with AI, this is something I would potentially like to recreate as a side project not associated to EliteMobs (though with EliteMobs integration). A system made for temporary servers or temporary maps, as maps get absolutely annihilated after running this kind of system for a few days.

If you think this would be an interesting plugin to have, do let me know – people showing interest in ideas is a big part of why some ideas go forward and others get shelved.

In closing, I want to say that once again I failed to release the dungeons I have queued up and ready for release, and I apologize for that. I am not exaggerating when I say that working on figuring the AI out has taken close to every waking hour since the last release. This time I will really work on the dungeons, as I have no plans for adding any other features for the public release – the only modifications I will do to the code are fixes based on feedback.

The good news, though, is that Dali_ finally finished the BetterStructures premium shrines pack for BetterStructures with EliteMobs integration. Internal testing has us believing that you will particularly enjoy this one, with nearly 100 new builds with completely unique elite bosses, powers and loot. We are just putting the finishing touches on it, and it should be out in the coming days.

That is it for now. I’ll be back in a few days with a ton of fresh releases for you!

Happy adventuring,

- MagmaGuy


More Creators