Nice build, and for me the best is the AI Mind View. You made the decision visible which I think is more than most demos bother with.
What I'd add isn't in the algorithm. Right now, the only evidence it's learning is that the opponent feels harder, and you're learning too, so you can't separate the two. Play the agent against a fixed scripted opponent for a few hundred matches and plot the win rate.
And the localStorage learning is per browser and per device, so wrap the read in a try/catch. It can come back empty or throw in private browsing.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Thanks a lot for the detailed feedback! Really appreciate it. 😊
Actually, before writing the post, I tested the AI myself. I played 29 matches against it, and it managed to win only 5 of them 😂
But you're right, that's not really a proper way to measure its learning since I'm also getting better at the game while playing.
The fixed-opponent idea is interesting. I'll try running multiple matches against a scripted opponent and track the win rate to see how its performance changes over time.
And thanks for pointing out the localStorage edge case! I'll look into handling that as well.
Really appreciate you taking the time to check out the project and share these suggestions!
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
100 Days of DevOps and Cloud. One lab a day for a hundred days, AWS, then Azure, with Ansible and Terraform near the end.
Working the tasks in labs was pretty easy. The writing was where I found out what I'd actually understood, which is why most of the posts ended up being about something that looked right and wasn't. I had to look at technical blogs, documentation, etc to get full insight into the tools and the expected results.
Day 100 went out this morning, so your post was good timing. 😄
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Woah, 100 days straight?! That's some serious dedication! 🔥 Huge congratulations on completing the series!
And I totally get what you mean about writing revealing how much you've actually understood. It's one thing to get something working in a lab, but explaining why it works is a whole different challenge.
Software engineer who builds things that run in production — and writes deep-dive guides on why they break. I explain how React, Node, Docker, Rust and Kubernetes actually work under the hood.
Hey Puneet! played two rounds just now, the ninja started reading my jump attacks by round three lol. closed the tab and came back later, it still remembered how i play. bit spooky haha. if i spam one combo does it just keep farming me? thanks :D
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Yep, the learning data is stored in your browser's localStorage, so it remembers your playstyle even after you close and reopen the tab.
And yes, if you keep spamming the same combo, the AI can start adapting to it and countering it. The idea is to make it learn from your patterns rather than just follow predefined enemy behavior.
Software engineer who builds things that run in production — and writes deep-dive guides on why they break. I explain how React, Node, Docker, Rust and Kubernetes actually work under the hood.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Software engineer who builds things that run in production — and writes deep-dive guides on why they break. I explain how React, Node, Docker, Rust and Kubernetes actually work under the hood.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Lmaooo 😂 the ninja has officially caught on to your favourite move! Now let's see if you can outsmart it haha. Waiting to see what strategy you try next! 😁
It's fascinating how the opponent learns through playing against you. This could be a really interesting direction for the next generation of CPU opponents in games!
I'm interested in game development myself, so I'll definitely take some inspiration from your project!
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Yeah, in the beginning, the AI behaves pretty dumb. But I tested it for around 60–70 matches, and now I'm seeing some interesting behaviour. It's started dodging my shurikens and kicks at the right moments. Before I land a heavy sword attack, it often moves back or interrupts its own action to avoid getting hit. That's the kind of improvement I wanted to see!
One thing to mention: its learning is mainly stored in your browser's local storage, so it learns from your matches on your device. If you play against my AI, it'll probably be much harder after you've played several matches with it. 😅
Actually, I've been thinking about trying Q-learning with a chatbot too. But then I wondered... would that even work? 😂
Imagine:
User: How are you?
AI: Who are you? 💀
I guess Q-learning could help a chatbot learn which responses or actions users prefer, but it probably wouldn't be enough on its own to understand and generate natural conversations. Still, it might be an interesting experiment!
I also like the idea of lightweight AI that can run on CPU-based devices, especially since GPUs can be pretty expensive.
Btw, what kind of project are you thinking of building with Q-learning? I'd love to hear your ideas! 😄
Haha!! Maybe I should retire undefeated before your AI gets too strong! 😹🏆
One idea I have is to let an AI-controlled character initially react to a boss's movements with random actions, then gradually learn which responses are most effective.
If the learning data can be stored on the client side using something like localStorage, there could be quite a lot of interesting possibilities without requiring expensive servers or GPUs!
I'd love to explore this further. Thanks for introducing me to Q-learning! 😸💚
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Haha, exactly! 😁 I'm actually using client-side localStorage only to store the learning data. Haven't connected any database or external server to it. Everything runs entirely in the browser!
That's what makes experimenting with Q-learning so interesting without needing extra infrastructure.
Pretty Amazing. I tried it myself too, and while enjoying the game, I decided to test the learning capabilities by throwing the same attack again and again. At first, it lost again and again, but then it started blocking my attacks and started counterattacking.
That seems pretty amazing to me. In fact, I am also working on a project where I need AI to learn, and now I think I should also use Q-Learning there.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Yooo, that's awesome! 😂🔥 The fact that you kept repeating the same attack and it eventually started blocking and counterattacking is exactly the kind of behaviour I wanted to see when building this.
And that's interesting about your project! Q-learning is definitely worth exploring if your AI needs to learn through actions and rewards.
Btw, is your project open source? I'd love to check it out! Also, what is it about? Is it a game or some kind of software? 👀
Yeah, my project is definitely open-source, but I am currently building it with my 2 other friends, as it is our Final Year Project. It will be a middle layer that will encounter every incoming request and check if it's a hacker or a normal person.
The AI part is that it will encounter the request, display it on the dashboard and check the behaviour and pattern of the user. If the AI can't decide, then the request will be sent to the human, he will check and then mark it either as a normal user or a hacker and the AI will then store that pattern in itself.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Ohh, now I get the idea! That's actually a really interesting project. 👀
So basically, you're building a security layer that monitors incoming requests, detects suspicious behaviour, and learns from human feedback whenever it isn't confident about a decision.
I especially like the human-in-the-loop part. It means the system can keep improving from patterns that humans identify.
Are you planning to use Q-learning for this, or are you exploring some other machine learning approach?
Also, would love to check out the GitHub repo once it's public! Good luck to you and your teammates with the final year project!
Thanks, there is no code at the moment because we are doing research on the attacks and the different kinds of attacks that hackers do.
The human part was added because we don't want the AI to handle everything, as it might start hallucinating.
Regarding th Q-learning, I am mainly interested in any Reinforcement learning type, since now, I have seen a demo of Q-learning, I will definitely discuss this with my teammates.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Ohh, now I get the idea! That's actually a really interesting project. 👀
So basically, you're building a security layer that monitors incoming requests, detects suspicious behaviour, and learns from human feedback whenever it isn't confident about a decision.
I especially like the human-in-the-loop part. It means the system can keep improving from patterns that humans identify.
Good luck to you and your teammates with the final year project!
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
I research AI tools, APIs & agents — comparing specs, pricing and real user reports — then publish honest rankings so you don't waste money. Research-first, never sponsored fluff.
The AI Mind View is the bit I'd steal — making the decision visible is what turns a demo into something you can actually learn from. The measurement problem ndcodes raised is the one that'd bug me though: you're getting better at the same time the AI is, so the win rate doesn't prove much either way. Have you tried freezing a Q-table snapshot and running it against a fresh random player for a hundred matches? That'd give you a baseline that doesn't move while you do.
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Thanks Paul! 😁 The AI Mind View was something I really wanted to include because I think making the learning process visible is just as interesting as the gameplay itself.
And that's a really good point about the measurement problem. Since both the player and AI are adapting, win rate alone isn't a reliable measure of how much the AI has improved.
I haven't tried freezing a Q-table snapshot against a fresh random player yet, but that's definitely an interesting experiment. Could give a much clearer picture of how well the AI is actually learning. Appreciate the suggestion!
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
A game that adapts to the player is a much harder claim than a game that reacts to the player, and the difference is where I'd poke. In our own runs this week we asked a model a question five different ways with no documents at all, and it answered --no-cache five times out of five, because the flag was already in its head, not because it learned anything from the run. How do you tell, in your game, whether the ninja is actually adapting to how someone plays versus just repeating a pattern that already worked once?
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
The distinction is important. In my game, the ninja uses Q-learning, so it's not simply hardcoded to repeat a successful move. It updates its Q-values based on the player's actions and the rewards it receives over multiple interactions.
One interesting thing is that the AI Mind View actually shows which moves the ninja chooses in response to certain player actions. I've observed those moves changing when the player's strategy changes over around 3–4 matches. So you can actually see the adaptation happening rather than just noticing a different difficulty level.
The learning data is also stored in client-side localStorage, so its behavior can evolve across sessions.
That said, I agree that seeing different reactions doesn't automatically prove genuine adaptation. Testing it against different playstyles and comparing its behavior with a fixed baseline would be a much better way to validate that.
Definitely something worth experimenting with! Thanks for bringing this up.
Fellow game dev here—love how lightweight this is! Using Q-tables and browser storage to get adaptive enemy behavior without external servers is a great approach 😁
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Thanks! 😁 Really wanted to keep it lightweight and fully client-side without depending on external servers. Glad to hear another game dev appreciates the approach!
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
That's awesome to hear! 😁 I wanted the AI Mind View to make the learning process visible rather than keeping everything hidden behind the scenes. Glad it helped make Q-learning easier to understand!
I'm Puneet Kumar, a 15-year-old full-stack developer. I love building innovative products, crafting beautiful web experiences, and turning ideas into reality.
Backend engineer building FastAPI webhook pipelines, Telegram Mini Apps, and TON Connect integrations. Writing practical notes on auth, idempotency, and production debugging.
The live AI Mind View is what turns this from a fun browser game into a great reinforcement learning visualizer. For tabular Q-learning in localStorage, two small tweaks keep the opponent sharp without bloating the table: bucketing distances and cooldowns into coarse discrete bands, and decaying epsilon across rounds while keeping a small exploration floor around 0.05 so it still adapts when a player changes tactics mid-session. After your 29-match test run, roughly how many distinct states ended up stored in the Q-table?
We're a place where coders share, stay up-to-date and grow their careers.
Nice build, and for me the best is the AI Mind View. You made the decision visible which I think is more than most demos bother with.
What I'd add isn't in the algorithm. Right now, the only evidence it's learning is that the opponent feels harder, and you're learning too, so you can't separate the two. Play the agent against a fixed scripted opponent for a few hundred matches and plot the win rate.
And the localStorage learning is per browser and per device, so wrap the read in a try/catch. It can come back empty or throw in private browsing.
Thanks a lot for the detailed feedback! Really appreciate it. 😊
Actually, before writing the post, I tested the AI myself. I played 29 matches against it, and it managed to win only 5 of them 😂
But you're right, that's not really a proper way to measure its learning since I'm also getting better at the game while playing.
The fixed-opponent idea is interesting. I'll try running multiple matches against a scripted opponent and track the win rate to see how its performance changes over time.
And thanks for pointing out the localStorage edge case! I'll look into handling that as well.
Really appreciate you taking the time to check out the project and share these suggestions!
Don't mention. I am bored now just finished my second series. And I had fun reading through your article.
Haha, glad you enjoyed reading it! And congrats on finishing your second series! What was it about? 😂😂🤣🤣
100 Days of DevOps and Cloud. One lab a day for a hundred days, AWS, then Azure, with Ansible and Terraform near the end.
Working the tasks in labs was pretty easy. The writing was where I found out what I'd actually understood, which is why most of the posts ended up being about something that looked right and wasn't. I had to look at technical blogs, documentation, etc to get full insight into the tools and the expected results.
Day 100 went out this morning, so your post was good timing. 😄
Woah, 100 days straight?! That's some serious dedication! 🔥 Huge congratulations on completing the series!
And I totally get what you mean about writing revealing how much you've actually understood. It's one thing to get something working in a lab, but explaining why it works is a whole different challenge.
Hey Puneet! played two rounds just now, the ninja started reading my jump attacks by round three lol. closed the tab and came back later, it still remembered how i play. bit spooky haha. if i spam one combo does it just keep farming me? thanks :D
Haha, the ninja is watching your moves! 😂
Yep, the learning data is stored in your browser's localStorage, so it remembers your playstyle even after you close and reopen the tab.
And yes, if you keep spamming the same combo, the AI can start adapting to it and countering it. The idea is to make it learn from your patterns rather than just follow predefined enemy behavior.
Glad you gave it a try! 😁
thanks Puneet!! localStorage explains it lol xD spammed jump attack.. got farmed haha, thanks :D
Lmaoo 😂 looks like the ninja figured out your strategy! Time to switch up your moves and surprise it this time haha. Thanks for playing again! 😁
haha Puneet it read me xD I kept jumping... 6 times lol, yeah I'm switching it up :D
Lmaooo 😂 the ninja has officially caught on to your favourite move! Now let's see if you can outsmart it haha. Waiting to see what strategy you try next! 😁
I didn't know about Q-learning! 😸💚
It's fascinating how the opponent learns through playing against you. This could be a really interesting direction for the next generation of CPU opponents in games!
I'm interested in game development myself, so I'll definitely take some inspiration from your project!
By the way, I defeated your AI! 😹🏆
Haha, you defeated it! 😂🏆
Yeah, in the beginning, the AI behaves pretty dumb. But I tested it for around 60–70 matches, and now I'm seeing some interesting behaviour. It's started dodging my shurikens and kicks at the right moments. Before I land a heavy sword attack, it often moves back or interrupts its own action to avoid getting hit. That's the kind of improvement I wanted to see!
One thing to mention: its learning is mainly stored in your browser's local storage, so it learns from your matches on your device. If you play against my AI, it'll probably be much harder after you've played several matches with it. 😅
Actually, I've been thinking about trying Q-learning with a chatbot too. But then I wondered... would that even work? 😂
Imagine:
User: How are you?
AI: Who are you? 💀
I guess Q-learning could help a chatbot learn which responses or actions users prefer, but it probably wouldn't be enough on its own to understand and generate natural conversations. Still, it might be an interesting experiment!
I also like the idea of lightweight AI that can run on CPU-based devices, especially since GPUs can be pretty expensive.
Btw, what kind of project are you thinking of building with Q-learning? I'd love to hear your ideas! 😄
Haha!! Maybe I should retire undefeated before your AI gets too strong! 😹🏆
One idea I have is to let an AI-controlled character initially react to a boss's movements with random actions, then gradually learn which responses are most effective.
If the learning data can be stored on the client side using something like localStorage, there could be quite a lot of interesting possibilities without requiring expensive servers or GPUs!
I'd love to explore this further. Thanks for introducing me to Q-learning! 😸💚
Haha, exactly! 😁 I'm actually using client-side localStorage only to store the learning data. Haven't connected any database or external server to it. Everything runs entirely in the browser!
That's what makes experimenting with Q-learning so interesting without needing extra infrastructure.
Pretty Amazing. I tried it myself too, and while enjoying the game, I decided to test the learning capabilities by throwing the same attack again and again. At first, it lost again and again, but then it started blocking my attacks and started counterattacking.
That seems pretty amazing to me. In fact, I am also working on a project where I need AI to learn, and now I think I should also use Q-Learning there.
Yooo, that's awesome! 😂🔥 The fact that you kept repeating the same attack and it eventually started blocking and counterattacking is exactly the kind of behaviour I wanted to see when building this.
And that's interesting about your project! Q-learning is definitely worth exploring if your AI needs to learn through actions and rewards.
Btw, is your project open source? I'd love to check it out! Also, what is it about? Is it a game or some kind of software? 👀
Yeah, my project is definitely open-source, but I am currently building it with my 2 other friends, as it is our Final Year Project. It will be a middle layer that will encounter every incoming request and check if it's a hacker or a normal person.
The AI part is that it will encounter the request, display it on the dashboard and check the behaviour and pattern of the user. If the AI can't decide, then the request will be sent to the human, he will check and then mark it either as a normal user or a hacker and the AI will then store that pattern in itself.
Ohh, now I get the idea! That's actually a really interesting project. 👀
So basically, you're building a security layer that monitors incoming requests, detects suspicious behaviour, and learns from human feedback whenever it isn't confident about a decision.
I especially like the human-in-the-loop part. It means the system can keep improving from patterns that humans identify.
Are you planning to use Q-learning for this, or are you exploring some other machine learning approach?
Also, would love to check out the GitHub repo once it's public! Good luck to you and your teammates with the final year project!
Thanks, there is no code at the moment because we are doing research on the attacks and the different kinds of attacks that hackers do.
The human part was added because we don't want the AI to handle everything, as it might start hallucinating.
Regarding th Q-learning, I am mainly interested in any Reinforcement learning type, since now, I have seen a demo of Q-learning, I will definitely discuss this with my teammates.
Ohh, now I get the idea! That's actually a really interesting project. 👀
So basically, you're building a security layer that monitors incoming requests, detects suspicious behaviour, and learns from human feedback whenever it isn't confident about a decision.
I especially like the human-in-the-loop part. It means the system can keep improving from patterns that humans identify.
Good luck to you and your teammates with the final year project!
i like it :O
😎 glad you liked it!!
The AI Mind View is the bit I'd steal — making the decision visible is what turns a demo into something you can actually learn from. The measurement problem ndcodes raised is the one that'd bug me though: you're getting better at the same time the AI is, so the win rate doesn't prove much either way. Have you tried freezing a Q-table snapshot and running it against a fresh random player for a hundred matches? That'd give you a baseline that doesn't move while you do.
Thanks Paul! 😁 The AI Mind View was something I really wanted to include because I think making the learning process visible is just as interesting as the gameplay itself.
And that's a really good point about the measurement problem. Since both the player and AI are adapting, win rate alone isn't a reliable measure of how much the AI has improved.
I haven't tried freezing a Q-table snapshot against a fresh random player yet, but that's definitely an interesting experiment. Could give a much clearer picture of how well the AI is actually learning. Appreciate the suggestion!
A game that adapts to the player is a much harder claim than a game that reacts to the player, and the difference is where I'd poke. In our own runs this week we asked a model a question five different ways with no documents at all, and it answered --no-cache five times out of five, because the flag was already in its head, not because it learned anything from the run. How do you tell, in your game, whether the ninja is actually adapting to how someone plays versus just repeating a pattern that already worked once?
That's a fair question! 😁
The distinction is important. In my game, the ninja uses Q-learning, so it's not simply hardcoded to repeat a successful move. It updates its Q-values based on the player's actions and the rewards it receives over multiple interactions.
One interesting thing is that the AI Mind View actually shows which moves the ninja chooses in response to certain player actions. I've observed those moves changing when the player's strategy changes over around 3–4 matches. So you can actually see the adaptation happening rather than just noticing a different difficulty level.
The learning data is also stored in client-side localStorage, so its behavior can evolve across sessions.
That said, I agree that seeing different reactions doesn't automatically prove genuine adaptation. Testing it against different playstyles and comparing its behavior with a fixed baseline would be a much better way to validate that.
Definitely something worth experimenting with! Thanks for bringing this up.
Fellow game dev here—love how lightweight this is! Using Q-tables and browser storage to get adaptive enemy behavior without external servers is a great approach 😁
Thanks! 😁 Really wanted to keep it lightweight and fully client-side without depending on external servers. Glad to hear another game dev appreciates the approach!
Tab showing the AI Mind View mid-fight sold me on Q-learning faster than the 29-match test ever could.
That's awesome to hear! 😁 I wanted the AI Mind View to make the learning process visible rather than keeping everything hidden behind the scenes. Glad it helped make Q-learning easier to understand!
Bro, nice Game 😀🥰😊
Thank you so much!! 😁
The live AI Mind View is what turns this from a fun browser game into a great reinforcement learning visualizer. For tabular Q-learning in localStorage, two small tweaks keep the opponent sharp without bloating the table: bucketing distances and cooldowns into coarse discrete bands, and decaying epsilon across rounds while keeping a small exploration floor around 0.05 so it still adapts when a player changes tactics mid-session. After your 29-match test run, roughly how many distinct states ended up stored in the Q-table?