Building JCloisterZone from source
Don't hesitate to ask if there are any problems with the explanations below!
- Java SE 7 (JDK 1.7) as your
$JAVA_HOME
. - Maven in your
$PATH
. - gettext in your
$PATH
. - (optional) Eclipse
cd your-development-folder # Your own preference.
# Get farin's fork of WebSockets.
git clone https://github.com/farin/Java-WebSocket.git
cd Java-WebSocket
mvn install # Install the WebSockets fork version.
cd - >/dev/null
# Get JCloisterZone.
git clone https://github.com/farin/JCloisterZone.git
cd JCloisterZone
mvn package # Create the main and plugin jar files.
open build/JCloisterZone.jar # Execute the game.
The special fork of WebSockets needs to be installed in Maven first.
- Clone the code from https://github.com/farin/Java-WebSocket.git
- "Import..." the "Java-WebSockets" project as an "Existing Maven project" from disk.
- Run the project as "Maven install" - it should now be available to the JCloisterZone project.
- Clone the code from https://github.com/farin/JCloisterZone.git
- "Import..." the "JCloisterZone" project as an "Existing Maven project" from disk.
- Right click the project and select "Update project..." from the Maven menu.
- Run the project as a java application; select
Bootstrap
(com.jcloisterzone.ui.Bootstrap
) as the main class.
Maybe $JAVA_HOME
was not set correctly. Try running export JAVA_HOME="`/usr/libexec/java_home -v 1.7`"
before running mvn
in the same terminal window.
Maybe gettext wasn't in your $PATH
. Try installing/finding it on your harddrive, then add it to your path variable.
Helpers for more pleasant development and application debugging.
JCloisterZone supports various system properties to help development
config=foo.yaml
- use custom yaml configuration fileerrorLog=false
- don't save error log to filecloseGameConfirm=false
- close game withiu showing confirmation dialognick=Bob
- force default nickname for play onlineforceChat=true
- enable chat window for local gamesallowAiOnlyOnlineGame=true
- allows online game without human players (must be allowed also by server)allowHotSeatOnlineGame=true
- allows online game with multiple human players from one clientorg.slf4j.simpleLogger.defaultLogLevel=info
- set log leveltransparentScreenshots=true
- don't fill screenshot backgroundwindowSize=L
- overrides config valus (eg 1024x768, or special values L or R)
Command line example:
java -jar JCloisterZone.jar -Dconfig=debug.yaml -DerrorLog=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info -DforceChat=true -DcloseGameConfirm=false -ea
Tweaked config.yaml
Use unpacked plugins from source.
plugins:
- plugins/classic
- plugins/rgg_siege
For immediately AI play comment delay option.
# ai_place_tile_delay: 250
Use debug options for quick and repeatable game setup with following possible options
debug:
# use some keys described below ...
Don't compress saves, autosave before each AI play.
save_format: plain
autosave: saves/_prerank.jcz
Skip game config dialog, player is name or AI class. You can comment just preset key to disable whole autostart.
autostart:
preset: default
players:
- Alice
- Bob
- com.jcloisterzone.ai.legacyplayer.LegacyAiPlayer
- com.jcloisterzone.ai.DummyAiPlayer
Developing expansion, don't bother with basic tiles. Override any expansion with own set definition.
tile_definitions:
BASIC: tile-definitions/basic-1card.xml
Force drawn tiles.
draw:
- BA.C
- BA.Cccc+
And then force final scoring with dot item.
draw:
# ... some tiles ...
- .
Experimental options
off_capabilities: [ Dragon, Fairy ]
area_highlight: figure
xgettext -k_ -o po/keys.pot --from-code=utf-8 $(find . -name "*.java")
msgmerge -N -U po/cs.po po/keys.pot
msgmerge -N -U po/de.po po/keys.pot
msgmerge -N -U po/el.po po/keys.pot
msgmerge -N -U po/en.po po/keys.pot
msgmerge -N -U po/es.po po/keys.pot
msgmerge -N -U po/fi.po po/keys.pot
msgmerge -N -U po/fr.po po/keys.pot
msgmerge -N -U po/hu.po po/keys.pot
msgmerge -N -U po/nl.po po/keys.pot
msgmerge -N -U po/it.po po/keys.pot
msgmerge -N -U po/pl.po po/keys.pot
msgmerge -N -U po/ro.po po/keys.pot
msgmerge -N -U po/ru.po po/keys.pot
msgmerge -N -U po/sk.po po/keys.pot
rm po/*~
rm po/keys.pot
mkdir builds/JCloisterZone
chmod a+x JCloisterZone.jar
zip -r -9 JCloisterZone-3.1.0.zip JCloisterZone tar cvzf JCloisterZone-3.1.0.tgz JCloisterZone