Author Topic: Chess  (Read 46499 times)

0 Members and 2 Guests are viewing this topic.

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
Chess
« on: February 26, 2011, 08:49:40 pm »
To all the googlers who come through here. The newest version is over at ticalc.org.



My friends at school told me to make chess. So I did.

I started this on wednesday, so it's pretty new. But it's awesome. :D



This is me playing against the calculator. I played in 50% speed, so don't think I'm a chess genius. Some strange stuff happens in that game though, like me castling out of check (legal?), it cheating its way out of checkmate, followed by me losing my queen, and then it forks me with a knight.

Since you're wondering, here is how the AI works. It looks through every single possible move and gives it a rating. It then chooses randomly from the top 4 unless there is one clear obvious choice. This way, you don't always play the same game, but the CPU won't pass up an obvious move. This rating is calculated, as of now, by this formula.

4*capture + 3/2*(threatAgainstCpuFinal - threatAgainstCpuInitial) + (threatAgainstPlayerInitial - threatAgainstPlayerFinal)

Each piece is rated on the usual scale. (pawn = 1, bishop = 3, knight = 3, rook = 5, queen = 9, king = 10) To calculate threat, you look at the sum of the reward of all possible attacks. So if there is a lone rook out in the center, and two different pieces can capture it, the threat would be 5 + 5 = 10.

As far as grayscale goes on this one, I'm trying out a new system. The first time you run the program on your calculator, it asks you to calibrate the flicker and adjust the contrast. Then it stores these values internally and never asks you again. But what makes this one different is that when you send it to your friend, it will ask them to recalibrate it even though you have already done so on yours. How? Along with the contrast and delay, it also stores the calcSerial. So if the stored serial and the real serial don't match, it asks to recalibrate.

In it's current state, this game is very playable. The only thing it lacks is pawn promotion, but I even included en passant. The menus however need serious work, the current ones are just to make navigation possible.

And for those people who will ask, GRAPH quits.
« Last Edit: September 30, 2012, 03:31:05 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

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Chess
« Reply #1 on: February 26, 2011, 08:51:06 pm »
Looks really nice! :D
Are you also gonna add difficulty?
Sig wipe!

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Chess
« Reply #2 on: February 26, 2011, 08:53:04 pm »
Awesome!
Will you be adding pawn promotion sometime soon? If so, then I'm definitely gonna give this to my friends, cuz they all play chess.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Chess
« Reply #3 on: February 26, 2011, 08:55:13 pm »
if it turns out really good, I can stop my bro from bothering me to play chess with him!
(He joined chess club and he's keep bugging me to make me play with him. But when we play, I just pwn him no matter how hard he tried XD )
Sig wipe!

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 #4 on: February 26, 2011, 08:58:43 pm »
Looks really nice! :D
Are you also gonna add difficulty?

I'm trying. But I doubt I will have different difficulty settings because the hardest one probably won't be too difficult to beat.

Awesome!
Will you be adding pawn promotion sometime soon? If so, then I'm definitely gonna give this to my friends, cuz they all play chess.

Pawn promotion is pretty simple, so that will be in the next update.
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 ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Chess
« Reply #5 on: February 26, 2011, 09:19:27 pm »
Well now you only need two things (once you get pawn promotion working) port to Nspire obviously, and 4 way chess. It is an awesome game.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

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 #6 on: February 26, 2011, 09:54:45 pm »
This looks incredible!  This is the first Chess with AI that I've scene, so it's certainly going on my calc.  Wonderful job! ;D
I can't wait for Pawn Promotion. :D

Also, where's the calc serial number stored?

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Chess
« Reply #7 on: February 26, 2011, 09:57:07 pm »
Actually, you also need this to work over gCn. ;-)

This is actually awesome.  I love the way you do grayscale.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Chess
« Reply #8 on: February 26, 2011, 10:02:48 pm »
amazing, to think TI-Chess was so popular without an AI

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Chess
« Reply #9 on: February 26, 2011, 10:35:02 pm »
I don't know if you'd be willing to do it but maybe you could make a variant that lets you play Shogi. It is a japanese version of chess. http://en.wikipedia.org/wiki/Shogi
It has slightly more complicated rules though.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Chess
« Reply #10 on: February 26, 2011, 10:51:37 pm »
You should still definetely put either link play or 2-player, though. It's more fun when you get to swear at your opponent and he has to listen.
I suck at chess.
In-progress: Graviter (...)

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Chess
« Reply #11 on: February 26, 2011, 10:54:24 pm »
I love chess. I have a tournament coming up I hope to get in one of the top 10 places

Its a district wide middle school tournament
« Last Edit: February 26, 2011, 10:54:44 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Chess
« Reply #12 on: February 27, 2011, 12:30:57 am »
Chess?

* Michael_Lee downloads immediately
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Chess
« Reply #13 on: February 27, 2011, 12:55:50 am »
BTW castling out of check is illegal.

Nice to see this type of prog coming out again! Haven't seen a chess game since I left behind my 86 :P

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Chess
« Reply #14 on: February 27, 2011, 02:03:54 am »
Pretty nice. The AI occasionally works surprisingly well for being so simple. More often it doesn't do too well though, I've seen it just leave pieces undefended and let me take them for no reason. I guess the Z80 probably isn't powerful enough for something super sophisticated, though.

One bug I noticed: Queenside castling is broken... it moved the wrong rook (from the h-file to the f-file, instead of a- to d-), and overwrote my bishop :(
« Last Edit: February 27, 2011, 03:09:55 am by Goplat »
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo