In this thread on fixing the Team Player/Loner perks, a request was made to look into allowing character portraits to be displayed in full color, rather than the green-scanline effect of the Pipboy. I think I have it working:
The hex changes to apply are below (be sure to make a backup of the BOS.EXE file before editing - if something goes wrong, it shouldn't corrupt any saves, but it could crash more frequently). Changes can be applied individually if desired.
Change 1: Allows selected character portrait to be in color:
000bc8c4: D8 0D 98 D5 7F 00 D9 05 9C DE 8B 00 D8 0D 98 D5 7F 00 8B 86 3F 01 00 00
-> D9 05 A0 DE 8B 00 D9 05 9C DE 8B 00 8B 86 3F 01 00 00 8D 4D C4 51 EB 45
Change 2: For unselected character portraits (in the character select and recruits list), all color channels will be dimmed equally (existing algorithm is biased to a greenish-gray):
000bc93b: D9 05 3C DE 8B 00 D8 0D 84 D7 7F 00 8B 86 3F 01 00 00 8D 55 C4 52
-> D8 05 98 D5 7F 00 D9 C0 D9 C0 8B 86 3F 01 00 00 8D 55 C4 52 EB 41
Change 3: Eliminate the scanline effect in the portrait
00345eb4: 74 0C
-> 90 90
Caveats:
Patch details:
At a high level, the code does the following when a character is selected from the Pipboy display:
The final change just disables the flag used to generate the scanline effect when copying an image bitmap to screen. This means that any bitmap which used the scanline effect will no longer do so. As far as I know, the only things which use this are the portraits, and the green character sprite in the inventory screen. If anyone sees that this has any other effect, please let me know.
The hex changes to apply are below (be sure to make a backup of the BOS.EXE file before editing - if something goes wrong, it shouldn't corrupt any saves, but it could crash more frequently). Changes can be applied individually if desired.
Change 1: Allows selected character portrait to be in color:
000bc8c4: D8 0D 98 D5 7F 00 D9 05 9C DE 8B 00 D8 0D 98 D5 7F 00 8B 86 3F 01 00 00
-> D9 05 A0 DE 8B 00 D9 05 9C DE 8B 00 8B 86 3F 01 00 00 8D 4D C4 51 EB 45
Change 2: For unselected character portraits (in the character select and recruits list), all color channels will be dimmed equally (existing algorithm is biased to a greenish-gray):
000bc93b: D9 05 3C DE 8B 00 D8 0D 84 D7 7F 00 8B 86 3F 01 00 00 8D 55 C4 52
-> D8 05 98 D5 7F 00 D9 C0 D9 C0 8B 86 3F 01 00 00 8D 55 C4 52 EB 41
Change 3: Eliminate the scanline effect in the portrait
00345eb4: 74 0C
-> 90 90
Caveats:
- For best results, once an image is cropped to the right size, use an image editor to convert it to 8-bit indexed color, then back to RGB. This is necessary because the game engine will perform this conversion itself (details below), and you will probably get better quality from doing this in a proper image editor.
- Portrait size is still 75x100. It might be possible to increase this, but given the requirement for indexed color, higher-resolution images likely won't provide much benefit in quality.
- Existing portraits in-game are all grayscale, and will be displayed as such (see the last two portraits in the screenshot). Only newly added character portraits will be shown in color.
- Turning off the scanline effect for portraits also disables it for Pipboy displays which use it (e.g. the inventory screen has an image of the character sprite(s)).
- Image display for the (big) prefab character screen still appears to be green. I'm surprised - this means there's a second set of code just for those images. If there's enough request, I can try to track this one down too. The portrait display inside the customization window is correct, though.
Patch details:
At a high level, the code does the following when a character is selected from the Pipboy display:
- Load the corresponding ZAR if it's not already in memory
- Decompress the ZAR into a 32-bit ARGB image
- Copy the image a couple of times - one of these resizes it for the location being displayed. It's likely one of these also crops the image if it's too large
- Generate a 256-color palette from colors in the image, and convert the image data into 8-bit indexed using that palette (passing through a 17-bit (!!!) color lookup table in the process)
- Copy the image and palette a few more times (never did track down what these did - just that they kept interfering with memory breakpoints in the debugger)
- Tweak the colors of the palette based on the desired image effect (in this case, applying the green or green-gray color bias)
- As needed, draw the image to the screen, converting back from indexed to RGB, and applying scanline effect if enabled
The final change just disables the flag used to generate the scanline effect when copying an image bitmap to screen. This means that any bitmap which used the scanline effect will no longer do so. As far as I know, the only things which use this are the portraits, and the green character sprite in the inventory screen. If anyone sees that this has any other effect, please let me know.
Last edited: