Browse Search Popular Register Upload Rules User list Login:
Search:
Chess in Algodoo!

Image:
screenshot of the scene

Author: 42flowermaster

Group: Dare to be different

Filesize: 255.96 kB

Date added: 2024-04-29

Rating: 5.6

Downloads: 2142

Views: 244

Comments: 19

Ratings: 2

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

~~~~~~~ SECTION ~~~~~~~
This is an attempt to make a chessboard with legal move detection. Have fun playing!!! :)

Update 1: Changed everything
Update 2a: Changed everything yet again
Update 2b: Added more legal move detection (which makes the scene about 10x laggier, but is worth it :y )
Last edited at 2024/05/01 02:04:07 by 42flowermaster
Please log in to rate this scene
edit
Similar scenes
Title: exploding chess board
Rating: 2.5
Filesize: 125.5 kB
Downloads: 201
Comments: 0
Ratings: 2
Date added: 2008/12/01 00:00:40
Made with: Phun
Rating: rated 2.5
download
Title: Boredom Buster's Chess Fix
Rating: 5
Filesize: 133.03 kB
Downloads: 184
Comments: 4
Ratings: 1
Date added: 2008/12/01 00:08:07
Made with: Phun
Rating: rated 5
download
Title: My version of Fareie Chess
Rating: 5
Filesize: 183.78 kB
Downloads: 603
Comments: 8
Ratings: 1
Date added: 2022/08/13 01:23:07
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Chess board
Rating: 5
Filesize: 29.73 kB
Downloads: 1143
Comments: 1
Ratings: 1
Date added: 2022/09/10 17:59:34
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Chess Game
Rating: 5
Filesize: 246.56 kB
Downloads: 739
Comments: 3
Ratings: 1
Date added: 2023/09/25 02:58:07
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Fairy Chess
Rating: 5
Filesize: 285.03 kB
Downloads: 301
Comments: 0
Ratings: 1
Date added: 2023/10/08 09:10:44
Made with: Algodoo v2.1.0
Rating: rated 5
download
There seems to be a problem. As soon as I run the sim, all chess pieces disappear and only some weird pattern remains on each piece. Does anyone else have this problem? :s
Xray - When I get back (around 2hrs from now), I will put the texture back in the scene (I forgot that Algodoo does this) :bonk: :bonk: :bonk: :bonk: :bonk:
Xray - Should be fixed now! :tup:
Nice work.:tup:
@ 42flowermaster -- I haven't spent much time with it yet, but so far it looks correct. Good job! :tup:
Thanks Xray and s_noonan :)
"Click the buttons on the left to disable/enable certain features."
What buttons?

I don't understand what you mean by "multiple piece possibilities". Do you mean consecutive moves by the same piece? Na2xb5 is not a valid move.

Why show "LEGAL MOVES" if it is not being used?
@s_noonan I'm sure that "Na2xb5" is just used as an EXAMPLE! I'm sure that it means: When 2 of any piece is on the same row / column("columns only" for pawns, as pawns only move forward/diagonal), different notation needs to be used to specify which piece was moved.

For the other 2 questions, here's my answer(Maybe not correct):
Q1 - "What buttons?"
A1 - Buttons that probably aren't in the scene yet.
Q3 - "Why show "LEGAL MOVES" if it's not being used?"
A3 - I can't even think of an answer
@CPJchute,

Thanks. If I understand you correctly, then the "x" in "Na2xb5" means "from". The added "xb5" would be to remove ambiguity if, before the move, (2) knights of the same color could move to "a2".

@42flowermaster,

I haven't looked into your code yet, but I'm thinking that legal move detection was not a trivial task.
Last edited at 2024/04/30 22:52:18 by s_noonan
s_noonan - I'm fairly certain that the "x" indicates capture. For example "Na2xb5" means Knight on a2 captured the piece on b5.
@CPJChute - (Q1) The buttons were in the scene, but algodoo crashed the moment I added them and decided not to go through all the work again.
(Q3) Legal moves were used, it worked but lagged the scene a lot everytime a move was played. If you want, I can add that feature again (there are definitely everything to fix)

@s_noonan - I used "Na2xb5" as an example because such a move notation would require legal move detection to determine the "a2" part because if this move were ever written it would require that the program determine that other knights on the a-file and 2-rank could move to the "b5" square. Since legal move detection is really slow, I decided not to implement this type of move notation.

I may consider completely deleting this scene and bringing it back in the future with (hopefully) faster move detection, this was just a test. Sorry for the confusion! :)
@Xray,
Thanks. I see you are correct. Algebraic_notation_(chess)

The reason for the mod in SAN is to disambiguate moves where two (or more) identical pieces can move to the same square. In my defense, I thought since "Na2" means knight moves to a2, that the added "xb5" was for disambiguation, which is wrong. In the “Na2xb5” case, the notation would be "Nb5" if there was not another identical knight that could move to b5.
Theres no clapping emoji so take these :tup: _o_ :tup:

how long did this take to code??
a_bored_coder - a long time
Ah yes. This scene is just like those types of scenes where the code is so complicated, it makes me wonder how they even do it. When I opened up the script menu of the pink rectangle on top, I'm amazed by the code. So many custom functions, so many variables... I have too many questions. Such as, how do you make the pieces snap to the grid? How do you understand all of this? Where did you learn all of this from??? You're not Albert Einstein, are you?

Anyway, I played the scene on the beta version, v2.2.0 b2, and it's not laggy at all. It runs smoothly. Good game!:tup:
@PizzaGuy22,

% of simulation time on my PC:

       sim.frequency
  Version  60   120
  ~~~~~~~~~~~~~~~~~~~~~~~
  v2.1.0   97   70
  v2.2.0 b2 93   30
Last edited at 2024/05/04 10:46:20 by s_noonan
PizzaGuy22 - Thanks for playing!

I had already attempted to make a chess engine a few times outside of Algodoo, so there was some code to replicate. The hard part was definitely translating all the bitwise operators and objects into Algodoo code, which is hard because it does not support those :bonk:

The way the pieces snap to the grid was by transforming the cursor position into a square index (a function in the script), and then transforming the square index into a position that is centered on the grid.

For legal move detection, the 0x88 board representation was really helpful because it made out-of-bounds checks much more efficient :)
How to move?
ElleryDeku - Pieces drag-drop using mouse while the simulation is running (no move tool or anything, it is scripted)