[FUN] ChessCraft - Play Chess [BukkitDev]

Discussion in 'Archived: Plugin Releases' started by desht, Jul 4, 2011.

  1. Offline


    ChessCraft - play chess

    ChessCraft is now on dev.bukkit.org. This thread will remain open for now for general discussion, but please use dev.bukkit.org for reporting problems and feature requests.

    All documentation is now maintained on dev.bukkit.org. Nothing below here will be updated from now on (8th September 2011).

    ChessCraft lets you play games of chess in the world of Minecraft. It has support for multiple chessboards and multiple concurrent games. You can play against other humans, or against the computer.

    Download ChessCraft.jar 2.0.1
    View source code on github
    Read the User Manual on dev.bukkit.org

    Thanks to BrandonHopkins for this review & tutorial:

    And to the WoopaGaming folks for this one:

  2. Offline


    Loving this plugin!

    Also loved how easy is was to customize - ie taking the glass enclosure off to enable some viewing platforms etc.

    Was very impressed to see that you could take pawns en passant! Cracking job!
    desht likes this.
  3. Offline


    Confirmed - typo in the message. It should definitely read /chess start. Will be fixed in the next release. Of course, it might be easier just to click the Start Game button on the board's control panel...

    When you say "start a game", you mean it's been created, and then actually started? Games which have been started never time out.

    Games which have not been started will time out (see the auto_delete.not_started config setting).
  4. Offline


    Ty for this plugin!
    desht likes this.
  5. Offline


    This is the most amazing plugin, if not up there in the top 10.

    Desht, your the boss when it comes to plugin's
  6. Offline


    Thanks :) Some of the credit needs to go to @jascotty2 as well, though.
  7. Offline


    Great mod, incredible how smooth it is , and the accessibility for both advanced and new players (it has enpassant and castle). All I ask for is possibly the option for multiple types of chess. If you don't know what I mean, I mean games like Transfer chess or Lightning chess or Lazer chess. However the one I would most prefer is transfer chess.

    In case you dont know what transfer chess is, It's where there are 2 teams of 2 players, and whenever a person takes a piece they give it to their partner to place anywhere on the board except on the back files. There are also 2 types of transfer chess, Four kings and Normal, Four kings: is where one team must own four kings to win (2 to each team - mate, including the one they start with) You also cannot place a piece from your partner if you do not have a king. Normal: is where you just play to checkmate, and the team loses when one person is checkmated.

    I understand that this is a big ask, (just thinking about the interface seems like it would be hard.) I thought of this when I started having multiple games at once, and realised it might be possible. Since you also seem to be keeping this plugin well updated (with the last update being last week) I was hoping this might actually be implemented, or atleast considered.

    Even if you don't implement this, thanks for the great mod. :)
  8. Offline


    Yeah... alternate rules are something that has occurred to me, but you're right in that it's a big ask :) But I agree it would be cool to support different rule sets. I'll add it to the feature requests list, but don't expect anything very soon :)

    One thing I do want to get in there in the not too distant future is time controls. I.e. the ability to enforce time limits on moves, or on the entire game, or a certain number of moves in a certain time.
  9. Offline


    what?! legendary! i am all over this. thanks for an original/awesome plugin [cake]
    desht likes this.
  10. Offline


    My server members were all over this from the get go! We are loving this plugin, it's great :D Can't wait to see how this plugin evolves!
    desht likes this.
  11. Offline


    Real nice Plugin. The KI is not easy to me.
    I played a few games and suddenly the KI gave up. (I take this as a win. :-D)
    server log (open)
    java.lang.IllegalArgumentException: Comparison method violates its general contract!
    at java.util.TimSort.mergeHi(Unknown Source)
    at java.util.TimSort.mergeAt(Unknown Source)
    at java.util.TimSort.mergeForceCollapse(Unknown Source)
    at java.util.TimSort.sort(Unknown Source)
    at java.util.TimSort.sort(Unknown Source)
    at java.util.Arrays.sort(Unknown Source)
    at fr.free.jchecs.ai.EnhancedMiniMaxEngine.findMin(EnhancedMiniMaxEngine.java:70)
    at fr.free.jchecs.ai.EnhancedMiniMaxEngine.searchMoveFor(EnhancedMiniMaxEngine.java:157)
    at fr.free.jchecs.ai.AbstractEngine.getMoveFor(AbstractEngine.java:317)
    at me.desht.chesscraft.ChessAI$1.run(ChessAI.java:237)
    at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)

    at java.lang.Thread.run(Unknown Source)

    moves as in pgn-file (open)
    1. a4 Nc6 2. Ra3 e6 3. b4 Bxb4 4. Rf3 Bd6 5. c3 Rb8 6. e3 f5 7. Bb5 Nf6 8. Na3
    Bxa3 9. Bxa3 Kf7 10. Nh3 Ne5 11. Ng5+ Kg6 12. Rg3 Neg4 13. h3 Kxg5 14. c4 *

    yml-gamefile (open)
    result: 3
    boardview: steinmine
    promotionBlack: 4
    - 5640
    - 6841
    - 5120
    - 6964
    - 5705
    - -27011
    - 5456
    - 6873
    - 5258
    - 7800
    - 5388
    - 6517
    - 6213
    - 7038
    - 5121
    - -27605
    - -27646
    - 7548
    - 5574
    - 6442
    - 6551
    - 7093
    - 5525
    - 6052
    - 5583
    - -26194
    - 5778
    state: RUNNING
    finished: 0
    timeWhite: 982753
    playerBlack: §f[AI]ai09
    stake: 0.0
    timeBlack: 568510
    name: PenzRules-1
    playerWhite: PenzRules
    promotionWhite: 4
    started: 1313724950877invited: ''

    For real, I just had another crash - the KI doesn't like good starts of mine it seems - you should add a "I give up!"-Message.
    The forfeit-timer-setting does not work - the timings should be 60 on end and 2 on forfeit - not vice versa.
    If I offer myself a draw and accept - the game ends. You could avoid this easily with some fake piece beside the board. This would also work for KI (if it likes my moves, respectively).
    I won one time out of ten and maybe 3, if the KI had played fair (by not crashing). I'm really disappointed.
    Ah, I got an idea: If the KI refuses to move - let the board-process decide to interpret this as "Offer Draw".
    Sorry, if I was inappropiate - I should get some sleep.
    And could you please remove the ability to laser the opponent's pieces? There are griefers on my server.
  12. Offline


    Hmm, this could be tricky to track down... I pulled your game persist file (thanks for supplying that, most helpful) into my server (tweaking the player & board name), and I couldn't reproduce the error. I presume that was a copy of your game just before the crash happened? When I loaded it up, the AI moved c7-c6, which seems like a sensible move given the board layout. Can you reproduce the problem reliably? i.e. pull that .yml file into your server and do /chess reload persist - does the exception get thrown every time?

    This is also in third party code (Jchecs library) which @jascotty2 integrated into ChessCraft. So not my area of expertise :)

    Also what version of Java are you running (I tested with 1.6.0_26 on Linux) ? A Java bug is possible here. I've seen some reports of this happening on 1.7 JVM's with code compiled for 1.6.

    Not quite sure I follow you here, with the forfeit-timer. The idea of the forfeit timer is so if you're playing another human and they go offline, you can claim victory after a configurable timeout (60 seconds by default). Prevents someone just logging off indefinitely and leaving the game in a stuck state. What exactly doesn't work?

    How do you mean "offer myself a draw" ? /chess offer draw offers a draw to your opponent, not to yourself.

    That's a good idea (having the AI offer a draw if an unexpected exception is thrown).

    I don't know what you mean by "laser" ...?
  13. Offline


    Hey Guy,
    if i play vs the AI sometimes the AI crash's .... with the following error in the server log

    2011-08-19 22:17:14 [SEVERE] ChessCraft: Unexpected Exception in AI
        at net.minecraft.server.World.a(World.java:1661)
        at net.minecraft.server.World.a(World.java:1629)
        at net.minecraft.server.Chunk.a(Chunk.java:261)
        at net.minecraft.server.World.setRawTypeIdAndData(World.java:297)
        at org.bukkit.craftbukkit.block.CraftBlock.setTypeIdAndData(CraftBlock.java:92)
        at me.desht.chesscraft.blocks.MaterialWithData.applyToBlock(MaterialWithData.java:68)
        at me.desht.chesscraft.BoardView.paintStoneAt(BoardView.java:434)
        at me.desht.chesscraft.BoardView.squareChanged(BoardView.java:730)
        at chesspresso.position.AbstractMutablePosition.fireSquareChanged(AbstractMutablePosition.java:171)
        at chesspresso.position.Position.setMove(Position.java:867)
        at chesspresso.position.Position.doMoveNoMoveListeners(Position.java:970)
        at chesspresso.position.Position.doMove(Position.java:940)
        at me.desht.chesscraft.Game.doMove(Game.java:538)
        at me.desht.chesscraft.ChessAI.aiMove(ChessAI.java:287)
        at me.desht.chesscraft.ChessAI$1.run(ChessAI.java:238)
        at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
        at java.lang.Thread.run(Thread.java:722)
    2011-08-19 22:17:14 [SEVERE] java.lang.NullPointerException
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.World.a(World.java:1661)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.World.a(World.java:1629)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.World.a(World.java:584)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.MetadataChunkBlock.a(SourceFile:104)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.World.doLighting(World.java:1616)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:446)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
    2011-08-19 22:17:14 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-08-19 22:17:14 [SEVERE] Unexpected exception
        at net.minecraft.server.World.a(World.java:1661)
        at net.minecraft.server.World.a(World.java:1629)
        at net.minecraft.server.World.a(World.java:584)
        at net.minecraft.server.MetadataChunkBlock.a(SourceFile:104)
        at net.minecraft.server.World.doLighting(World.java:1616)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:446)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
  14. Offline


    Another one that's going to be tough to track down :( especially since its happening deep down in the craftbukkit code...

    Any extra info would be very handy here... anything special about the circumstances etc., also what version of CB are you running?
  15. Offline


    In the painterly texture pack, there is an option to change your wool into chess blocks. I would rather use that than installing a plugin, but I still like this. :D
  16. Offline


    Love this, what about an Iconomy based challenge system?
    Hope the feeling of extra competition and something on the line could challenge my mostly PVP playerbase ^.^
  17. Offline


    Err, OK :) Kinda comparing apples and oranges, there? (ChessCraft isn't a texture pack, and Painterly isn't a plugin that lets you play chess...)

    Already done. https://github.com/desht/ChessCraft/wiki/Economy

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  18. Offline


    I need to read, my apologies :). One thing though the system already ports people into the game, but could they save the position from where they came? And return them when the game ends? Going to read some if I actually missed that, but I haven't seen it happen yet.
  19. Offline


    Very Well.

    I just want to say: "ThanxXx so much" for the developing of this wonderful plugin.

    I support it. :)
    desht likes this.
  20. Offline


    Hi, i love ur plugin. My server is now really great when players can play chess. I was wondering if i can translate ur plugin to Czech language. Contact me ;)
  21. Offline


    i can translate it in german :D its a awesome plugin :)
  22. Offline


    Thanks guys. I'll get in touch soon, hopefully in the next few days - getting ready for a v0.4 release, which will support translations.
  23. Offline


    can you add a entrance or so that teh users can go into the chess field , and if somebody play a game the door closed? because i have the glass case around the chest field and so they can not go directly on the field if there is no game. And if i build a door into the glass case it would be obstructed if i relaod the field
    Could be nice if you can add something like that :D
  24. Offline


    Hmm, I'll think about it, but that was never really the intention. If you want people to come and go as they please, just create an open board. Otherwise, it's still possible to get into a closed board by creating a game on it and then doing /chess tp (gamename).

    Also in the next version, I have some ideas about making it easier to see what games and boards there are, and to do things with them (create/delete/port to games etc.)... watch this space :)
  25. Offline


    Thanks nice plugin i love it
    desht likes this.
  26. Offline


    Oh my god, this is one of those things i wanted but never knew i wanted!
    desht likes this.
  27. Offline


    New version released:
    v0.3.4 (9 Sep 2011)
    • Fixed a potential problem with thread safety in the AI. Hopefully fixes some odd exceptions which a few people have seen.

    As a reminder, all docs etc. are now on dev.bukkit.org - see the OP for details. In addition, I'd appreciate if any problem reports went to the ticketing system there too. Feel free to continue any general discussion in this thread though :)
  28. Offline


    Cool, hope it works well great idea xD[diamond]
  29. Offline


    Hi, just posting to let you know that our server is in awe at how awesome this plugin is. We've been playing games for the past couple of hours. We love it! It's really easy to use, and you seem to have everything covered. Thanks for your hard work. :)

    desht likes this.
  30. Offline


    Hey Guys
    if i play vs the ai i get the following error code:

    2011-09-17 13:21:53 [SEVERE] java.lang.IllegalArgumentException: Comparison method violates its general contract!
    2011-09-17 13:21:53 [SEVERE]     at java.util.TimSort.mergeHi(TimSort.java:868)
    2011-09-17 13:21:53 [SEVERE]     at java.util.TimSort.mergeAt(TimSort.java:485)
    2011-09-17 13:21:53 [SEVERE]     at java.util.TimSort.mergeForceCollapse(TimSort.java:426)
    2011-09-17 13:21:53 [SEVERE]     at java.util.TimSort.sort(TimSort.java:223)
    2011-09-17 13:21:53 [SEVERE]     at java.util.TimSort.sort(TimSort.java:173)
    2011-09-17 13:21:53 [SEVERE]     at java.util.Arrays.sort(Arrays.java:659)
    2011-09-17 13:21:53 [SEVERE]     at fr.free.jchecs.ai.EnhancedMiniMaxEngine.findMax(EnhancedMiniMaxEngine.java:113)
    2011-09-17 13:21:53 [SEVERE]     at fr.free.jchecs.ai.EnhancedMiniMaxEngine.findMin(EnhancedMiniMaxEngine.java:75)
    2011-09-17 13:21:53 [SEVERE]     at fr.free.jchecs.ai.EnhancedMiniMaxEngine.findMax(EnhancedMiniMaxEngine.java:118)
    2011-09-17 13:21:53 [SEVERE]     at fr.free.jchecs.ai.EnhancedMiniMaxEngine.findMin(EnhancedMiniMaxEngine.java:75)
    2011-09-17 13:21:53 [SEVERE]     at fr.free.jchecs.ai.EnhancedMiniMaxEngine.searchMoveFor(EnhancedMiniMaxEngine.java:157)
    2011-09-17 13:21:53 [SEVERE]     at fr.free.jchecs.ai.AbstractEngine.getMoveFor(AbstractEngine.java:317)
    2011-09-17 13:21:53 [SEVERE]     at me.desht.chesscraft.ChessAI$1.run(ChessAI.java:237)
    2011-09-17 13:21:53 [SEVERE]     at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-09-17 13:21:53 [SEVERE]     at java.lang.Thread.run(Thread.java:722)
  31. Offline


    Yeah... that's been reported once before but I haven't been able to track it down or reproduce it as yet. I suspect a bug in the 3rd party jChecs AI engine. It's a subtle one, for sure.

    I think it's probably limited to the EnhancedMiniMax search algorithm, so as a workaround you could disable those definitions in the AI_settings.yml file - just set "enabled" to "false" for ai09 through ai12. Then that algorithm won't be used as an opponent.

Share This Page