Portrait Builder is a tool for Windows that allows to render CK2 portraits outside of the game.
This is a fork and continuation of Measter's original tool, for which the development stopped end of 2012, but whose code was open-sourced.
Features:
Installation:
This is a fork and continuation of Measter's original tool, for which the development stopped end of 2012, but whose code was open-sourced.
Features:
- Read portraits definitions from vanilla, portrait DLC zip archives, or flat mods
- Preview character portraits based on portraitTypes (ethnicity, sex, age, year), dna, properties, rank and government.
- Merchant republic and religious special clothing frames are supported via a government drop-down.
- Societies clothing override is supported via an optional dropdown to replace sprites used by culture-indexed layers (c0->c7)
- Merchant republic and religious special clothing frames are supported via a government drop-down.
- Auto-watch for modifications on loaded mod files while editing, to automatically reload the mod data and refresh current portrait
- Randomize values for selected characteristics
- Import/export DNA and properties strings
- Save current character portrait as png image
- Disabling of the characteristics that are not used by the selected portrait type, or that have only one frame.
- Read the user mod folder location via a userdir.txt file in Steam directory (if any)
- Only works on Windows, compatibility for Linux/Mac with Mono is not working.
- Note: the tool has some rendering issues with HIP/CPR+ mod on Win7.
- Does not support archived mods (the ones downloaded from Steam Workshop as .zip)
- Load order of gfx files is hardcoded to vanilla -> DLCs (alphabetical) -> mods (alphabetical), i.e. "dependencies" of .mod files is not taken into account for overridden files. If you need this for a mod, report it here so it gets supported.
- Government list is hardcoded with vanilla governments (no parsing of governments from mods)
Installation:
- Download PortraitBuilder-2.5.0.zip and unzip it somewhere.
- Download and install required .NET 4.5 library (in case not already installed)
- Start PortraitBuilder.exe
- Select the location of your CK2game.exe (for instance: C:\Program Files (x86)\Steam\SteamApps\common\Crusader Kings II\CK2game.exe) - You can get it from Steam, by right-clicking the game in the library, then Properties / Local Files / Browse Local Files. This value will be kept into a gamedir file.
- Wait 20-30s for the DLCs to unzip, then the UI should show up.
- In case of crash, look into the log.txt file for details.
- Properties are overridden dynamically by the game based on portrait_properties.txt, only DNA is immutable.
- Source code is available here: https://github.com/rquinio/PortraitBuilder
By Romulien:
Version 2.5.0 - 2018-01-27
- Add labels for new vanilla 2.8 properties (p14 makeup, p15 makeup2, p16 jewelry and p17 immortality)
- Add new 2.8 government frames
- Allow selection of characteristics to update when clicking randomize button
- Read mod directory from userdir.txt file in Steam CK2 folder, if any
- Prevent crash when mod directory doesn't exist
- Support unquoted values for spriteType name and texturefile
- Show incompatible mods as disabled in the list, with the reason in tooltip (archived mods, no portrait data or invalid path)
Version 2.4.0 - 2017-04-07
- Support for clothing propertyType override, replacing sprites used by culture-indexed layers (c0->c5)
- Support for a variable number of properties, with dynamic creation of characteristic comboboxes in the UI
- Improve error reporting when parsing portraits.gfx when parsing string into integer or byte
- Allow non-ordered flags in propertyType layers
- Fix randomization that was never using the last frame
- Solve some eye-related rendering issues caused by attempting to read pixels outside of the width/height of the source image
Version 2.3.0 - 2016-09-03
- Support for mask (p12) and eyepatch (p13) new characteristics
- Add dropdowns for head (p2), d5 and d10 characteristics, in case used by mods
- Disable dropdown if sprite has only 1 frame (e.g. p2)
- Remove randomization when dna/properties 'letter' is 0 , and use index 0 instead
- 'letter' 0 is now used in output dna/properties strings with index 0, instead of (max - 1)
Version 2.2.0 - 2016-07-03
UI:
- Add government dropdown
- Add some tooltips to UI controls
Engine:
- Implement override logic for religious and merchant special sprites
- Add file watchers to mod content, in order to auto-refresh in case of changes
- Add some safeties to .mod file parsing
- Add unhandled exceptions handlers in application
Code re-factoring:
- Upgrade dependencies and use NuGet to retrieve them
- Switch DDS lib from DevIL to CSharpImageLibrary
- Generate .pdb to always have line numbers for exceptions
- Use Costura.Fody to embed dependencies in assembly
Version 2.1.0 - 2016-06-25
UI:
- Use better icon
- Add DLC/mod tabs
- Add "Toggle All" and "Reload" buttons for content.
- Keep selected portraitType when enabling DLC/mod
- Use 2 tabs instead of 3, and move hair/eye color to DNA tab
- Move PORTRAIT_ prefix as a label for portraitType dropdown
- Add d/p codes in labels
- Add warning for properties overridden via portrait_properties.txt
- Rename Earl to Count
- Add dropdown for Player (p11), used in certain mods
- Disable dropdown when a dna/property is not used by any portraitType layer, rather than adding index 0-26.
Engine:
- Split DLCs so they can be activated separately
- Support rendering from multiple mods
- Parse vanilla/DLCs/mods portrait data only once during startup
- Avoid unzipping DLCs at startup if not needed (use Reload button to force refresh)
- Filter files to unzip from DLC, to reduce loading time & size.
- Allow content to only contain sprites in gfx/characters/, without portraitTypes
- Fix bug were duplicate portraitType definition would not override previous one (byzantinegfx)
- Fix load order of assets that was using vanilla instead of mod
- Optimize memory usage, by unloading assets when reloading/unchecking content
- Catch parsing failures at spriteType / portraitType level
Code re-factoring:
- Simplify code structure within a single project
- Separate class concerns to have smaller files
- Adapt class namespaces to match new folder structure
- Replace redundant CustomFlags by proper characteristics
Version 2.0.0 - 2016-04-04
- Compatibility with vanilla 2.5.2
- Update lookup of ck2.exe to CK2game.exe
- Support for offsets (inline and external)
- Support for extra proprty p11 (player overlay)
- Support for DLCs. Disable buggy mod loading, for now.
- Replace poorly usable BrowseFolderDialog by an OpenFileDialog, to locate CK2 .exe
- Rework the logging, using log4net, with various log levels
- Append the version to the window title
- Add an icon to the .exe
- Remove code duplication, and general cleanup of the code
- Fix some gfx parsing errors
- Try/catch around some bad .dds files like western_male_eyes2.dds that cause exceptions
By Measter:
Version 1.1.7 - 2012-11-24
- Added logging. Outputs log on error, and can be forced to output with -log.
- Now attempts to load portrait info from all .gfx files in \interface.
- Can now load mods from My Documents folder.
- Fixed crash when trying to parse a portrait type which already exists.
Version 1.1.6
- Fixed bug in import validation.
- Changed notice text in import dialog to specify 11 digits.
Version 1.1.5
- Updated for CKUtils 1.8.
- Now loads portrait sprites from portrait_sprites.gfx.
- Added selector for the 11th property digit.
- Importing now requires 11 digits for property code.
Version 1.1.4
- Changed UI setup to not be dependent on certain keywords.
Version 1.1.3
- Fixed bug in Muslim hair rendering in vanilla files.
Version 1.1.2
- Added digit to DNA code output to prevent game crash(again).
- Fixed bug when importing DNA codes when using a female portrait set.
- DNA and Property codes are now no longer randomized when changing portrait sets.
Version 1.1.1
- Fixed bug causing crash due to lack of beard on females.
Version 1.1
- Rewrote the program to use CK2s portrait.gfx file instead of .portset files.
Version 1.0.3
- Added randomization button.
Version 1.0.2
- Fixed bug causing the first tile to have the wrong index.
Version 1.0.1
- Changed the DNA output to match the length of that in the game's character definition.
Attachments
-
PortraitBuilder-2.0.0.zip884,8 KB · Views: 154
-
PortraitBuilder-2.1.0.zip890,7 KB · Views: 116
-
PortraitBuilder-2.2.0.zip525,5 KB · Views: 225
-
PortraitBuilder-2.3.0.zip526,4 KB · Views: 840
-
PortraitBuilder-2.4.0.zip523,6 KB · Views: 1.428
-
PortraitBuilder-2.5.0.zip520 KB · Views: 3.630
-
PortraitBuilder-3.0.0.1.zip281,5 KB · Views: 303
-
PortraitBuilder-3.0.0.2.zip292,4 KB · Views: 1.274
Last edited:
- 20
- 3