Myth 1&2 AI Upscale Future Attemt

A forum for solving problems that might be encountered during installation, updating, or in game.
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Hello, I'm new here. I finally decided to play Myth series game, but found that some of the game aspects could be improved.
I already did several AI Upscale mods for Thief community (https://www.moddb.com/members/akven), so maybe I could do something for Myth.

So, several questions:
1. How could I unpack CUTSCENE.GOR file from Myth 1?
2. What is the biggest resolution Magma Project engine supports for cinematics?
3. What file extensions its supports for cinematics? (only QuickTime, or it can play avi/mkv through ffmpeg?
4. What is the biggest resolution for textures and in what format (png,dds etc) they are supported?
5. The Fallen Levels for Myth 2 uses Myth 2 textures or Myth 1 textures? Does this textures differ? And if they are, could I create a pack for upscaled Myth 1 textures to use with Fallen Levels?
6. Are characters/units textures upscalable?
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Ok, I managed to extract smk movies using UnTag, but they are encrypted in some way, not playing. They have this in header:
00prolog_smk moov00pr mythSMK2
So as I understand - I need to decrypt them somehow.

Also I managed to extract textures and shadow map in bmp format for maps.
As I understand - this is the one texture for the whole level? Can it be upscaled and inserted back to game? It clearly could be dedithered.
I'm strucked with game files formats for now.
Jon God
Posts: 1641
Joined: Sat Mar 25, 2006 11:24 pm
Location: Here
Contact:

Re: Myth 1&2 AI Upscale Future Attemt

Post by Jon God »

The cutscenes from Myth 1 and 2 are available on the Tain in higher resolution, and in quicktime format, which can be exported to .mp4 or whatever else you'd like.
Image
Image
PSN: Jon_God
XBL: J0N GOD
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Jon God wrote:The cutscenes from Myth 1 and 2 are available on the Tain in higher resolution, and in quicktime format, which can be exported to .mp4 or whatever else you'd like.
As I can judge from Myth 1 QuickTime cinematics description - they are original smk files, filtered and converted to QT. Is it right? Cause it's better to refilter them once again from original files.

"Note: Unlike the Myth II QuickTime Cutscenes, these files were converted from the low resolution, interlaced TFL smacker files. Although great care was taken to achieve the best possible conversion, the image quality is ultimately limited by the source data."

So I'd want to repeat this process using ESRGAN models
Jon God
Posts: 1641
Joined: Sat Mar 25, 2006 11:24 pm
Location: Here
Contact:

Re: Myth 1&2 AI Upscale Future Attemt

Post by Jon God »

Akven wrote:
Jon God wrote:The cutscenes from Myth 1 and 2 are available on the Tain in higher resolution, and in quicktime format, which can be exported to .mp4 or whatever else you'd like.
As I can judge from Myth 1 QuickTime cinematics description - they are original smk files, filtered and converted to QT. Is it right? Cause it's better to refilter them once again from original files.

"Note: Unlike the Myth II QuickTime Cutscenes, these files were converted from the low resolution, interlaced TFL smacker files. Although great care was taken to achieve the best possible conversion, the image quality is ultimately limited by the source data."

So I'd want to repeat this process using ESRGAN models
To my understanding, some of them (I think Crow's bridge and Bragada?) were taken from the beta of Myth TFL, and were not interlaced, and were a higher resolution.
Image
Image
PSN: Jon_God
XBL: J0N GOD
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

I found a way to play/convert those Myth smk files.
Just deleted this header from files:

00prolog_smk��������������������moov00pr�����&����@Y[$����myth

SMK files should start with SMK2 to be correctly playable. So you need to delete everything before SMK entry
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Well, quick test.
https://yadi.sk/i/yR-x5QETyVkGrg

I deinterlaced and filtered (ESRGAN+AviSynth) 01crowsb cinematic.
Removed duplicated frames (original video was about 15 fps, they just added duplicates to make 30fps smk) and interpolated them back to 30fps with Dain-App.
And upscaled using ESRGAN model.
I don't like the result much, but it's worth a try.

The biggest problem are scene transitions cause they had very bad quality in original file. I could deblock them more, but the video will became more blurry.
User avatar
Melekor
Site Admin
Posts: 2449
Joined: Sat May 01, 2004 12:10 am
Contact:

Re: Myth 1&2 AI Upscale Future Attemt

Post by Melekor »

Hi Akven and welcome to the forum.
There is also a discord channel for mapmakers/modders. PM me for invite if you are interested.

Your upgraded cinematic is surprisingly good, although with a few problems as you mentioned. I wonder if some of the issues could be fixed manually by an artist.

If you didn't find them already, the higher resolution crow's bridge and bagrada cutscenes are here: https://hl.udogs.net/files/Uploads/--MY ... r%20M2.zip

The game's textures are not so simple to access like some other games (dds, png etc). They are all stored in a custom format called a "collection", and they are all 8-bit palletted (256 color) images.

There is a tool called Oak which you can use to export and import textures and sprite bitmaps. However, if you increase the resolution of images and re-import them then the alignment will be lost and require manual adjustment. Additionally, such manually re-aligned sprites will not be compatible with the original game files for purposes of saved games, recordings and multiplayer.

What this means is it is currently not possible to build any kind of "texture pack" for Myth as is often done for other games. The only way it can work currently is as a plugin (aka a mod) which everyone in a multiplayer game has to have the same version of.

A complete solution to this problem will require using/building custom tools and also writing new code in myth itself. I have done some work towards this already but it is not fully complete. Eventually I will release an Oak tool which will allow building new format files which are high resolution, 32-bit color, aligned and compatible.

We actually have the original 3D models for most of the units and we used them to create high resolution renders. So, no AI upscaling is required for units. But there are no original assets available for scenery (trees, etc) and buildings. AI upscaling is potentially useful there. I am curious if you can get good results on some trees and building textures with ESRGAN. For now you can use Oak to import the upscaled bitmaps, and eventually the new tool.
So, several questions:
1. How could I unpack CUTSCENE.GOR file from Myth 1?
2. What is the biggest resolution Magma Project engine supports for cinematics?
3. What file extensions its supports for cinematics? (only QuickTime, or it can play avi/mkv through ffmpeg?
4. What is the biggest resolution for textures and in what format (png,dds etc) they are supported?
5. The Fallen Levels for Myth 2 uses Myth 2 textures or Myth 1 textures? Does this textures differ? And if they are, could I create a pack for upscaled Myth 1 textures to use with Fallen Levels?
6. Are characters/units textures upscalable?
1. You figured it out
2. 640x480. But perhaps can be increased in future versions.
3. Only Quicktime currently.
4. Bitmaps can be huge, perhaps even 4k. It is not a format limitation. 256 colors will be a limitation for any high res project. See above.
5. Technically I believe the texture format is 99.9% identical between the games. The plugin format is different though, so you cannot use the same packaging. Additionally you can't really build "texture packs" as explained above. Also, Myth 1 is considered obsolete so nothing new should be built for Myth 1.
6. Sort of. See above.
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

For example, I extracted shadow for ambu map.
Image
And there are visible square artifacts. Is it normal of was it ever corrected?
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Melekor wrote:Hi Akven and welcome to the forum.
If you didn't find them already, the higher resolution crow's bridge and bagrada cutscenes are here: https://hl.udogs.net/files/Uploads/--MY ... r%20M2.zip
I'm trying them right now. Don't know if it would be better, but I hope.
The biggest problem is that I don't know the original fps (it was clearly not 24, because there are a lot of duplicated frames). I'll try to use DAIN to remove duplicates and insert interpolated frames instead.
The game's textures are not so simple to access like some other games (dds, png etc). They are all stored in a custom format called a "collection", and they are all 8-bit palletted (256 color) images.

There is a tool called Oak which you can use to export and import textures and sprite bitmaps. However, if you increase the resolution of images and re-import them then the alignment will be lost and require manual adjustment. Additionally, such manually re-aligned sprites will not be compatible with the original game files for purposes of saved games, recordings and multiplayer.
I already found this tool. I understood about collections. Maybe I could just stick to detail maps available in some already made mod.
But there are no original assets available for scenery (trees, etc) and buildings. AI upscaling is potentially useful there. I am curious if you can get good results on some trees and building textures with ESRGAN. For now you can use Oak to import the upscaled bitmaps, and eventually the new tool.
Where I could find them in game resources?

I think for now I would just try to upscale cinematics. I found bitmaps for houses etc, but's it's too much for me to done/redone plugin to insert them
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Try this

https://yadi.sk/i/9JRZPxejOSRTiA

It's myth1cr, upscaled from higher quality source. Looks better. Asides from fps, which was strange in the smk file.
My steps were:
0. SMK decoded to PNG files
1. Dejpeg ESRGAN model for removing artifacts and compression errors. Greatly helped with blocks and dithering/low palette.
2. Filtered with AviSynth with anime designated filter for better silhouettes.
3. FPS conversion in Dain-App from 24 to 48 using mode 3 (adaptive record timestamps). Don't know if it helped much with jagged motions. I tested all the modes, didn't noticed much difference.
4. ESRGAN upscale model 4x_DigitalFrames_2.1_Final
5. Dain-App slightly messed with fps (made it 47 instead of 48) because of chosen mode. So the sound went away. I returned fps back to 48 and after that made it 50 using ConvertMFlowFPS.
6. Slightly downscaled video to 1080p height and filtered with AviSynth cause ESRGAN is not designated for motions so frame changes could act weirdly. Filter slightly hide that.
That's all.
User avatar
Melekor
Site Admin
Posts: 2449
Joined: Sat May 01, 2004 12:10 am
Contact:

Re: Myth 1&2 AI Upscale Future Attemt

Post by Melekor »

Akven wrote:For example, I extracted shadow for ambu map.
And there are visible square artifacts. Is it normal of was it ever corrected?
I don't think it's normal at least for Myth II shadow maps, this could be a bug in the original TFL data or in the TFL=>Myth II conversion process. I've never noticed in game though, so it's clearly a very subtle effect, and probably not worth fixing.
Akven wrote:I already found this tool. I understood about collections. Maybe I could just stick to detail maps available in some already made mod.
I don't know what that means. If you are talking color maps (i.e. terrain), their resolution can't be changed. If you are talking about detail texures, they are already highres.
Akven wrote:
But there are no original assets available for scenery (trees, etc) and buildings. AI upscaling is potentially useful there. I am curious if you can get good results on some trees and building textures with ESRGAN. For now you can use Oak to import the upscaled bitmaps, and eventually the new tool.
Where I could find them in game resources?

I think for now I would just try to upscale cinematics. I found bitmaps for houses etc, but's it's too much for me to done/redone plugin to insert them
Trees are also in collections, for example check out "01 scenery" for Willow Creek.

If you just do a single building it would be an interesting proof of concept. There's no need to release a plugin file. The windmill from Willow Creek is the most obvious choice if you're interested. Textures in "windmill textures" collection.
Akven wrote:Try this

https://yadi.sk/i/9JRZPxejOSRTiA

It's myth1cr, upscaled from higher quality source. Looks better. Asides from fps, which was strange in the smk file.
My steps were:
0. SMK decoded to PNG files
1. Dejpeg ESRGAN model for removing artifacts and compression errors. Greatly helped with blocks and dithering/low palette.
2. Filtered with AviSynth with anime designated filter for better silhouettes.
3. FPS conversion in Dain-App from 24 to 48 using mode 3 (adaptive record timestamps). Don't know if it helped much with jagged motions. I tested all the modes, didn't noticed much difference.
4. ESRGAN upscale model 4x_DigitalFrames_2.1_Final
5. Dain-App slightly messed with fps (made it 47 instead of 48) because of chosen mode. So the sound went away. I returned fps back to 48 and after that made it 50 using ConvertMFlowFPS.
6. Slightly downscaled video to 1080p height and filtered with AviSynth cause ESRGAN is not designated for motions so frame changes could act weirdly. Filter slightly hide that.
That's all.
That's very cool. The image quality looks really good! I'm not sure if I like the effect from increased FPS though, it looks kinda weird. I wonder if it might be best to preserve the original resolution and FPS and just use these methods for enhancing image quality.
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Melekor wrote:I don't think it's normal at least for Myth II shadow maps, this could be a bug in the original TFL data or in the TFL=>Myth II conversion process. I've never noticed in game though, so it's clearly a very subtle effect, and probably not worth fixing.
I didn't found how to look for shadow maps in Oak. I can open the map itself in Meshes, but I can't found just the bitmap (colormap) & shadowmap for the map.
I don't know what that means. If you are talking color maps (i.e. terrain), their resolution can't be changed. If you are talking about detail texures, they are already highres.
Colormaps can be dedithered, but don't think it would change much in game. And I don't know if game supports anything besides paletted bitmaps.
But there are no original assets available for scenery (trees, etc) and buildings. AI upscaling is potentially useful there. I am curious if you can get good results on some trees and building textures with ESRGAN. For now you can use Oak to import the upscaled bitmaps, and eventually the new tool.
I already did it with windmill (see below). Characters also can be upscaled rather easily.
That's very cool. The image quality looks really good! I'm not sure if I like the effect from increased FPS though, it looks kinda weird. I wonder if it might be best to preserve the original resolution and FPS and just use these methods for enhancing image quality.
Original file had this issues with framerate. Original framerate could be preserved though.
But all the other cinematics are hard to upscale. I tried prolog - and it looks ugly. Upscale model does beautiful work with clean lines and characters, but it multiply every compression error to the final image. And there are a lot of compression errors.
I need to heavily prefilter videos in AviSynth before upscaling. More deblocking, more everything. I will try to upscale mov versions.

Try this for Windmill
https://yadi.sk/d/9nSL-LhthbASPA
I upscaled its textures, but don't know how to insert it to the game and in what format.

I'm new to Myth engine and it's hard for me to understand it.
1. So, the geometry of the maps is stored in Meshes?
2. Textures stored in collections in arrays of bitmaps?
3. Most of the over folders are script/text properties for different game aspects (monster behavior etc). Customization stuff.
4. Where are stored the map's maps? (colormap, shadow map etc).
5. Game files are paletted bmps. What other formats does the modified engine supports and in what colors (non-paletted png, dds?)
6. If I change something how can I insert it back?
User avatar
Melekor
Site Admin
Posts: 2449
Joined: Sat May 01, 2004 12:10 am
Contact:

Re: Myth 1&2 AI Upscale Future Attemt

Post by Melekor »

screenshots of the windmill original and enhanced here:
www.projectmagma.net/~melekor/tmp/ESRGAN

it's very subtle. After seeing this, I don't think this is going to work well for buildings. New art work and new UV coordinates mapping is needed to really make these look good.
I didn't found how to look for shadow maps in Oak. I can open the map itself in Meshes, but I can't found just the bitmap (colormap) & shadowmap for the map.
Yeah. Oak can't open color/shadow maps, Loathing is the only way.
Colormaps can be dedithered, but don't think it would change much in game. And I don't know if game supports anything besides paletted bitmaps.
It doesn't support anything but 8 bit. And I agree it probably wouldn't change much anyways.

Increasing the resolution on shadow maps could be a decent improvement, I think. This would need a lot of engine changes though.
Characters also can be upscaled rather easily.
We're re-rendering them from 3D models at higher resolution. This is much better than upscaling.
I'm new to Myth engine and it's hard for me to understand it.
1. So, the geometry of the maps is stored in Meshes?
2. Textures stored in collections in arrays of bitmaps?
3. Most of the over folders are script/text properties for different game aspects (monster behavior etc). Customization stuff.
4. Where are stored the map's maps? (colormap, shadow map etc).
5. Game files are paletted bmps. What other formats does the modified engine supports and in what colors (non-paletted png, dds?)
6. If I change something how can I insert it back?
1,2,3. Yes.
4. In collections also, but only Loathing will extract them. Each 256x256 tile is stored as a separate bitmap, so the mesh file is also required to read the dimensions, and knowing the dimensions they can be combined into a single image.
5. Nothing publicly released yet. It is an extension of the collection format which supports something close to 32 bit color.
6. The only way currently is using Oak to modify the collection files. This is a very cumbersome process, admittedly. You would have to convert the images back to 8 bit, replace the originals, and re-align them inside sequences if they are sprites.
Akven
Posts: 39
Joined: Sun Sep 27, 2020 1:38 pm

Re: Myth 1&2 AI Upscale Future Attemt

Post by Akven »

Melekor wrote:screenshots of the windmill original and enhanced here:
http://www.projectmagma.net/~melekor/tmp/ESRGAN

it's very subtle. After seeing this, I don't think this is going to work well for buildings. New art work and new UV coordinates mapping is needed to really make these look good.
Anyway, it's possible and it's rather easy to do. And it would depends on the model and vary from object to object. But overall it will increase quality of the game.
From the screenshots it is clear that the main problem is vegetation - and it could be treated the same way. I should give it a try.
I didn't found how to look for shadow maps in Oak. I can open the map itself in Meshes, but I can't found just the bitmap (colormap) & shadowmap for the map.
Yeah. Oak can't open color/shadow maps, Loathing is the only way..
I'll thing of it in a different time then. I don't liked this square artifacts but it really could be just convertation issues.
We're re-rendering them from 3D models at higher resolution. This is much better than upscaling.
I found only iron tagset for this. Am I missing something? Or I need to look for another mod? Are every characters are present in such way or some 3D models were lost?
6. The only way currently is using Oak to modify the collection files. This is a very cumbersome process, admittedly. You would have to convert the images back to 8 bit, replace the originals, and re-align them inside sequences if they are sprites.
I think I could do it with some training. As I understand I need to modify existing collections, replace bitmaps and then create new plugin/container with just my modifications, which will be placed to plugins folder and loads as a mod, replacing original collections on the fly.
Post Reply