Giter Site home page Giter Site logo

eu4replay's Introduction

eu4Replay

Screenshots

Interface

Windows Interface

Exported Map (with mod support!)

VEF Export

Installation

Windows

A pre-compiled package is available at http://goo.gl/uLUL2l

Extract this package to a folder and run eu4Replay.exe in order to launch the program. If this does not work, please file an issue; it is currently only tested on amd64 Windows 8.1.

Alternatively, you can install the dependencies shown in the OS X & Linux section, either from source or from binary distributions. I have tested with the amd64 binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/

OS X & Linux

Install Python 2.7 and the following dependencies using your favourite package manager (eg, brew on OS X). Versions which have been tested are shown in brackets.

Dependencies:

  • wxpython (2.8.12.1)
  • numpy (1.7.1)
  • scipy (0.11.0)
  • matplotlib (1.2.1)
  • PIL (1.1.7)

After that, all that is required should be to clone this repo and configure your settings file.

Configuration

Overview

Configuration takes place in settings.cfg.

You must save any changes prior to launching the program. Configuration changes are not currently supported via the GUI.

EU4 Directory

You will need to specify the full path to your EU4 directory.

Please note that if you are entering a windows path, you must escape any backslashes. In other words, enter C:\\Games, not C:\Games.

There is currently no intelligent mod support. However, as long as your mod overrides the following files, you may be able to set eu4_directory to your mod directory:

  • map/provinces.bmp
  • map/definition.csv
  • map/default.map
  • common/country_tags/
  • common/countries/
  • history/provinces/

Proper mod support will be added in a later version.

Mod Support

If your save file was created using a mod, you will need to fill out the mods settings.

Set mods_directory to your mods directory. If you are on windows, you can try leaving this empty; the program will try to determine it automatically.

Set mod_name to the name of your mod. This should be the name of the mod file, without the extension (eg, for vef.mod, `"mod_name": "vef").

Both compressed and uncompressed mods are supported. However, you will get much better performance with an uncompressed mod.

If your mod starts at a different date to vanilla EU4, you will need to alter start_date (and similarly with end_date).

Start and End Dates

Enter start_date and end_date in yyyy.mm.dd format.

The program currently assumes that it will be able to determine the original owner of a province as at the start date (using the history files).

Unspecified behaviour may result if this is not possible.

Month Names

You may localise month names using the month_names settings key.

Exactly 12 names are required, for obvious reasons.

Animated GIFs

The gif_settings key contains several options which control how animated GIFs are generated:

  • tick_duration is the time, in seconds, that a frame is displayed before the GIF changes
  • tick_years is the time, in years, between frames

A GIF will be generated for all times between start_date and end_date (or as close as is possible given the value of tick_years.

Usage

Loading Province Data

The first thing you need to do is load the map data. There are two ways to do this:

  1. File -> Map -> Load Provinces File
  • this will load a previously-generated provinces file
  1. File -> Map -> Build Provinces File
  • this will parse provinces.bmp, along with various other files, to determine the location of each province on the map
  • building a province file is a very slow process
  • you will be prompted for somewhere to save the file, so that you may re-use it in future
  • this should only be required if you are using a new map (eg, a mod)

Available provinces files:

This file must be unzipped before use.

Loading a Save File

Next, you need to load a save file, by choosing File -> Saves -> Load Save File.

Parsing the save file can take a few minutes. Getting the province histories themselves is easy; the problem is dealing with tag changes, which requires parsing the entire file so that country histories can be accessed.

If this is an issue, I can look at further optimisation.

Viewing History

Move the sliders to set the current date.

The map will update automatically, although it may take a few seconds if you're making big adjustments. (This is because the history is advanced day-by-day.)

Previously viewed dates are cached to enable instant back-tracking. If this causes memory issues, a configuration setting can be added to disable this behaviour.

License

By downloading the software, you agree to abide by this license.

You are not free to redistribute this software, or reuse any part of this program, without the express written permission from the author.

All rights are reserved.

This license may be updated from time to time by publishing modifications to this file on github. You will be bound by any such modifications once published.

eu4replay's People

Contributors

sapi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eu4replay's Issues

Use cStringIO

Due to an oversight, StringIO is currently being used instead of cStringIO.

Making the switch should improve performance in save parsing.

Province controller not set on tag change.

Province controllers seem not to be reset correctly on tag change, and possibly at other times.

Check that the controller, as well as the owner, is being set at tag change.

Refactor viewer.py

gui/viewer.py has got very large and very ugly.

It needs to be refactored before it becomes completely unmanagable.

A good first step would be to split off the menu handling into another class/file.

Refactor display.py

model/display.py currently does two things:

  • manages the state of the map
    • loading saves
    • saving an image to file
    • resetting to defaults
    • maintaining a cache
  • contains logic for rendering at a particular date
    • tracking province changes
    • handling tag changes

It's possible that the latter belongs in another file/class.

Proper mod support

Add a mod key to the settings file, and then preferentially search for needed files in the mod folder.

Colonial nations not supported

Needs investigation.

Both partial and total disappearances have been noted, of large nations (Aztecs, Inca).

My initial thought is that it was because of protectorates, but that doesn't seem possible if the nation partially disappears.

Add settings for animated gifs

Need to add additional settings for animated gifs.

At minimum, need a quality setting (probably max/high/med/low rather than resolution).

Branched from #11.

Adding EU4 directory to settings.cfg is confusing

Defer the check for directory validity until the GUI has appeared, then immediately prompt to change the directory if it appears to be invalid.

On windows, could possibly try to read it out of the registry.

Consider doing so for other settings keys as well.

Performance issues loading saves

Loading saves is far too slow.

The majority of this issue seems, according to profiling, to come from read_object.

A good first step would thus be to change how parse_object operates, so that it does not need read_object.

At the moment, read_object is required because parse_save assumes that its stream contains one, and only one, complete object. It thus aims to terminate on EOF.

Changing the termination conditions to include the end of object marker should enable this to be avoided, although additional care will need to be taken with invalid objects.

This program creates too few animated gifs

Suggested resolution: make the program create animated gifs :)

In more detail:

  • add ability to export gifs
  • allow user to select how often frames should be taken (ie, how many years; lower resolution shouldn't be necessary)
  • allow user to edit gif framerate

Show province controller

Show the current controller of a province with hashed lines.

Should be safe to do this in all cases (cf where not the owner), as that would just involve hashing the same colour over it. That said, for performance reasons it's probably best to only do it where needed.

Zoom map

Allow zooming of the map.;

Couple of ways to do this:

  • preset zooms
  • click and drag

Could also offer a popup window with a pnlImagePlot bound to the same buffer.
However, this may not be possible, as from memory you can only have a view on an array when you're looking at a contiguous block (which would only be possible, for a row-major array, if the view was the entire width of the map).

Immediate todo:

  • check if img[20:40,20:40,:] actually gives back a view that can be used as the input to a pnlImagePlot

Animated gif generation is inefficient

Out of memory errors can occur when attempting to generate an animated gif using too many frames.

Suggested fix is to modify contrib/images2gif.py to accept a generator, then lazily load the image:

  • create single, static image buffer
  • render map for date
  • copy map into image buffer
  • (resize if necessary)
  • write to GIF
  • increment date

Branched from #11.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.