Smort banner

Smort

5 devlogs
7h 55m 52s

A fun AI game where the user chooses a start, finish and obstacles and the bees learn to navigate it!

This project uses AI

Occasionally used AI models to learn the fundamentals of certain functions of the algorithms.

Repository

Loading README...

Capy

Hey! I’ve made some more fun updates. :D
I mostly fixed some bugs and introduced some other fancy icons and a new menu! I’m working on UX things largely. I’ve come to the unfortunate realisation that my current algorithm (despite being fun to watch) isn’t very smart when it comes to multiple obstacles. I’ve had to limit it to 3 obstacles…

HOWEVER!

I’m OFFICIALLY ADDING ANOTHER ALGORITHM! A more complex one. I’m planning a Q-learning algorithm. I currently don’t really know how to code one, but that’s what I plan to figure out over the next few logged hours! I plan to alter the home page to be a selection menu. The ā€˜recommended’ option (Q-learning) and the fun option (genetic algorithm).

I really hope I can figure out how to make this work properly, as I think it’d be a super fun improvement. Naturally, I’d have to limit it to a grid-based game, but I think that can also be fun! I’d love to hear what you think! :)

Also, this devlog is 1000 characters EXACTLY! Check for yourself.

Attachment
0
Capy

Added a start menu. Working on improving it with labels. I also improved the icons and AI logic.

Haven’t coded in a while!
I also added the obstacle dragging system and the other things I planned to add in my previous devlog! :D
yay

Attachment
0
Capy

Updates!

Finished the algorithm! It is much smarter now!

Optimisation

I didn’t copy-paste any code, but I asked Claude AI to help me diagnose the main issues. I learned how Svelte’s reactivity is done, and now I know a lot more about handling arrays and DOM updates efficiently! :D

I learned to use {#key} in Svelte, which triggers updates upon a change in the selected variable, which makes 100 updates per frame, (6000 a second) into 1 per frame! It only updates when needed.
There are a few more optimisations

Plans!

I plan to add, like the rounding of the ā€œcuriosityā€ variable, since it’s converting to a string each update, which is quite inefficient. I wanna make it stay a number. Also, I should REALLY start adding comments. Maybe using key-words for each part? That would help me find certain things. Coding using these indices and arrays can be quite inefficient. ONE more thing, you can see the art I made for the bee in the image below! If you don’t like it, please say so. I don’t know if I should keep it.

PS, I write all the devlogs, descriptions and READMEs by hand (no AI), so I apologise for any spelling or grammar mistakes! :D

Attachment
0
Capy

Improved learning algorithm!

I spent a while optimising the algorithm in various VERY effective ways! The agents respond well to distance from the target, and very well to arrival! I’ve also added a simple, small button panel for the user to change training values! I also added a curiosity and speed parameter.
In the image below, you can see the agents learning to navigate around the obstacle to the target! I’m next going to improve graphics, adding cute icons and sprites, theming the site around bees going towards their hive!

Attachment
0
Capy

Started implementing AI algorithm. Using a genetic algorithm! Trying to figure it out. :D
The AI currently chooses a pre-determined set of random directions, and whichever one does best is recorded. Then, the others receive its genes alongside a randomiser so they don’t directly copy it.

Attachment
0