#Visualization of chess
1 messages · Page 1 of 1 (latest)
I think you should instantiate the chess board as a gameobjects, maybe just make prefab for each type of piece, its not that many pieces really
what is fen
no like literally what does fen mean
oh
lol I'm also making Chess in Unity
I recommend making the pieces into Scriptable Objects
makes things much cleaner
Oh well I guess prefabs also work
I have both in my project, I just like using scriptable objects lmao
You tell us what you think you want to do based on FEN string value. Like give an example. Because I have no clue the what rules are for chess beyond the basics
The string is a little awkward where you will need to split it via a couple different delimiters
What part of the FEN corresponds to the correct square placement ?
Green line?
Couting the spaces? Perhaps that’s a typo for counting?
So you just split the string and grab the placement part. Creating an algorithm to be able to handle the actual placing of the piece given the placement value extracted is something that requires knowing how to handle the value and I have no experience with that
Well, each piece you read from the fen you can instantiate by using a dictionary that maps each symbol into the correct prefab. Dont you have the position already?
Yes. Why would you ever need to read that fen string again after loading the initial setup?
Id definitely watch the sebastian lagues video about chess, it should give you some idea of how all this could be achieved, its not a tutorial but shows everything needed (and all the code is available on github I think). Iirc he even made fen reader himself so definitely worth taking a look. You have to make class (or maybe struct) to represent a piece and then make some sort of collection to store all the pieces. That video should get you started with that

r/woooosh