Author Topic: Chess  (Read 47690 times)

0 Members and 2 Guests are viewing this topic.

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Chess
« Reply #105 on: March 29, 2011, 10:48:14 am »
By far, this is the best chess game I have found. Great job!

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Chess
« Reply #106 on: March 30, 2011, 04:53:10 pm »
Eh.... Oops.

Not only is the current version slightly buggy (I don't know why though) I screwed up on the AI detection for protected pieces. I'd fix it, but the current state of the program is super-unstable, so sorry about that

-----------------------------------------------------------------------------------------------------------------------------
That is how to not double post.

The last version sucked, so I fixed it. New features:
-Check detection is like lightning
-Checkmate/stalemate detection is way faster than before
-Option to not move cursor after AI moves
-Option to not show possible moves
-Moves that put your own king in check are no longer displayed
-New move cursor is now white and dark gray
-AI is fixed
-No-move stalemate detection
-50 move stalemate detection (50 on each side right?)
-Holding CLEAR and pressing ON aborts all processes and quicksaves the game

Just to give you an idea of why the AI takes so long, the AI routine maxes out at a nested 8 calls 10 loop and 57 pushes to the stack. Each of those 10 loops does 8 iterations, so 8^10= 1,073,741,824 possible trials of the inner code. (Not really though because ever square is not filled with a piece that can move to ever other square, but you get the idea).

In other news, I have passed TI's limit for a program (~8100). All this speed comes from specialized routines which take up space.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Chess
« Reply #107 on: March 30, 2011, 05:08:00 pm »
This sounds wonderful. ;D

(Actually, since this was a project update, you could have posted another post.  But, if you didn't want to double post, that's fine.  To clarify, you only have to wait for one hour before posting a project update.) :D

Great job, ThePenguin! :)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Chess
« Reply #108 on: March 30, 2011, 06:31:50 pm »
Incredible :crazy:




Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Chess
« Reply #109 on: March 30, 2011, 06:58:43 pm »
Great!  The greyscale is wonderful!

I see that you changed the front screen. 
ld a, 0
ld a, a

Offline Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: Chess
« Reply #110 on: March 30, 2011, 08:51:41 pm »
Here are those sprites penguin. They werent made by me, Raiser had made these at one time and sent them to me. I don't think I actually had a project going at the time and he had these laying around.

Do what you see fit, use them or not, I don't care ha. If you do use them, be sure to give Raiser credit. What you have is really great, and I'm not sure if these fit the style your going for. But I know I won't ever be making a chess game, especially as great as this one is. Keep it up man, this is fantastic.
« Last Edit: March 30, 2011, 08:52:00 pm by Madskillz »

Offline ikemike

  • LV3 Member (Next: 100)
  • ***
  • Posts: 67
  • Rating: +4/-0
  • Hmm.
    • View Profile
Re: Chess
« Reply #111 on: March 30, 2011, 10:15:38 pm »
thepenguin77, I really have to congratulate you on this one. The AI is actually making decent moves. It's amazing! Whatever your AI is, it's great. I'd like it to be a bit faster, but if that's not possible, that's alright. However, a bullet chess mode where the AI is simplified and you're on a timer would be absolutely amazing! Since it's a calculator game, I'd imagine a fast mode would help its appeal, as not everyone wants to play a full-length game of chess. =)
Also, since the AI is turn-based (I think?...), I'd imagine Chess960 wouldn't be too tough to do either. I'd love it if you included stuff like that!
Madskillz, those sprites are amazing. It'd be pretty awesome if thepenguin77 could make the chess piece "sets" selectable, so you could choose between the 3D and 2D pieces.

Points made:
Bullet chess
Chess960
Swappable chess piece "sets"
« Last Edit: March 31, 2011, 01:05:48 am by ikemike »
Anonymous Legend

Offline c.sprinkle

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 221
  • Rating: +23/-1
  • There ain't no rest for the wicked? True indeed.
    • View Profile
    • The Corread on NationStates.
Re: Chess
« Reply #112 on: April 01, 2011, 12:44:11 am »
Also, I noticed that the AI doesn't understand sacrificial moves and will go right ahead and take my piece...

Other than that, though, excellent job!

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Chess
« Reply #113 on: April 03, 2011, 03:06:02 pm »
The AI has improved a ton. It now can be much more fun to play.

Offline ikemike

  • LV3 Member (Next: 100)
  • ***
  • Posts: 67
  • Rating: +4/-0
  • Hmm.
    • View Profile
Re: Chess
« Reply #114 on: April 04, 2011, 06:25:40 pm »
I don't know if your AI already does this, but I think you should specifically program the AI to prioritize controlling the center, especially early in the game. Right now the AI does strange moves half the time. It only really shines when more pieces come into play, limiting its options. I think making the AI prioritize controlling the center could really give the AI a significant boost in competency, especially when it's playing white. The AI isn't good at playing white because it doesn't really give much thought to the center, allowing you to take control of the game easily.

Of course, whether this would cause significantly more slowdown than there is already, I don't know... Maybe it could be an "hardcore" mode?
« Last Edit: April 05, 2011, 10:28:39 pm by ikemike »
Anonymous Legend

Offline yoman82

  • LV3 Member (Next: 100)
  • ***
  • Posts: 71
  • Rating: +1/-1
    • View Profile
Re: Chess
« Reply #115 on: April 05, 2011, 06:11:58 pm »
There was another chess game with an ai... and programmable difficulty. I'm not criticising you, I'm saying this because it was open source and you could look at the code. I could find it if you want

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Chess
« Reply #116 on: April 05, 2011, 10:12:39 pm »
yoman: Really? If so, that's pretty cool. Could you find it, please? :)
c.sprinkle: That would require looking several moves ahead; a bit much, I think :P
If thepenguin wants to make an attempt at that, that'd be interesting. Slow, probably :/
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline ikemike

  • LV3 Member (Next: 100)
  • ***
  • Posts: 67
  • Rating: +4/-0
  • Hmm.
    • View Profile
Re: Chess
« Reply #117 on: April 05, 2011, 10:25:32 pm »
I believe the program yoman is looking for is "Chessmaster 83", at http://www.ticalc.org/archives/files/fileinfo/236/23676.html. It doesn't work in Mirage, which prevents me from testing it (I'm lazy.. =D), but I remember looking at it a while back.

Anyways, it DOES have AI, but it's (likely) the same type of AI that thepenguin77 is going for. I posted a comment a couple posts ago asking whether prioritizing center control was possible— I think that would really help the AI, as it would solve a lot of its problems, such as falling for scholars mate, putting knights on the rim, never doing e4/d4 as white, etc...
« Last Edit: April 05, 2011, 10:27:26 pm by ikemike »
Anonymous Legend

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Chess
« Reply #118 on: April 05, 2011, 10:32:37 pm »
Quote from: User review
2. There is no difference between amateur and beginner except that one of them has a purposely inserted pause between each move.

O.O




Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Chess
« Reply #119 on: April 05, 2011, 11:10:38 pm »
I don't know if your AI already does this, but I think you should specifically program the AI to prioritize controlling the center, especially early in the game. Right now the AI does strange moves half the time. It only really shines when more pieces come into play, limiting its options. I think making the AI prioritize controlling the center could really give the AI a significant boost in competency, especially when it's playing white. The AI isn't good at playing white because it doesn't really give much thought to the center, allowing you to take control of the game easily.

Of course, whether this would cause significantly more slowdown than there is already, I don't know... Maybe it could be an "hardcore" mode?

I agree with that, I was playing today and I realized that the main reason that it fails so bad is that it has a poor opening. The hard part is telling the AI how to move towards the center because moving towards the center should never put the piece itself in danger, and this is a possibility if I give center moves a value. Also, whatever system is in place should probably only last about 10 moves, because especially in a 3 piece checkmate situation, it is pointless.

One thing I'm going to do to fix this is make the AI consider more move choices, right now it only looks at the last best 4, which is why black always moves the rightmost two pawns. I might also give the move a bonus if it moves a piece away from a wall, but it would have to be small so that it wouldn't put the piece in danger.


There was another chess game with an ai... and programmable difficulty. I'm not criticising you, I'm saying this because it was open source and you could look at the code. I could find it if you want

Sure, I'd love to see it if you can find it, although I believe the one you are talking about is TI-Chess. It does have source but for one it is in C and I'm programming asm. I remember critor talking about this, and he said that he didn't even look at the AI code, he just got it from somewhere else. And lastly, the AI takes like 5 min to make a move and the 68k calculators are about twice as fast as the z80s. This means on the hardest difficulty it would take 10 minutes between moves and even then the AI isn't really all that great.

Edit:
   Sorry, missed a few posts.

Bullet chess
Chess960
Swappable chess piece "sets"

Bullet chess at the moment is not possible because to be fast, the AI would suck really bad.

Chess960 is a maybe, if I could work out the castling situation it would be pretty easy though.

Swappable piece sets will definitely be done. I'll probably also have just a plain letter set too for maximum readability.


@madskillz
    I'll try to use that sprite set when I add in sets. The only thing I worry though is that even zoomed in on that picture, I really couldn't tell the pieces apart.
« Last Edit: April 05, 2011, 11:14:50 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112