Git Product home page Git Product logo

hoi4_province_editor's Introduction

HOI4 Province Editor

This program is designed to simplify or replace needing to manually edit provinces.bmp and definition.csv when editing HOI4 Maps. The idea behind this program is that it unifies editing both files in one place with a graphical editor, as well as attempting to guarantee that all province maps created by this program will load correctly into the game.

This program is not a complete replacement for MapGen, it is intended to be used to edit a map you have already generated with MapGen, or for making tweaks to an already complete map.

Province Map Mode Terrain Map Mode

To load a map, you can do one of the following:

  • Drag a folder and it will look for a provinces.bmp and definition.csv inside that folder
  • Drag a file and if its name is provinces.bmp or definition.csv, it will look in the same folder for the other file
  • Drag a ZIP archive, and it will try to load provinces.bmp and definition.csv from the archive
  • Use Ctrl-O or Ctrl-Alt-O to load a folder or archive using the file browser

By default, HOI4PE will scramble all of the province IDs in your definition.csv. If you are editing a pre-existing map, this will probably mess up states, strategic regions, etc. In order to mitigate this, you can set the preserve-ids key to true in hoi4pe_config.toml; this will attempt to keep the ID scrambling to a minimum, and if IDs do change, they will be logged to id_changes.txt.

In the terrain/biome map mode, the colors are based on what MapGen/ProvGen takes as input for terrain maps. In the coastal map mode, darker colors represent provinces that are not coastal, while lighter colors are coastal.

When painting continent IDs, you cannot paint continent 0 on land, and sea can only have continent 0.

Controls

  • 1 Color/province map view mode
  • 2 Terrain/biome map view mode
  • 3 Land type map view mode
  • 4 Continents map view mode
  • 5 Coastal provinces map view mode
  • 6 Adjacencies map view mode
  • Left-click will draw with a color or map data while a color or some data is selected
  • Right-click will grab and pan the camera around
  • Middle-click will pick whatever color or map data that you are pointing at
  • Scroll will zoom the map view
  • Shift-Scroll will resize your brush when in color mode
  • Ctrl-Z and Ctrl-Y are Undo and Redo, respectively
  • Ctrl-Shift-S will Save-As, adding Alt will allow you to save as an archive
  • Ctrl-S will Save, overwriting whatever map files you had imported
  • Ctrl-O will let you open a map folder, adding Alt will allow you to select archives
  • Spacebar will give you a new color/type/terrain/continent to paint with depending on map mode
  • Shift-C will re-calculate coastal provinces
  • Shift-R will randomly re-color all of the provinces on the map
  • Shift-P will calculate and display symbols indicating map errors/warnings
  • A switches to the area/brush tool
  • B switches to the bucket/fill tool
  • L switches to the lasso tool
  • H resets the camera view
  • Tab show all recent informative alert messages
  • Escape to cancel a lasso
  • Enter to complete a lasso

Adjacencies may be created by dragging from one province to another with Left-click. Note that HOI4 requires sea and land adjacencies to have a "through province" which you will have to specify manually.

Features

  • Map viewing, editing, manupulation, importing and exporting
  • Flood-fill and polygonal lasso tools
  • Support for custom terrain types via hoi4pe_config.toml
  • Seeing map errors/warnings graphically (via Shift-P)
  • Auto-generating which provinces are coastal (via Shift-C)
  • Exporting terrain or land type view modes for MapGen/ProvGen
  • Preserving province IDs (in order to not break maps)
  • Viewing province ID numbers on the map
  • Support for creating/editing adjacencies

Manually Building

  1. Install Rust
  2. Clone this repository to a folder and navigate there in your terminal
  3. Run cargo build --release in that folder, wait for it to complete
  4. The resulting executable should be located in /target/release

hoi4_province_editor's People

Contributors

dependabot[bot] avatar scottythepilot avatar

Stargazers

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

Watchers

 avatar  avatar

hoi4_province_editor's Issues

Crash on saving

Hi, been using this tool for the past few months and suddenly there's a crash when I try to save.

Crash log:
`The application panicked (crashed).
Message: no entry found for key
Location: src\app\map\bridge.rs:399

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: BaseThreadInitThunk
at
2: RtlUserThreadStart
at `

max-undo-states: 24
preserve-ids: true
generate-coastal-on-save: false
I am using a few added custom terrains.

Error: csv parse error: too few or too many columns were found

Hi. I'm using your province editor and it is very awesome! The problem is, I don't know why, but I can't load my map and my definitions.csv anymore as it says "Error: csv parse error: too few or too many columns were found" when I try to load it. This is weird because my map functions correctly when playing, and there's no problem with any column or province.
That is why I'm asking your help.
Thank you for your work!

question 2

Ever thought about adding it a mode where you can edit rivers?

question

do you ever plan on coming back to this tool or no?

Editor crashes when saving

I noticed this yesterday, and it seems to only happen in certain conditions.
Here is the error log:

The application panicked (crashed).
Message:  index out of bounds: the len is 8342 but the index is 8342
Location: src\app\map\bridge.rs:350

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1: BaseThreadInitThunk
    at <unknown source file>
 2: RtlUserThreadStart
    at <unknown source file>

This seems to happen when I remove a province from the province map, and then hit save. This is crucial, I can't delete any provinces because of this bug! I'm not sure if this is a problem with my map or with the editor itself, but I can't understand what the editor is saying is wrong in this log.

link.exe not found

So I was following the steps for manually building, and when I ran the cargo build --release command in the folder, it prduced an error, and the exectuable file didn't show up in \target\release.

image

Is this just an issue with me missing software?

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.