Chess-Challenge icon indicating copy to clipboard operation
Chess-Challenge copied to clipboard

Chess board not working

Open OmerKop opened this issue 3 years ago • 20 comments

image_2023-07-21_170319493

my chess board looks like this for some reason and i dont think its suppose to be like that

OmerKop avatar Jul 21 '23 14:07 OmerKop

I m think game cant load files (piece images, fonts, etc)

CREAsTIVE avatar Jul 21 '23 14:07 CREAsTIVE

That looks like a font issue. If I'm not wrong, the chess pieces are text too and they're getting hidden because the font doesn't work for you for some reason.

just-a-hriday avatar Jul 21 '23 14:07 just-a-hriday

That looks like a font issue. If I'm not wrong, the chess pieces are text too and they're getting hidden because the font doesn't work for you for some reason.

I m try to delete font files (they inside resource folder) and get same font, but my pieces didn't disappear. Still the problem is reading the file.

CREAsTIVE avatar Jul 21 '23 14:07 CREAsTIVE

Try check YOURE_REPOS_FOLDER\Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\resources and tell me what's in it

CREAsTIVE avatar Jul 21 '23 14:07 CREAsTIVE

Ok turns out I was wrong the chess pieces are all in a png. But yeah as creastive said it looks like there's something wrong with the resources.

just-a-hriday avatar Jul 21 '23 14:07 just-a-hriday

after net6.0 there is no resources

Try check YOURE_REPOS_FOLDER\Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\resources and tell me what's in it

OmerKop avatar Jul 21 '23 14:07 OmerKop

after net6.0 there is no resources

Try check YOURE_REPOS_FOLDER\Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\resources and tell me what's in it

Open VS and find OPENSANS-SEMIBOLD.ttf, sdf.fs, Fens.txt and Pieces.png in solution explorer then for each file look down, set "Build action" to "Embedded resource" and set "copy" to "always copy", then try run again

CREAsTIVE avatar Jul 21 '23 14:07 CREAsTIVE

i found the files but how do i do what u said?

OmerKop avatar Jul 21 '23 15:07 OmerKop

after net6.0 there is no resources

Try check YOURE_REPOS_FOLDER\Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\resources and tell me what's in it

Open VS and find OPENSANS-SEMIBOLD.ttf, sdf.fs, Fens.txt and Pieces.png in solution explorer then for each file look down, set "Build action" to "Embedded resource" and set "copy" to "always copy", then try run again

textures and fonts still do not work after setting params you mentioned

manfromfms avatar Jul 21 '23 15:07 manfromfms

Then just copy them manually copy folder repos\Chess-Challenge\Chess-Challenge\resources to repos\Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\resources

CREAsTIVE avatar Jul 21 '23 15:07 CREAsTIVE

Still does not work. Ive tried to reinstall project too

manfromfms avatar Jul 21 '23 15:07 manfromfms

tried it didnt work

OmerKop avatar Jul 21 '23 15:07 OmerKop

strange... Do you have Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\resources\Pieces.png file?

CREAsTIVE avatar Jul 21 '23 15:07 CREAsTIVE

yes

OmerKop avatar Jul 21 '23 15:07 OmerKop

launch \Chess-Challenge\Chess-Challenge\bin\Debug\net6.0\Chess-Challenge.exe

CREAsTIVE avatar Jul 21 '23 15:07 CREAsTIVE

I have a theory that VS simply doesn't have enough permissions to copy the files and read them after the program starts.

CREAsTIVE avatar Jul 21 '23 15:07 CREAsTIVE

your theory is wrong. I have solved it but idk what was the problem:

  1. Path is too long
  2. Path includes non english letters

After moving main dir to root folder it loads correctly

manfromfms avatar Jul 21 '23 15:07 manfromfms

After moving main dir to root folder it loads correctly

What exactly do you mean by that? I'm having this same issue and nothing i do seems to do anything

WithoutNameIdeas avatar Jul 22 '23 00:07 WithoutNameIdeas

Check the entire path to the project, and in the project, if there are bad characters in the paths it could cause the resources, fonts, sprites, ect... not to load properly

CaptainDeathead avatar Jul 22 '23 01:07 CaptainDeathead

Thanks! Turns out one accent in the name of a folder was killing visual studio

WithoutNameIdeas avatar Jul 22 '23 01:07 WithoutNameIdeas