Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Submitted] UChess - Unity Chess Engine

Discussion in 'Assets and Asset Store' started by JohnnyA, Jun 30, 2013.

  1. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    I'VE REMOVED THIS ASSET FORM THE STORE

    Contact me via PM if you are interested.


    - - - - -










    $Header.png


    UChess is a Unity Chess Engine with advanced features like Killer Moves, Ponder, History Hueristics, AI personalities and Opening Books.

    Included in the package are two sample chess games: one in 2D and one in 3D.

    Details

    UChess is a Unity wrapper for the open source chess engine SharpChess , a C# chess engine by Peter Hughes. UChess extends the base code with changes to ensure compatibility with Unity as well as adding additional attributes like personality and a few engine improvements.

    UChess also includes a simple 2D sample chess game built on NGUI, and a simple 3D Chess game that has no third-party requirements.

    Licensing

    Although Sharp Chess has a commercial license in which 30% of profits must be donated to creator, UChess does not have this requirement.

    UChess has been separately licensed from the creator of Sharp Chess such that you do not need to pay anything other than the asset store purchase price. For you the user the license is a standard asset store license where you may include the asset in your game without further restrictions.


    NOTE: The UChess engine works with Desktop and Mobile but does not currently work with the Unity Web Player.
     
    Last edited: Feb 20, 2014
  2. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Just a little bump, although still not approved yet. Come on Unity! :)
     
  3. Jum

    Jum

    Joined:
    Aug 20, 2011
    Posts:
    63
    Does it work on Unity Flash?
     
  4. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    I haven't tried it, but to be honest I would expect not. It required unsafe (umanaged) memory access. Can we still get the flash trial, if so I'll try it out.

    - John A
     
  5. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Approved and now available.
     
  6. BBRome

    BBRome

    Joined:
    Jul 3, 2012
    Posts:
    373
    This error

    ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) System.Threading.Interlocked:CompareExchange (UChess.Model.AI.Search/SearchEventDelegate,UChess.Model.AI.Search/SearchEventDelegate,UChess.Model.AI.Search/SearchEventDelegate)' while running with --aot-only.

    at UChess.Model.AI.Search.add_SearchMoveConsideredEvent (UChess.Model.AI.SearchEventDelegate value) [0x00000] in <filename unknown>:0
    at UChess.Model.AI.Brain..ctor (UChess.Model.Player player) [0x00000] in <filename unknown>:0
    at UChess.Model.Player..ctor () [0x00000] in <filename unknown>:0
    at UChess.Model.PlayerWhite..ctor () [0x00000] in <filename unknown>:0
    at UChess.Model.Game..cctor () [0x00000] in <filename unknown>:0
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for UChess.Model.Game
    at UIBoard.RegisterListeners () [0x00000] in <filename unknown>:0
    at UIBoard.Start () [0x00000] in <filename unknown>:0
    UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    UICamera:Notify(GameObject, String, Object)
    UICamera:processTouch(Boolean, Boolean)
    UICamera:processTouches()
    UICamera:Update()
     
  7. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Argh sorry. With iOS compile you need to use the fullSource instead of the packaged DLL version. I'll write some step by step instructions and post them here shortly.

    - John A
     
  8. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Detailed instructions emailed to you.

    Updates to be submitted shortly (although Unity likely to take a few days to approve).

    If anyone else has trouble with mobile builds before the update send me an email or PM.

    Regards and sorry for the Hassle.

    - John A
     
  9. BBRome

    BBRome

    Joined:
    Jul 3, 2012
    Posts:
    373
    Solved using code instead DLL great support.
     
  10. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Just thought I would give this a little bump. Not a big user base for this one, but most seem to be happy with the product.

    Cheers,

    John A
     
  11. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    If anyone has issues with NGUI v3.0 I have a fix available, just send me your order number (to the support email in the doco).

    - John A
     
  12. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
  13. phi6

    phi6

    Joined:
    Nov 11, 2013
    Posts:
    7
    Hello JohnnyA, this looks like an excellent asset. Is there any more information on the API for this? I'd like to know whether I can do things like set up custom games and multiple pieces such as more than 1 queen. If possible could you send me the documentation for it so I can evaluate, very interested in purchasing.

    Cheers
    Phi
     
  14. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi Phi6,

    the underlying chess engine was built by Peter and unfortunately he's not so much of code documenter. It should be pretty easy to set up your own game but working your way through the APIs could be a little bit of a challenge initally.

    I'll take a look for you and either write some sample code or at least point you at the right API's, I have tomorrow dedicated to Unity Assets so should be able to do it then.

    For customisations beyond setting up the baord in different ways, it really depends on how far you want to take it. You can change how pieces move fairly easily (I've done this before), but the engine will play a little weaker as the hueristics for position and killer moves wont apply. Changing board size should be doable but I can't say I've done that one before. Win conditions could be cahnged witha bit of effort. Beyond that I guess its not really chess any more :)

    Cheers,

    John A
     
  15. phi6

    phi6

    Joined:
    Nov 11, 2013
    Posts:
    7
    Thanks very much for your help. Initially all I need to do is set up games such as teaching scenarios! Although custom board sizes and things like that would be great, obviously it will affect the AI. Looking forward to seeing some samples.

    Cheers!
    Phi
     
  16. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    This looks very interesting, but I would like to know more before shelling out 75$.

    Is there documentation that we can read about what this does, or how to use it, before purchase? I would like to gauge how easy it is to set up, how many components there are, and how easy it would be to modify for our own use.
     
  17. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    The documentation on the underlying engine is non-existent. As this package doesn't sell much there's little justification to spend the time documenting the underlying engine. So far I've just been providing the details people need. Completely understand if thats not acceptable for you.

    The engine itself has no Unity components, however typically to get started you would duplicate and modify my ChessEngine component to your own needs. This is a hook between Unity and the underlying engine. There is also an optional component for the AI personalities if you decide to use them. The 3d sample has a component for the board and one per piece. The NGUI sample wraps this all up in to one component.

    If you are a coder then setting it up the engine should be relatively straight forward... basically its just passing moves to the engine and listening to events from the AI. The only caveat is due to the threaded nature you need to defer things that like renderer updates to the Unity main thread. The two samples illustrate this.
     
  18. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    What kind of game-play modes does this have? I am interested in normal play, and a "timed" mode, where players (and AI) has a certain amount of time to perform a move.
     
  19. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    It supports a standard chess clock which can be set to any times. There are various options for how the timed works (per 40, whole game, etc). These are part of the underlying engine and will need to be set in code.

    You can always check out the open source c# version from peters site: http://sharpchess.com/

    - John A
     
  20. khyskie

    khyskie

    Joined:
    Jan 21, 2014
    Posts:
    1
    Hello! I´m making a 3d chess game using this engine. I think it´s very useful but i have a question: Is there any way to save a match in progress (and load after to continue)?

    Maybe it´s an easy question, i´m quite new in Unity, but I´d appreciate any help.

    Thanks!
     
  21. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi Khyskie,

    can you send your request to the support email address and include your Asset Store order number. Its much easier to track that way.

    - John A
     
  22. PlayJoWee

    PlayJoWee

    Joined:
    Feb 13, 2014
    Posts:
    2
    Hi Johnny.

    We would like buy your assets. We want to know some poitns.
    1. We can't find assets in store.
    2. We need Android and iOS version Does your assets compile to this platforms?
    3. We want to know about features (Hints, Load Save and some other features)

    Please send me e-mail: Rackoushine@gmail.com
    Skype: Rackoushine
     
  23. Muhammad-Saqib

    Muhammad-Saqib

    Joined:
    Feb 20, 2014
    Posts:
    1
    Hi we are facing some issued using this Game engine.

    1) when you lose the game and press the restart button the following exception occurred.
    MissingReferenceException: The object of type 'Square3D' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.

    2) while playing white vs black many time the game got stuck at the turn of black(chess engine turn) i.e it does not move any "Square3D" object in Board Object because the thinking process can not ends. Can you please help

    Thanks
     
  24. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Hi Muhammad,

    please use the support email address and include your asset store number. This asset is no longer for sale so I do not want to bump the post.

    - John A
     
  25. THE_JAB

    THE_JAB

    Joined:
    Dec 25, 2013
    Posts:
    21
    Does the code really work on ios? As in, the variables are typed (#pragma strict) and it fully compiles.
     
  26. NewBie01

    NewBie01

    Joined:
    Feb 22, 2015
    Posts:
    7
    Hi, how do i download it sir?
     
  27. Yogesh0750

    Yogesh0750

    Joined:
    Mar 19, 2018
    Posts:
    3
    Hi, I want to Purchase this asset. how do i contact you?
     
  28. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    This asset is no longer availabel for puchase.
     
  29. zidandika

    zidandika

    Joined:
    Oct 21, 2021
    Posts:
    1
    UChess games can also be played on the sbobet website