Author Topic: Custom graphics driver for FF7/FF8 [v.1-.7.6]  (Read 760960 times)

Prince Lex

  • *
  • Posts: 882
  • Opinionfact is Redundancy
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #50 on: 2009-04-09 01:47:05 »
Thanks for this Aali.

I realise your installation instructions are perhaps the simplest of every thing, but I clicked the .reg to change the registry and was told that the registry has been changed. Upon running my game I notice no difference whatsoever. I tried a good few different scenarios such as cosmo canyon, mt corel on world map, start of game etc and was able to view movies also. The only thing I noticed was a strange discoloration of cosmo canyon itself, but other than that it ran exactly the same as it always does. This leads me to believe that it either didn't install correctly or is just perfect....

Although its more than likely that it didn't install correctly, because for some reason when I've tried to make changes to the game recently the changes haven't taken any effect. I.e. I've put a new model in and it just doesn't appear and shows the previous one instead. I might have to post a "help me" thread about it.

Where do you have definite known glitches so that I can copy the situation to test to see if my FF7 is actually running your driver?

Hellbringer616

  • *
  • Posts: 1913
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #51 on: 2009-04-09 02:16:35 »
Quote
Although its more than likely that it didn't install correctly, because for some reason when I've tried to make changes to the game recently the changes haven't taken any effect. I.e. I've put a new model in and it just doesn't appear and shows the previous one instead. I might have to post a "help me" thread about it.

Going on a limb here, But maybe it's the Vista virtual store, That happened to me. It's probably not cause you're waaay better with tech stuff then me.

But it's a thought

Prince Lex

  • *
  • Posts: 882
  • Opinionfact is Redundancy
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #52 on: 2009-04-09 03:58:33 »
If it is something to do with VirtualStore (thanks for bringing that up by the way, because I'd forgotten about it) then how could I circumvent the issue?

You see, changing folder permissions within the program files folder doesn't seem to work for me. I've tried giving myself and other programs full access but every time I click apply, it seems ok until I go back into it and discover it's been taken away again. Also, for some bizarre reason FF7Music doesn't seem to be working anymore. Its just stopped loading any music files, which is rather confusing because it worked the last time I played which was 3 days ago.

And also, everytime I try to run FF7Music or FF7 on its own "as an administrator" I get the "FF7.exe has stopped working" nonsense.

I can see virtual store being the issue with changing models, but I can't see it in this instance. If "installing" the new FF7 graphics driver is a case of just modifying the registry, and my computer is telling me that it has successfully modified the registry... then it should be using the graphics driver it's pointing to, no?

Sigh.

Perhaps then the issue is that even with the registry modified, the files aren't "really" there and therefore aren't read, so FF7 defaults to that of FF7Config.

Which begs the question...

Aali... is there a way to run this from a location outside of the FF7 folder? I intend to find a more long-term solution but for the time being, just for testing purposes. Perhaps modifying the registry manually?

EDIT: Just as a small side-note and for no particular reason... I'd like to point out how ironic it is that now everytime I start up FF7 I'm actually hoping the movies don't work.
« Last Edit: 2009-04-09 04:04:39 by Prince Lex »

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #53 on: 2009-04-09 05:08:55 »
Oh man this is an amazing project.  Gonna give this a test tomorrow.

Hellbringer616

  • *
  • Posts: 1913
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #54 on: 2009-04-09 05:20:58 »
If it is something to do with VirtualStore (thanks for bringing that up by the way, because I'd forgotten about it) then how could I circumvent the issue?

You see, changing folder permissions within the program files folder doesn't seem to work for me. I've tried giving myself and other programs full access but every time I click apply, it seems ok until I go back into it and discover it's been taken away again. Also, for some bizarre reason FF7Music doesn't seem to be working anymore. Its just stopped loading any music files, which is rather confusing because it worked the last time I played which was 3 days ago.

And also, everytime I try to run FF7Music or FF7 on its own "as an administrator" I get the "FF7.exe has stopped working" nonsense.

I can see virtual store being the issue with changing models, but I can't see it in this instance. If "installing" the new FF7 graphics driver is a case of just modifying the registry, and my computer is telling me that it has successfully modified the registry... then it should be using the graphics driver it's pointing to, no?

Sigh.

Perhaps then the issue is that even with the registry modified, the files aren't "really" there and therefore aren't read, so FF7 defaults to that of FF7Config.

Which begs the question...

Aali... is there a way to run this from a location outside of the FF7 folder? I intend to find a more long-term solution but for the time being, just for testing purposes. Perhaps modifying the registry manually?

EDIT: Just as a small side-note and for no particular reason... I'd like to point out how ironic it is that now everytime I start up FF7 I'm actually hoping the movies don't work.

Hmmm. Puzzling.... Sitting here trying to think of why it would do this, I haven't been on Vista in so long (been using Windows 7, and that issue no longer plagues us. :P)
Can you install FF7 other then in the default folder? I'd try doing that (if you can) and see if it works, Or just try reinstalling FF7 all together. If it also fails then i'd say the issue is with your computer, I don't mess with the Registry so i could be wrong here, But if it was done on Vista 64 (or you have vista 64) and/or XP would that cause a problem?

again forgive my lack of knowledge of these things, just throwing out ideas.

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #55 on: 2009-04-09 12:27:43 »
I guess you could double check the registry yourself,

HKEY_LOCAL_MACHINE\SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics

Driver should say 3, while DriverPath should point to the dll

(if for some reason the dll fails to load, it will silently revert to d3d, so that might be something to look into aswell)

:EDIT:

Oh, and DriverPath is relative to the working dir of ff7.exe so it should not matter where you installed it

:EDIT2:

I should also point out that I have only tested this on XP SP3, for all I know, it may not work at all on Vista/Windows 7 (Although it really should)
You will notice when the driver is running, it will skip the intro movie and go instantly to the credits scene when you start the game.

:EDIT3:

It seems the snowboard minigame is not completely broken, you just can't see anything unless you pause it. (And when you unpause it will start filling the screen with garbage, so you have to pause/unpause all the time)
« Last Edit: 2009-04-09 14:43:56 by Aali »

Prince Lex

  • *
  • Posts: 882
  • Opinionfact is Redundancy
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #56 on: 2009-04-10 00:42:31 »
I've just checked it and its apparently pointing to the right place.

If anyone else is using Vista and having this issue, please speak up. I'd like to know how to get around it. I'm gonna try a full re-install tomorrow morning. (as in, not installing it in the program files folder.)

magixts

  • *
  • Posts: 52
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #57 on: 2009-04-10 06:09:31 »
I ran it through IDA on Vista 64-bit and the problem is the registry keys are not located in the same place on Vista 64-bit as in XP.

Modifying these keys does the trick:
Code: [Select]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics]
"DriverPath"="ff7_opengl.dll"
"Driver"=dword:00000003
"Mode"=dword:00000002
"Options"=dword:00000012

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #58 on: 2009-04-10 06:31:24 »
Hmm, seems I'll have to provide more .reg files next time.. thanks magixts.

Added another fun feature just now, it is now possible to run FF7 in any resolution without modifying FF7.exe :-)

Field looks pretty bad though, I'll probably have to adjust the TNT fix (which is really just alternate pixel center "emulation") for this to work 100%

This will pretty much kill the high-res patch since now you can high-res FF7 without getting any of the bugs/glitches. (This is a "real" fullscreen resize and FF7 doesn't even know about it)

Unfortunately, only multiples of 320x240 are going to look really good (because thats just how the engine works) but "laptop resolutions" (1280x800 etc) should still see an improvement over 640x480

koral

  • Guest
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #59 on: 2009-04-11 09:39:41 »
I tested this out and it seems to work fine enough for me  :-D
You haven't uploaded the new screensize-feature version yet, have you?
It sounds extremely useful!

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #60 on: 2009-04-11 10:03:25 »
No, that will be in the next release, along with fixes for the battle camera, snowboard and submarine minigames and (hopefully) the directinput bug.
Oh and a very minor fix for non-paletted textures (I have found _one_ so far, the ropeway station background is in BGRA 5:5:5:1 format and wasn't working in 0.1a)

The screensize-feature is not terribly useful yet though, since it messes up field, but I have something in mind that will both fix that issue and in the long run make it much easier to replace field backgrounds :-)

ultima espio

  • *
  • Posts: 1357
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #61 on: 2009-04-12 19:26:10 »
I've just had an idea reading this topic, theres a program that can replace textures in realtime from the application called texmod. It might be possible to replace the background textures with this new driver...

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #62 on: 2009-04-12 22:15:22 »
If you got the idea reading the topic, you might want to read the thread... It's been discussed already :P

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #63 on: 2009-04-12 23:14:37 »
Working on movies right now though, I'm replacing the entire movie player with my own routines, using ffmpeg to decode them (so no more shitty propietary truemotion codec)

After that I'll probably make a 0.2b release, and THEN work on my new idea for field :-)
(that release will be fully playable, the only known problems right now are some missing effects and field glitches with custom resolutions)

Terid__K

  • Guest
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #64 on: 2009-04-13 08:43:50 »
Quote
Working on movies right now though, I'm replacing the entire movie player with my own routines, using ffmpeg to decode them (so no more sh*tty propietary truemotion codec)
You think this would make it possible to run FF7 in 32-bit without glitches? Because that would be awesome.

Good luck on this project, it looks very promising.


Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #65 on: 2009-04-13 12:53:17 »
Err, this driver was never running in anything but 32-bit :-P

And I already have movies playing (no sync, no sound, just video) so that would be a definite yes :wink:

ultima espio

  • *
  • Posts: 1357
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #66 on: 2009-04-13 13:19:10 »
If you got the idea reading the topic, you might want to read the thread... It's been discussed already :P

.....So it has :-P

Cyberman

  • *
  • Posts: 1572
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #67 on: 2009-04-13 21:48:53 »
Err, this driver was never running in anything but 32-bit :-P

And I already have movies playing (no sync, no sound, just video) so that would be a definite yes :wink:
Hmmm interesting.  As for 32/64bit a warning to keep compatibility with older systems (IE not breaking them) I suggest you look at MS method of checking if a system is 32/64bit. Someone else forum didn't bother to do that on an open source project and it crashes on win2k as a consequence.  However the program is 32bit ... hmmm how would it behave correctly in a 64bit?

Erstwhile are you putting your DLL functions into the wiki for FF7PC? I think other people might find it 'fun' to do ;)

The functions themselves and there calling conventions might be handy for the Q-gears project namely it can give an idea of the API they used originally.

Cyb

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #68 on: 2009-04-14 02:23:41 »
I was talking about color depth, not machine word size :-P

And I assume Terid__K was too, since one of the known issues with running FF7 in 32-bit color depth is messed up movies.

64-bit systems will just have to pretend to be 32-bit systems, just like they do for FF7 itself :-)

The DLL exports only one pretty trivial function, the constructor for the graphics driver "object".

It's enough work to create this thing in the first place but I do intend to document my findings on .tex and .p file formats and if someone wants to have a look at the source code, thats not a problem.

I doubt it would be of any use to the Q-Gears team though, if anything, they should be trying to move away from the old outdated concepts used in the original engine. (And this driver just handles graphics after all, its 90% generic OpenGL code, 10% FF7 specifics)

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #69 on: 2009-04-14 22:58:55 »
The only thing thats holding off the 0.2b release right now is a bug in the ffmpeg truemotion2 codec that leads to oversaturated and sometimes just plain wrong colors.

It's still missing some battle effects, no idea why, but that is also the only big thing that sets it apart from the original drivers, everything else should be working now :-)

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #70 on: 2009-04-15 00:25:23 »
So is this running in 32 bit color to make the FMVs look slightly less terrible?  I can't believe this got so far so fast.  Fantastic job, I hope to see this followed up after the next release.

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #71 on: 2009-04-15 09:47:14 »
Nice job, Aali.

I just wonder that noone discovered the possibility of injecting a custom graphics driver into the engine before, especially since there have been several patches developed for the internal engine.

And we thought that we have already reached the limits of the original engine years ago...  :-P

 - Alhexx

myst6re

  • *
  • Posts: 641
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #72 on: 2009-04-15 13:50:09 »
This driver don't work with the french version of Final Fantasy VII. He said : "It's not the 1.2 version". Yet I have patched the game, but with the french 1.2 patch. :|

Marc

  • *
  • Posts: 445
  • I hear Voices ... in my head
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #73 on: 2009-04-15 14:56:59 »
If you modify the backgrounds, you have to do it properly (improve the picture as a whole, then re-cut it)

Otherwise you'll get all sorts of artifacts as the different layers bleed over into each other

Even linear filtering for textures (standard feature in opengl) has to be disabled for field to look good
It's the way Square constructed the scenes.  Basically they have some sort of software Z buffering technique and assign each layer a depth. This determines the ordering of what is drawn, 3d objects inclusive. The 2d objects are not drawn in 3d but 2d but are depth sorted as stated.  So things go something like "background" which I suppose has infinite depth in this case. Then sorted 3d objects (character people etc) with sprite objects and lastly foreground objects (IE infinitely close to the camera). 

Transparent objects (alpha blend objects) also exist but they are done in the foreground depth (overlaying things). You see this in area's like the wall market.
That being said, if you want hirez tile sets they must be an integer multiple of the original tileset just like the screen needs to be as well.
I'm not sure if it's possible to use 3d objects strected and depths to give perfect alignment at various resolutions.
(render the background to a texture and paste the texture on a surface which would have the effect of something akin to wolfienstien).

The only way to make improved backgrounds is as said before they must be cut from the same template coordinates, or integer multiple, as used before.


Cyb

Going back to shaders and filters, what causes the glitches when you apply it to the whole scene ?  The fact that some layers show artifacts when rendered ?

If so, wouldn't it be possible to apply a filter/shader individually to each layer and skip the ones that show artifacts (the alpha layer comes to mind) ?  Pete's GPU drivers seem to use a similar principle for filtering and it works well for ff7 on epsxe.  I have to admit I don't recall if it improves the backgrounds at all though.

If it doesn't show, I don't know much about these things and I'm tossing (probably ridiculous!) ideas out there based on what little I do know but realistically, I think this is the closest somebody has ever been to improving the backgrounds as I doubt anybody is ever going to go through the 758 or so field files of the game to re-render them at a higher resolution!

Regardless, keep up the good work.

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #74 on: 2009-04-15 15:04:45 »
This driver don't work with the french version of Final Fantasy VII. He said : "It's not the 1.2 version". Yet I have patched the game, but with the french 1.2 patch. :|

Version detection is a bit of a hack, yes :-)
I might just remove it if its going to cause trouble with other languages.. (but that will make it crash instead of displaying the message if ff7.exe really is incompatible)
Could you please upload your ff7.exe somewhere so I can compare it to the US english version?