#Visualization of chess

1 messages · Page 1 of 1 (latest)

obtuse elk
#

gnu-chess probably has already a game notation in which you can take inspiration on

tawny dew
#

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

stone seal
#

what is fen

stone seal
#

no like literally what does fen mean

stone seal
#

oh

heady mica
#

lol I'm also making Chess in Unity

#

I recommend making the pieces into Scriptable Objects

#

makes things much cleaner

stone seal
#

how does that make things cleaner?

#

why not just prefabs?

heady mica
#

Oh well I guess prefabs also work

#

I have both in my project, I just like using scriptable objects lmao

pure orbit
#

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

tawny dew
#

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?

tawny dew
#

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

obtuse elk
formal spire
#

r/woooosh