How to make a chess type moving system and the "squares of a chess board"

So for those of you who know how to play chess, you know that the pieces can move, but only in certain directions, and attack from certain places. I would like to know how to make something like that suggestions and ideas only, I want to learn also. And how I can make the “squares of a chess board” onto roblox. GUI? or something else? Again suggestions and ideas only because I also want to learn

Any code we can work from that you have?

Currently, no.

I am looking for ideas and such to create this code

hey guys! no answer for 2 days! Sorry to bump the topic but I need a solution for this.

Maybe this can help you How do I make a Moving Unpredictable Chess Piece?


I haven’t really made a chess game yet, sorry.
Just wait for someone else to respond, I guess. Good luck!

1 Like

the thing is I don’t know how to input that to ROBLOX, I’m not that good of a scripter.

This seems pretty like it is for a pretty advanced scripter.
Idk, it might not be a starter thing.

My point is I’m not experienced but I want to learn how to do it

You could make the squares with building and maybe some form of scripting for a placement script.

Ok, but I’m trying to make a chess AI like system first

Check this out. Neural Network Library (Obsolete)

lol sorry I sounded a bit rude, also I looked at that thanks!

I can help, i’m making one for some months from now. So i recommend making a raycast to select pieces, and using and abusing canquery, so you use the raycast to check if the part is parent of a piece and if it has been clicked, if yes then that’s the selected piece, then clone it, make a for i statement and pass by all parts to make them a different material or something. Then you turn off cancollide and canquery in all pieces and with that selected piece make it appear by positioning it on the square with the humanoidrootpart. then you can check if the player clicks and if he does the piece moves there, as you won’t be changing the selected piece that i told up. If you want to know more just tell me

This is an interesting approach to say the least, but tbh I don’t dig the idea of entirely depending on raycast to move pieces. A better approach imo would be to create a 2D array with 8 colums and 8 rows, make classes for your pieces, and then use math instead of raycasting to figure out the target_square, after which you can use multiple methods to move a piece to a square corresponding to the target_square.

GAM Chess - Roblox here is the game
Raycast allows you to see a preview of the piece for exemple and makes it nicer for the eyes. Also it’s not entirely dependant on raycast. It is only used to find the piece and where the cursor/last place touched is. After these 2 things it determines everything else. The game requires 2 players, i really don’t want to make a AI. Change the language to english in settings because it was mainly made for my school friends. Sorry for late reply i rarely check devforum.

An easier option is to use Minimax algorithm or the optimized version aka Alpha beta pruning algorithm.