stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

caleb_welch

@caleb_welch

Joined August 19th, 2026

  • 13Devlogs
  • 3Projects
  • 2Ships
  • 18Votes
I like code. My coolest project yet Tetr.AI
Open comments for this post

47m 41s logged

Devlog 1

I got a little busy with school and my social life so I have not worked much on this project yet. Definitely a little step down from my grand project that I just finished. (You should check it out, it’s called Tetr.AI). But I want something a little more relaxed to work on. So I opted to make my own Chess engine built in python. And making this project could lead to some other future projects maybe a cool chess bot or an AI that learns to play chess.
|
So I just got finished with the basic board initialization and piece initialization. Nothing too much.

0
0
12
Open comments for this post

2h 24m 27s logged

Not to big of a devlog but I added executable files for easy running for this project. Also added a training_config json file to easily change training values.

0
0
14
Ship

Tetr.AI

This is the first release of Tetr.AI, my first ever reinforcement-learning project built for the Hack Club Stardance YSWS.

Tetr.AI includes:

  • A custom built Tetris environment built with PyGame which allows you to train and run your own models as well as just play Tetris
  • A PyTorch neural network
  • Deep-Q-learning
  • Model checkpoint saving and loading
  • Saving of training statistics into a CSV file
  • A graphing script to allow you to visualize how well your model trained
  • Windows and Linux setup scripts

Model status

The training pipeline is completely functional, but due to time constraints this release won’t contain a model which can play Tetris well.

I completed two long duration training experiments during development which revealed problems with reward shaping, epsilon, and sparse rewards. Everything on this is documented in the README.

Training and experimentation will continue after stardance

  • 8 devlogs
  • 23h
  • 17.26x multiplier
  • 401 Stardust
Try project → See source code →
Open comments for this post

2h 59m 16s logged

DEVLOG 8: I think I may ship soon…

Ok so I’ve hit a road block. Stardance ends soon which means I don’t really have much time left. My project is a completely working reinforcement learning AI which can play Tetris but not well.

Originally I wanted to perfect a model and then ship the project but due to Stardance ending soon I may change that.

Recent additions

  • Added the ability to resume training on a model you made at your most recent checkpoint
  • Added setup automation scripts for windows and linux
  • Refined README with a getting started section and more detail in the Model History section to give the project more story

Because I’m essentially prepped for shipping and it is a completely working project I will probably ship soon. Wish me luck.

The screenshots shown are the results from training Tetr.AI-V2

0
0
28
Open comments for this post

4h 18m 13s logged

DEVLOG 7: more AI training (hint: FAILED)

This graph shows the results of my first training session of my AI showing how well the AI does over time through the reward. In total it lasted ~17 hours and its obviously not nearly enough time. The reward is supposed to go up over time, which it is. But not fast enough. Overall it only seems to increase in reward over time just by VERY little.

Moving onto the other graph which shows the rows cleared over time. As you can see it never really increases on average. This shows that:

  1. MY AI SUCKSSSSSSS
  2. My AI is dumb

Overall my AI can’t learn and I need to just keep on adjusting numbers over and over again.

0
0
34
Open comments for this post

2h 19m 9s logged

DEVLOG 6: actual learning

Wow two devlogs in pretty much a day… I need to touch grass…

But that is not the point. IT IS FINALLY LEARNING (just very inefficiently) Currently it only learns from two things:

  1. How many rows it cleared on a single run
  2. Whether or not it sold the game

Now pretty much the rest of this project will just be tweaking and experimenting with things. Before I ship I do want to train and release a demo model that you can test locally on your PC ( and I may want to test if it would work on android phones too ) that will come with the project. I also want to make it to where you can create and train your own models and potentially share them with other people. CAN’T WAIT FOR EVERYTHING TO BE DONE!!!!!!

0
0
19
Open comments for this post

1h 38m 5s logged

DEVLOG 5: Random movements

An update from my previous devlog where I started learning pytorch. I have not learned pytorch to the point to where I can explain everything down to its finest details but enough to make my “AI” do some random junk with no direction.

Pretty much I’m just initializing random weights and letting it go. I have 200 input neurons for my 20x10 board. The video I attached below shows the AI just doing some random stuff like rotating non stop and moving left and right.

0
0
27
Open comments for this post

3h 9m 11s logged

DEVLOG 4: The beginning of learning PyTorch & Working AI-Tetris-Environment

Pretty much the title sums up what I’ve been doing for the past 3h and 9m of this. I have some prior knowledge of the basics of machine learning ( from The Nature Of Code by Daniel Shiffman awesome book about coding would recommend ) by making a single layer perceptron ( basically a single neuron algorithm ) that can separate linearly separable data. I attempted to make a multi layered perceptron which actually puts the network in neural network. But I got stuck on back propagation. I don’t really know what to put as the picture for this devlog so I’ll just show a visualization of a neural network.

1
0
38
Open comments for this post

2h 6m 11s logged

DEVLOG 3: TETRIS ✅

THE TETRIS GAME IS PRETTY MUCH COMPLETE (besides some finishing touches) the game is completely playable with:

  • Moving pieces with arrow keys
  • Rotating pieces
  • Deleting rows
  • And the game restarts after there is no more valid places to go

So pretty much complete. Now it is time to dive into the deep waters that is…

NEURAL NETWORKS

Oh boy this is going to be fun (and hard). I already know that the kind of training that I have to do for this is reinforcement learning. Which basically is like giving dopamine to your artificial brain when it does something good and giving it a slap in the neck when it does something bad. Which in return it changes its weights based on its previous performance.

But for the first thing I got to do is set up all of the mumbo jumbo that will actually allow the neural network to see. And I think I have a rough understanding on how I’m going to implement that.

Stay tuned on this awesome journey of making an AI play Tetris!

0
0
48
Open comments for this post

1h 51m 24s logged

DEVLOG 2

Ok it’s been a couple days but I’ve added key presses where:

-Left Arrow = Piece moves to the left
-Right Arrow = Piece moves to the right
-Down Arrow = Piece soft drops.
-Space Bar = Piece hard drops.

Overall it wasn’t that hard to implement but I had this bug where after soft dropping it saves that position to the locked pieces array. Which in return kind of broke the whole game. Here is the broken code block:

if event.type == pygame.KEYDOWN:
    if event.key == pygame.K_LEFT:
        self.currentPiece.x -= 1
        if not validSpace(self.currentPiece, self.grid):
            self.currentPiece.x += 1

            lockPiece(self.currentPiece, self.locked_pos)

The problem was the last line where it says

lockPiece(self.currentPiece, self.locked_pos)

So all I had to do was remove that and it works perfectly. Now I need to make the game rules where if you finish a row it deletes it and then the hardest part… ROTATION.

0
0
86
Open comments for this post

4h 52m 56s logged

DEVLOG 1: Basic foundations

It took me way longer than it should have but I finally did it. I learned how to use PyGame and now I’m on my way to remaking Tetris. I set up a function that puts a random Tetris shape onto the 2D array that is essentially the one source of truth in Tetris at least that’s how I think of it. With PyGame I then update every frame what it should display based on that 2D array. The picture below shows me spinning up 3 instances of this code working. Currently the blocks don’t do much but I’ll start working on that tomorrow. Plus I really want to get the Tetris remake done quick so I can start building and training the neural network to actually play the game for me.

0
0
44
Ship

I made my very first website. With this project I learned basic HTML and CSS and to be completely honest I found that really challenging (harder than real coding). I’m not the most creative person especially when it comes to frontend developing but I think I did pretty good. I had help from AI in the whole learning process but I didn’t let it code everything for me most if not everything was written by me. The projects section doesn’t have anything inside of it mainly cause I haven’t done anything noteworthy lol. If you’ve checked it out I want to say thank you for doing so!

Try project → See source code →
Open comments for this post

56m 13s logged

I added mobile compatibility to my website. Was a bit of a long process but I got it done! What is shown below is the learn more section on mobile (I just listed a bunch of my favorite video games and movies/shows)

0
0
194
Open comments for this post

22m 48s logged

Just came back to this project after a few days due to getting sick and being miserable. But after a few finishing touches I completed it. I have not tested it on mobile and will do so later but I also learned how to use markdown files for this projects README and how to deploy websites to Github Pages. The picture shown below is the socials tab where I put a link to my Github profile and my Stardance profile.

0
0
28
Open comments for this post

3h 37m 4s logged

My first ever website honestly think I’m doing pretty good. I’m not the most creative person alive so it overall looks pretty bland but that is ok.

2
0
50

Followers

Loading…