MicroCol development

Development documentation is at https://jajir.github.io/microcol/microcol-game/, various reports are at https://jajir.github.io/microcol/microcol-game/project-reports.html.

How to start development

Checkout project source code

Go to directory where MicroCol source code will be stored and execute at command line:

git clone https://github.com/jajir/microcol.git

Now directory microcol should appears with source code.

Project structure

Main project directory microcol will contain following projects:

  • microcol-dist - project build distribution packages.
  • microcol-game - Game itself.
  • microcol-site - This documentation.

Each project is maven module with same name.

Import to Eclipse

From main menu select "File" --> "Import". Select option "Existing maven projects". Importing wizard should appear. In field "Root directory" select previously created microcol directory. Click to "Finish". Now all maven modules should be imported.

Run game from command line

This guide is useful when you just need start game for testing purposes. For running from command line is used maven exec plugin. To compile whole game and start it go to directory microcol-game and execute:

mvn compile exec:exec

Clean all settings

Sometimes it's useful to clean all game setting and achievements. Execute:

mvn exec:exec -Dclean=true

Information about cleaning should appears in log and game should not start.

Development mode

When you want to run MicroCol from command line in development mode run this:

mvn exec:exec -Ddevelopment=true

Use development mode

To run application with enabled some additional development features start application with VM argument -Ddevelopment=true.

Project infrastructure

Working with images

Most of game images are stored in file src/main/resources/images/background.png. This file is generated from file scr/graphics/background.svg. All images in game should be edited with inkscape version 0.92.

Editing with background.svg

Open scr/graphics/background.svg in Inkspace. Look at layer description. In this layer is description of each tile. It's useful to have description layer visible during editing.

All image tiles are separated by Guides. Between each tiles is small space. This space prevent tiles from influencing each other during exporting in png.

Exporting images

Here is described how to produce final png file from svg sources file.

How to export images:

  1. Open scr/graphics/background.svg. And perform image editing.
  2. Hide layer description.
  3. Zoom and center document and make all tiles visible at screen.
  4. Choose "Select and transform tool" with shortcut F1. Select all visible tiles. Selected area should contain in top left corner blue sea and bottom right corner should contain yellow square.
  5. Open "Export PNG image" and select tab "Selection".
  6. Width and height should be counted from class BackgroundImageLoader See constants EXPECTED_IMAGE_WIDTH and EXPECTED_IMAGE_HEIGHT. This values should be placed in fields width and height. DPI will counted accordingly to entered values.
  7. Select filename src/main/resources/images/background.png.
  8. Press "Export".

Compile application and start it. Verify that there are no exception is logs.

UML Diagrams - plant UML

Before generating UML diagrams graphviz have to be installed. For UML diagrams are used plant UML diagrams. Diagrams are generated from plain text source files located at ./src/main/plantuml/. Images are generated during site generating process to directory ./target/site/. Images could be generated manually by:

mvn plantuml:generate

Useful links