Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Mistakes were made, what's crazy is that I almost got away with it if bodies teleported instantly. It seemed easier to make the player's pieces in 3D, however I didn't realize how much harder that would make to bot to program due to my engine knowledge. I definitely made an oil painting for a napkin here.



The system I made is super modular. I would have made so many more chess pieces such as the elephant, camel, tiger, and more if I wasn't debugging my bot.

Granted, we didn't have all of the time in the world, I had to prioritize making the game I was imagining because I wanted an outdoor section too. Still it's a little crazy how many inefficient computations I can make at once without lag.

I love sharing nightmare code stories. Half for learning sake, and half for amusement. I think I might have an idea why you had Area2D detection issues. body_enterd only detects bodies while area_entered only detects areas. It's so easy to overlook.



(Congratulations on your fist game jam game by the way!! I loved it) 

Evaluate position is more simple than you might think! Its a function that returns the score of the current board. The bot tries literally every possible combination of moves, than scores the end result. 

Board evaluation
White has a queen (9)Black has a knight (3)=   6
White has a pawn (1)Black has a rook (5)= -4

Then score bonuses would be given if a pawn is close to promotion, the king is close to the center, the rook is cutting off the king's squares. etc.

That's why the bot is so capture hungry. It sees a piece it can take, but can't evaluate it getting taken back BECAUSE of detection issues. The pawn that could take the queen only sees an empty square.

Unfortunately you can't see my work in action because of my detection issues, otherwise my bot would roughly be a 600-1000 elo. In my opinion, the sweet spot for a game jam where some people can be beginners.

Thank you so much for leaving a comment by the way, made my night! 

The modularity would’ve been a huge plus, I found out how important that is later in the dev cycle when I ended up with a bajillion functions shooting all over the place because I hadn’t thought of trying to compress things. Thankfully for us, computers are fast and so in a lightweight engine like Godot you can really get away with a lot of stuff. In the hustle and bustle of modern computing it can be easy to remember that even with a fairly regeular cpu like mine I’ve still got 12 threads performing over 4 billion calculations every second, that’s a lot of math.

Also, you were totally right about the Area2D vs Body2D nodes. The cattails were the third thing I made for my game (right after the walls and the player character), so at that point I didn’t really understand the difference between the two in any meaninful capacity and I was still struggling to wrap my head around the collision system. By that point I had a hammer in the form of my ability to get collision calculations to work, so those cattails were looking suspiciously nail-like. Even later on I couldn’t figure out how to fix it because part of how I got the cattails to work to begin with was by them sending a signal to the main game node, and I didn’t know about object.connect(“signal”,local_function). In hindsight it should’ve been obvious that such a function existed, but I didn’t really have a feel for the way information flowed between nodes so I didn’t think of it. Yesterday I went back in and finally made the cattails work the way they always should’ve (which also cut out almost a dozen lines of code only to add like 4), and now it’s just a really good example of how much I’ve learned through this whole thing (like you’re chessboard example!).

By every combination, what kind of depth are you using here? Just simple “one move white one move black” or what? 600-1k Elo isn’t half bad for a random chess engine whipped up in a week! It even fits in with your modular things since I’m sure you could pump that up another couple hundred elo with some more tuning.