Freecol Documentation Developer Guide For Version 0.11.6
Freecol Documentation Developer Guide For Version 0.11.6
Freecol Documentation Developer Guide For Version 0.11.6
3 Missing features 17
5 Mods 33
6 Resources 35
3
4 CONTENTS
Chapter 1
5
6 CHAPTER 1. HOW TO BECOME A FREECOL DEVELOPER
1. Assign yourself to the tracker item before you start working on it.
• If you can find a duplicate and the bug has not been fixed, please
set its status to “Closed-Duplicate”, its milestone to “Unspecified”,
and post a comment with the ID of the other tracker item (add a
comment to the other tracker item as well).
• If you can find a duplicate and the bug has been fixed, use the
“Closed-out-of-date” status to close the tracker item.
5. If you are unable to complete the item: assign it back to “None” and
make a comment describing any problems relevant for another devel-
oper. The milestone of open bugs should be “Current”.
1.4. HOW TO USE THE TRACKERS 7
6. If you successfully commit a fix for a bug, set the milestone to “Fixed-
trunk”, the status to “Closed” if you are certain of the fix, or “Pending-
Fixed” if there is some uncertainty and/or further comment is welcome.
Please also write a comment telling that the work is done, and it is
helpful to refer to any commit/s where relevant changes occurred.
This is how a feature request item should be updated while you are work-
ing:(Needs updating since the sourceforge migration)
1. Assign yourself to the tracker item before you start working on it.
• If you can find a duplicate and the feature has NOT been im-
plemented: Please use the group "Duplicated", set the status to
"Closed" and post a comment with the ID of the other tracker
item (add a comment to the other tracker item as well).
• If you can find a duplicate and the feature has been implemented:
Use the group "Out of date" and close the tracker item.
3. Set the item’s status to pending if you require input from the person
originally submitting the item.
4. Set the group to "Accepted" if you decide that this feature request
should be added before the next release (please discuss on the mailing
list if there are any reasons not to include this feature).
5. If you are unable to complete the item (or you think someone else
should be implementing it): Assign it to "None" and make a comment
describing any issues relevant for another developer.
6. After you have completed the work: Set the group to "Added" and the
status to "Closed". Please also write a comment telling that the work
is done.
You can use any suitable canned response instead of writing a comment.
8 CHAPTER 1. HOW TO BECOME A FREECOL DEVELOPER
1.6 Git
Git is the tool we are using to manage the changes within our source code
tree. This system makes it possible for all developers to have their own full
copy of the project, and supports synchronization between the central version
of the code (‘the repository’) and the local copies. Git also makes it possible
to undo changes that were previously committed to the repository.
This page describes how you can start using Git and get a working copy
of the code (without commit privileges).
You can use git pull for updating an existing working copy. Changes
can only be applied by those who have write-access, so you may need to
either send the changes to the developer mailing list or use the patch tracking
system.
bottom of the menu. Select ’Builders’ in the menu to the left. You should
now see one entry in the list, named ’Java Builder’. This is the default, built-
in java builder in Eclipse. Click ’New...’ to create our Ant builder instead.
Select ’Ant Builder’ from the list and click OK.
In the configuration dialog, click the ’Browse Workspace...’ button the
’Buildfile’ section. Click on the FreeCol project, and select ’build.xml’ from
the list on the right. Click OK. Click OK again, and the Ant builder is
created. You can keep both builders active at the same time, but if you want
to save processing power, you can uncheck the ’Java Builder’. Eclipse will
warn you about doing this, but don’t be alarmed, you can always turn it on
again.
Click OK. If you have activated Automatic building in Eclipse, Ant should
start building the project right away. Possible errors could be, that Ant can-
not access either the java compiler or a stand-alone svn client. In either of
these cases, make sure you added the right directories to your path environ-
ment variable.
If the build went succesfull; congratulations. Open the project folder in
the file system, and you will see ’FreeCol.jar’ in the root folder. Since this
is an executable jar file, you can double click it and launch the game right
away. Enjoy.
then from the opened dialog choose “Java Sources” on the tree part, then
change the “Source Level” setting to “JDK 1.8” and click the “OK” button.
This is necessary every time, until the NetBeans bug got fixed!
– In the Location box, browse to where ever you put the source
(.../freecol/)
– It should auto detect the build file location, project name and
folder
– Add the ’src’ folder as Source packages and ’tests’ as Test packages
• Click Finish
12 CHAPTER 1. HOW TO BECOME A FREECOL DEVELOPER
You will obviously need to have installed ant to do the build, and git to
make the commits, however this will be normal for a developer. To gen-
erate the online manual you will also need htlatex, and pdflatex for the
print manual. You can avoid these requirements by setting the ant properties
online.manual.is.up.to.date and print.manual.is.up.to.date respec-
tively, however this is not recommended for a release. Uploads to sourceforge
use sftp.
• Make sure that all relevant changes have been committed to the branch
you are about to release. If you plan to upload the manual and/or
JavaDoc, regenerate it (with ant manual and ant javadoc), and fix
any JavaDoc errors.
• Merge translations from trunk if the release is not made from trunk,
with ant merge-translations. Skip this step if the localization files
are essentially the same as the ones in trunk (we try to ensure this).
Make sure they are up to date, however.
• Lately we release from the git master and continue to work from there,
so there is no urgent need to create a special release branch.
• Start a clean compile, run all tests and verify the specification(s). You
can do that by calling ant prepare-commit.
• Call ant dist in order to build all packages. You will be prompted for
the version of this release. Alternatively, you can specify the version on
13
14 CHAPTER 2. HOW TO MAKE A FREECOL RELEASE
• Install one of the generated packages and verify that you can play
normally for at least five turns (the java installer can be run from
the command line with java -cp freecol-version -installer.jar
com.izforge.izpack.installer.Installer). Other good tests in-
clude loading a saved game and running the game in debug mode for a
hundred turns or so. It might also be a good idea to compile the game
from one of the source packages.
• Start a new wiki page for the release notes for the next release.
16 CHAPTER 2. HOW TO MAKE A FREECOL RELEASE
Chapter 3
Missing features
We know that FreeCol does not yet emulate all features of the original game.
However there are several features which are inevitably different to Colo-
nization due to FreeCol being a multiplayer game — interactions with other
European players being the obvious example. Similarly we do not attempt
to exactly emulate the graphical look and feel of Colonization, although no
displayed information should be lost.
Otherwise, any missing feature from Colonization is considered to be a
bug. Please report such omissions on the pending features tracker.
Since we do not have access to the source code of the original game, we
can only guess at the algorithms used. This is particularly true in complex,
detailed areas such as production and combat. In some cases, players have
reverse-engineered the algorithm. If you know of some calcuation in FreeCol
that differs from that of the original game, please tell us about it. There is an
effort underway to completely document Colonization’s production amounts
here.
17
18 CHAPTER 3. MISSING FEATURES
Chapter 4
We would like to make FreeCol configurable, so that the game engine becomes
capable of emulating many similar games. For this purpose, we have made
many of the game’s features configurable.
At some point in the future, we will probably add a special rule set
editor, but at the moment, the most effective option is to edit the file spec-
ification.xml directly. This file defines the abilities of units, founding fa-
thers, buildings, terrain types, goods and equipment, for example. You can
find this file in the data/freecol directory. Try to avoid overriding the base
Colonization-compatible rules in data/classic. For a small self-contained rule
change, another option is to build a mod — see the Mods section following.
This is still work in progress, however, and the schema for the rule set
certain to change again in the future. If you wish to develop your own rule
set, you will have to monitor FreeCol development closely.
This having been said, we are particularly interested in hearing about
problems caused by your changes to the rule set. Some dialogs might be
unable to display more types of goods than are currently defined, for example.
Or other dialogs might not recognize your new Minuteman unit as an armed
unit. Please help us improve FreeCol by telling us about such problems.
If you have a working rule set that adds a new flavour to the game, we
will gladly distribute it along with our default rule set. If you have ideas
that can not currently be implemented, we will probably try to remove these
limitations.
If you try to modify the rule set, you are strongly encouraged to check
whether the result is still valid. You can do this by validating the result with
the command ant validate.
19
20 CHAPTER 4. CHANGING THE RULES
model.ability.addTaxToBells
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player adds the current tax rate as a bonus to bells production. The
bonus is modified every time the tax increases or decreases.
model.ability.alwaysOfferedPeace
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player is always offered peace in negotiations with AI players.
model.ability.ambushBonus
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is granted an ambush bonus equal to the terrain’s defence value.
model.ability.ambushPenalty
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit suffers an ambush penalty equal to the terrain’s defence value.
model.ability.autoProduction
4.1. MODIFIERS AND ABILITIES 21
Affects: Building
Provided by: Building Type
The building needs no units to produce goods, and will never produce
more goods than can be stored in the colony.
model.ability.automaticEquipment
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit automatically picks up equipment if attacked.
model.ability.automaticPromotion
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
A unit that can be promoted will always be promoted when successful in
battle.
model.ability.betterForeignAffairsReport
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player is provided with more information about foreign powers.
model.ability.bombard
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is able to bombard other units.
model.ability.bombardShips
Affects: Building
Provided by: Building Type
The building has the ability to bombard enemy ships on adjacent tiles.
model.ability.bornInColony
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
22 CHAPTER 4. CHANGING THE RULES
The unit can be born in a colony, provided that enough food is available.
model.ability.bornInIndianSettlement
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can be born in an Indian settlement, provided that enough food
is available.
model.ability.build
Affects: Building
Provided by: Building Type
The building can build units or equipment.
model.ability.buildCustomHouse
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player can build custom houses.
model.ability.buildFactory
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player can build factories.
model.ability.canBeCaptured
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can be captured. Land units that can not be captured are
destroyed, naval units that can not be captured are either sunk or damaged.
model.ability.canBeEquipped
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can be equipped.
model.ability.canNotRecruitUnit
Affects: Player
4.1. MODIFIERS AND ABILITIES 23
model.ability.captureEquipment
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can capture equipment from another unit.
model.ability.captureGoods
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can capture goods from another unit.
model.ability.captureUnits
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can capture enemy units.
model.ability.carryGoods
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can transport goods.
model.ability.carryTreasure
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can transport treasures, not treasure trains.
model.ability.carryUnits
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
24 CHAPTER 4. CHANGING THE RULES
model.ability.convert
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is a native convert.
model.ability.dressMissionary
Affects: Building
Provided by: Building Type
The building can commission missionaries.
model.ability.electFoundingFather
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player can elect Founding Fathers.
model.ability.expertMissionary
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is an expert missionary, but not necessarily commissioned.
model.ability.expertPioneer
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is an expert pioneer, but not necessarily equipped with tools.
model.ability.expertScout
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is an expert scout, but not necessarily equipped with horses.
model.ability.expertSoldier
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
4.1. MODIFIERS AND ABILITIES 25
Type
The unit is an expert soldier, but not necessarily equipped with muskets.
model.ability.expertsUseConnections
Affects: Player
Provided by: Nation, Nation Type, Founding Father
Experts working in factories can produce a small amount of goods even
if the raw materials are not available in the colony.
model.ability.export
Affects: Building
Provided by: Building Type
The building can export goods to Europe directly.
model.ability.foundColony
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can found new colonies.
model.ability.foundInLostCity
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit may be generated as the result of exploring a Lost City Rumour.
model.ability.hasPort
Affects: Colony
Provided by: Map
The colony has access to at least one water tile. This ability can not be
set by the specification, but it can be used as a required ability.
model.ability.ignoreEuropeanWars
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player will not be affected by the Monarch’s declarations of war.
model.ability.improveTerrain
Affects: Unit
26 CHAPTER 4. CHANGING THE RULES
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is able to improve terrain.
model.ability.independenceDeclared
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player has declared independence.
model.ability.mercenaryUnit
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit may be offered as a mercenary unit.
model.ability.missionary
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is able to establish missions and incite unrest in native settle-
ments.
model.ability.moveToEurope
Affects: Tile
Provided by: Tile Type
Units on the tile are able to move to Europe.
model.ability.multipleAttacks
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can attack more than once.
model.ability.native
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
4.1. MODIFIERS AND ABILITIES 27
model.ability.navalUnit
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is a naval unit.
model.ability.pillageUnprotectedColony
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is able to steal goods from and destroy buildings in an unpro-
tected colony.
model.ability.piracy
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is a privateer.
model.ability.produceInWater
Affects: Building
Provided by: Building Type
The building enables units to produce on water tiles.
model.ability.refUnit
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can be part of the Royal Expeditionary Force.
model.ability.repairUnits
Affects: Building
Provided by: Building Type
The building can repair units.
model.ability.royalExpeditionaryForce
Affects: Player
28 CHAPTER 4. CHANGING THE RULES
model.ability.rumoursAlwaysPositive
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player will always get positive results from exploring Lost City Ru-
mours.
model.ability.scoutForeignColony
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can scout out foreign colonies.
model.ability.scoutIndianSettlement
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit can scout out native settlements.
model.ability.selectRecruit
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player can select a unit to recruit in Europe. This also applies to
units generated as a result of finding a Fountain of Youth.
model.ability.teach
Affects: Building
Provided by: Building Type
The building enables experts to teach other units. However, the building
may place limits on the experience level of teachers.
model.ability.tradeWithForeignColonies
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player may trade goods in foreign colonies.
model.ability.undead
4.1. MODIFIERS AND ABILITIES 29
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit is an undead unit (used only in revenge mode).
model.modifier.bombardBonus
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player’s units are granted a bombard bonus when attacking.
model.modifier.buildingPriceBonus
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player can build or buy buildings at a reduced price.
model.modifier.defence
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit has a defence bonus or penalty.
model.modifier.landPaymentModifier
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player can buy Indian land at a reduced price.
model.modifier.lineOfSightBonus
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
30 CHAPTER 4. CHANGING THE RULES
model.modifier.minimumColonySize
Affects: Colony
Provided by: Building Type, Nation, Nation Type, Founding Father
The population of the colony can not be voluntarily reduced below this
number. The modifier does not in any way affect a population reduction due
to starvation or other events.
model.modifier.movementBonus
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit has an increased movement range.
model.modifier.nativeAlarmModifier
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player generates less native alarm.
model.modifier.nativeConvertBonus
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player has a greater chance of converting natives.
model.modifier.nativeTreasureModifier
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player generates greater treasures when destroying native settle-
ments.
model.modifier.offence
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit has an offence bonus or penalty.
model.modifier.religiousUnrestBonus
Affects: Player
4.1. MODIFIERS AND ABILITIES 31
model.modifier.sailHighSeas
Affects: Unit
Provided by: Nation, Nation Type, Founding Father, Unit Type, Equipment
Type
The unit’s travel time between Europe and the New World is reduced.
model.modifier.tradeBonus
Affects: Player
Provided by: Nation, Nation Type, Founding Father
Prices in the player’s market remain stable for longer.
model.modifier.treasureTransportFee
Affects: Player
Provided by: Nation, Nation Type, Founding Father
The player pays a smaller fee for transporting treasures to Europe.
model.modifier.warehouseStorage
Affects: Building
Provided by: Building Type
The building increases the capacity of the warehouse.
32 CHAPTER 4. CHANGING THE RULES
Chapter 5
Mods
33
34 CHAPTER 5. MODS
Note that not all elements take a delete tag yet. You may need to read
or modify the source to be certain a mod will work.
Chapter 6
Resources
Various links pointing to more or less reliable information about the original
Colonization game:
• Strategy Wiki
35