RE4R Treasure Optimizer is a console application designed to optimize treasure and gem configurations for maximum sell value in Resident Evil 4 Remake (RE4R).
The application enables users to:
- Load preset treasure and gem configurations.
- Manage an inventory by adding or removing gems and treasures.
- Optimize gem placements in treasures to maximize total sell price.
- View treasure lists, inventory, and optimization results.
- Run tests on all presets to compare optimization outcomes.
- Preset Loading: Load predefined treasure and gem combinations based on available presets.
- Inventory Management: Add or remove gems and treasures to customize your inventory.
- Optimization Algorithm: Automatically optimize gem placements in treasures to maximize sell price.
- Sell Price Calculation: Calculate and compare the total sell price before and after optimization.
- Command Help: Built-in help command to display all available commands and their usage.
- .NET 6.0 SDK or later.
You can build the application as a self-contained executable for different platforms. This allows the application to run on machines without the .NET runtime installed.
-
Clone the repository:
git clone https://github.com/MangkorN/RE4R-Treasure-Optimizer.git cd RE4R-Treasure-Optimizer -
Publish the application as a self-contained executable:
Replace
{RID}with the Runtime Identifier (RID) for your target platform. Here are some common RIDs:win-x64for Windows 64-bitlinux-x64for Linux 64-bitosx-x64for macOS Intel 64-bitosx-arm64for macOS Apple Silicon (M1/M2)
dotnet publish -c Release -r {RID} --self-contained true -p:PublishSingleFile=trueExamples:
-
Windows 64-bit:
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -
Linux 64-bit:
dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -
macOS Intel:
dotnet publish -c Release -r osx-x64 --self-contained true -p:PublishSingleFile=true -
macOS Apple Silicon:
dotnet publish -c Release -r osx-arm64 --self-contained true -p:PublishSingleFile=true
This command will create a self-contained, single-file executable in the
bin/Release/net6.0/{RID}/publish/directory. -
Run the application:
Navigate to the publish directory:
cd RE4R-Treasure-Optimizer/bin/Release/net6.0/{RID}/publish/-
On Windows:
RE4R-Treasure-Optimizer.exe
-
On Linux/macOS:
./RE4R-Treasure-Optimizer
The application will start in Interactive Mode, allowing you to input various commands.
-
help- Show available commands.clear- Clears the screen.exit- Exit the application.
load [preset_id]- Load a preset to generate the starting treasure list.optimize- Generate a new and optimized treasure list.view- View treasure lists and inventory.reset- Reset treasure lists and inventory
add [quantity] [name]- Add a specified quantity of a gem or treasure to your inventory.rm [quantity] [name]- Remove a specified quantity of a gem or treasure from your inventory.names- View all gem and treasure names and their aliases.
view startorview s- View the starting treasure list.view inventoryorview i- View the current inventory.view neworview n- View the new treasure list after optimization.test- Test all presets.
Below are the preset IDs available in the application:
- 0: Base Game w/Merchant + DLC
- 1: Base Game + DLC
- 2: Base Game w/Merchant
- 3: Base Game
Use the names command to see all available gem and treasure names and their aliases.
- Ruby (
ruby,r) - Sapphire (
sapphire,s) - Yellow Diamond (
yellowdiamond,yellow,yd) - Emerald (
emerald,e) - Alexandrite (
alexandrite,a) - Red Beryl (
redberyl,red,rb)
- Butterfly Lamp (
butterflylamp,bl) - Chalice of Atonement (
chaliceofatonement,coa) - Elegant Bangle (
elegantbangle,eb) - Elegant Crown (
elegantcrown,ec) - Elegant Mask (
elegantmask,em) - Extravagant Clock (
extravagantclock,exc) - Flagon (
flagon,f) - Golden Lynx (
goldenlynx,gl) - Ornate Necklace (
ornatenecklace,on) - Splendid Bangle (
splendidbangle,sb)
-
Load a preset (e.g., preset 0):
load 0 -
View the starting treasure list:
view start -
Optimize the loaded preset:
optimize -
View the optimization result:
view new -
Add gems to your inventory:
add 2 ruby -
Remove gems from your inventory:
rm 1 sapphire -
View your inventory:
view inventory -
Reset the application:
reset
Contributions are welcome! Feel free to open an issue or submit a pull request to improve the code, add new presets, or enhance the optimization algorithm.
This project is licensed under the MIT License for the original code.
It also uses third-party components (such as Google OR-Tools), which are licensed under the Apache License 2.0.
See the LICENSE file in the repository root for more details.