Skip to content
Enno Rehling edited this page Aug 12, 2020 · 10 revisions

These instructions are for an Ubuntu Linux system. See the GM Guide for setting up the server and game creation basics.

Compile Code

  1. compile, test and install the code as describe in the GM Guide.

  2. Set up your game:

     cd $ERESSEA/git
     s/install
     s/setup -g 5 -n -r e3
    

    The arguments for the setup scripts are somewhat important: -g game identifier, creating game-5 in this example -n create a new eressea.ini configuration file (overwrite existing) -r rule set name. Sets supported by default, are e2, e3.

Data (world) Creation

  1. You can view scripts for world creation in $ERESSEA/server/scripts/tools/build-e{3,4}.lua

    • These scripts are not ready to use, but for reference on how to create your own.
  2. Alternatively the long hand example below will allow you to manually create a data file

  3. cd $ERESSEA/game-5

  4. Open eressea command line

     ./eressea
    
  5. You will be at an eressea command line E>

  6. Run the following commands to create a quick test world

     require 'config
     -- clear the game data:
     eressea.free_game()
     -- make the world 11*11 hexes, and wrap at the edges
     -- with coordinates in [-5..5],[-5..5]
     pl = plane.create(0, -5, -5, 11, 11)
     -- create a new region:
     r = region.create(0, 0, "plain")
     -- ... ditto for "ocean", "mountain", "highland", etc.
     -- create a new player faction (humans, german language):
     f = faction.create("enno@eressea.de", "human", "de")
     -- create a 1-person unit for this faction, in that region:
     u = unit.create(f, r, 1)
     -- give it some stuff:
     u:add_item("silver", 1000)
     u:add_item("horse", 1)
     u:add_item("log", 5)
     -- write the game to disk:
     eressea.write_game("0.dat")
     -- export the world to the report format used by tools like Magellan
     write_map('world.cr')
     -- export the world to JSON (map only):
     eressea.export("map.json", 1)
     -- export the world to JSON (with factions and units):
     eressea.export("world.json", 7)
    
  7. That export function at the end of the example script hints at another way to create the world. If you have another mapping tool, and you can convert its output to the same JSON format, then you could create a world by simply importing it from that interchange format.

  8. If you created “world.json” outside of e> then need to import and write the the game file

    eressea.import("world.json")
    
  9. Whichever process you created “world.json” in you now need to write the data to eressea

    eressea.write_game("0.dat")
    
  10. The game does have a map editor which can now be used instead of scripting

  11. You must still be at an eressea command line E> or run ./eressea again from eressea/game-5

    E> require 'config'
    E> eressea.read_game("0.dat")
    E> gmtool.editor()
    
  12. This reads the configuration data, again, then reads the tiny world we created earlier, then starts the editor. It will look as if there is more than one plain on the screen, don't let that fool you - because the world wraps at the edges, this is all the same region. You can navigate the world with the arrow keys, and there are a lot of other keyboard combinations that are poorly documented. Try Ctrl-T for terraforming, Space to select/deselect a region, and semicolon followed by t to terraform the current selection. It's a little clunky, but it allows interactive map editing. Shift-S saves the game.

  13. Each game has slightly different rules, and needs to know where the configuration data lives, so the game directory contains an eressea.ini file. The file looks somewhat like this:

    [eressea]
    

    report = reports locales = de,en [lua] install = /home/eressea/eressea/server paths = /home/eressea/eressea/server/scripts:/home/eressea/eressea/server/lunit rules = e4 kill_after = 3 maxnmrs = 5

  14. You now need to get everyones first reports

  15. Run the following to generate turn 0 reports

    cd eressea/game-5
    ./eressea reports.lua
    
  16. You now have (hopefully) a fully functional game

  17. The command line for running a turn is:

    cd eressea/game-5
    ./eressea -t $turn run-turn.lua
    – where $turn equals the turn number you wish to run-turn
    
  18. Orders need to be compiled in eressea/game-5/orders.$turn to be executed

  19. After getting your first reports the orders would go into eressea/game-5/orders.0/

  20. The next orders will go into eressea/game-5/orders.2 and then orders.3, orders.4, etc.

  21. The order.$turn folders need to be manually created after each turn.

Clone this wiki locally