Code Monkey home page Code Monkey logo

toonchess's Introduction

ToonChess

3D Chess game based on OpenGL and Stockfish

Build Status

Installation (linux only)

Install CMake, Stockfish and OpenGL:

sudo apt-get install cmake stockfish xorg-dev freeglut3-dev

Install Bullet Physics:

wget https://github.com/bulletphysics/bullet3/archive/2.87.tar.gz
tar -xzf 2.87.tar.gz
cd bullet3-2.87/
mkdir build && cd build && cmake .. -DBUILD_EXTRAS=OFF -DBUILD_BULLET2_DEMOS=OFF -DBUILD_CPU_DEMOS=OFF -DBUILD_OPENGL3_DEMOS=OFF -DBUILD_UNIT_TESTS=OFF
sudo make install
cd ..

Download source code:

git clone https://github.com/martinRenou/ToonChess.git
cd ToonChess

Install ToonChess:

mkdir build && cd build && cmake ..
sudo make install

Run it!

ToonChess

Tests

Tests are written using GoogleTest, you can compile and run them using:

cmake -DTOONCHESS_BUILD_TESTS=ON ..
make
./toonchess_tests

toonchess's People

Contributors

martinrenou avatar wolfv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

toonchess's Issues

Weird error with a specific game scenario

There is a weird error with the following scenario:

Stockfish 7 64 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
isready
readyok

User move: h2h4
IA move: d7d5
Suggested user move: d2d4

User move: d2d4
IA move: g8f6
Suggested user move: c1f4

User move: c1f4
IA move: e7e6

User move: f4c7
IA move: d8c7
Suggested user move: e2e3

User move: e2e3
IA move: c8d7
Suggested user move: g1f3

User move: g1f3
IA move: f8d6
Suggested user move: f1d3

User move: f1d3
IA move: b8c6
Suggested user move: c2c3

User move: c2c3
IA move: e8g8
Suggested user move: b1d2

User move: b1d2
IA move: f8c8
Suggested user move: e1g1
Game error: A forbiden move has been performed!
quit

It wasn't clear for me that something was wrong when I played it. This scenario has to be checked in order to see what went wrong

Out of range raised

std::out_of_range raised for map::at. Backtrace:

#0  0x00007ffff6b01428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6b0302a in __GI_abort () at abort.c:89
#2  0x00007ffff744484d in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff74426b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff7442701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff7442919 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff746b2cf in std::__throw_out_of_range(char const*) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x000000000044fd1e in std::map<int, Mesh*, std::less<int>, std::allocator<std::pair<int const, Mesh*> > >::at (this=0x7fffffffdb20, __k=@0x7fffffffd7f0: 8) at /usr/include/c++/5/bits/stl_map.h:523
#8  0x000000000045dc61 in shadowMappingRender (game=0x1286cf0, gameInfo=0x7fffffffdb80, 
    meshes=0x7fffffffdb20, programs=0x7fffffffdac0)
    at /home/martin/Documents/ToonChess/src/ShadowMapping/ShadowMapping.cxx:90
#9  0x000000000045e028 in ShadowMapping::getShadowMap (this=0xda7fd0, game=0x1286cf0, 
    gameInfo=0x7fffffffdb80, meshes=0x7fffffffdb20, programs=0x7fffffffdac0)
    at /home/martin/Documents/ToonChess/src/ShadowMapping/ShadowMapping.cxx:166
#10 0x000000000044c45f in main () at /home/martin/Documents/ToonChess/src/ToonChess.cxx:241

Installation on ArchLinux

libsfml-dev does not exist on ArchLinux (either on official repos or AUR), but sfml and csfml are available.

But this is not the main issue here: make fails with the following error.
/home/.../ToonChess/src/ColorPicking/ColorPicking.cxx:172:24: error: ‘round’ was not declared in this scope
int selectedX = (int)round(pixel.r*8);
^~~~~

Each shader program should be part of its own class

Each shader program should be part of its own class:

  • ColorPicking shader should be loaded and compiled in the ColorPicking class
  • ShadowMapping shader should be loaded and compiled in the ShadowMapping class
    ...

Problem in h6 position

When a piece goes to the h6 position, the program always crashes:

basic_string::_M_construct null not valid

Change game difficulty

We should be able to change the game difficulty by saying to stockfish:

setoption name Skill Level value 0

min: 0 max: 20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.