Author Topic: Again about filtered 2D backgrounds in Final Fantasy VII PC  (Read 13178 times)

Salk

  • *
  • Posts: 609
    • View Profile
Hello!

After reading this http://forums.qhimm.com/index.php?topic=6005.msg80769#msg80769,
I just wonder: is filtering the background just a lot of work but technically very possible or is it something that we are not even sure yet that can be accomplished ? In the first case, then why not try and build up common resources in order to help The SaiNt in this ? I read that Borde had already tried before an approach with some encouraging results...

A filtered background is the last step (in my opinion) to ultimate enhancements in the game as we have already all we need save that. Q-Gear is still at its earliest stage and it will support (at least initially) only the PSX version of the game so I just think a common attempt at tackling this 2D backgrounds might be taken...

I am no programmer but if I can be of help with anything that doesn't require specific knowledge, I am of course available!

Thanks for your attention!




Aali

  • *
  • Posts: 1196
    • View Profile
its possible, but not all that easy, in theory or practice
what it all comes down to is that noone really knows how the whole rendering engine works (yet)
but even then, its a big step to actually make it do what you want

and in the end, its probably not worth it
filtering can only do so much, it wont make that much of a difference
if its done in real-time, expect some simple filtering algorithm like hq4x
modifying the actual background files would require ALOT more work, although that might actually make things look kind-of pretty

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
TheSaint has already said he isn't touching the HiRes patch anymore, and neither does he have the time to work on anything FF7 related.
Your best bet is to wait for QGears, since this is a completely new engine any kind of filtering or resampling can be added in as easy as it would for any 3d application.

Salk

  • *
  • Posts: 609
    • View Profile
I get your point, The Skillster but Q-Gears is a long term project which might not be offering anything of the sort before 2009 and sincerely, I might even be dead before that date comes. I was thinking of something to start now. A project that would be totally independant from The_SaiNt's patch.

I believe we have together the resources to make it possible since The_SaiNt had already started his experiments with bilinear filtering...

Otokoshi

  • *
  • Posts: 552
    • View Profile
Quote from: Salk
I was thinking of something to start now.

Quote from: Salk
I am no programmer but if I can be of help with anything that doesn't require specific knowledge...

I suppose you could learn some programming fundamentals, since you wish to start this project and cannot wait until Q-Gears completion...of 2009 apparently.  I wish you the best of luck.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Are you considering fancy processing of the tiles before they are pasted to the display or making new filtered backgrounds?

The background data is in tile sets. Prefiltered etc. backgrounds have a limit to the number of tiles and palettes that they will accept (Ask Borde about this).
Stretching and filtering tiles before they are pasted to a hirez screen that is an integer multiple is possible. Another possibility that was also discussed is rendering the tile data to a drawing surface and use the surface as a texture that's pasted to the display with bilinear filtering etc.

None of these are trivial and require you to hack the executatble.

As for 2009 .. heh.. there is no guarentee of that ;)

Cyb

Salk

  • *
  • Posts: 609
    • View Profile
Cyberman,

tell me if I understand wrong so far. The 2D backgrounds are built using a number of individual tiles of a resolution of 16x16. The engine is limiting the size of this tiles so that we cannot change it. We can use a tool to extract these tiles and it's possible to apply filters to them. Problem is that the result is a real mess because the filtering is applied to the single tiles and not to the final result. Also, we must keep in consideration that the background has 2 kind of depths so that in some places the 3D models passing by will be seen while it won't be so in some others.

Am I correct so far ?

It's just a starting point to understand how the mechanic more or less work...  :-D

Thanks for your support!

And by the way, to answer Otokoshi. This is NOT my project. This is just an attempt to gather forces and resources in order to improve the biggest weakness left in the PC version of FF VII. Alone I am probably going nowhere but perhaps there will be people who can contribute much better than I can at the moment.

Jari

  • Guest
And by the way, to answer Otokoshi. This is NOT my project. This is just an attempt to gather forces and resources in order to improve the biggest weakness left in the PC version of FF VII. Alone I am probably going nowhere but perhaps there will be people who can contribute much better than I can at the moment.

I'm going to go out on a limb, and guess that Otokoshi was referring to the: "someone do this for me - right now"-vibe your post is giving off. And pointed out that if you want something done, especially on your terms, it's best to do it yourself.

lparcshinoda

  • *
  • Posts: 56
  • The story never ends ...
    • View Profile
I think that Salk was just passing the Idea... and I think that everyone with hacking skills here has thought to that almost 3000 times. Anyway we can't surrender to this... even thinking that we have really gone a lot far with the hacking possibilities on the ff7 engine. And are good ideas that moves the world... non only knowings....

Cyberman

  • *
  • Posts: 1572
    • View Profile
Cyberman,

tell me if I understand wrong so far. The 2D backgrounds are built using a number of individual tiles of a resolution of 16x16. The engine is limiting the size of this tiles so that we cannot change it. We can use a tool to extract these tiles and it's possible to apply filters to them. Problem is that the result is a real mess because the filtering is applied to the single tiles and not to the final result. Also, we must keep in consideration that the background has 2 kind of depths so that in some places the 3D models passing by will be seen while it won't be so in some others.
Borde tried rebuilding the backgrounds themselves by scaling them.  The problem is you are only allowed so many tiles in FF7 per screen.  1280 tiles I believe is the limit.
Tiles are fixed at 16x16 pixels this is the only format the engine will accept.  You are limited to < 32 palettes per field location for the background tiles. Tiles have layers.  There are background tiles (behind everything) and sprite tiles that have depth. 

Am I correct so far ?
1/2 right :D
It's just a starting point to understand how the mechanic more or less work...  :-D

Thanks for your support!

And by the way, to answer Otokoshi. This is NOT my project. This is just an attempt to gather forces and resources in order to improve the biggest weakness left in the PC version of FF VII. Alone I am probably going nowhere but perhaps there will be people who can contribute much better than I can at the moment.
Well ... you should read the wiki I'll have to check if the background information has been updated for PS1 and PC.

Cyb

The SaiNt

  • *
  • Posts: 1300
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #10 on: 2007-01-23 15:16:29 »
If you take a look at Aeris, it will be pretty obvious that the format is far more complex than you think.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #11 on: 2007-01-23 17:04:01 »
What he said ;)
It's a lot of work yes, but not just twiddling data that is well known.  The entirity of the background information is ... in my experience quite complicated. Doable yes, fast no. By the time you are done with your hack Q-gears might have reached 0.5.1412.  Maybe you should look at Q-gears some to see just how much is really going on.

The SaiNt are the PC files compressed like the PS1's?

Cyb

Salk

  • *
  • Posts: 609
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #12 on: 2007-01-23 19:24:42 »
I am sorry if I gave the wrong impression. I do believe in Q-Gear as project and, believe me or not, I follow your threads there pretty much regularly  :-) despite my little understanding of the matters. And I do admire you guys for working hard on it. I have great hopes for Q-Gear and I am wishing you guys the biggest success with it. I was just probably hoping that filtering the background was not technically very hard but mostly time consuming. At the moment, I have free time to give my contribution and if somebody would be willing to "teach me" the basics about how it could be done, I'd try my best. That's it...Example: I have redone the movies bringing a sensible improvement on their quality and it was not really difficult to do. It just took some time (not even that much). So I was just hoping for something like that for the 2D backgrounds as well...If nothing can be done then okay...I will wait. Because I do not intend to play FF VII untill justice will be made to it...  :-D

The SaiNt

  • *
  • Posts: 1300
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #13 on: 2007-01-23 23:25:12 »
Each field file is LZS compressed.
However since it's one full file and not several files like the PS1, they compressed the whole file and not the seperate parts individually.

Borde

  • *
  • Posts: 891
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #14 on: 2007-01-24 22:37:26 »
If anyone wants my source code and the hacks I did to the EXE, I can hand both to him. Of course I'm sure those are nothing new. Anyone with knowledge about the background format could write a better code than I did and my hacks are most likely already known by The Saint. But that fixed-lenght buffer with the references to the tiles that will be sent to the rendering engine (basically this excludes all the tiles that are completly outside the screen) was too much for me. I'm quiet sure it could be solved, but my assembler knowledge is insuficient.

If you want an alternative way... well, you could make a TEX file with the whole background, apply it to a square that covers all the screen, reposition and set it's direction using the camera matrix, add the entinty to the level file and then add it's initialization to the script. Yep, not trivial. But you could put there whatever you wanted and it would have bilinear filtering.
 :mrgreen:
By the way, does FF7 really support 16 bit TEX files? I know it's defined on the standard, but never tried it.
« Last Edit: 2007-01-24 22:39:04 by Borde »

Turc

  • *
  • Posts: 18
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #15 on: 2007-02-02 00:55:02 »
Why not dump all the tiles of a background to a single image (.bmp?), then run filtering on the entire image, then split it back into teeny tiny 16x16 tiles back into ff7? It would look a lot better than applying to each and every individual tile, unless you're looking for in-game filtering. Problem solved.... I think.

Salk

  • *
  • Posts: 609
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #16 on: 2007-02-02 06:58:26 »
I doubt it can be so easy...  :-(

Aali

  • *
  • Posts: 1196
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #17 on: 2007-02-02 10:14:17 »
Why not dump all the tiles of a background to a single image (.bmp?), then run filtering on the entire image, then split it back into teeny tiny 16x16 tiles back into ff7? It would look a lot better than applying to each and every individual tile, unless you're looking for in-game filtering. Problem solved.... I think.

first off, ff7 does not support enough 16x16 tiles to fit 1280x980 pixels of data
second off, only filtering the background would look really silly since the foreground tiles would still be unfiltered
and last but not least, we do not understand enough of ff7 to make it render this correctly

Borde

  • *
  • Posts: 891
    • View Profile
Re: Again about filtered 2D backgrounds in Final Fantasy VII PC
« Reply #18 on: 2007-02-02 17:35:19 »
That's basically what I tried last summer Turc. But I failed miserably because, as Aali stated, FF7 can't render that many tiles (and I just tried with 640x480, not 1280x980).