ResidualVM logo Forum Index - ResidualVM website - Contact us - Rules Login    Register     Search curved edge
It is currently Sun Mar 26, 2017 8:45 pm

All times are UTC

Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: EMI PS2 -> PC
PostPosted: Wed Jan 27, 2016 7:17 pm 

Joined: Sat Aug 02, 2014 12:22 pm
Posts: 10
EMI on ResidualVM has been steadily improving and though it still has a way to go before all the issues are ironed out, I thought it might be time to revisit an old plan: Putting the improvements from the PS2 version of EMI into the PC version. You can read about my previous (unsuccessful) endeavours here.

Since we now have the option of running the PS2 version directly in ResidualVM, I’ll start by listing some of its disadvantages that make the PC version preferable (all glitches and stability issues aside):
  • Lower quality backgrounds (they show signs of dithering, implying a reduction to 16-bit colour).
  • Some backgrounds have been lightened and have a washed-out look to them.
  • Lower quality music (24kHz vs 44kHz in the PC version).
  • Pre-rendered giant monkey head is replaced with a 3D model.
  • No “main menu”, no menu hotkeys, and a very limited save/load system.

With that out of the way, here are the 5 improvements I have identified in the PS2 version...

Smoother Models (status: not yet)
The PS2 renders models more smoothly than the PC version by using “smoothing groups”. I don’t know much else about this. ResidualVM doesn’t currently do this and I don’t know if it would be feasible to implement, or if it could be applied to the PC version too.

Higher Quality Video (status: not worth it)
The PS2 video suffers from less compression artifacts than the PC video. Sadly, this comes at a cost: the video is only 640x448 rather than 640x480, dropping every 15th line. It’s questionable as to which version is actually better. Various techniques could be tried to reconstruct the missing lines, but the end result still may not be any better than the current video.

Higher Quality Audio (status: success)
The PS2 videos have 48kHz uncompressed audio tracks, while the PC version has 22kHz bink audio.
This is relatively straight-forward to add to the PC version, though it requires some Windows-exclusive tools:
  1. Demux all the PS2 videos using PSS Demux.
  2. Cut the SMUSH headers out of the PC .m4b videos.
  3. Use RAD Video Tools to mix in the wav files to the corresponding m4b files. I recommend quality = 3.
  4. Add the SMUSH headers back in.
Note: Skip the “sory” video as the PS2 version of this is a few seconds shorter.
This only works in ResidualVM - the audio won't play if you try it with the original game. In theory I could provide a binary patch to allow people to apply this on any platform (using the ResidualVM patchr tool), but this may be a legal grey area - I’m open to advice. My arguments would be: all the patch does is improve the quality of your existing audio; it’s impossible to use for any other purpose; it can’t actually be traced back to the PS2 data.

Extra Dialog (status: success)
The PS2 version shows a few extra lines of dialog in various places, such as a line between Guybrush and the catapult operator about why he’s having such a hard time hitting the house. These lines don’t appear in the PC version because it doesn’t show the scroll arrows for some reason.
This can be fixed by changing Dialog.scroll_mode (local.m4b/_dialog.lua, line 20) from FALSE to TRUE. I’m hoping this fix can be included with ResidualVM at some point but in the meantime you can download the fix here. Place the datausr.m4b file in your EMI install folder and check the “Load user patch” option in the ResidualVM game settings.
The fix could also be applied to the original game. I failed to fix it in the past because I couldn’t find a compatible lua compiler, but ResidualVM has now provided all the necessary tools.

Monkey Kombat Chart & Monkey Invaders (status: not yet)
The PS2 version keeps track of moves you learn for Monkey Kombat so you can easily review them, and includes a new easter egg mini-game called Monkey Invaders when you complete all the moves. Could be fun to try porting this to the PC version, but as far as I can tell ResidualVM doesn’t support the Monkey Kombat chart yet. Or at least, I can’t figure out how to show it.

Any comments, corrections or further info are most welcome.

 Post subject: Re: EMI PS2 -> PC
PostPosted: Thu Jan 28, 2016 1:12 pm 
User avatar

Joined: Thu Jun 21, 2012 3:00 pm
Posts: 129
Regarding the models, has anyone actually tried loading the meshes in a 3D editor and tried counting the faces? "9 times more polygons" seems highly unlikely.
The fact that smoothing groups are mentioned however could indicate that there is additional data on how the mesh normals are calculated.
It's a very basic/simple principle, I think anyone who's done 3D modelling would be familiar with it.
I've talked about this in the Grim deluxe thread before, though sadly the links to the images are down and I don't keep them locally...

A good examle of applied smoothing groups can be seen here.

Normals can be calculated on many levels, per edge, per face, per vertex... I believe vertex normals are already loaded in ResidualVM as I can see it here:

This could simply mean that: (this is only speculation without actually looking at the model data, as I'm not sure I can find a copy again of the PS2 anytime soon)
- PS2 models have better or any normal data on the vertex level. I can't remember whether the PC models have it, though I expect they must. If this is the case, and the "smoothing effect" that they're boasting has already been applied on the vertex normals themselves when creating the models, I'm not sure if there's anything more to be done engine side
- they have additional grouping data, and therefore normals may have been computed based on that. E.G. whether vertices belong to the same group or share a face. There's a simple example of some shared-face computing done in this post:

In the thread you posted there are some windows vs ps2 comparison links, but they're down. I think checking between how ResidualVM would render the PS2 models and how they're natively rendered (maybe even ResidualVM comparisons between the PC and PS2 versions) would prove or disprove what I've said above...

EDIT: Having looked at the best quality gameplay video on youtube that I could find, I'd only make this suggestion:
Enable antialiasing on in the *.ini file, something upwards of 16...
E.G. If you're on Windows, the file would be in: C:\Users\[USERNAME]\AppData\Roaming\ResidualVM\residualvm.ini
Then find the relevant EFMI entry, like [monkey4-win] or [monkey4-ps2] (probably), and somewhere in that section add:

To me what I'm seeing from the video and hat I'm seeing in ResidualVM don't seem to have much if any difference :/

DOUBLE EDIT: Actually I think I can see some subtle differences which don't seem to be related only to the shader. In that video I think I notice that Otis' arms are bulkier/more rounded...

 Post subject: Re: EMI PS2 -> PC
PostPosted: Fri Jan 29, 2016 10:24 pm 

Joined: Sat Aug 02, 2014 12:22 pm
Posts: 10
The only reference I have to smoothing groups is a post on the forums here.

I've uploaded some screenshots, follow the link to dialog fix in my first post. On the PS2 things appear "bulkier/more rounded", as you mentioned. You can also see the lighting in RVM is different (I'm tempted to say better?) than the original game.

 Post subject: Re: EMI PS2 -> PC
PostPosted: Sun Jan 31, 2016 1:26 am 
User avatar

Joined: Thu Jun 21, 2012 3:00 pm
Posts: 129
I've taken a look at the images (especially at the PS2 comparisons in native environment and residual), an idea occurs to me...
In the other forum you mention that the PS2 models need to be converted, you also say that you've managed to load the PS2 models in the Windows version:
The format of the PS2 .meshb files is almost identical to the Windows ones. Once converted they can be put into the Windows data and the game will load them correctly.
So I guess the question is, were you able to see the model's differences with the PS2 versions on Windows? Presumably not on ResidualVM, but natively-run.
If yes (as in, once the PS2 model was loaded on Windows and indeed had the better look), ResidualVM isn't handling the extra data.
If no, they've done something interesting engine-side on the PS2.

And again, if yes, I have a couple of speculations. I can't check them out myself as I don't have the PS2 discs right now (I have looked at them though once before), I'll try to get them in the next few days, but in the meantime:
- The Windows version has all the models etc. bundled up in the root art*.m4b files. I remember that the PS2 actually had some island-named folders with the files in them as well, in addition to the art*.m4b ones. One speculation is that one of those (duplicate) files might be higher-res than the others. But instead of getting that one, ResidualVM is (maybe) somehow loading the default one from the art*.m4b file.
If such a file indeed exists, placing it in the datausr.m4b will most likely suffice, as it takes precedence. Probably not for the Windows version though as I can see some platform specific loading...

- What did converting them from PS2 to PC entail? On the other forum I saw that you wrote that the PS2 uses longs instead of words in the facedata. Do you strip out the extra bytes? Is it empty padding?
If it's not padding, it might hold some relevant data. But again this is only a speculation...

As for the lighting, yes, it's different.
IIRC the original game was done with Direct3D while ResidualVM uses OpenGL, so I guess it can't be perfectly identical... And AFAIK the PS2 didn't support OpenGL (with the exclusion of PSGL I think it was).
Gannet wrote:
You can also see the lighting in RVM is different (I'm tempted to say better?) than the original game.
Bah, I think I like the PS2 lighting better myself :P

 Post subject: Re: EMI PS2 -> PC
PostPosted: Sun Jan 31, 2016 8:05 am 

Joined: Sat Aug 02, 2014 12:22 pm
Posts: 10
Unfortunately the answer is no. The only observed differences were subtle variations in shading, just as can be seen between the two RVM screenshots (also see post #7 in the other forum).

I checked through all the subfolders etc when I was doing this originally and found only duplicate copies of the meshes - all identical.

Unfortunately I don't have the script I made to convert the meshes anymore. It did indeed strip out extra bytes but whether there was more to it or not I don't remember. The PS2 meshes could well contain extra data about smoothing groups or something but the Windows version isn't designed for that, and for the moment it seems ResidualVM isn't either. Of course, the devs could probably weigh on what they know?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Forum design by ScummVM team, icons by raina, adopted for ResidualVM
curved edge   curved edge