OpenXcom Forum

Modding => Released Mods => XPiratez => Topic started by: Drago888 on November 12, 2020, 04:16:33 pm

Title: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on November 12, 2020, 04:16:33 pm
Dear all,

I had modified Xcom extended to support high resolution images (1280x800) for Cutscenes and most of Ufopaedia.

For those interested, you can download the game from https://bit.ly/xpiratez-32bits-images. Please check back once in a while as will update any patched version there.

My codes is found at https://github.com/drago888/OpenXcom.

For any errors, please drop an email to me at drago888@gmail.com with subject beginning with Xpiratez.

If anyone have good quality images better than what ESRGanResizer can generate, please pass to me.

To use back the original x-com or 320x200 xpiratez, change the options.cfg file for the below or delete them.
  cutsceneResolutionX: 320
  cutsceneResolutionY: 200
  pediaBgResolutionX: 320
  pediaBgResolutionY: 200

Attached are some screenshots of the HD version.

Thank You

PS: Only 64bits executable attached

Edit on 9 Dec 2020 - Version L6 is ready
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Dioxine on November 12, 2020, 07:19:56 pm
That cellshading looks quite nice - I guess it's better than just converting straight from source and risk infringement...
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: EryliaStarheart on November 12, 2020, 08:01:52 pm
That being said, if Bootypedia is reworked, I'd really like to see some more consistency in artwork. Around 70% of Bootypedia is RIGHTFULLY PLUNDERED comic/anime artwork which works really well together, but there are obvious standouts. I'm compiling a tentative list of what might need replacement and suggestions for substitutes, with the emphasis being on:

1) 3d renders of people. Many look plastic, though obviously Gudrun's looks need to be preserved as she's the only named character not represented by appearance from other media. Dioxine, you're right in that adequate cel shading/line/anisotropy/median filter can possibly help bring these pictures in line with the others, I'll see what can be done.

2) A few really basic line drawings not comparable in quality to other art.

3) Illustrations not really relevant to the subject matter of the article.

Will present my suggestions once done with the armor I'm making and life stuff.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Dioxine on November 12, 2020, 08:15:45 pm
Truth be said I would not like to change too much is resolution of pictures. 640x400 could be a good compromise, but any larger than that and we run into serious size issues - I would definitely want to keep the mod in no case larger than around 500 MB, maybe 600 (CD sized game - also many free DL services put limits on single file size around same ballpark). So perhaps keeping to 320x200 and thus 25-30kb images is for the best - that way the capacity to add new stuff to Pedia is basically unlimited. Current size is around 22MB, and even with high promiscuity I don't think it will grow by more than another 20, maybe 30 for a total size of 50MB. With 640x400, though, that's 200MB - that's still viable, but already kinda cumbersome. With proposed 1920x1200, that's 1.8 GB - totally unacceptable.

As for artwork donations, or even sensible replacement suggestions - ofc I welcome such initiative with great interest.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Meridian on November 12, 2020, 08:20:25 pm
I'll just add here that OXCE will remain 320x200x8bpp.

More reading: https://openxcom.org/forum/index.php/topic,6498.0.html
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Dioxine on November 12, 2020, 08:28:22 pm
Well, then it's settled, no resolution bump, since I don't want to stray from OXCE. In a way that is a relief - it's good to have clear boundaries.

EDIT:
@Erylia: I would be quite happy if the other characters than Dr. X also would not be 'stolen' from other media, but they fit their roles and a popular character provides a lot of 'fodder' to pick and choose from.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Stoddard on November 12, 2020, 08:58:48 pm
This ESRgan thing is quite curious though. I wonder if it can be used at runtime, as a zoom filter/shader option perharps
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on November 13, 2020, 02:27:48 am
This ESRgan thing is quite curious though. I wonder if it can be used at runtime, as a zoom filter/shader option perharps

I am not sure if it can be done.
However for my version (using ESRGanResizer), I need to install python and pytorch.

Also it takes about 5s to process each image (doing waifu2x-caffe denoising 3 before and after converted). - and that is using a GPU
And ESRGan don't work well with transparent pixels thus have a program to convert transparent pixel to background color before passing in.

And afterwards, have another program to strip off the transparent color. If you look at items - eg. shiv, you will be able to see some of the background color (probably 1 pixel) around the edges.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on November 13, 2020, 02:34:26 am
Well, then it's settled, no resolution bump, since I don't want to stray from OXCE. In a way that is a relief - it's good to have clear boundaries.

EDIT:
@Erylia: I would be quite happy if the other characters than Dr. X also would not be 'stolen' from other media, but they fit their roles and a popular character provides a lot of 'fodder' to pick and choose from.

No problem :) Anyway will still put my version here and will be playing on it at least until Cyberpunk 2077 is finally released
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 06, 2021, 04:41:33 am
Well, then it's settled, no resolution bump, since I don't want to stray from OXCE. In a way that is a relief - it's good to have clear boundaries.

EDIT:
@Erylia: I would be quite happy if the other characters than Dr. X also would not be 'stolen' from other media, but they fit their roles and a popular character provides a lot of 'fodder' to pick and choose from.

Pfft, very piratey attitude there mate. Xcom engine will remain at MCGA rez so you wouldn't dare to do bump rez a bit on bootypedia where your nice/embarrassing scans would benefit most plus obviously text would benefit hugely.

There are probably (one or two) people who would get angry about it but since you are in no way or manner changing how the plain Xcom works and you're not exactly shy of ruffling boo..feathers, are you?
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Meridian on June 06, 2021, 09:24:57 am
Pfft, very piratey attitude there mate. Xcom engine will remain at MCGA rez so you wouldn't dare to do bump rez a bit on bootypedia where your nice/embarrassing scans would benefit most plus obviously text would benefit hugely.

There are probably (one or two) people who would get angry about it but since you are in no way or manner changing how the plain Xcom works and you're not exactly shy of ruffling boo..feathers, are you?

Not exactly sure what you want to say mate.

It is not possible to increase the resolution in the official OXC and OXCE versions, and it will not be possible in the future... there's nothing Dioxine can do about that.
If you want to blame someone, feel free to blame me.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 07, 2021, 02:48:41 pm
Not exactly sure what you want to say mate.

It is not possible to increase the resolution in the official OXC and OXCE versions, and it will not be possible in the future... there's nothing Dioxine can do about that.
If you want to blame someone, feel free to blame me.

Just saying it's his mod and if he wants to implement e.g. 640x400 bootypedia it shouldn't be a problem for OXCE in general.

Whether that's practical and/or anyone's going to process all the artwork again from sources is a completely different matter.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Meridian on June 07, 2021, 03:22:34 pm
Just saying it's his mod and if he wants to implement e.g. 640x400 bootypedia it shouldn't be a problem for OXCE in general.

OXCE supports only 320x200.
Unless you make your own fork of OXCE, 640x400 is not possible.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Apocca on June 07, 2021, 04:50:56 pm
It's nice but I like the original images better. Might be a nice add-on for some people.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 08, 2021, 04:05:26 am
OXCE supports only 320x200.
Unless you make your own fork of OXCE, 640x400 is not possible.

Thanks Meridian and Yankee for the wonderful openxcom mod.
Thanks Dioxine and all contributors for the wonderful xpiratez mod.

Sorry that my programming skill is not up to Meridian/Yankee standard. But if someone is interested, I can try to modify Geoscape and Battlescape for 1280X800 resolution. Please inform me via email drago888@gmail.com.


However, will only do it for PC version. (Preferably someone can teach me how to create an exe without need to install SDK and redistributable - eg how Meridian do it). If need to do for Linux, please inform me too (Only able to test on Ubuntu).

Also, need guidance on how to test - eg currently, some UFOpaedia from xpiratez uses the TFTD ufopaedia. I did not modify that portion previously (but modified after my last playthrough) as don't know how to test previously

Also, need help from talented artist to convert those small pictures (Or any of the HD images that can be improved) to high resolution. (as using ESRGAN for very small images, the results is very bad. (eg if you look at the xpiratez weapons in ufopaedia. The image is really ugly as there is only so much that the program can recreate from very small, low resolution images)

Thank You
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: kevL on June 08, 2021, 04:51:09 am
@Drago i commend your optimism ...
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 08, 2021, 05:35:59 am
@Drago i commend your optimism ...

Hi Kevl,

I had not looked into the codes for geoscape/battlescape yet. But I always believe that with perseverance (except when chasing after lady), most things can be resolved. However, my concern is with compatibility with Openxcom-extended. Hopefully will not raise any conflict when merging with new version of the source code.

But I agree that it will not be an easy task.

Also, personally I see no need (as what made me change the resolution is due to cutscenes and Bootypedia images blurry on my laptop). I'm okay with Geoscape and Battlescape images. But if there are request, then will consider taking up this project

PS: Also I believe I will need to extract out those images from XCOM format into normal images to be upsized.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 11, 2021, 01:49:08 am
OXCE supports only 320x200.
Unless you make your own fork of OXCE, 640x400 is not possible.

Xpiratez is already a TC with bazillions of man-hours sunk on it, so fork is not that much of a stretch.

But to reiterate, even if someone would modify the whole thing to run on 640x400 (fairy straightforward to 2x2), redoing all of bootypedia would be a hell of a job.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 11, 2021, 02:04:50 am
Hi Kevl,

I had not looked into the codes for geoscape/battlescape yet. But I always believe that with perseverance (except when chasing after lady), most things can be resolved. However, my concern is with compatibility with Openxcom-extended. Hopefully will not raise any conflict when merging with new version of the source code.

But I agree that it will not be an easy task.

Also, personally I see no need (as what made me change the resolution is due to cutscenes and Bootypedia images blurry on my laptop). I'm okay with Geoscape and Battlescape images. But if there are request, then will consider taking up this project

PS: Also I believe I will need to extract out those images from XCOM format into normal images to be upsized.

I don't think you benefit that much on geoscape, most obvious visual improvement would be on boobypedia. Running battlescape at 640x400 would give you option to zoom out, though.

Obviously 1280x800 is another easy target for scaling but probably won't add that much visually over 640x400 as far as boobypedia is concerned. But if someone takes on the herculean task of reprocessing artwork.. And if Dioxine has the originals. And if he doesn't mind sharing them.. If if.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 11, 2021, 03:04:54 am
But to reiterate, even if someone would modify the whole thing to run on 640x400 (fairy straightforward to 2x2)

I beg to differ. It is not that straightforward to convert it to 2x2. When I convert the cutscenes and boobypedia to 4x4, there are some obstacles to overcome.
Eg. To modify the algorithm for drawing the cursor on 4x4, to modify the codes for the scrolllist (probably my codes break it), to modify the codes to upsize existing images without remodeled images, to set the correct/acceptable colors (as no longer using palettes which the current version is using - palettes are only usable by 8 bits images) etc.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 11, 2021, 03:07:30 am
I don't think you benefit that much on geoscape, most obvious visual improvement would be on boobypedia. Running battlescape at 640x400 would give you option to zoom out, though.

Obviously 1280x800 is another easy target for scaling but probably won't add that much visually over 640x400 as far as boobypedia is concerned. But if someone takes on the herculean task of reprocessing artwork.. And if Dioxine has the originals. And if he doesn't mind sharing them.. If if.

I agree that upscaling geoscape will not have any benefits. Thus I guess I will leave it at status quo.

To add on, I use 1280x800 not because that there is much benefit over 640x400 but rather due to the below reason
1. The ESRGAN model that give acceptable results (for cutscenes) to me are all 4x scaling
2. Delay resizing in the future (maybe 2 decades down the line) where the norm resolution is so much higher than 640x400. (such as XCOM 320x200 is acceptable so many decades ago but now we cannot accept that resolution). Downside is the download size which to me,  for modern game, 1 - 2GB is nothing. Eg sometimes patching our modern game, the patch size might already be more than 1GB
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 11, 2021, 03:57:28 am
I beg to differ. It is not that straightforward to convert it to 2x2. When I convert the cutscenes and boobypedia to 4x4, there are some obstacles to overcome.
Eg. To modify the algorithm for drawing the cursor on 4x4, to modify the codes for the scrolllist (probably my codes break it), to modify the codes to upsize existing images without remodeled images, to set the correct/acceptable colors (as no longer using palettes which the current version is using - palettes are only usable by 8 bits images) etc.

It's extremely simple as far as upscaling bitmaps goes, UI is obviously a different animal. It's not like some relatively new commercial titles don't struggle with e.g. 4k UI being unusably small and so on.

Fair point re: palettes, albeit dithering obviously works better the more pixels you've got and it's not like you have to manually assign the palette unless you're a pixel artist..
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 11, 2021, 03:58:59 am
I agree that upscaling geoscape will not have any benefits. Thus I guess I will leave it at status quo.

To add on, I use 1280x800 not because that there is much benefit over 640x400 but rather due to the below reason
1. The ESRGAN model that give acceptable results (for cutscenes) to me are all 4x scaling
2. Delay resizing in the future (maybe 2 decades down the line) where the norm resolution is so much higher than 640x400. (such as XCOM 320x200 is acceptable so many decades ago but now we cannot accept that resolution). Downside is the download size which to me,  for modern game, 1 - 2GB is nothing. Eg sometimes patching our modern game, the patch size might already be more than 1GB

Yeah, I agree with you, if you go to a lot of trouble to reprocess/postprocess all of boobypedia, you might as well as go for 1280x800..
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 11, 2021, 04:06:17 am
It's extremely simple as far as upscaling bitmaps goes, UI is obviously a different animal. It's not like some relatively new commercial titles don't struggle with e.g. 4k UI being unusably small and so on.

Fair point re: palettes, albeit dithering obviously works better the more pixels you've got and it's not like you have to manually assign the palette unless you're a pixel artist..

Hi Barleyman, thanks for sharing your knowledge. My limited knowledge on images is unsurprisingly obvious here. Thus I depends a lot on models that other people create for ESRGAN to upscale and patch(smoothen) the blurry part. Sadly, there is no model for XCOM - old version not the recent version.). Although I found models for Fallout 4.

Or maybe some ML experts can help train some models for openxcom-extended and xpiratez? Will really appreciate it
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 12, 2021, 04:30:26 am
Hi Barleyman, thanks for sharing your knowledge. My limited knowledge on images is unsurprisingly obvious here. Thus I depends a lot on models that other people create for ESRGAN to upscale and patch(smoothen) the blurry part. Sadly, there is no model for XCOM - old version not the recent version.). Although I found models for Fallout 4.

Or maybe some ML experts can help train some models for openxcom-extended and xpiratez? Will really appreciate it

2x2 upscale just means that you take 1 pixel and copy it 4 times. Hence 320x200 => 640x400 looks exactly the same and so does 320x200 => 1280x800. It'd be probably reasonably (*) straightforward to tweak the game engine that way if someone felt very dedicated to it. That way you could have boobypedia bitmaps in "native" hi-rez and battlescape in upscaled 320x200 without having to change resolutions or such.

But someone would have to go and bang the C code and so on. Meridian's not volunteering, I've got a day job and don't feel that strongly about it. Plus last time I looked into graphics processing I was trying to co-opt FFMPEG into capturing Linux "desktop" so I can feed it into a local dimming algorithm. You don't want to go there unless you want to spend a year on it, believe me.

I could put in some grunt-work on processing the boobypedia images to higher rez if someone actually had the original bitmaps etc.

(*) to some values of "reasonable"
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 12, 2021, 04:53:47 am
2x2 upscale just means that you take 1 pixel and copy it 4 times. Hence 320x200 => 640x400 looks exactly the same and so does 320x200 => 1280x800. It'd be probably reasonably (*) straightforward to tweak the game engine that way if someone felt very dedicated to it. That way you could have boobypedia bitmaps in "native" hi-rez and battlescape in upscaled 320x200 without having to change resolutions or such.

But someone would have to go and bang the C code and so on. Meridian's not volunteering, I've got a day job and don't feel that strongly about it. Plus last time I looked into graphics processing I was trying to co-opt FFMPEG into capturing Linux "desktop" so I can feed it into a local dimming algorithm. You don't want to go there unless you want to spend a year on it, believe me.

I could put in some grunt-work on processing the boobypedia images to higher rez if someone actually had the original bitmaps etc.

(*) to some values of "reasonable"

Thanks for the clarification. Although i don't see the benefits of doing that. Do you mind enlightening me?

Fyi, sdl 1.2 have a upsize function. I used it to upscale images without remodelling  (eg look at clothing and bases in boobypaedia)

Thanks Meridian, Yankees, Dioxine and others contributors for adding to the project amidst your freetime in your full time employment
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 14, 2021, 05:07:08 pm
Thanks for the clarification. Although i don't see the benefits of doing that. Do you mind enlightening me?

Fyi, sdl 1.2 have a upsize function. I used it to upscale images without remodelling  (eg look at clothing and bases in boobypaedia)

Thanks Meridian, Yankees, Dioxine and others contributors for adding to the project amidst your freetime in your full time employment

The benefit is that you don't get blur. If you just plop 320x200 @ full screen, it'll get stretched by 5.4 on 1920x1080 display which makes your big blocky pixels fuzzy. Which was your problem! Multiplying by 5 would be 1600x1000, add a bit of black borders and you got crispy sharp pixels.

Anyways, we're talking of two different things, I was speculating on recreating boobypedia at 640x400 or 1280x800 which would make the anime girls look nicer but thinking about just how many entries there are.. If one takes 5 min to process it'd be like 8.3 hours to do a hundred entries. Whoops. And if you need to go look online for originals..

Makes you think just how much time Dioxine has put into this!
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on June 14, 2021, 06:49:38 pm
Anyways, we're talking of two different things, I was speculating on recreating boobypedia at 640x400 or 1280x800 which would make the anime girls look nicer but thinking about just how many entries there are.. If one takes 5 min to process it'd be like 8.3 hours to do a hundred entries. Whoops. And if you need to go look online for originals..

Makes you think just how much time Dioxine has put into this!

When i use esrganresizer (although there is cupscale which seems much better - will try it for the next version ), it takes about 5s per images. If including those weapons images in resources folder, have a few thousands.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Barleyman on June 22, 2021, 02:26:40 am
When i use esrganresizer (although there is cupscale which seems much better - will try it for the next version ), it takes about 5s per images. If including those weapons images in resources folder, have a few thousands.

Sure, that's fairly sensible. My line of thought of taking original images and using them with higher resolution instead of 320x200 maybe not so much. Even if the original artwork was nicely organized as separate images ready to go it'd take a good long while to resize + cut + paste everything one at a time.. Weapon images have obviously been painted pixel by pixel by a quite a few guys as you can see in the credits, post processing those and looking good would be quite the trick.
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on July 25, 2021, 10:02:03 am
When i use esrganresizer (although there is cupscale which seems much better - will try it for the next version ), it takes about 5s per images. If including those weapons images in resources folder, have a few thousands.

Just for people who are interested to upscale the images themselves using ESRGAN. You can't find ESRGANResizer on the web anymore. Cupscale works very well (It even supports transparent background unlike ESRGANResizer) The images looks much better now when using Cupscale. However, all my images are still png files (and renamed to .gif if source is gif) (As formerly ESRGANResizer don't allow other than PNG)
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on January 11, 2022, 08:12:43 am
Dear all who are using this version,

If you encounter any bugs for the HD version, please kindly drop me an email at drago888@gmail.com with subject Xpiratez, attaching the save file and also the description of the bug and how to replicate it using your save file.

Also, I had fixed the images issues (for Ufopaedia - items (eg bite, weapons etc). Sorry that did not notice it until now.

Thanks for all your help and support

Also as I'm busy with work currently, thus unable to play and test thoroughly
Title: Re: Xpiratez High resolution for Cutscenes and most of Ufopaedia
Post by: Drago888 on January 12, 2022, 02:35:17 am
Sorry but I owe anyone using this version an apology.

Just trace through MeridianOXC RuleItem.cpp commit History. The item image had been rendered wrongly (small picture instead of big) since 13 Nov 2021. (Could be earlier but 13 Nov 2021, there is modification to the drawHandSprite method)

As when testing after merging the new codes, did not look carefully at the images and just ensure that game can run.