Training an Unbeatable AI in Minecraft
ฝัง
- เผยแพร่เมื่อ 5 ม.ค. 2024
- I created Artificial Intelligence using only command blocks inside of Minecraft. This A.I. has the ability to complete parkour and solve ANY MAZE. this project was aids
ALSO for@PalmDEV who i showed in the beginning of the video, I'm sorry; you just left the funniest comment lol. Also you gave me the urge to even make this video so thank you
I know this video is a bit hard to follow but if you somehow were still able to enjoy it then I'm glad.
✦ Join My Discord For Map ➾ / discord
✦ Subscribe If You Like My Content ➾ th-cam.com/users/KiddyKene?sub_c...
✦ Follow My Twitter ➾ / kiddykene
✦ Follow My Instagram ➾ / kiddykene
✦ Follow My Tik Tok ➾ / kiddykene
✦ Follow My Twitch ➾ / kiddykene
✦Channel Member ➾ / @kiddykene
Have a good day :)
- Kiddy Kene
#minecraft - เกม
I am genuinely honored that you made a whole video and project just out of the urge to prove me wrong.
Well done, and well played. I have subscribed. If you are reading this and you are not Kene, you should too.
Guys, I can't believe, there are actually people with good sportsmanship in the world
Hahah thanks for the good spirit
@@KiddyKene You deserve it for sure! The video was impressive!
I'm curious, did you confuse AI and ML with each other?
XD
As a programmer, all this hard coding hurt my soul
Same bruh
The pain
Future proofing? What's that?
same
fr
As someone with a bit of command experience, the hardcoding of 360 angles TWO TIMES wanted me to throw myself out of the window
The worst part is because this is just hard coding this isn’t AI at all
@@patfre That just isnt true. Rule-based AI is, in fact, a branch of AI-it follows predefined rules to make decisions. In this case, the system uses rule-based AI by spawning all possible locations to move to and then deciding the best course of action based on a set of rules.
This AI literally jumps in all directions, and if nothing works it pulls back on the jump and if that still doesn't work, it repeats the process until it gets the desired outcome, or if it reaches a dead end, using rules it figures out it aint doing jack for shit and back tracks and checks again if its doing anything, and keeps backtracking until it can continue. This aligns with the literal definition of machine learning,
Consider any other machine learning program designed to figure out the optimal way to complete a task, like finishing a race. Lets take a Trackmania AI I saw once, The rules are simple, if a movement puts your time behind a previous run, then thats bad, dont do it next time, but if an action makes your time faster than a previous run, than do that action until you figure out a better way, and it repeats that thousands of times until you have a perfect run that beats humans.
its literally the same concept, but here, if a jump makes you touch the kill range its game over- re try, but if you succeed than thats perfect, keep going, its just a simpler rule set with MUCH less room for error, which makes it seem like its not machine learning when it's just simpler.
It is literally doing what AI is, what are you guys complaining about, just because its simpler, yes its hard-coded, but that doesn't make it any less of an AI, it is a program that can learn how to complete a puzzle.
Its almost like you guys are expecting Kiddy to code Chatgpt when thats not what most problem solving AI's are, they are programs that do stuff on a rule set THAT IS HARD CODED, of course there are better ways to do the angle stuff, I get the op's post, but you are just spouting bullshit.
@@PythonicIe the thing you see here is called depth first search which is an algorithm and NOT AI
@@patfre The learning aspect comes from the exploration and evaluation of different paths. The AI is making decisions based on the outcomes of its previous attempts, and it learns to avoid paths that lead to undesirable results (e.g., falling into the death area). This kind of learning through exploration and feedback is a fundamental aspect of machine learning, while it may not be Absolute Artificial Intelligence(like most problem solving algorithms), the 'AI' system, which uses DFS for path exploration and combines it with decision-making and learning components to find and utilize the most optimal path through the parkour course, can be classified as a form of reinforcement learning within the broader domain of machine learning, the very fact it uses its knowledge to take the best path to the end after its training classes it as Machine Learning, which is an application of AI.
I guess I was being harsh, we both arent wrong here and Kiddy can indeed call what he made AI as it does fall under the branch
@@PythonicIe what your saying is exactly what depth first search algorithm does and it is NOT EVER AI seriously how is this so damn difficult to understand? And algorithm is an algorithm end of story.
Something people are forgetting is that command blocks and redstone are Turing complete, meaning they can create any other Turing complete machine or just something the Turing complete machine could do. So, you could use that fact to immediately prove that artificial intelligence is possible in Minecraft.
eEeEeErRRrmMmM AaAAaCcCcTtuUaLllyYy
Yes!!!
People are saying it's not AI because of all the hardcoding
But its a simple AI just because it has memory and a winning/losing state
The hardcoded stuff can actually be programmed because of the turing completeness!
You just need the correct algorithms for sin/cos/better AI algorithm and machine learning concepts
Minecraft can do it all
I think that's only correct with infinite simulation distance
aw man we didnt get to see it complete the labyrinth in the end properly like he did with the parkour
I was so upset because of that lol
he did it boys, he actually made sin, cos, and tan useful
He did
It has always been very much so. When was that ever contested??
this depends on what job/things you do but since, cos, and tan are VERY useful, like to find height of a wall using shadow length*tan(angle of sunlight) also sin and cos are used to graph things like sound and light waves, which in music, phonology, and things like noise cancelling earphones all use, cosine and sine can also enable the deaf to use devices to hear, so this isnt to be rude but sin, cos, and tan are very very useful
yes i also love measuring walls with shadows@@cliryu
@@cliryu I definitely agree with most of what you said but WHY did you include finding the height of a wall???????????? that's one of the worst (real world) applications for trig when you could use so many other faster methods that don't depend on it being a sunny day with no clouds
One must imagine Kiddy Kene happy building ALL those command block towers...
sisyphus reference?
one must imagine kiddy kene sane
there is a WAAAY better way to do the direction, you make a scoreboard that you constantly add 0.1 to and set it to 0 when we reach 360, which you also make it convert to storage in /execute, we use that and /data modify to set it to the value in a specific integer, so we do it for x , and z. That's it.
or just only do like 30 of the values, which is probably good enough
my guy is speaking enchantment table
@@williamroe8905 well it has to move like a player, a player doesn't go to one spot every single time
@@Ratz99 I think the quality of movement from 30 angles would be just as good
@@Ratz99yeah but then again, 30 jumps is gonna be around 12 times faster than doing all 360. Plus you can probably run several different jump distances sequentially if you individually if you only run 30 different angles. Especially if you only calculate 1 angle at a time.
“And I took that personally”
What@@RobloxPrompt
I have to try this myself 😂
Hello,villager ai song
@@garysoh3347hello, skibidi toiler song
🤖
Great video, but there's a better (and much shorter) way to calculate sine and cosine using a shortened Taylor Series.
The Taylor Series approximates sine and cosine through an infinite sum that gradually gets closer to sine and cosine's true values (this is actually how trig operations are often dealt with in math), but you don't need infinite accuracy, especially if you use modulo to restrict everything to { -π/2 < x < π/2 } for sin(x) & cos(x) which is much more accurate due to being located at the center.
Just take the infinite sum and cut it off to a certain point (by changing the infinity sign on top of the sum operator) when its accurate enough (I think 2 should be more than enough for your purposes).
Then, just simplify down the equation until you get an easy to use calculation.
For instance, for the the Taylor Series of sine shortened to sum up to 2 we get x - (x^3 - (x^5/20))/6.
This is very accurate at less than 0.5% error even at the extremes within { -π/2 < x < π/2 }
btw if you do read this I challenge you to build an actual neural network instead of a decision tree (I recommend using a dense network + backpropagation)
Talor swif
@@Beatrix-VR lmao
I stopped read after 5lines 😂
or even better, do /tp ^ ^ ^1 on an armour stand to move 1 block forward in whatever direction it's facing, and then measure the change in x and change in z, and since you know the magnitude of the change in displacement vector is 1, that will give you the cosine and sine. haven't worked with mc commands/datapacks in a while tho so i don't remember which is which.
@@Bohemianism_ While that does work, the issue with that is the fact that it uses an armorstand, which can be easily destroyed, lost, is harder to copy between builds and datapacks, and is in general, annoying to deal with. The shortened Taylor Series method means no dealing with armorstands and easy storage and manipulation (like copying and pasting) as well as having control over the accuracy as well as having EVERYTHING managed on the scoreboard which means that values can be more easily manipulated.
So while the armorstand strategy works, I personally would recommend the shortened Taylor series over it just for its ease of use and the amount of control you have over it.
That's actually not AI, that's just pretty smart path finding algorithm :)
If you really need for it to be a AI you need:
1. vision system (AI must "see" things around it)
2. training without "manual corrections" (like that your "AI" can find incorrect path due to marks)
3. training with trials&errors (so AI even if do error can "understand" it's error and correct that)
So good luck with learning about perceptrons, neural networks, biases... stuff like that ;)
BTW. Still, good job. I don't want to say "Screw that, that's not real AI", but much more "It's not AI, but as something simmilar to AI this is pretty good"
Exactly
Omg finally, someone said it
The pronunciation of cos and sin killed me
That must've taken so long! You deserve this my friend ❤
appreciate it
@@KiddyKene
I don't know if there is already some tools that allow you to fill command blocks from a TXT file containing your list of commands but I think it would be pretty easy to write one in Python or AutoHotkey. This script would read a file line-by-line, move Steve to the next command block by sending keystrokes, open the block and paste the command inside it, etc... With this method it would still take you some time but it should be able to fill hundreds of command blocks automatically.
@@Alfred-Neumanor generate a Minecraft structure file
Yeah....
0:44 bro really said: wake up to reality
7:45 Nooo my friend you have forgotten the pythagorean theorem!
bro is batshit insane
in a good way
I never knew AI took over Minecraft. (I'm looking at you Elon)
It also didn’t this has as little AI as the printer
it is ai learning, rule based aproach.@@patfre rule is: search where theres blocks to move.
move if possible, if not go back and try again. reach end = win.
if was not ai he would have to set each movement by itself, you can literally see the machine deciding where to move, a bit hardcoding but still ai. in mc theres no way he would make a learning based aproach
@@patfre boo hoo you expect someone to make chatGPT in minecraft. get a grip on what is feasible.
@@cewla3348 This is more of a pathfinding algorithm. Each individual follows a set of instructions instead of deducing the next action based on the current input. Fred doesn't know anything about it's own state, because it is just a visual representation of a fixed set of jumps that he blindly follows. If you put fred in a new course, he will always fail unless you retrain him, and that new fred will forget everything about the original course. An AI (ML model) would have some inputs that give it information about it's surroundings, and based on that information, it could store data that helps it make the correct jumps. This method would result in an AI that would make jumps determined on the actual course, and not on a predefined set of instructions, and would be capable of traversing new courses without retraining
@@cewla3348 , do you even have a pinch of knowledge about making ai? any one who has watched the first 3-5 minutes of an actual ai video will know that an ai need: input (aka a number value that can be processed), a layer with internal neurons (one neuron takes info from the input or another neuron from the previous layer and does some math that is basically the sum of all the inputs multiplied by there corresponding weight and then a mathematical function that i forgot the name of) and output (if you don't know what output could be then that would surprize me). respectfully, no, i don't expect him to make a gpt model but he could at least try to make an actual ai. even one layer with 1 neuron would be fine, just don't use AI in your title as clickbait
The reason you hit a motion vector of [0,0,0] halfway between the jump is actually correct in terms of physics. the motion vector is the velocity along a taken path, and in kinematics the peak of a thrown curve with respect to gravity always has a velocity vector of [0,0,0]. After that point, the velocity goes from positive to negative and begins its descent
I think you mean vertical velocity, the armor stand shouldn't stop moving forward midway through the jump
I only recently discovered your channel and you've already become one of my favourite tech TH-camrs. Props to you and your hard work.
Smae
Same
Smae
smae
Msae
3:40 . Bro could teach maths and geometry in Harvard but he decided to create minecraft videos... That's a good thing because they are very entertaining well done Kiddy Kene
School ❌️ video from you✅️
Good video.
Could anyone stop you at this point ? (Keep doing it, you're insane !)
Stage 4 cancer:
this dude is so underrated
Ignore all the people talking about how hard codes it is, your work is still worthy of the title and time you put into it.
I'd call this a maze solving algorithm that does parkour on the side.
Learn how to place command blocks WITH nbt data using python so you could yeet the values in to the command blocks within the loop so you wouldn’t have to annually do this (sorry for my bad English)
Replaying the stored graph really just makes this breadth first search, not really reinforcement learning or AI. That said, this is one of the coolest videos I've seen in a while.
I agree it's not reinforcement learning, but i would argue it _is_ still AI. There's no rigid definition of AI, so in one sense, anything that attempts to think is still "artificial intelligence," even the CPUs in mario kart 64.
I hate to say "well actually" to your well actually, but well actually, it's depth first search
@@rytan4516 It's not. BFS means every single branch would be explored for each platform before continuing, which is exactly what this does
@@user-xu8it5nh2l BFS, or breadth-first search, means searching every node of the same rank at the same time. Here, we don't see the node on the left being searched immediately before the node on the right. We see the node on the left be searched, and then we see a node next to that be searched, etc. until a dead end is reached and backtracking is forced. This backtracking behavior is characteristic of depth-first search.
@@user-xu8it5nh2l BFS is where you pick a node and traverse all its child nodes then begin traversing those children's children right? Isnt DFS when you fully traverse one node before returning to the first one with children not traversed?
this is absolutley insane
I love this man’s sense of humor, I think I’ll stick around.
Every video of yours blows my mind because ITS SO HARD TO MAKE SOMETHING LIKE THIS OMG
It's a good day when Kiddy Kene post, he deserves 1m.
Edit: Also love the Steven Universe music.
The only thing that would be now left to do, is to give the the ai intelligence, that it always looks fow the goal and the how it could get there in the shortest amount of jumps...
Considering it isn't a real learning algorithm, but just a depth search algorithm with physical array for storing path it made, you can make it do parallel computing by branching stand and its memory in a 2d array (you already made 2d array you just need to make it extendable, ae make dynamic array). In result it would take exactly as many jumps as a length of parkour. (and there would be no need for reverse)
"Sine,cosine,forklift" - kiddykene 2024
This is amazing! I can’t believe this is possible in vanilla Minecraft.
it'n not actual ai tho
. @@Abnorlmally
Calculated all the angles you needed for anything within a 4 radius circle
Ring 1:
0.0,
45.0,
90.0,
135.0,
180.0,
225.0,
270.0,
315.0
Ring 2:
26.6,
45.0,
63.4,
116.6,
135.0,
153.4,
206.6,
225.0,
243.4,
296.6,
315.0,
333.4
Ring 3:
18.4,
33.7,
56.3,
71.6,
108.4,
123.7,
146.3,
161.6,
198.4,
213.7,
236.3,
251.6,
288.4,
303.7,
326.3,
341.6
covers all degrees that could be blocks
as for the parabolics, you'd only need to account for the center of each block a player could jump to, which should have uniform y velocity per "ring"
a 45 or
Bro just calculated the video
Great video! I doubt you ever want to work on this again but I would recommend looking into path finding algorithms to see if you can implement that into your AI. It would make the amount of time it takes to train a lot shorter. However it would probably be very difficult if you want to make significant improvements. Also a simple thing to increase performance at the cost of how good the AI is at completing a course would be to decrease the amount of angles it jumps. Maybe instead of 0, 1, 2, 3, 4 all the way to 359 degrees could be having 0, 2, 4, 6, 8 all the way to 358 degrees or another could be having only common angles, 0, 30, 45, 60 and their other quadrant equivalents.
6:26 don't think we didn't notice the "kiss" my boy 😂😂
Great idea, i will try to do my best at optimizing…
Congrats, you made me more confused than I am when I watch most redstone tutorials.
Nice Video!! And i love ur projects! Continue like this ^^
This is honestly insane. GG bro.
VERY COOL
Have you tried using structure blocks and another scoreboard for the rows and collums of memory?
Using a scoreboard that counts each column (just an increment each time it needs more memory) and then adding a row when you need a row. (after 5 columns you add a row and reset the counter)
@@Dr.KGaming 🤡
@@gasic7129
@@Dr.KGaming👹
@@Dr.KGaming 🤡🤡🤡
@@Dr.KGaming🤡🤡
The amount of command blocks used hurt my brain lol. If I were to do this I would suggest making a way for the "ai" to generally know where which jump is with beforehand like with armor stands placed on each block with a numbered tag and instead of using 360 degree armor stand summoning I would summon like ±2.5° while facing either the numbered tag its on plus 1 or just generally higher than the one it's on to be able to find short cuts
My guess is that motion inconcistancies were caused by the fact that motion is less effective for entities on the ground.
This mf actually reinvented assembly code just to give armor stands alzheimer. Respect.
Wdym assembly?
@@SuperLlama88888 assembly is a language
@@_bleh_ Ik, I was asking the commentor to elaborate what they meant by reinventing assembly code
this made me laugh out loud
definitely a brand new sentence
This made me genuinely laugh out loud
"Command Blocks Ide" the mod that can help u with ACCESSING EVERY COMMAND BLOCK THAT TOUCHES EACH OTHER and FINALLY ENTERABLE COMMANDS JUST LIKE NORMAL CODING
=-30 hours work=🤯
No mods tho
@@-duck.-.duck.777 true
@@-duck.-.duck.777 It's just helper he can do all that without mod but mod is just for helping him
It's vanilla Minecraft that's the whole point.
Mindustry lets you code but it’s super basic, like redstone in MC. You can make all kinds of AI inside Mindustry!
You know, I have my honest respect for you, spending 2 months on a project so unimaginable to the regular minecrafter, you deserve far more than 125k, keep up the incredible work man💪
So the best command block wizard is back ? Interesting 👍
Genuinly top tier content
get this man 1 million subs so he uploads more
That altzimers thing where it redos it's steps, apply it to chess and there won't be enough atomes in the world to keep the data (probably).
this is really impressive but it's still not ai if it just checks for all possible combinations
everything isn't AI
This guy could cure cancer if he wasn't too busy playing Minecraft.
you didnt even finish the vid
Holy mother of god, he did it.
“Stay in school kids, it makes you better at Minecraft.” -technoblade
The last video was AI: AI is a program that does something human like. Also, AFAIK are commands/command blocks turing complete so it really is possible (as you have proven)
halting problem:
Hi
This guy is 1st
i love how he "cured" his dementia but then gave him alzheimers a few minutes later
holy shit, that is absolutely insane. i do have to wonder how difficult it would be to just edit the command blocks into the world file with your python script. it would definitely be less painful than all the manual coding you did lol
I mean this isn't a neural network but more like a maze solving algorithm, but great job
you should use a timer next time you do these coding vids so we could see at the end how long it took
the thing that hurt my soul is that with the programming you could have had the script you ran to get the angles print the actual in-game command to copy-paste
You earned a sub for that
12:00 what you should do, is make all other armor stand invisible but not fred who made the last jump.
Then simulate all the stuff and do the kill stuff, and then give the tag to the remaining armor stand "valid_issue" and make fred jump to his position, and then kill "valid_issue"
That way you get a beautiful thing
Now make an one where the *A.I.* is given eyes..
One of my random ideas is to use arrows that are shot from the eyes of the armour stand, and then check where they collide. Or you can figure out another ray casting method.
I'll let you figure out the rest of the details. 👍
It's not pronounced sin it's called sine
Im amazed you did this with COMMAND BLOCKS, WHAAT? Not even a data pack, that's really epic
What is this! You are an insane Minecraft engineer, and someone with an iron will to make something so tedious and extraordinary as this! I don't really know anything about maths and armorstand scoreboards and such, but I do know enough to realize that this neurological creation is way beyond me.
Why aren't you using data packs? It's easier to manage and with a good editor (like vscode) and an extension pack it's really easy. Additionally there are tools like JMC that change making data packs like coding in javascript.
I believe it’s because it is a challenge to do something like this. Also, other people have made ai with data packs already so it’s a new idea to do it with just command blocks
@@nighthawkgaming2953 but datapacks are commands but just in files
Uuuh, that’s not really AI either? That’s just a brute force algorithm that tries every single possible outcome…
You could say it’s machine learning ig, but when people say AI they are usually referring to artificial neural networks, this is just a brute force algorithm.
it is machine learning. you're expecting too much from a BLOCK GAME.
@@cewla3348 no its not even that though, anyone who has ever even attempted anything in ML, would agree that this is nothing more than a brute force algorithm.
The whole idea of artificial inteligence is that it approximates the brute force "perfec" algorithm to get something mostly correct while being physically possible to compute. AI is a nothing more than a function approximator, where the math equation/function that it is approximating is the highly complex equation that perfectly describes the entire english language (as a chatGPT example), where that equation, although technically exixts, does not practically exist.
He mentioned reinforcement learning earlier in the video, though he used absolutly no reinforcement learning concepts.
and i am not expecting too much from a block game, bc ppl have already made realy artificial neural networks in mc years ago, only using redstone, no commands... it is 110% possible with commands...
@@redthunder6183CodeBullet a yter who mostly does "ai" things uses that
this is very scuffed programming... subscribed
This is a legendary feat in the minecraft community.
Now add reinforcement deep learning. The agent gets a scire after each jump based on how close to the goal he is. This could fix the backtracking it did in the maze.
thats literally insane, i love it
I really need to learn trigonometry it's been holding me back while mapmaking for way too long now
AMAZING VIDEO! I literally cant imagine the fatigue that you experienced making this video and the hours of editing behind it! well done!!! you earned 21 minutes of watch time lol
I do think Palm has a point though. What you created here is a pathfinding algorithm, not a generalized Machine Learning algorithm like what you brought up with the Reinforcement Learning wiki page. For your next project you should absolutely see if you can create a Machine Learning algorithm that learns how to parcour, not one that just finds a path in a single pre-built map
oh hi
i did not expect to see you here
As someone with no command block knowledge, I just enjoyed watching a video where all he did was speak enchanting table.
Slime molde has some properties in real life, you simulate that slime molde's behaviour. I truly Respected you brother.
As its vanilla minecraft, it would be almost impossible to give the AI raycasts, so its kinda hard to make ai do real "training" not just "remembering what is the best score from the previous generation" , also you should have given the ai movements like "just jump" or "just move x blocks forward" or 'jump x blocks forward"(Ik that would be suffering but it would be worth it) so it could make better jumps and more choices to do. Also your ai cant make choices while being in the air, and its making it quite not able to do "neo jumps" and other tricks.
OK great video but the Steven Universe background music is too good i mean i can not resist singing along too "STRONGER THAN YOU!!!
An alternate method for the 360° of armor stands would be getting sine/cosine from teleporting a separate armor stand forward one block facing the degree you need, then storing the relative x and z position of that armor stand as another one's motion
duuuuude this video was so well made holy moly!!!! i love random techy stuff like this
oh why hello Craftymasterman
This was the most incredible thing I’ve seen, never once did I think you could create an AI with command blocks, AI learning and training is hard to learn and you pushed the boundaries!!
not ai tho...
i just discovered your channel and damn i love your vids and style of editing man
23 seconds in I already love this guy’s editing style 😭 gonna binge all the videos he has tonight
This is probably the coolest command block creation ive seen
If the printer wasnt enough bro built ai in a block game💀
U are the first person that made an AI in Minecraft
This video feels like a successor of The Science from game theory (formerly) snd ShoddyCast originally, good work :D
Friend: "i am sane"
The friend:
ok now make one that can solve a maze but it doesn’t jump like the way you have it in the video, Fred needs to “walk” smoothly , and make the maze automatically generated
Bro i'm always so happy when you upload a video, keep it up
Bro got a degree in command blocks on the Minecraft section of university
Fred,bob,carl... they all make good testrat names. I do it all the time
Mad respect for coding this in command blocks. It's the worst programming language
Man i wont negate that you did an exeptional work with this AI and you did get me engaged throughout the whole video. But if you try to improve the AI, instead of hard coding you could divide the jump function into two parts. First check its surroundings for a block that has 2 air blocks above it. Then attempt a jump into it with different speeds. Just limit the distance to wich you check for a posible block to jump. This would cause less lag and people would complain less about it beeing hard coded.
And also even tho it's hard coded it's completely functional so good job