Author Topic: Online Chess Project (I'm Back!)  (Read 1370 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Online Chess Project (I'm Back!)
« on: December 07, 2017 »
Hi everyone,

Long time no see. I hope everyone is well.
I've decided to take a break from writing books to create an online chess game, so I thought I'd stop by to see how everyone's doing.

The chess game is currently built on the Wire Frame Rain demo I did a while ago, but it'll use flat shaded polygons when it's done.

So far I've got every piece finished apart from the King: http://fx.barcodebattler.co.uk/wf/Chess.htm

The individual chess pieces are object oriented and the 3d-2d rendering has become a lot more streamlined than the original demo, so I've definitely improved over time.

When it's done, the game will be a fine blend of HTML5 Canvas / Ajax / PHP / MySQL, so in theory anyone can play low-poly chess against anyone else in the world. Mwahahahaaaa!
« Last Edit: December 07, 2017 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #1 on: December 08, 2017 »
I know I shouldn't double-post, but this is a considerable update:

All 6 character shapes are finished, though I may go back and redo the Knight at some stage.
The back-face culled wireframe has also been replaced by the flat shaded polygons, so now I need to experiment with the board layout.

I know it only runs at 10fps, but when it's finished it'll be an almost static chess board, so it'll only need to update the graphics when the pieces are moved.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #2 on: December 13, 2017 »
I've added ears to the Knight, optimised the drawing routines to get it running at 25fps on my low-spec laptop and implemented a 2D map for the interface.

Next up I'll be improving the look of the 2D symbols, but it still won't use any pre-rendered graphics. EVERYTHING is being drawn procedurally.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #3 on: December 20, 2017 »
I've moved the project to its own sub-domain, http://chess.barcodebattler.co.uk so I'll put a redirect from the old address.

A lot of features are now working, but I still need to add Check / Checkmate conditions and online play.

I can do this!
« Last Edit: December 21, 2017 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2708
  • Karma: 484
    • View Profile
    • http://www.rbraz.com/
Re: Online Chess Project (I'm Back!)
« Reply #4 on: December 20, 2017 »
Keep it up mate, it's looking nice already.  :)
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #5 on: December 22, 2017 »
Thanks RBZ,

I'll be adding some new features during my time off work. Hopefully I'll have online play working in the next week or so.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #6 on: December 26, 2017 »
Check(mate) testing is really quite complicated!

I just need to finish off the predictive Check(mate) test to prevent the player putting themselves into Check.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #7 on: December 29, 2017 »
It's just about up and running, at least in off-line mode. I'm going to start tinkering with some AJAX for a live online experience.

I wonder if it'll be impressive enough to a potential employer. I'll definitely need to annotate the code.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #8 on: December 30, 2017 »
OK, I've rigged the JavaScript / HTML5 Canvas front end to create an AJAX call to a PHP script, which then requests information from a database using MySQL, then returns it in a format which the JavaScript can use!

The game itself isn't using the connectivity yet, but it's working as a simple test.

The next stage is to set up a handshake between the front end and the server, associate them with a board record in the database and start the game once 2 players are connected!
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #9 on: January 12, 2018 »
Progress is slow at the moment, between work and looking after my kids I barely get much time to get my brain in gear.

I also have to keep switching between PHP and JavaScript, but it's gradually coming together.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1197
  • Karma: 229
    • View Profile
    • Homepage
Re: Online Chess Project (I'm Back!)
« Reply #10 on: January 17, 2018 »
Cool project ck, keep it up! The start button for an offline game doesn’t seem to respond (yet?), I tried it on chrome and puffin for ipad.
www.kirl.nl
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #11 on: January 18, 2018 »
There was an issue with the event handling a few days ago, but it should be fixed now.

That said, I haven't done much testing with touch screen devices, so I'll need to find one and see if there's anything I can code that can fix it.
You are our 9001st visitor.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #12 on: January 19, 2018 »
Major update! Online Guest Mode is now working!

Of course, it only works if someone else is online at the same time as you are.
You are our 9001st visitor.
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: Online Chess Project (I'm Back!)
« Reply #13 on: April 19, 2018 »
Major update! Online Guest Mode is now working!
Of course, it only works if someone else is online at the same time as you are.
I can create a second guest in another browser.
But there's quite a bit of delay between two moves.
Can you have different angles for the 3d view?
Maybe you can also pick the field in 3d.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #14 on: April 19, 2018 »
Because it's shared hosting, I've set the ajax calls to 10 second intervals. There's nothing stopping me switching to a shorter interval I guess, especially while the site isn't very popular.

If you click and drag the 3D view horizontally, you can rotate the board. Although I have yet to get this working with touch screens.

Picking the field in 3D would be a major step, but definitely one to consider.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1197
  • Karma: 229
    • View Profile
    • Homepage
Re: Online Chess Project (I'm Back!)
« Reply #15 on: April 25, 2018 »
Awesome ck, looks really cool! played it on ipad.  :clap:
Maybe automatically select the king on check.
www.kirl.nl
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Online Chess Project (I'm Back!)
« Reply #16 on: April 26, 2018 »
Love the King / Check idea, I can already imagine which lines of code I need to add / alter to make this work!
You are our 9001st visitor.
Challenge Trophies Won: