Author Topic: Higher Resolution in FF8  (Read 33876 times)

Evil Squall

  • Guest
Higher Resolution in FF8
« Reply #25 on: 2001-10-25 23:37:00 »
well, I have the same card, and after enabled that 8-bit palatized thingy, the game wont run at all!!!

dagsverre

  • Insane poster
  • *
  • Posts: 323
  • Karma: 0
    • View Profile
    • http://ffsf.cjb.net
Higher Resolution in FF8
« Reply #26 on: 2001-10-26 07:51:00 »
It might be that the background are layered out using 3D calls. This is what is done in very many new 2D games at least. The problem with using 2D calls and then 3D calls is that it plays a little havoc on the system bus and so on. Direct3D might be emulating DirectDraw in 3D mode, this is really what I fear, however they might still have picked Direct3D for rendering the backgrounds because it gives automatic hardware scaling! Think bilinear filtering...

So, at least if I had written this, I'd do stuff like this (this is psuedo-code!):

SetRes(640, 480);
SetViewport(0, 0, 640, 480, D3D_ORTHOGONAL);
//Draw my 2D stuff using quads at a very far distance
//Things do not get smaller if they are far away in this mode
SetViewPort(-1, -1, 1, 1, D3D_FRUSTUM);
//Draw my 3D stuff, thinks will now become
//smaller the further away they are

This means that the only part that *might* need to be changed is the constants passed in to SetRes. The game will still set up a 640x480 viewport and work with that while drawing the background (not that it is guaranteed that the game uses that exact mode).

Still the problem is with hacking into Direct3D with it's hundreds of calls. I think the solution is to write low-level COM code, the kind of code we would have written from C or assembler to use Direct3D. What we do is:

Build our own low-level DllGetComObject or whatever those were called (the four global functions present in all COM dlls). Those low level functions...
- calls the original DirectX code to get a pointer
- copies the destination into it's own buffer using a simple memcpy
- changes the necessarry stuff, this will be done by casting the copied buffer into an array of functions and change the stuff at a fixed address

This way there's only work to be done per call being replaced, and the size of the lib doesn't really matter. The clue is that COM interfaces really are only a v-table (table of function pointers).

As always, I have not got the time for actually doing this. Sorry.

ffsquall

  • Guest
Higher Resolution in FF8
« Reply #27 on: 2001-10-26 10:05:00 »
i'm not that bright
but i'll prefer english your speaking in codes

and as hurricane halmes would say "whats up with that"

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #28 on: 2001-10-26 10:08:00 »
That exactly how I do the rendering on the Remake project (ortho's for backgrounds, normal frustum for 3d objects) but in my case, that's because OpenGL really is 3d only anyway...

Don't know if FF8 actually does stuff that way, though.

Reznor007

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 0
    • View Profile
    • http://www.geocities.com/ninninetynine
Higher Resolution in FF8
« Reply #29 on: 2001-10-28 02:07:00 »
How are you handling situations where 3d models go behind 2d objects?

I am thinking that the 2d tiles are in the same 3d space as the models, but just done as a square, and only having the z coordinate changed. And places where the 2d tile is a curved or angled edge, it simply uses an alpha value that makes it transparent, so that the things behind it will show up. Not sure if that makes sense the way I worded it though...

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #30 on: 2001-10-28 11:25:00 »
Yes :wink:

Oh, details? OK...

Well, I hope you can see the 2d backgrounds consist of a number of "layers". At the bottom is the "real" background that everything appears on top of. Then there's some tiles that you might appear behind - that's the second layer. Then there might be some tiles that you might appear behind all the time - that's the third layer.

When rendering the scene, the game would do this:
  • Draw "real" background
  • Draw 3d objects on top of real background, behind layer 2
  • Draw second layer
  • Draw 3d objects on top of second layer, behind layer 3
  • Draw third layer
  • [/list:u]

    Obviously it could continue this indefinitely ... I'm not sure what the limit on layers is in the current engine build but it's pretty high (probably ~65000, ie. 16 bits, though it might not be...didn't put a specific limitation in on purpose).

Reznor007

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 0
    • View Profile
    • http://www.geocities.com/ninninetynine
Higher Resolution in FF8
« Reply #31 on: 2001-10-29 04:14:00 »
Ah, sounds good.

The number of layers is probably quite lower than 65,536. While I can't say for sure, it may be as low as 256(8bit). The reason I say this is because the 3d models would have their own thickness, which would take up Z space, and since the 2d tiles can't overlap the 3d models's z coordinate, they would have to have a value substancially higher/lower to compensate for any forward/backward movement the character may make.

Hope that makes sense :smile:

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #32 on: 2001-10-29 07:48:00 »
Actually, the way I do it, you hardly need any layers. For example, the Wutai shop location (the one I'm using as the example field location) has 3 layers. That's it.

Reznor007

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 0
    • View Profile
    • http://www.geocities.com/ninninetynine
Higher Resolution in FF8
« Reply #33 on: 2001-10-29 13:36:00 »
Yeah, most scenes from 7 are simple enough that 3 passes should cover it(background, 3d, foreground). It would be fun to see how complex you could get with it though :smile:

Basically unrelated, but with the remake, are you planning on supporting video backgrounds?

And also, have you thought about implementing a scanline option? If you don't know what I'm referring to, try an arcade or SuperNES emulator, and compare the screen with scanlines on and off. This option would help FF7(and :cool: alot since it was designed for low-res TV's.

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #34 on: 2001-10-29 14:06:00 »
Video backgrounds? I'd *like* to, but I haven't got that far yet. It's certainly possible, of course.

Layering system ... you've not *quite* understood how it works. In effect, all 3d models have 2 depth values; firstly, their 3d depth (used to calculate occlusion with other 3d models); secondly, their layer depth (used to calculate occlusion with 2d backgrounds). So the Wutai shop gets rendered like this:

  • Render 2d layer 0 (background)
  • Render 3d models on layer 0, with proper depth for each other
  • Render 2d layer 1 on top of whatever's already on the screen, possibly covering some parts up
  • Render 3d models on layer 1, with proper depth for each other
  • Render 2d layer 2 on top of whatever's already on the screen, possibly covering some parts up
  • [/list:u]

    Scanlines ... well, I know what they ARE. I'm not sure how good it'd be, to be honest - it's not exactly that easy to implement in OpenGL and to be honest, I doubt it'd improve results more than the OpenGL texture filtering already would. Check out the screenshots of the Field unit from the Remake site; OpenGL's already filtering the backgrounds quite a bit by itself.

Goku7

  • No life
  • *
  • Posts: 1308
  • Karma: 0
    • View Profile
Higher Resolution in FF8
« Reply #35 on: 2001-10-30 00:51:00 »
Hmmm....Video backgrounds?

For those, couldn't you write the video to the card as a texture (as opposed to directly writing the video the the memory) with alpha transparency to get both the video and the characters on the screen at the same time?  I think I read somewhere that that's how the PSX does it.....

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #36 on: 2001-10-30 01:02:00 »
Yes; that's AFAIK the recommended way to do it with OpenGL. You do have to deal with the video compression manager which is NOT simple at all ... again, it's one of those things which I hope to do at some point.

Goku7

  • No life
  • *
  • Posts: 1308
  • Karma: 0
    • View Profile
Higher Resolution in FF8
« Reply #37 on: 2001-10-30 01:28:00 »
Could QuickTime work for the video compression?  I don't know how hard the compression manager would be for the various compression algorithims, but I think QuickTime has some very fast response time (does anyone remember the speed of the movies in MYST or Riven?)

[edited] 239 2001-10-30 02:30

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #38 on: 2001-10-30 01:32:00 »
It might ... the problem basically is that I've *never* done any work using any video compression manager directly, whether it be the Windows VCM or whatever Quicktime uses ... it's all just a question of getting the experience, of course.

Dammit, I should go to sleep now! It's far too late to do, well, anything, considering I have lectures tomorrow :wink:

J*** H*******

  • Guest
Higher Resolution in FF8
« Reply #39 on: 2001-10-30 11:06:00 »
Message!

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #40 on: 2001-10-30 11:10:00 »
Well, I took the next best option; I dispatched two of my minions to visit the lecture for me and report back on anything I need to know :grin:

OTOH, I think I should probably go to the one this afternoon ... going to *no* lectures during a day would be fairly bad :smile:

Reznor007

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 0
    • View Profile
    • http://www.geocities.com/ninninetynine
Higher Resolution in FF8
« Reply #41 on: 2001-10-30 23:29:00 »
Quote

On 2001-10-29 10:06, ficedula wrote:
Video backgrounds? I'd *like* to, but I haven't got that far yet. It's certainly possible, of course.

Layering system ... you've not *quite* understood how it works. In effect, all 3d models have 2 depth values; firstly, their 3d depth (used to calculate occlusion with other 3d models); secondly, their layer depth (used to calculate occlusion with 2d backgrounds). So the Wutai shop gets rendered like this:

  • Render 2d layer 0 (background)
  • Render 3d models on layer 0, with proper depth for each other
  • Render 2d layer 1 on top of whatever's already on the screen, possibly covering some parts up
  • Render 3d models on layer 1, with proper depth for each other
  • Render 2d layer 2 on top of whatever's already on the screen, possibly covering some parts up
  • [/list:u]

    Scanlines ... well, I know what they ARE. I'm not sure how good it'd be, to be honest - it's not exactly that easy to implement in OpenGL and to be honest, I doubt it'd improve results more than the OpenGL texture filtering already would. Check out the screenshots of the Field unit from the Remake site; OpenGL's already filtering the backgrounds quite a bit by itself.


Ah, I see. Small misinterpretation in how it was done. I was thinking it was done it one pass, but rather a multipass situation, that makes sense.

The video backgrounds shouldn't be too hard to implement. Use an open source codec(Divx probably) or any other coded that is known, and instead of writing it to an overlay for viewing, write it to a texture.

Scanlines can be implemented without too much effort. Since the backgrounds are already being stretched 2x(for 640x480), it would be easy to generate a 640x480 texture and overlay that over the entire scene. The texture would alternate each line with solid black, and a line of transparency. You could also change the alpha value of the black lines to 75% brightness, 50% and so on. Well, at least I think that would work :smile: Haven't tried it out.

For an example of scanlines in an OpenGL mode you can look at Pete's OpenGL renderer for PlayStation emulators. It is an option in there. I'm not sure if he uses the method I mentioned though.

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #42 on: 2001-10-30 23:46:00 »
OK, on further reflection I guess scanlines wouldn't be too hard. I personally don't think they'd improve quality at all, but ... I suppose it couldn't hurt to put them in.

Video codec: Well, if I use the VCM (Windows Video Compression Manager) I get access to all AVI codecs. And yes, you can upload the frames as textures. I'm just saying *I* have never done this!

My time is semi-short at the moment ... I should catch up soon. OTOH, I'm downloading anime quicker than I can watch it, so I'm building up a massive backlog of stuff to watch. Which is good, of course, but drains away yet more time :wink: I'm trying to multitask by only watching anime while cooking, eating, or similar :wink:


J*** H*******

  • Guest
Higher Resolution in FF8
« Reply #43 on: 2001-10-31 03:19:00 »
Message!

Reznor007

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 0
    • View Profile
    • http://www.geocities.com/ninninetynine
Higher Resolution in FF8
« Reply #44 on: 2001-10-31 04:50:00 »
Quote

On 2001-10-30 19:46, ficedula wrote:
OK, on further reflection I guess scanlines wouldn't be too hard. I personally don't think they'd improve quality at all, but ... I suppose it couldn't hurt to put them in.


Yeah, scanlines aren't all that hard. Just make sure that if you try the method I mentioned, you use GL_NEAREST for the filtering on the overlay.

And believe it or not, scanlines REALLY help FF7. I took a screengrab once and scanlined it(painstakingly, I couldn't be arsed to write a program to do it). It looked alot better(IMO).

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #45 on: 2001-10-31 07:05:00 »
My goodness ... do we have a fellow OpenGL programmer in here? You're quite right about how to do the overlay. Possibly I'll try that this afternoon.

Jari: Heh. My CD burner can intheory write at 8x, but not on my dodgy CD's ... bought a big stack of 100 shrink wrapped CDR's which only write at 2x. 'Course, what do you expect, they look sooo dodgy anyway ... but I really needed that many ^_^

Luckily our house server (Hal2k) has a nice 60GB drive solely for the purpose of storing downloads. That'll give me a *bit* more time...:grin:

dagsverre

  • Insane poster
  • *
  • Posts: 323
  • Karma: 0
    • View Profile
    • http://ffsf.cjb.net
Higher Resolution in FF8
« Reply #46 on: 2001-10-31 07:22:00 »
FF8 uses Bink in RAD video tools (www.radgametools.com), meaning you'd get the resource usage of FF8 (and I personally didn't think compression in FF8 was all that bad, you get what you pay for (in resource usage in this  context)). The tools themselves are free, you have to pay for the SDK but that shouldn't really be a problem, a little TDUMP and a little ff8.exe disassembly and you're set. Except that it legally might be a problem releasing something using Bink without paying for it, perhaps they'd take action...

ficedula

  • No life
  • *
  • Posts: 2179
  • Karma: 40
    • View Profile
    • http://www.ficedula.co.uk
Higher Resolution in FF8
« Reply #47 on: 2001-10-31 07:50:00 »
Heheh. Quite. Personally I don't really see any other option than VCM, that way we get to play any AVI files we want, so we can reuse the original FF7 movies (crap though their quality was - by the time they've been through OpenGL they might look better...) and use (say) DivX's for our own movies. Or any other AVI codec you might feel is useful, for that matter.

J*** H*******

  • Guest
Higher Resolution in FF8
« Reply #48 on: 2001-10-31 11:29:00 »
Message!

Reznor007

  • Crazy poster
  • *
  • Posts: 133
  • Karma: 0
    • View Profile
    • http://www.geocities.com/ninninetynine
Higher Resolution in FF8
« Reply #49 on: 2001-10-31 13:57:00 »
Quote

On 2001-10-31 03:05, ficedula wrote:
My goodness ... do we have a fellow OpenGL programmer in here? You're quite right about how to do the overlay. Possibly I'll try that this afternoon.


I can do a little bit :smile: I haven't done anything with OpenGL in a while, I've been too busy with work and other stuff. Right now I'm starting to look into merging the SMPEG library into the MAME source so that Dragon's Lair and other laserdisc games can be supported. Whether or not I actually finish that project depends on how hard it is to get it to fit into MAME's structures.