Since long, long ago, back when I didn't have a computer, a YouTube channel, or 4,000 hours in CS, I’ve had the idea of creating my own Minecraft mod. But, to be honest, I just couldn't bring myself to do it for many reasons. For instance, due to a complete lack of programming skills. However, neural networks have now given everyone the opportunity to create their own dream mod. You just need to have some imagination. So, why shouldn't I give it a try? Naturally, I had already thought through exactly what my mod would be. I want to create a friend for myself, someone who will exist alongside me in single-player . Someone I can go mining with, or who can go mining on their own if they want to gather the resources they need. Someone who will farm, help raise animals, and be more than just a helper —a full-fledged character with their own story, personality, desires, interests, and relationships with the player. And I do have friends, okay? I am not lonely at all. I downloaded everything that needed to be downloaded to work with mods. But since I’m not well-versed in Java, the language mods are written in, I decided to enlist a neural network to handle the routine parts while simultaneously answering a billion of my questions about the code. My job was to figure out the logic of that code, as well as rewrite the flaws and blunders of the AI, of which there were quite a lot. The first thing created was just a cube with eyes, just to see how to work with Minecraft mods. Alas, at this stage, it was just a motionless dummy without any programmed actions. And to fix that, I connected it to behavior patterns already present in Minecraft itself. Like walking back and forth, looking around, floating in water, and reacting to damage. For all of this, by the way, I hadn't even used the neural network yet. I did a good job. Now our friend has a primitive brain, comparable to the brain of...Since I want our new NPC to look like a player, I gave him a player-like body. And at this stage, it would be nice to give him a name, too. Let's call him Akakiy. A good name. I started by trying to give our Akakiy some sight. It worked quite primitively, but it performed its function perfectly. Akakiy learned to identify ore that came into his view, and later even managed to mine it. Only, as it turned out later, I had rushed things a bit too much. >> myself. >> By the way, Honkai Star Rail recently released update 4.7. For those who don't know, Honkai Star Rail is a space RPG from the creators of Genshin Impact, which was recognized as the best mobile game at The Game Awards. In the current update, the two-dimensional storyline concludes, where the Beast of Insatiability sleeps, capable of devouring an entire star system. For over a thousand eras, it was kept in check by the Fountain Game show, where the winner becomes a god for a minute. But this time, the Aeon of Elation, Aha , is personally hosting the final games among the stars to put an end to the beast forever. The Aeon of Elation is an ancient deity who embodies joy itself. Despite this, the deity decided to live the life of an ordinary person, becoming a carefree girl who simply loves drawing comics. She does what she wants and often pulls things off in her own way with unexpected jokes and absurd tricks . But hidden behind all this is a long and mysterious past. And she is the one you will be able to add to your team. In battle, Aha puts on a real show. With a magic wand in hand, playing cards swirling around, the entire battlefield turns into a massive stage. She also buffs allies on the Path of Elation and reduces the enemies 'maximum health. Honestly, it looks absolutely stunning. And since we’re talking about joy, there have to be gifts. Just for logging in, you will receive a free five-star character of your choice , and for checking in—Comet Gifts and 20 more Warps. Also, a new season of Star Wars starts with new bonds, and along with Aha, Sparkle, Yaoguang, and other beloved characters return. Download the game via the link in the description and pinned comment, meet Aha, and grab a promo code for 50 Stellar Jades. Enjoy the game. Pretty quickly, I ran into the fact that our Akakiy is very bad at pathfinding. He constantly gets stuck, doesn't understand where his target is, and overall just acts really dim. And that's no surprise. As I said before, at the moment our Akakiy is connected to the brain of a cow, and a cow's route-planning algorithm is, well, let's say, primitive. That's why I deleted the first version of Akakiy and started from scratch. And first, it would be good to give him decent pathfinding. The task turned out to be non-trivial. I had to study a bunch of videos, articles, examples from other games, and in particular, modifications within Minecraft itself that had already done something similar. All this helped me figure out how to teach Akakiy to find his way properly. And let me try to briefly explain how this is supposed to work. Let's imagine Akakiy's task is to get from point A to point B. To build a route, he will iterate through every tile toward point B until he finds the cheapest path to his assigned target. Such a search algorithm is called...but movements in Minecraft aren't limited to just walking forward, backward, right, or left. There's also jumping, running, ladders, swimming, falling, breaking, building, and, god, I’ll get tired of listing them . Each of them is appropriate in one situation and inappropriate in another. And for the algorithm to correctly build a suitable route, you need to work with how much each listed move will cost. Let’s take two simple actions as an example: a step forward by one block and a jump over a block. Let's forget about running for now. Let’s assign a conditional penalty to our two actions. Five points for a step forward by one block and 13 points for a jump over a block. The bot’s task is to get from point A to point B while receiving the fewest penalties. With a correct penalty system, the bot will travel a straight path without a single jump, as it is simply cheaper. However, if we slightly curve our path, it becomes more profitable for the bot to shorten the route with a costlier jump to get a lower penalty. Everything said above is a very simplified scheme that does not account for other movement options and a huge number of checks. For example, so that the bot doesn't try to walk through a wall. At first, I taught Akakiy just to move in space—up, down, avoid obstacles, and find an advantageous route. Doing all this was quite simple and took no more than a day. But when it came time to teach him to jump, that’s where the little problems started. Well, just teaching him to jump wasn't hard, but jumping correctly—that was already difficult. Right away, problems arose with slabs and fences, since the original algorithm only accounted for jump distance from the center of a full block to the center of another. Non-full blocks differ from normal ones by being higher, lower, or having a different shape entirely, which my algorithm naturally didn't account for, causing Akakiy to constantly get stuck, glitch out, and fall. To solve this problem, I delved into the real physics of Minecraft. I studied how the code itself works, measured walking and running speed, as well as jump range and height, then created formulas from them, based on which the AI helped me write buggy code that I then had to fix myself. What? Huh? But why? What do you mean in seconds? Ah, it it gave me ticks it gave me What ? Did it convert ticks into seconds for me? Th-these are ticks. Ticks! >> After a huge number of edits, my efforts bore fruit. I ended up with an algorithm capable of understanding quite well where and how to go, able to run, jump far, and even complete parkour that was quite difficult even for me. Moreover, you’ve likely noticed that in Minecraft, moving by hopping is faster than just running. And Akakiy also started actively using this. What's more, he figured this out on his own. I didn't teach him that. The algorithm took the data from my measurements and my formula and calculated this method of movement to be more efficient. Over time, Akakiy gained more and more skills. He learned how to use various doors and gates, climb walls, use his inventory, build structures, and dig his way through blocks. Moreover, when plotting a route through blocks, he takes into account the tools in his inventory and decides for himself how to get there faster and easier. However, there is one skill I never managed to teach him. That is swimming. >> Man, you are so annoying. >> Well, to be more precise, he knows how to swim and does it well, but there's a huge chance he'll run into another bug that prevents him from reaching the end of his route, and he ends up dying. I tried for a long time to sort out this situation. However, every time I fixed one bug, two new ones would pop up. And to be honest, I was already pretty fed up with working on pathfinding by that time, so I simply set a high penalty for entering water to give him a kind of fear of water, so that he would avoid it as much as possible. But that became a great foundation for Akakiy's future personality. Speaking of personality. Watching Akakiy time after time go through the parkour section I built and get out of various caves, I realized one thing—he's not actually alive. He has no character whatsoever. Right now, Akakiy is completely soulless. He's just a mediocre pathfinding algorithm without any interests, desires, or needs . Even his appearance looks soulless. That's why I decided to start with Akakiy's look. I’m sorry, but the default Alex skin, and especially Steve's, doesn't really do it for me. So I started looking for a new one. I didn't take long to choose, as I already had a vision of exactly what my friend would look like. I adore black cats. Like, really, a lot. I can't help myself. That's why I chose a corresponding skin, later tweaking it just a little bit. I also gave him a new name. Now our friend's name is Borya. However, a skin and a name aren't enough to make Borya feel more alive. His eyes are still empty. So, after experimenting a bit with the mod's code, I managed to turn these static skin eyes into real ones with actual moving pupils that blink, change based on his mood, genuinely look at objects, and react to events happening to Borya. Naturally, I wasn't going to stop at just the eyes. Borya needs to be able to speak and react to the world around him . Teaching Borya to speak is actually not that hard of a task. He won't have a real voice; he is a cat, after all. So, for the base, I downloaded cat sounds and organized them by mood. And Borya " speaks" the words as text, right above his inventory, so that they are easier to read. But what he will actually say— that is a painstaking job. Because it was important to me that Borya stood idle as little as possible and reacted as much as possible to what he encountered, saw, or heard, so that he would comment on what was happening to him. And what do you see most often in Minecraft? That's right, mobs. That’s actually where I started. I wrote a few phrases for every peaceful mob in the game. And Borya reacts to each of them in his own way. He doesn’t really like chickens, and he has some unpleasant childhood memories associated with horses. And he just doesn’t get cows, but he still likes them—they’re tasty. And I specifically tried to write as many unique phrases as possible, so that Borya would repeat himself less and seem more alive. Besides animals, Borya chatters about the sun, the moon, and thunderstorms. And to some things, he not only talks, but also reacts. He runs away from bees, for example. He gets scared if lightning strikes near him. Borya won’t stand in the rain; he’ll go look for a place to hide so he doesn't get wet unnecessarily. After all, he is afraid of water. But if he has to get into the water, for example, to reach the player across a stream and there is no other way, he will do it reluctantly, but he’ll definitely remind you about it later. And for that, I still had to tweak the pathfinding in water a bit, curse it. It’s still buggy, but not nearly as bad anymore. And also, if you stare at Borya for a long time, he’ll notice and will definitely say something. And he certainly won’t stay silent if you light TNT next to him. Why would anyone even do that? And this is all just the beginning. The more Borya is capable of, the more he will have to say and the more different situations he will be able to comment on. So, I will return to his phrases more than once later in the video. Now for a question that has plagued me since the very beginning of the mod's development. Where will Borya live? Let me explain. One of the mechanics I planned is mining. Meaning, Borya will either on his own, with the player, or at the player's request, go into a mine to gather resources and bring them home. But what is "home" to him? Where exactly should he take the resources? For us, the answer is simple. Home is the place where we live, where we keep our things , and so on. But Borya is not us; he’s not a human, he’s an algorithm trying to imitate a human. How can this algorithm understand what a home is? At first, I wanted the player to be able to mark the home territory themselves, but I quickly realized that wasn't a great idea. Afterward, I thought the algorithm could define a home by the bed and chests placed by the player. But there are often situations where they might be outside the house. After thinking it over a bit, I settled on the following system. Let's imagine the player places a couple of wood blocks. As soon as they do that, the game immediately notices and asks a question . Is this a house? And it immediately provides an answer in percentages. The current work of art looks little like a house. Accordingly, its percentage will be low. Now let's turn it into a box. That looks more like a house, but it still isn't one. Let's add a bed, a crafting table, furnaces, a pinch of chests, and slap a door on the outside. Now that definitely looks like a house. But how exactly does the algorithm evaluate all this? Basically, every object placed by the player has weights that add percentages to the final score . Each item has its own. It's a rather primitive system, but I couldn't come up with anything better. Borya, by the way , can also notice that you've started building a house, and his reaction will depend on exactly where that house is and how complete it is. If the house is in a cave, he has one set of lines. If you take a house from a villager, he has other lines. For a witch, it's a third set. By the end of this video, I had written over 10,000 lines in total. And more than half are such rare and specific situations that I can't even imagine how to stumble upon them accidentally. Now it would be nice to make Borya more useful. I started by teaching him how to mine wood. Borya will either come to help at the player's request or on his own when he sees the player mining wood . And here, too, I tried to think through many different situations, which, in my humble opinion, made the wood-mining mechanic turn out quite well. But wait, he won't go to chop trees just anywhere. He doesn't like water, as you remember. Well, we've taught Borya to work, let's also teach him to get tired . I added a stamina indicator for Borya , which depletes over time. It doesn't just deplete on a timer, either. The more Borya engages in various activities , the more tired he gets. If Borya gets very tired, he will move slower and start begging for a bed, and if he gets completely exhausted, he will simply collapse in a faint. So, he will periodically need to get some sleep. You can tell that Borya is tired by his eyes or by looking at a special window that shows all his indicators. Here you can see his camera , where he currently is, his HP, fatigue , and hunger. Speaking of hunger, by the way. Yes, Borya will also get hungry, just like us. He will also need to eat something occasionally, because on an empty stomach, he will get tired even faster. And if he goes too long without eating, he will start losing health. To satisfy his hunger, Borya will first check his own inventory, then he'll look in a chest. And if that's empty too, he will go find food himself, prowling the area for animals. And as a last resort, he will ask the player. But Borya doesn't just think about himself. If he sees the player is hungry, he might share his food with them. Often, by the way, that's food I gave him myself or that he swiped from my chest. That was a kind of Now it's time to discuss how Borya will fight enemies. And he won't be fighting at first, by the way. You see, Borya is a cowardly kitty, so if a scuffle breaks out, he'll hide behind the player or run back home. At worst, he'll bury himself in blocks so the mobs can't reach him. But he will cheer you on while you fight the mobs. But he won't stay cowardly forever. The more time Borya spends with the player, the more he learns. Specifically for this, I thought up a skill tree and tried to make it look as nice as I could. I made all sorts of animations for it in After Effects, so that clicking the buttons would be interesting. In short, I obsessed over things I really didn't need to obsess over. One of the skills in that tree will actually be combat. As soon as the player levels up this skill , a separate combat tree unlocks for Borya, and he'll start fighting back against foes. Of course, he's still wary of taking on a huge crowd of skeletons or creepers, but he will try to help the player anyway. And the more he practices in battles, the more experience he'll gain, and the more skills he'll be able to master in the future. What's more, Borya also decides whether to fight or not in a smart way. Just like with the house, a smart algorithm weighs the enemies and his chances of victory. And based on these chances, Borya's behavior during the fight, and even his dialogue , will change. And as I'm listing all of this to you now, it might seem to you that I just told the AI something like " please make him know how to use swords. " And it just did everything perfectly right away. Hell no. If you do that, the AI will create a buggy piece of code that won't work as it should at all. And fixing that whole mess later would take much longer than if I had thought through the correct logic beforehand. Borya has more or less learned to fight , but there's a place much harder for me than a crowd of zombies: the mines. And here, everything will be set up for me roughly the same way as it is for combat . Initially, Borya is afraid to go down into the mine. It’s dark there and full of scary monsters, but that changes the moment Borya gets the necessary upgrade . However, Borya won't just pick up a pickaxe right away. At first, he’ll just walk around the mine, examining structures with interest and helping the player spot ores. And after a while, Borya will pick up a pickaxe himself and start mining the ores that his level allows. And, naturally, everything is upgraded in the skill tree using the experience he gains alongside the player . Eventually, after reaching a certain level, Borya will even learn to go into the mine on his own and gather resources there. In general, I wanted to make Borya more independent and less dependent on the player. For example, right now, Borya only gets new tools thanks to the player. That is, only if the player gives him the tools themselves, say, an iron axe, will he actually have it. I, on the other hand, was trying to figure out how to make Borya craft the items he needs himself. In reality, it’s not difficult to come up with a sequential crafting algorithm . The hard part was keeping it in my head , so I asked an AI to create this node-based thing for me, where I could think through the algorithm and gradually build it into a system. And this is roughly what the tool crafting algorithm looks like. But at least the AI clearly understood what was required of it. And as a result , Borya learned how to craft tools for himself. And I think I’ll stop there. Right. How is it done? You know, for you, this video lasted 20 minutes at most, but for me, it’s been 3 months of working on the mod without a single day off. And, in my opinion, that's a bit much for something I just wanted to try out. Honestly, I didn’t think I’d get this hooked. The mod still has a lot of problems and a lot of bugs. It’s quite raw and, in some places, even unplayable. And many mechanics are still stuck in my head, and I never actually implemented them. The same goes for farming and animal husbandry. But for now, I need to take a little break from all of this. I will definitely post this modification on my Telegram channel. I don’t know which side this thing will appear on. There, you will be able to download the modification, play it, and give your feedback. Well, actually, I don’t know if I’ll continue working on this mod. For the most part, it will all depend on your reaction. Yes, this is everything I’ve been doing for the last 3 months. That’s all, love you all, kisses to everyone. Bye.