Project Infinity Engine 4K - Allows extracting, upscaling, and assembling from all game assets to a new override-X4 directory for use in GemRB.
The purpose of this project is to have native 2k/4k playable IE game assets and an engine capable of playing at those resolutions. The current focus is on the GemRB game engine and getting that capable of running these upscaled assets. The main focus of this repository will initially focus on creating a tool chain that allows people to create the assets and run them in game. Currently we have basic AI upscaling, but new methods and workflows coming soon.
You can join our discord community at - https://discord.gg/Pr7wapQ5H6
Currently the project supports all file types that have image data and related files that have coordinate data that also needs to be updated in conjunction with the image data. The BCS support is currently lacking and still needs more work to work properly. BAM and PLT color configuration is also slightly off and needs some fine tuning I haven't been able to get working right yet. Another portion of this project I think requires improvements and slight modifications to the GemRB engine. To make the experience better GemRB needs zoom in and out support. It also needs some changes to support an UpScaleFactor. Things like movement speed, projectile speed, and size of some overlays like the circle around the player will need to be increased by the UpScaleFactor.
Everything in the project focuses on allowing you to upscale your game assets. For the first release the easiest way to get going is to clone this repository and build it yourself, but builds should be out soon. All the commands should be viewable from the binary. You can run ./install/bin/pie4k and it should show you available commands. It will never make changes directly to your game override directory. All assets will be created in the "output" directory. We will create a new override directory like demo-override-X4 or demo-override-X2. The commands for converting each file type can be run individually or as part of batch operations. You can also run the enitre operation from start to finish with ./install/bin/pie4k batch complete -c demo-reference.cfg for example. Upscaling the entire GemRB demo is much faster than the real games and is a good test to see if everything is working. On my system to complete all operations it takes about 3 hours on BG2. Once you complete the operations you can run gemrb -c demo-x4.cfg, if you haven't installed gemrb yet you can run ./scripts/gemrb/install.sh, of course you can also just install it in other ways that GemRB supports. Keep in mind you need to use my fork for now at https://github.com/Goddard/gemrb/tree/pie4k
- Linux - SUPPORTED - My primary development operating system so has had the most usage currently
- Windows - SUPPORTED - I have a windows drive and got it built and working on Windows. Resource usage is slightly more forgiving for VRAM since Windows supports SVM, but in my limited testing Windows did perform slower.
- MacOS NOT SUPPORTED - I don't have a mac. I don't think it would take too much to get it working, but I just haven't tested yet.
GPU - Nvidia, AMD, and Intel should work. I personally only have an Nvidia GPU so I haven't tested the others. User "draghan" on discord tested AMD and it does appear to work in their testing. Please report issues if it isn't using your GPU when doing GPU operations(e.g. upscale). I tested on a 4090 with 24 GB of VRAM, but it should still work if you have less VRAM available it will just take longer.
CPU - More cores more speed, but any CPU should still funciton. The tasks the project does requires ample CPU power though. I don't recommend trying to perform pie4k operations on a system without a GPU, but it is technically still possible, but it will probably take several days to complete if not weeks.
RAM - All testing has been done with 32 GB of RAM and SWAP space at 32 GB.
Download binaries on github page from releases section
When you build this project you are really building 3 projects currently. We obviously are building pie4k(project ie 4k), but also GemRB with our modifications included and NCNN.
Whatever package manager you use, you will need gcc, cmake, git, libvorbis, sdl2, sdl2_mixer, sdl2_image, gtest, libvlc, vulkan headers, ninja
Nvidia - libnvidia-ml-dev (ubuntu) AMD - nothing extra at this time Intel - intel-level-zero-gpu level-zero
If you have an Nvidia GPU you will need cuda with nvml. AMD should work without intstalling extra packages, but we may use amdsmi in the future. Intel should work with intel level zero library.
./compile.sh
I use msys2 to build on Windows. You should use mingw-w64 and install these packages
pacman -S --needed \ mingw-w64-x86_64-gcc \ mingw-w64-x86_64-cmake \ mingw-w64-x86_64-extra-cmake-modules \ git \ make \ mingw-w64-x86_64-freetype \ mingw-w64-x86_64-SDL2 \ mingw-w64-x86_64-openal \ mingw-w64-x86_64-SDL2_mixer \ mingw-w64-x86_64-libogg \ mingw-w64-x86_64-libvorbis \ mingw-w64-x86_64-libpng \ mingw-w64-x86_64-gtest mingw-w64-x86_64-vlc \ mingw-w64-x86_64-vulkan-headers \ ninja
You also need to have cuda installed if you have an Nvidia GPU. If you have an AMD GPU you will need AMD ADLX. Intel users can use Intel Level Zero.
./compile.sh
Rules System
RuleEngine - 30% - Rule system allows basic file operation skipping but is not super advanced yet.
Python Support
- Add the ability for people to create python scripts that perform additional operations.
Resume Operations
- Resume 80% - Resume now works, if you want to run an operation and disregard resume use --force
Mass Convert - PIE4k
- 2DA 100% - Extract,Upscale,Assemble
- GAM 100% - Extract,Upscale,Assemble
- MOS 100% - Extract,Upscale,Assemble
- BAM 98% - Extract,Upscale,Assemble - still some issues to work through.
- TIS 90% - Extract,Upscale,Assemble - while everything works it could still be optimized for improved utilization.
- ARE 100% - Extract,Upscale,Assemble
- BCS 95% - Extract,Upscale,Assemble - Better support has been added, but still need a little more work to ensure only some functions are upscaled
- BMP 100% - Extract,Upscale,Assemble
- CHU 100% - Extract,Upscale,Assemble
- KEY 10% - add/remove - This is not really well tested and I don't recommend using it right now.
- PLT 100% - Extract,Upscale,Assemble
- PNG 100% - Extract,Upscale,Assemble
- PVRZ 100% - File format is more of a child secondary to other file types so no direct operations
- WED 100% - Extract,Upscale,Assemble
- WMP 90% - Extract,Upscale,Assemble - Works, but maybe some issue with gemrb or pie4k files not sure yet
- MVE 100% - Extract,Upscale,Assemble
GemRB - Modify GemRB allowing upscaled assets to run properly
- 70% - Use UpScaleFactor for actors, projectiles, and ovarlays that are specific to engine and not files.
- 95% - Add Zoom In/Out - mostly working with 4k assets, but has some issues when zoomed in for normal assets.
Plugin System
- All file types supported "plugins" currently and most fit the mold with some secondary "plugins" that kinda don't yet.
Services System
- All services currently mostly fit a mold I've created, but they are intended to be used to either add additional context or support for new AI systems. For example upscaling is mostly simply handled by an NCNN service. Some of the logic could be abstracted further than it is now to make it more generalized and easier for others to do something similar without as much work, but the structure exists now. Planning support for other models and operations.
Multi-GPU Support
- Currently only 1 GPU is supported, planning on adding support for multiple.
Configuration Expansion
- Configuration options are currently limited. Need more options for how things are handled such as alpha channels, colors, etc..
Overall the BG2 is still not playable. It is getting closer though.
- zoomLevel added and mostly working in x1 and x4 which is what I tested so far in demo and bg2.
- UpScaleFactor working in most situations but still bugs exist that need to be fixed, but getting much closer.
- Door Closed state visuals not working.. should be fixed soon
I think the potential for this tool is eventually something like the concept art below. In the future I imagine we will be able to create more detailed art work, or even a completely altered style for the whole game, for example an "anime" style like shown in some of the models below. It all depends on what the user wants really. Here is a human theif model concept for example that I personally would love to see in a more ultra realistic style.
IESDP - Really so useful and it would have been insanely difficult without it. - https://gibberlings3.github.io/iesdp/index.htm
GemRB - I borrowed some things from GemRB for this project, so many thanks for their hard work. Couldn't have gotten this far without being able to review their code. I tried to leave credits for things I basically directly copied SClass IDs and kinda the logging system, but both have been modified. I actually originally planned on heavily using, and did, but due to the design specifications of this project it would have required too many changes to the GemRB code base and the things I change in GemRB I want to be things that we can actually submit in a PR. - https://gemrb.org/
Near Infinity - I didn't directly borrow anything from their code since it is java, but I used it along the way to verify results and it was invaluable. Also reviewed how they did things in their code to understand better and really helped with many things. - https://github.com/NearInfinityBrowser/NearInfinity
NCNN - https://github.com/Tencent/ncnn
Model Developers - https://github.com/upscayl/custom-models
We use the GNU GENERAL PUBLIC LICENSE version 3 and most the code is licensed as such unless otherwise noted. Models are all contributed from outside contributors and they have their own respective licenses.
I haven't submitted my changes to the mainline project, but we can work off my branch to get the changes submitted and use them quickly between ourselves. Here is the repo link - https://github.com/Goddard/NearInfinity










