Check the online demo!
This Diem plugin is about Chess game.
Provides a graphical HTML/CSS/JAVASCRIPT client, and an Artificial Intelligence server.
It allows to play against a distant friend or an aggressive AI.
Can also act as a Chess AI webservice.
Heavily unit tested ( 427 unit tests for now )
git clone git://github.com/ornicar/dmChessPlugin.git plugins/dmChessPlugin
class ProjectConfiguration extends dmProjectConfiguration { public function setup() { parent::setup(); $this->enablePlugins(array( // your enabled plugins 'dmChessPlugin' ));
php symfony dm:setup
There is a symfony/doctrine bug where generating migrations for models using doctrine inheritance. This plugin uses doctrine inheritance, so untill the bug is fixed, you cannot generate migrations for your project when you install this plugin.
Just drag and drop the Chess/Play widget somewhere on your site. Play.
I made this plugin to show how complex things can be done easily with Diem plugins.
Have a look to:
By replacing services implementation classes in your config/dm/services.yml, you may tweak absolutely every part of the plugin to match your needs.
To tweak the style of the game, just use a CSS file.
Bu default the AI is not executed on your server. The AI moves are asked to a web service. This service is provided by another instance of dmChessPlugin installed on http://chess.diem-project.org.
So if you plan to have many visitors playing Chess on your site, you should consider running the AI on your own server instead of sending tons of requests to mine :)
You can change the AI driver by putting these lines in your
/config/dm/services.yml
parameters:
dm_chess_ai.options:
driver: web # can be "stupid" or "web" or "crafty"
The stupid driver plays randomly and is just used for test purpose.
Enabled by default, will use the chess.diem-project.org web service to make AI play. Requires no configuration from you to work.
The crafty service run crafty on your server. Crafty is an open source Chess AI program you can install on your server. It will give you the ability to tweak it, and will improve A.I. response time since no requests to chess.diem-project.org will be sent no more.
If you installed crafty on your server, you can transform your dmChessPlugin onto a Chess A.I. web service:
/config/dm/services.yml
parameters:
dm_chess_ai_server.options:
enabled: true
Now other instances of dmChessPlugin can set the web service url to your url instead of mine:
/config/dm/services.yml
parameters:
dm_chess_ai_driver_web.options:
url: http://your-domain.com/+/dmChessAiServer/play
If you want to help making it better, or provide translations in your language, your help is welcome! Please send a request to http://www.symfony-project.org/plugins/dmChessPlugin.
Open issues
Closed issues
dmChessPlugin, created on December 28, 2009 by Thibault D, used by 6 projects
morewebDecember 28, 2009 9:49 PM
.. I said "fun". I didn't say "usefull" :D ..
ThibaultDecember 29, 2009 12:31 PM
Hehe. We can't just spend all time on serious things. I was happy to work for a few days on something useless.
Anyway, this can be usefull to show what a complex Diem plugin is made with.
It also demonstrates although Diem is a CMS, it can do more than websites.
manuJanuary 13, 2010 9:12 PM
what does mean 'Just drag and drop the Chess/Play widget somewhere on your site'?
Can you how to call this chess plugin from my application?
Thanks
Thibault DJanuary 17, 2010 2:56 PM
@manu
Once the plugin is installed, a new widget appears on the front toolbar "Add" menu. Drag&drop this widget on your site. That's all.