top of page

Kratos - Adding Classic AI to Minecraft

SmileyDude

Kratos is a classic AI whose goal is to hunt down the enemy player and stop them from beating the game. Greatly inspired by the series of Minecraft Manhunt videos by Dream, Kratos knows your location at all times, and has a fully autonomous lifecycle.


He will collect his own food, gather his own resources and craft his own armour and weapons. He will mine through the ground to reach you, or tower into the sky to chase you. He will set you on fire when he has the chance, and avoid lava and save himself from dangerous falls.


Kratos, in Greek mythology and video games, is the God of War, and an all-round destruction machine. I took this as inspiration to building the Minecraft bot who has access to all the game-world information, and takes the optimal path to reach his goals of collecting tools, and defeating the enemy player.


Kratos originally started life as an attempt to integrate machine learning (specifically, reinforcement learning) with Minecraft. In this period, he was called Ryoshi (Japanese for Hunter). I used a headless Minecraft bot generator, called Mineflayer, to create bots (headless meaning it didn't need a copy of Minecraft running to create the bots, it could simple insert them into the world).


After connecting these bots to my PPO algorithm written in Python, and extracting information from the game-world using a Javascript-to-Python bridge, I set the bot to be trained on very simple tasks. World navigation was working successfully, and Ryoshi was able to learn to travel north as effectively as possible, by turning to face the correct direction each time he would spawn at the start of a training run. However, the more I aimed to use RL for more complex tasks approach with Minecraft, the more challenges arose.


Namely, Mineflayer was unfortunately too unstable a platform to use. The bots would frequently become stuck in the ground mid-jump, they would abandon their commands given, and frequently crash, to the degree I spent more time debugging and bug-fixing the Mineflayer bot creator than actually implementing the ML solution. Due to the challenge of working with an unfortunately unstable headless platform, I explored alternative paths to creating my hunter bot.


Largely, I was aiming to follow the SpaceX approach to development of prototypes and ultimate products, in that the simplest solution is the best one. Following this approach, I realised that Mineflayer may not be the optimal solution for the hunter bot, due to the complexity of fixing the litany of bugs it came with.


Therefore, I opted to employ Alto Clef, and renamed the bot to Kratos. Alto Clef was an extremely stable, extremely effective bot platform. It wasn't headless, which meant the physics bugs I would routinely encounter with Mineflayer were gone. And it had extremely sophisticated gameplay mechanics built in. It had behaviour trees, which would distil a task such as "Acquire a diamond pickaxe" into all the necessary pre-steps which would need to be taken (Acquiring wood, getting a wood pickaxe, smelting iron, etc).


Alto Clef was also capable of pathing towards the player over extremely great distances, a crucial part needed for Kratos to work effectively, which Mineflayer also failed to do, often crashing by trying to decide the most optimal route to take, rather than simply picking a route, as Alto Clef would do.


As Alto Clef was not headless, and required a copy of the game to be running in order to work, training Alto Clef using ML became infeasible due to budgetary constraints. However, the power of Alto Clef meant that a Minecraft hunter bot was fully possible to realise using itself, and implementing a classic AI solution.


After a month or so of development, I had an extremely sophisticated-looking bot. Kratos would result in extremely dynamic, fun gameplay, with a constant feeling of tension not knowing if he were nearby, and with a constant raising of the stakes, as each time you would kill him, it would result in him gathering even stronger armour and equipment in order to defeat you.


I also integrated Kratos with an NLP API, allowing the player to speak with Kratos as though he were a human being. This added an additional extremely fun element to the game, as one would often find themselves bantering and taunting Kratos in the chat, often met with dry and sarcastic replies in response.


Creating a Classic AI, instead of a machine learning based solution, taught a great deal of lessons in working with an existing game and codebase, as well as the limitations such classic AI has. While Kratos is incredibly fun, and engaging to play with, it is always to some degree predictable, which limits the amount of fun which is possible. An ML solution, by comparison, will have near-infinite possible scenarios and actions from the hunter bot, and will have the player never able to anticipate what will come next, and constantly engaged on a whole other level to a classic AI solution.


I'm aiming to release Kratos commercially in the future for people to use, potentially with the. mod being released for free, and the NLP API being an optional paid feature. Most of all however, Kratos was incredible fun to develop, play against, and very valuable for learning the benefits, as well as the vast limitations of Classic AI.

20 views0 comments

Recent Posts

See All

FlowTale Privacy Policy

Privacy Policy Effective Date:  21/01/2025 Last Updated:  21/01/2025 At SmileyDude Limited, we prioritise your privacy. This Privacy...

FlowTale Terms of Use (EULA)

Terms of Use Effective Date:  21/01/2025 Last Updated:  21/01/2025 Welcome to FlowTale, an AI-powered language learning application...

Download Free Now

Downoad SmileyDude free now! https://itunes.apple.com/us/app/apple-store/id6451423488

Comments


bottom of page