EliteMobs 8.5.0 dev log and thoughts
Added 2023-04-18 01:59:54 +0000 UTCHello everyone,
EliteMobs 8.5.0 is now out, as well as a lot more content as you have probably noticed. Here's a quick look at what changed:
Dungeons:
- Released the following dungeons:
- The Climb Dungeon ($1 on patreon) - This will become free on April 27th!
- The Cave Sanctum ($1 on patreon) - This will become free on June 1st!
- ?? ?? ???? (patreon)
- Updated the following dungeons:
- Primis (patreon / itch)
- Premium Enchantment Dungeons (patreon / itch)
- The Knight's Castle Lair (itch)
Models:
- Updated the resource pack
- Updated the Goblin Models pack (patreon / itch)
Plugin:
- [New] Created the EasyMinecraftGoals API which allows EliteMobs to start adding custom AI to bosses. It's open-source and GPVL3!
- [New] Changed the way regional boss leashes work, bosses now use EasyMinecraftGoals to walk back to their spawn point whenever possible, creating a smoother experience.
- [Other] Many fixes, tweaks and performance improvements, full change log is available on GitHub.
Funnily enough, this isn't all the content we prepared. The Craftenmine Sanctum only needs to be packaged, The Mines Dungeon should also be ready to go and we should be very close to being able to release the new Oasis chapter, which will introduce NPCs and quest lines, as well as updated mechanics and general improvements to the experience. Dali_ is currently grayboxing the next 3 dungeons, and I've been working on a surprise for BetterStructures I think people will be very happy about.
Which brings me to the two topics I want to talk a bit about on this post.
1) An unfortunate return to bad habits
The mob AI really took up a lot of mental space and stupidly large amounts of time, which I will expand on in a bit. As a result, I inadvertently went back to some bad habits - not releasing content when I should.
As you might imagine, all the content I am currently releasing didn't appear overnight. I've been effectively sitting on it for a while, shelved content for when I had the time and energy to look at it.
This is obviously a mistake. Content piled up further and further, making the task of reviewing and polishing it up for release seem more daunting by the day.
I would like to be able to process things one by one as the team of people helping me create content are done creating it, but sometimes that is just not possible, and this was one such time.
Now that the worst of it is done, I fully intend to get back to a release schedule that sees a steady stream of content coming out instead of massive content drops at an unreliable pace.
2) Mob AI post-mortem
For those of you following the EasyMinecraftGoals saga, you will be happy to know that we have now - and only now - reached its conclusion.
As it turned out, the system worked just fine for the Goals system, which most mobs use. However, newer mobs use the Brain system, and that was not working as intended.
It took many, many hours of reading decompiled code and testing to arrive to a a rather unfortunate conclusion: the Brain system is... bad.
This is for one reason so phenomenally weird that it took me days of testing to make sure it was the case: it is simply impossible to convince Minecraft brains to keep doing one task. Tasks will be cancelled by other tasks, no matter the priority, due to an unfortunate quirk of how states and priorities work.
Without getting excessively technical, if the leash is set to be active during the idle phase, bosses will stop doing the leash when the attack phase triggers. If the leash is set to the attack phase, it turns out the attack phase only triggers very shortly and then has a cooldown hardcoded to it, which basically means it goes out of combat every time a boss hits a player. There are many other issues with how it works, but this gives you just a small glimpse at the madness I was staring at for an entire week.
And yet, I got it working. Unfortunately I had to use the strategy I was trying to avoid: forcing a task to keep the leash pathing active. There is nothing really inherently wrong with doing this, it is how other plugins do essentially all of their AI, but I really wanted to fully integrate these behaviors with Minecraft.
Ultimately I was only successful for the majority of mobs, and the rest will have a slightly more forceful way of enforcing the custom behaviors.
As I mentioned before, I plan to use this API for far more than just leashes. The leashes themselves were done in preparation for the elite shrines release that is about to happen for BetterStructures, and similar pathfinding will be used for EternalTD which I am hoping to be able to resume work on in the coming week. There is also the potential of using it on other plugins, as described in previous posts which I won't rehash here.
In conclusion:
I did not expect mob AI to be easy to reverse engineer, but I was not expecting just how obtuse and hardcoded mojang made their brain system. It is a genuinely baffling AI system, a patchwork monster where every mob type has to override half a dozen things to make it even barely functional.
I am not exaggerating when I say that this really fried my brain. Over this weekend I started tinkering with Godot (a game engine) again, making some game prototypes for fun and to unwind, and it is genuinely easier to make a game than it was to figure out the AI - and it's not even close.
This is now behind us, and I feel ready to tackle the next set of challenges. The recent releases will probably be getting a fresh coat of paint before they are truly finalized - we still need to set up the storyline for players through a set of quests, and the cave boss encounter actually had a really nice soundtrack I still have to put into the dungeon.
I genuinely can't wait to be done with the EliteMobs and BetterStructures releases to be able to work on EternalTD. After all this time focused on EM and BS, ETD sounds like a fun, nice, relaxing break, and we have some really exciting ideas for it. And honestly? I want to play a nice tower defense game as much as I want to develop one right now.
Alright, that's all for now. Based on the previous poll, I will probably be making another update post in a couple of weeks.
Happy adventuring,
- MagmaGuy