/Home

https://chessforeva.gitlab.io
......... ...........
.... ....

Chess software for fun

svētdiena, 2010. gada 24. oktobris

Unity3D chess project

Last version: Unity 2018.1.0b4 (beta)
 source 19Mb project, assets* 

*Upgraded the 7-years old project, solved compatibility issues, have read lots of docs. It's up to date now (jan.2018). Have tested Win 64b.32b.standalones, running in editor scene view. No errors, 0 warnings.
WebPlayer is discontinued now because browsers are disabling such plugins, except old browsers maybe.
Unity will throw lots of errors for WebGL compile (or android, or iOS). Each platform is very much different and there is no universal code for them all. Or modify code as needed. 


Description

  • Development platform: Unity3D game engine (free licence);
  • Runtimes: Windows Standalone (download, unzip and run). The old 32-bit compile, it's smaller;
  • Program sources: 2018.jan upgraded project with assets folders;
  • Chess engines: modified Valil chess engine used (C#);
  • FICS freechess.org: connection to chess server via telnet realized in windows standalone version (10/15/20min games, simple run for dummies -as guests, look screenshots, not advanced);
  • Strong chess: windows 32-bit standalone version is integrated with Crafty, Rybka and Stockfish chess engines (without opening/ending-tablebases, strong anyway or can add);
  • Other: Blender models of chess pieces - all from the free web;
  • Disclaimer: There is no commerce on this site!




  • 118 comments:

    1. Hello, nice proyect, how can we download the 190mb source code? thanks.

      AtbildētDzēst
    2. All this code is only 106Mb now and is available for download. Cheers!

      AtbildētDzēst
    3. Great! Thank you. We'll be investigating the code and maybe using it for a uni proyect.

      Thanks again! :D

      AtbildētDzēst
    4. Thanks for this entry!
      I will check it out :D

      AtbildētDzēst
    5. Hello Chessforeva ;-)

      I have just discovered the Unity 3D Chess Project.
      I'd like to use this as a Base, for a commercial Chess Game. is this Project really totally free for Developers?

      If you please could give me some Information about that?

      Marco

      AtbildētDzēst
    6. Marco, use it as You like. I am not interested in chess commerce and have no time for product support, nor bug-fixes or further developments.
      I think, that for serious product Unity-Pro should be used, because then You could write c# code for UCI connection or chess servers via sockets. My demo-solution is a bit limited. And then for all mobile devices. Anyway, Unity is powerful as hell (suggest it very much).

      AtbildētDzēst
    7. Hi Chessforeva ,this is very nice game.i am trying to switch into mobile i am getting lot of errors(Array Declaration).Shall you help me.i mean you declared directly array.but mobile needs integer array,float array,char array, String array also.i am trying to change the separate arrays but still i have lot of errors.

      AtbildētDzēst
      Atbildes
      1. Hi Subbu,
        did you find solution?

        Dzēst
      2. 19.04.12

        Arrays described here
        Also good explanation here

        Arrays can be:
        1) fixed-length predefined (for floats and others);
        2) dynamically created as lots-of-objects having key index.

        Unity compiles in 2 stages:
        Unity compile (syntax, assets,as Unity needs) and .NET build (compiles and links into exec.code - MS Studio .sln project inside your folder)
        And therefore types for javascript variables should be (:int, :String) because compilers lose type info somewhere in-between inside.

        Javascript (kinda browser's interpreter) is easier to use, but c# (read Microsoft) is closer to exec-code inside.
        Maybe use c# for these data and just send data to other 3d-objects.
        I hope, it helps, but I don't know.
        Best regards,
        Chessforeva

        Dzēst
    8. Hello.
      Thanks.
      Congratulations.
      Only thing to improve: the pieces are not perfectly placed.

      AtbildētDzēst
      Atbildes
      1. Yeah. Maybe pieces could move separately, having own path finding AI script.

        Dzēst
    9. I am planing to make a two player Chess game.I trying to swithoff AI but i am not finding to switch off AI.Please send me.

      AtbildētDzēst
      Atbildes
      1. There is a 3d object for each engine in the scene. And the main controller script has object too with assigned script Scriptings.js, search for "DoEngineMovements" in it. This function sends messages (requests) to other 3D objects and they send back AI moves after (function EngineAnswer). So, there is no direct function-calls.

        Dzēst
    10. i am using valli chess engine i removed other chess engines. "DoEngineMovements" in this function nothing is there. Just game winning ,game lose and game draw.you are calling your chess server(when statusTcp == 21).That time you are calling your TcpServer.i mean in script 4(Ch_socket.cs).you are calling your server "http://localhost:5050/IN_BUFFER.txt".I planing to use my own server for TWOPlayer game.

      AtbildētDzēst
    11. In fact, there are connections to freechess.org and to the old crafty.exe interface (via this local web-server) implemented. Just turn it off and hack the script as You like.

      AtbildētDzēst
    12. Congratulations. that project as well, I wanted to ask if you have a math game. Unity3D developed?

      AtbildētDzēst
    13. hi...
      First of all... Brilliant project. It's very impressive.

      I'm making a similar sort of chess game. I have made the board and the pieces in 3dsmax and imported them in Unity in .FBX format. I have also imported the scripts (I only want to use the Valil engine).
      Now, how do I go about using or applying the scripts to the pieces? Could you help me out? I'm pretty new to this stuff.
      Thanks.

      AtbildētDzēst
      Atbildes
      1. Trying to be short:
        1) create meshes for pieces (these FBXes and textures);
        2) create objects-instances (8 white pawns as copies of white pawn mesh, etc...) and place them in a scene;
        3) assign scripts to objects (mouse controller, piece behaviour on movements, chess calculations).
        Read previous comments and scripts of source code.
        It is too complicated to describe in comments, spend time and find best way. Objects can call functions of other objects, by the way.
        Mouse capturing is in Scriptings.js.
        Valil is not the only, other C# chess engines.

        Best regards,
        Chessforeva

        Dzēst
    14. Thanks a lot!!!
      :D
      Really appreciate it!!
      :D

      AtbildētDzēst
      Atbildes
      1. Hello once again!!!
        I did whatever you said. Created the instances and placed them in the scene. When I drag and drop the movement script on the piece, it says the names don't match. :|
        I tried to re-export the FBX with the names in the used in the scripts. Still doesn't accept. What am I doing wrong?
        I'm really sorry but I'm a real amateur. Please be patient with me. :)
        Thanks again!

        Dzēst
      2. Aha, I knew. Scripting can be done smarter (colliders/ready scripts created by others) or my way (simple MonoBehaviour class script assigned to object) that is not so smart but working.
        The main idea of controlling: 1) capturing events - you should "override functions" (OnMouseDrag() fxmpl, which is doing nothing by default) or 2) doing what you like in update() function working in FPS (frames per socond) manner (look status of mouse etc).
        Don't expect drag & drop programming, scripting is coders' world.

        Dzēst
      3. Thanks a lot (again!) :)
        Sorry for being such a nOOb.
        -_-

        Dzēst
    15. Hey, really great project. Nice work :)

      I've just finished creating my own chess pieces, but they are actually characters, like in harry potter :) Just needed help by replacing your pieces with mine. How do i do that?? Maybe later on i'll put in some animations for those characters too
      thans :)

      AtbildētDzēst
    16. Docs about it. Open Unity, add 3D asset by browsing model in FBX format. I used Blender to export to FBX. Also OBJ of lightwave and zipped colladas are common formats. Model for the game engine should be triangulated (simplified) before importing, it can't be Ferrari model with thousands of polygons for rendering best ever pictures.

      AtbildētDzēst
    17. Can you explain in general what the 5 script files do aka c0_4unity_chess.js, CraftyCall.js , JsJester.js ,RybkaCall , Scriptings.js ,and StockfishCall.js ??? (Couldn't completely follow the comments in the script)

      Also can you give some details about the networking aspect ? I can see the code, but i'm totally lost. :(

      Thankyou for this amazing work btw. :) and for helping us noobs out. :)

      AtbildētDzēst
      Atbildes
      1. About networking. In general, network always means sockets. Unity normally is for game server. This means to set up Unity server solution (of your choice, fxmpl. or ask google) and via networking class You get procedures "bumping" on all kinds of triggers. It is high level. If You are more advanced, You can build DLL in C++ which controls sockets (can't use in free version). My networking is by telnet protocol. So, I use HttpWebRequest to other program (local webserver) which while running in background does the telnet connection. This chess project is "a demo" and I didn't pay a dollar for Unity, but I can say for sure, there isn't (and wasn't) other better platform for serious education on game development, coz it's complex and others just are kinda not for people. Study this and You will know meshes, textures, triggers, all what is graphics with working result on average hardware at the end without C compilers.
        About script files: CraftyCall.js starts crafty chess engine, interfaces via stdin-stdout; JsJester.js is javascript chess engine (ludochess.com), RybkaCall.js starts Rybka free version of chess engine, interfaces via WebRequest, subprocess via stdin-stdout; StockfishCall.js - it's Stockfish engine, like Rybka. c0_4unity_chess.js contains chess logic (simple way to validate chess moves for pieces); Sockets.js is connection to FICS telnet server by starting process and interfacing via WebRequest. Scriptings.js is main script for scene which resides under fake-object and waits for action, plus other functions.
        The cube scene on youtubes for noobs, in Blender tutorials, demos of all kinds is like ABC for graphics, best learning way. Try rotate a simple cube, give color, move it. Hope it helped. Regards.

        Dzēst
    18. Hey, I imported the character into unity chess, but is there a way to replace the pieces with mine and still have it playing the way it should? For example, i want to replace the bishop piece with my character and still play the game.
      Thanks for your time help btw. Really appreciate it :)

      AtbildētDzēst
      Atbildes
      1. Every object has a name tag. This is how script (Scriptings.js) links with objects by function GameObject.Find("tag"). So, you can replace names in script or simply set the same names for objects You created in scene. The pieces You see in editor's scene are just templates (I hide them) for cloning and material adjustment (dynamically on runtime).

        Dzēst
    19. Hey, i got the pieces replaced :) Thanks :) still got a problem with the functioning tho.. Do i need to add the prefabs to them? If so, how do i do it??

      AtbildētDzēst
      Atbildes
      1. I understand prefabs this way. Assets are to be defined in the project view. For me it is list of all links to files of models and textures in readonly way. When You drag and drop by mouse something from assets then You create a "pointer" to asset (prefab instance) for this scene (it saves in cache files). And properties are just additional parameters for these pointers. I mean, You use prefabs already all the time.

        Dzēst
    20. When i tried to add the behaviour file from Valil (WhiteKnight - I was just trying that one only, haven't started with the others), I get the error - Can't add Script behaviour WhiteKnight. the Script needs to derive from monobehaviour!

      I did name the model I was trying to drag the Behaviour to as knight (just as your own model is named). The model is replicated, but it does not move - which i believe is because no behaviour attached to it.

      There was a previous similar comment to which you replied - "Aha, I knew. Scripting can be done smarter (colliders/ready scripts created by others) or my way (simple MonoBehaviour class script assigned to object) that is not so smart but working.
      The main idea of controlling: 1) capturing events - you should "override functions" (OnMouseDrag() fxmpl, which is doing nothing by default) or 2) doing what you like in update() function working in FPS (frames per socond) manner (look status of mouse etc).
      Don't expect drag & drop programming, scripting is coders' world."

      Can you describe it a bit more?

      AtbildētDzēst
      Atbildes
      1. Unity is a smart construction. All You see is graphics editor application. There is Visual Studio 2008 project for C# inside with compilation in background when running scene (Mono thing). For javascript there is internal webbrowser javascript engine right from Mozilla. Javascript has simple syntax but higher risk of miscompilation (more levels internally), slower performance. C# is closer to ground but Unity itself is not Microsoft. I you want get compiled under MSStudio then should be under defined class and this is Unity's MonoBehaviour class with functions and variables. All C# scripts assigned by browse should be class files. And You write your functions (override) under predefined Update, Start, etc. But, by the way, You really get compact Chuck Norris compiled at the end, especially for WebPlayer.

        Dzēst
    21. Lol thanks for your help. :) Can i ask you more thing??? (sorry for being this annoying)

      Basically Once I imported the models (and got everything setup thanx to u , luck etc), I realised that the models (which are not radially symmetric - as they are humanoid characters) are oriented in only one direction. i.e say the White chess piece characters are facing North, then the Black pieces (except for the opponent knight - since you've added a separate class for opponent knight)

      Now i assume that this can be fixed by stating something similar to - GetComponent("INSERT NAME OF CLASS HERE"transform.EulerAngles 180,0,0) . So in this scenario i should target what class?? (that is what should i insert in the INSERT NAME OF CLASS part)

      Also I wanted to hide the promotion menu till the point that is required. How would you advice we go about with that? Also in terms of targetting what class should I target (for the menu)

      AtbildētDzēst
    22. GameObject.transform.eulerAngles = Vector3(x,y,z);
      GameObject.Find('Object name').transform.eulerAn...... is the same for other object than script attached to (with finding before inside).
      And "transform" is like a parameter (component) for object, so GetComponent just returns parameter of type (name of class) NOT OBJECT.
      GameObject.GetComponent(Transform) returns "transform" for example.

      About hiding GUIs (menus). Draw the menu in OnGUI () when You need and keep a public variable for "menu status". Good answer already here. OnGUI is like "renderer per seconds function" and GUI.Label inside is not definition once, it draws all the time what You ask to.
      To hide objects use GameObject.Find("Object name").renderer.enabled = false;
      Hope it's helpful.

      AtbildētDzēst
    23. Thanks. that was very helpful indeed. :)

      AtbildētDzēst
    24. Hmmm I still don't understand what variables i should use with the GameObject.Find('_______________').transfor.eulerAngles......
      so as to be able to rotate only the black pieces. :( Any help with that?

      AtbildētDzēst
      Atbildes
      1. In Scriptings.js procedure CreatePiece there is toObj.name="piece_"+piece_at. This assigns ID to object. Also, toObj.renderer.material=... in the same procedure. This gives visual texture according to the color of piece, just the same as hidden rook (on a8 or h1) has. So, GameObject.Find("piece_e4") returns object on e4.

        Dzēst
      2. I tried this
        function protate()
        {
        GameObject("peice_e1").transform.eulersAngles = Vector3(180,180,180);
        }
        To see if that would rotate, the characters, but that doesn't seem to do anything. Any Help? Also I can't seem to replace the opponents_knight.I get a nullReferenceException. Even though i did it the same way as the other Characters.Any clue as to why that is so?

        P.S this is what it looks like atm. -> https://www.dropbox.com/sh/dmd0ii4lshw7fcj/GwsOp-CSYA?m

        Dzēst
      3. Looks like warcraft :) Black knight stays on g3 with name "oponents_knight" (sorry, one "p"). So, assign the same name to Your monster, put on g3, and remove my black knight. GameObject.Find("piece_e1").transform.eulerAngles = Vector3(180,180,180); Be precise on syntax, also read unity docs. Error message tells that it can't find something internally.

        Dzēst
      4. Close.. THey are DotA2 based models, Lightly sculpted, and polygons reduced. Had to remove (i.e attach everything to one) all the parts and make it one, so that it would work as i wanted. (I think if i make the changes to just the root of those bodies, then I should be fine, but that is for later - Once i start getting animations and whatnot).

        Yeah I guess i really got trolled by that P in opponents (and "ei" in piece).

        I tried GameObject.Find("piece_e1").transform.eulerAngles = Vector3(180,180,180); and using it as a function. No errors, but no effect either.
        I thought it maybe because of the FInd attribute somehow, as it may just be finding something (I dunno. This is my first time working full on Unity. )

        I tried it using it as part of a function, but again to no avail. :(
        P.S should i get this discussion through email? (I just set it here so that others in the same sad boat as me would be helped.)

        Also please do tell me if am irritating you too much. I'm juut doing this so I can learn Unity more. Just been a designer till now. Wanted to start trying stuff I really like.:P (my id githugt@gmail.com)

        Dzēst
      5. Look, I'll give You some advices how to work with Unity. I use limited feature Debug.Log() very much to see memory, but, I really think You should install Debugger solution if not skilled on intuitive error correction all the time (I just feel this animal). Then stop somewhere (maybe You even not getting here) and take a look whats inside (just as we programmers do in MsStudio or Eclipse). Another important thing. Unity is really well documented, I've seen much worse. And also people give really good answers on Stackoverflow, the best expert source. Just look for tags and there are good answers already.

        Dzēst
      6. An by the way, how did You get the starting position, I mean, placed by mouse all of them or replaced my template pieces only? If by mouse then the object name (1st field in Inspector panel) is not "piece_e1" (these are generated for copied objects in my script).

        Dzēst
    25. I did by deleting your models, and placing the pieces on d1|e1|f1|g1|h1.
      Example<-https://www.dropbox.com/s/9ek0wik1inminz3/Screenshot%20%2826%29.png?m
      As can be seen from the picture ^. The first field in the Inspector Panel just shows rook. But I thought that was just the name of the model, We cannot control orientation with just that right? Coz these are mapped for both the sides. (White and Black.)

      AtbildētDzēst
      Atbildes
      1. Yes, this is the name of object in pic. For both sides one piece. Except the black knight, which is rotated. I copy object "rook" to "piece_h1","piece_a1","piece_a8","piece_h8" in Scriptings.js on startup. I change the name when animation of moving piece is over by GameObject.name = "piece_h2" ,where h2 is the square piece moved to;

        Dzēst
    26. Thank you for making this available! I'm working on a commercial chess project as well, and just needed a good chess engine. I really appreciate that you created this!

      AtbildētDzēst
      Atbildes
      1. Telling the truth, the strongest chess engines are listed here working via UCI interface. So, the GUI should be closer to C level - for strong chess, I think so...

        Dzēst
    27. Hey, I was just looking into the files in Unity, and I have a few questions. First, do you have any documentation for the project?

      For each side, I have two different looking rooks, knights, bishops, and pawns. So, for example, the black rooks look a bit different from each other, and also different from the white rooks, and so on.

      How can I integrate them into this version of the game?

      I'll also be making minor graphic changes to the board, and adding other features to the game for my project. But, as far as the chess play goes, I'm really happy with your engine. My main issue will be getting all the right pieces in there.

      I'd be very grateful if you could help me out. Thanks!

      AtbildētDzēst
    28. I've figured out that the individual pieces on the board are generated at startup. Since the default version has only six types of pieces, they are generated using them. There must be a way to tell the program to use different meshes for each rook, each queen, and so on. Can you give a brief explanation of how to do this?

      AtbildētDzēst
    29. Jonathan, there is no documentation, except my answers on comments right here. At first, I would suggest using stronger C# engines, or develop UCI standard via DLL for all types of chess engines. Unity is a rich graphics game development platform at first. I don't think it is reasonable to improve this scene. Better take it as sample how it is possible to realize in Unity, and start from the blank. Too much garbage also. By the way, Microsoft's Chess Titans is a nice looking chess app, but I don't think chess players would buy it because of graphics. It's not for serious chess. I think so.
      Best regards,

      AtbildētDzēst
    30. Thanks for the continued help. I'm not a programmer, though I'm beginning to learn JavaScript so that I can develop other games in Unity. My chess game is about more than just chess, and I think the specific them of it may actually draw the most customers. Of course, a really strong chess engine couldn't hurt!

      I may end up hiring a freelance programmer to help me adapt one of the C# engines, per your recommendation. Thanks again!

      AtbildētDzēst
      Atbildes
      1. Chess engines require deep calculations and JavaScript can't provide it. That's why C# should be used here, or UCI. I know nothing about freelance, so Google and trust them/or not. No suggestions, sorry. I have seen softwares with minimal chess science inside, but mostly chess GUIs support usual 2D as well and configurable list of engines attached. By the way, there are different kjnds of chess too: standard, losers, bughouse, etc...

        Dzēst
    31. How do you view the source code for the game?

      Thanks

      AtbildētDzēst
      Atbildes
      1. The source is in the zipped project archive. Unzip in a separate folder. Start Unity, go to menu and Open Project. Browse for folder. Should be simply.

        Dzēst
    32. Compiled this for iOS Mobile. Had 26 errors or so. Most of them were string manipulation functions, and integer/object confusion. I worked through it and it looks great! Good work on this, I'll post the link once iOS version and Android versions are published :)

      AtbildētDzēst
      Atbildes
      1. I have no iOS experience at all. Thanks for info.

        Dzēst
      2. Could you tell me how to fix these errors?
        If could, Please share it with us, @Chessforeva Dev

        Extremely Thanks

        Dzēst
      3. The truth is, I can't imagine compilation for Androids (java mostly,btw) or Ipads (objective-C) without serious modifications, testings and debuggings using real devices. This is rich graphics IDE built above Microsoft Studio. It took me lots of time to get the webplayer version working, it's too different.
        I think, the way is by trying to compile and search Unity answers or forums as stackoverflow for good advices when errors appear.
        I have no vision to work on this, nor appropriate devices, sorry.
        Best wishes.

        Dzēst
    33. can anyone tell me,how to highlight the possible moves in that?

      AtbildētDzēst
      Atbildes
      1. Hmm, I would swap textures for squares, or create dynamic objects above squares, or just put another GUI element with written text.
        3D engine means objects in space, not a 2D table of pixels.

        Dzēst
      2. hi chessforeva , one thing that i also added in that is i have not find the possible moves . .how can i find that one?

        Dzēst
      3. Take a look in Scriptings.js. There is function C0.c0_get_next_moves() in the main loop Update().

        Dzēst
    34. hi chessforeva, thnx bt
      i have one question is that how can i slow down the piece movement in the chess after every turn?

      AtbildētDzēst
    35. hi chessforeva can u tell me how can i get invalid move in that?

      AtbildētDzēst
      Atbildes
      1. ? Maybe You could just set up position by using FEN string, and adjust 3d-objects in scene.

        Dzēst
    36. hi sir can u help me working a checkers game?

      AtbildētDzēst
      Atbildes
      1. Nope. Sorry. Checkers is too different. Ask google for "checkers engine".

        Dzēst
    37. Hello, how to promote a pawn when it reaches the opponent's side?

      AtbildētDzēst
      Atbildes
      1. Pawn becomes a queen by default. In other 1% games user can select other piece before moving. Actually, only knight is reasonable :)

        Dzēst
    38. from where i can download 190 mb file..because the link you have share is not working properly...

      AtbildētDzēst
    39. All this code is only 106Mb and the link is http://goo.gl/B2NRJ
      Sorry, I have no mirror for this.

      AtbildētDzēst
    40. Hi, I'm using your chess engine in my artificial intelligence subject, and I would like to know which scripts are used to achieve it, and which techniques you have used, if it's possible of course.
      Thank you very much! And really good job!

      AtbildētDzēst
      Atbildes
      1. Thanks for kind words. So, there are 3 types of chess engines:
        1) javascript JsJester.js (slow performance, anyway working as sample);
        2) c-sharp in folder "valil_chess_engine_component" (all .cs files, it is the best way for Unity, because it is script and very fast when compiled);
        3) UCI-connected Rybka, Crafty, Stockfish (actually I don't like connectors to executables).
        If You are interested in using scripts of stronger chess engines, please, take a look at cs-collection http://chessforeva.blogspot.com/2012/01/c-chess-engines.html. Just copy .cs files and create class MonoBehaviour (Unity needs it) as I did in ValilScriptObject.cs
        Regards,
        Chessforeva

        Dzēst
    41. good day sir, can you help me out with the mesh thingy? i wanted to replace a piece by a battlion perhaps. and it composes 5 characters. my problem is that whenever i move a pawn, it reappears on the rook's side :3

      AtbildētDzēst
      Atbildes
      1. Javascript generates piece on square by using template-mesh with id-name. So, take a look in Scriptings.js procedure CreatePiece. Instantiate() does it. Modify script as You need. Yes, it is scripting. There is no click&drop methods, pure programming :D
        There are some advises in comments above. I hope it helped little bit. Just make Instantiate(your meshes,position...) and activate in script.
        Best regards,

        Dzēst
    42. https://drive.google.com/file/d/0B5OUDMN7p_Zpd0tSVW5pNkdodHM/view?usp=sharing

      AtbildētDzēst
      Atbildes
      1. Hi, to transform 3d objects to the right place (square of chess board) in the scene, TransformVisualPieceToH1 function in Scriptings.js calculates (x,y,z) by using positions of static manually placed "black_rook_scaled_a8", "white_rook_scaled_h1" hidden objects (Look, maybe they are rendered now? See HideBlankPieces()). So, pieces are transferred to H1 (stage1) and then moved to square place (stage2). Maybe square parameter for TransformVisualPieceToH is incorrect, then piece stays on H1 + Vector(0,0,0). Use Debug.Log() to inspect memory variables. Can't give better advice :)
        Regards,

        Dzēst
    43. Good Day sir, can you help me out on where to put my animations? (e.g upon click, upon moving, etc.)

      AtbildētDzēst
      Atbildes
      1. Very simple, the only thing You need is to know that all 3D engines are fps (frames per second) oriented. The big main loop loops n-times per second where everything is redrawn on screen, keyboard and mouse things processed, etc. If it lags then blame weak hardware or too heavy engine, or "non-triangulated properly" too large 3d models :)
        In Unity the function Update () "happens" in fps-manner. Here by using functions we verify mouse status, keypresses (sample) and do animations. Just make status-counter variable for particles to know what to do next. Of course, object properties also tell much where it is.
        Another approach is trigger thing, that I don't use, but it is useful. You can define: what to do when something happens. 3D engine calculates inside do object collide or not and calls your function if it occurs (sample). Shiva 3D engine does this way. The main loop is very inside, but user can write trigger-scripts. Unity makes it simpler with Update() and somehow better controlled scripting for developer.
        By the way, objects can send messages (by object.SendMessage() ) one to other (like hello, I'm here, move away) and process on triggers defined for these objects.
        Kind of described as could. Ah, and animations mostly are too complex to write scripts for them, they are predefined with scripts to check or select. These are "effect" things that people develop, share and nobody should calculate gravity of rigidbodies after :)
        Best regards,

        Dzēst
    44. thank you so much for your replies sir :) bdw, can u help me out with the coding? how do i prevent the pawn from moving diagonally? and how do i move it diagonally if it eats up a piece? thank you :)

      case "Pawn":
      if(activePlayer == -1)
      activePlayerPawnPostion = 6;


      // Pawn can move 1 steap ahead of them, 2 if they are on their initial position
      if(_deltaY == activePlayer || (_deltaY == 2*activePlayer && _coordPiece.y == activePlayerPawnPostion))
      {
      //Debug.Log ("_deltaY");
      _movementLegalBool = true;
      }

      AtbildētDzēst
      Atbildes
      1. Yeah :) I see, You have come to chess logic part. This is the point where You should decide: 1) to use a ready code from chess software developers, or 2) develop own chess "accounting" of board, moves generator, movement history, etc. In my code there is c0_4unity_chess.js file. The object variable C0 in Scriptings.js with its methods-functions provides all You need to know chess related (object oriented approach, by the way). If You want to create chess part by Your own, then imagine array Board[64] of numbers and lot's of math around it to see king checkmated in corner by queen promoted from pawn :)
        I advice to set margins for project, make moves by your constant array of moves without knowing chess at all. Kind of dumb demo but in 3D. Or look what a 3D-object stays where You want to move by mouse and decide "do or not and what to do". But, for sure, You will find resulting code too messy very soon, it is not Unity thing. I mean, You are trying to build Rome in one day, it takes centuries.
        Sincerely,

        Dzēst
    45. How can i transform in 2 players game? And to play in local lan? Thank you very much ^^ Amazing project!

      AtbildētDzēst
      Atbildes
      1. Actually this is a 2 player game already when running standalone version, click "freechess.org" to connect FICS server. There is no big reason to split local lan and global internet in todays world. If You would like to make 2 computer connection over network without involving central server then you should do sockets (ports) programming, allow firewall exceptions, as games do. The PUTTY in FICSconn folder is good link-making tool to avoid low level programming. I think there are other Unity samples for networking on internet also.

        Dzēst
    46. Hi
      how can i set the difficulty level so easy such that a begginer player should won that easily match?

      AtbildētDzēst
      Atbildes
      1. There is "Chess strength" option on right side, set to minimal. If You ask for "noob level" then You should develop own chess engine, because these are professional programs :D. Or modify chess code, limiting search depth or time.

        Dzēst
    47. Hola atodos, como hago para que me lea archivos pgn y los muestre en el tablero la posicion del pgn.

      AtbildētDzēst
    48. It may be a dumb question, but I got an empty scene when I opened this project in Unity.
      I see Chess_assets in the project folder with all components, though.
      The screen was empty (obviously!) when I built it as is.
      Could someone tell me how to configure and build this game?

      AtbildētDzēst
      Atbildes
      1. I think, You have extracted Chess_assets folder only. You should have folders Assets, Library,... and files UnityChess.csproj, UnityChess.sln too. Unity project is a complete bunch of folders and files. If it's not the case, sorry.

        Dzēst
      2. Thank you for your response. I forgot to mention the version of Unity.
        It was fine with Unity 3, but the error happened with Unity 4 and 5.
        Is there any way to convert this project to Unity 4 or 5 project?

        Dzēst
      3. I think, the project should be compatible. If not, sorry can't do now.

        Dzēst
    49. Como hago para que cuando juegue con negras pueda hacer la primer jugada

      AtbildētDzēst
    50. como puedo solucionar para GetTriangleStrip

      AtbildētDzēst
      Atbildes
      1. MeshCombineUtility.cs obsolete GetTriangleStrip solution
        Replacements in Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs:
        a) int curStripCount = combine.mesh.GetTriangles(combine.subMeshIndex).Length;
        b) mesh.SetTriangles(strip, 0);
        Actually, I'm too busy to be up-to-date. Sorry.
        Chessforeva

        Dzēst
    51. The standalone windows version contains a button "freechess.org". This connects to FICS chess server in guest mode. But I recommend to use their original softwares. My project is(was) the Unity adventure :)

      AtbildētDzēst
    52. Atbildes
      1. Ups. Don't know anymore :) Maybe few years later. Sorry.

        Dzēst
    53. hello. how to build android phone? i have one error. android not support object?

      AtbildētDzēst
    54. Hello. I need help. How to change model on blender to fbx. Thank you so much

      AtbildētDzēst
      Atbildes
      1. Blender can export/import fbx file: addon here. Unity natively works with .blend files, no need for fbx, read here. FBX is Autodesk. Blender is other modeling tool, can't change to fbx inside, only export/import.

        Dzēst
    55. Hello there,
      I need information about how to set that stockfish engine in server and get connection over web apis.

      AtbildētDzēst
      Atbildes
      1. Set up a web server with CGI (Common Gateway Interface)support, write a script in php (or asp, py,...) that calls stockfish app with cmd-line parameters (chess position or moves done).

        Dzēst
    56. Hi, please can you share the source code used for the exe file ? I am trying to find how to connect to the servers and didn't find anything

      AtbildētDzēst
      Atbildes
      1. source 2018.
        Take a look here. Programming options: sockets(low level, as telnet based FICS), http requests(slow, most web interfaces fxmple chess.com).

        Dzēst
    57. This is so amazing post very interesting.Keep sharing dude.Well done.
      Download Latest Version Unity Pro Crack

      AtbildētDzēst
    58. looking for chess app if u can make chess app for me in 3d with online multiplayer same as Real Chess
      With feature of chat and emos
      And players can buy coins and play with coins and coins can be redemeed.

      AtbildētDzēst

    SiteMap: Index of/ ..
    Blogposts:
    free counters