Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Micky

Pages: [1] 2 3 4 5 6 ... 12
1
Those animations rely on the field script being able to modify the palette in real-time (changing the actual colors in the palette, not just switching between different palettes). Obviously that cannot work with your upscaled images since there is no palette to speak of. In theory it would be possible to create upscaled images that use the original palettes but that would kind-of defeat the point not to mention be difficult to implement and since there's no hardware from this millenium that supports paletted textures it would run incredibly slow even if you could make it work.

I have been thinking long and hard on this one, I figure the best bet would be to somehow analyze the field script to figure out what effect it is trying to accomplish and implement it with a shader. That is unfortunately only slightly more feasible than the above "solution".
Yeah, palettes are dropped, but current GPUs have crazy fill rates and shader performance compared to a few years ago.

What about this:
- bind two textures, one is a I8 texture with the palletised tiles, one is a 256x256 RGBA texture with the palettes. Pass the current palette index as a shader variable or vertex stream.
- set up both samplers to point sample.
- first load the colour index from the first texture, then look up the colour from the second texture with u=colour index, v=palette index, making sure you sample from pixel centres.

Disadvantage:
- You don't get bilinear interpolation, though you can implement that manually in the shader as well. That would mean 8 texture loads instead of 2, but then again, GPUs are much faster nowadays.

For upscaled RGB images it gets complicated. If you have only lighting, and not colour-cycling, you could try to do tone mapping:
- With a matrix, assuming you only have brightness or slight colour tone changes, you need a matrix Ax=b , with x being the old palette and b being the new palette. Then solve for A for example with a least squares fit ( http://eigen.tuxfamily.org/dox-devel/group__LeastSquares.html ). In your shader you can multiply your texture colour by this matrix to get a similar effect as the palette change.
- With a 3D texture, which is more powerful. Basically, for every r,g,b of the old palette you store the r,g,b value of the new palette. As the PSX is only RGBA5551 you should be able to get away with a 32x32x32 cube. It will be a bit tricky to fill in all the colours that are not in the palette, though. Maybe you could use a kD-tree or octree to quickly look up the nearest colours and blend between them, or write a shader to build the 3d texture in a render-to-texture pass. At runtime you would bind both the RGB texture and the 3D texture, and the shader would look up the final colour by using the input colour as u,v,w of a texture lookup into the 3D texture.


2
I guess I didn't remember that Unity is left-handed. It's a trivial fix, but it'll have to wait until there is some stuff for a new version.

3
Most of my efforts were toward conversion toward a modern-GPU conversion for the models (ie:  no crazy palette shifted textures) and it seems that most of the meshes are conducive to this.  I wasn't able to make heads or tails out of the field textures in any automate-able way though ;(
Yeah, the psx data is not very appropriate for modern gpu. For best result you'll probably have to make new uv charts and resample from the old ones. Or even remodel, like the Project Noah guy.
Quote
Can I contact you via Skype or gtalk or some such?  I'd love to chat about this stuff :)
Which time zone are you in? Though I think most of my stuff is already documented, and Akari is probably ahead of me anyway. I spend my time at the moment to develop something of my own.
(Though if Squeenix feels like they need a mobile/XBLA/PSN/WiiU/3DS version of Xenogears, I am available for hire!)

4
Sorry for the thread necromancy, but it will make it easier for people using the forum search.

I made a new version:
http://bin.mypage.sk/FILES/ImportXenogears.zip

I tested this with Unity3D 4.3 on Windows 7. I had to make a small fix for path names, because it looks like Unity doesn't like backslashes. This was developed on OSX, so I missed it for the first release. Sorry. This version ramps the ambient lighting up so you can see models correctly. You'll have to enable the sun icon in the scene view to enable lighting.


5
I did some stuff with Xenogears and Unity3D as well: http://forums.qhimm.com/index.php?topic=13887.msg194889#msg194889
(Apparently you have to use "Save As..." to save the package as the web browser may try to open it as a document.)
(New version! Check the thread.)


6
I understand now.  This thread can be deleted.  :)
That is not going to help anyone who comes across this thread from google in the future. ;)

7
This looks impossible to me.  Not only is it managing to find the edges so finely (and easy), but it's placing data where it doesn't exist. In terms of FF7 objects, this wouldn't work regardless... a lot of it requires full updates to models (as in true 3D modelling with textures) and already uses 3d modelling software.
I think that is because it mostly shows you where it works best - many cylindrical or bent cylindrical objects. There are a few at the end where it doesn't work, for example the tooth paste tube. And I guess it makes many assumptions about connectivity. They fix the background (and I guess the back side of a model) with a texture synthesis algorithm. If you look closely for example in the picture with the telescope you see that the filled in data doesn't look that realistic. (Theory and GIMP plugin for something similar is here: http://www.logarithmic.net/pfh/resynthesizer Look at the removing objects from images link for an example).

I was planning to experiment with something similar to this to add shadow casters and receivers to field files, where an exact match isn't really required.

8
Think of it as a quick way to get the low res models out of a field screen. So instead of setting the background image into the camera, you would load it into the tool and sweep over key objects and export the result as a textured mesh.
The code gives you both geometry and a synthesised texture. Though until they actually release the code, or somebody implement the paper, it is hard to say how useful it is.

9
Well, kind of on-topic, even though an accessible implementation is still a bit off:
http://youtu.be/Oie1ZXWceqM
(Depending if they release the code or not.)
Still, together with the existing camera and walkmesh info this may be a quick way to get a starting layout to work off.

Here's the abstract: http://www.faculty.idc.ac.il/arik/site/3Sweep.asp

10
Team Avalanche / Re: [HD Remake] Midgar sewers
« on: 2013-06-18 07:54:02 »
I wish there could be a "dirt & grime simulator"!
Did you try this? http://quixel.se/ddo/ I downloaded a demo ages ago but never got around to play with it.

11
To be honest I was happy with your contribution, and I have never understood why so many forums enforce the "thread is too old" rule.  I think resurrecting a thread (if you have something to contribute and it is relevant) is preferable to opening up a completely new thread.  It makes no sense imho.  But you have to understand people like sl1982 do a thankless job and more often than not are dealing with idiots day in and out, and it gets to them.  I have been just as guilty of being rude to people asking for help for the same reason.  It's a fine balance.
I guess "thread too old" rules make most sense in technical support questions. Either the original poster has long solved his problem, the problem deals with ridiculously out of date hardware or software revisions, or the new post is simply "Oh, I've got the same problem, help me!".
In this sub-forum people should be able to keep contributing to old threads so that information is in one place (until it is moved into the wiki) and can be easier found with a search. Especially nowadays that many fundamental parts of FF7/8/9/XG have been discovered and we are mostly filling in the blank spots.
I'm a member on another forum where some threads are going on for many years, whenever new information arrives. I personally don't mind if anyone adds posts to any of the threads I started, and even though I don't post much any more, I still check now and then if anyone has found something cool, or asks questions about anything I worked on.

12
I have started to port it to python, I'll post it here once it is done.

13
Try this: http://bin.mypage.sk/FILES/release.zip
It works with the background I tried.
Cyberman is right, there is no error checking. I should probably put an assert into the get_le* functions, the NULL pointer should be really checked outside, in cases where a NULL can be returned.

14
Unfortunately since I installed a new HD a few weeks ago my netbook doesn't really have anything FF7 related on it. I'll have to try tomorrow if I can find some time to copy everything over again.
You are stepping over load_lzs. I assume it returns NULL in data, because it somehow fails to load the file. What is interesting is if it fails to open the file, or fails to decompress it. Though I have no experience with mingw, if it needs anything special.

15
Hmm... that looks correct. At this point I'd step through load_lzs and see where it fails. Though I don't have mingw installed anywhere and it has been ages since I used gdb directly, I'm using xcode on MacOS and Visual Studio 2005 (because I'm poor) on Windows.

16
It looks like it failed to find/load the stage file. Maybe mingw munges the path somehow? Or there is a conflict in the code that tries to make the path absolute? Can you show the current value of filename in load_background? (I should really port that to python sometime, to make it more portable.)

17
I just tried mine again... it should still work. Try running a debug build in visual studio and let me know where it crashes. You can set the argument in the project settings. It needs to be a full path to a stage in  STAGE1 or STAGE2. I guess STAGE04.LZS is the one you've got in the windows viewer.

18
If you look in ImportXenogears.cs, from line 821 on:
Code: (C#) [Select]
int itemCount = (int)getUInt32LE(archiveData, 0x018C);
for(uint itemIndex=0; itemIndex < itemCount; itemIndex++) {
ushort flags = getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 0);
ushort rot_x = getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 2);
ushort rot_y = getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 4);
ushort rot_z = getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 6);
short pos_x = (short)getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 8);
short pos_y = (short)getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 10);
short pos_z = (short)getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 12);
ushort index = getUInt16LE(archiveData, 0x0190 + itemIndex * 16 + 14);
This positions the different parts of the field model in the world, though some positions seem to refer to other things depending on the flags field. Index is the index of the mesh to place at a position.

Or this thread that shows the original problem and solution:
http://forums.qhimm.com/index.php?topic=8334.msg100658

19
I'm going through the q gears stuff to fill in some of the newer information. I could've sworn that someone decoded the meaning of the type flags in the skeleton/hierarchy for field models, but the documentation/reverse directory in q-gears doesn't contain it, and the exporter tools don't seem to handle it. Am I imagining this, or have documents and tools been lost? (Yes, I searched the forum.)

20
Scripting and Reverse Engineering / Re: FF7.exe data
« on: 2012-11-28 22:44:20 »
I sometimes get the feeling that even Microsoft is trying to nudge people away from VB and towards C#, especially as the structure of modern VB isn't too far away from the C family of languages (or Delphi/Pascal).

21
Scripting and Reverse Engineering / Re: FF7.exe data
« on: 2012-11-28 21:18:53 »
I can't contribute to this but I'm a bit surprised that people still start new projects in VB...

22
I'm playing around with Unity3d at the moment, and I like it a lot! As an experiment I implemented an importer for some of the Xenogears assets types. It is just some of my old C++/Python code converted to C# and munged together. It doesn't contain any of Akari's latest research from q-gears and I didn't make any attempt to clean up duplicate functionality, yet.
You can't actually play anything, but you can use the Unity editor as a viewer to explore some of the models and textures.
http://bin.mypage.sk/FILES/ImportXenogears.unitypackage

Usage:
- Make sure you don't need the computer for the next hour or so and have lots of free space on the HD.
- You need raw disc images of disc 1 and disc 2. (2352 byte sector format, file extension .img. The extension is only cosmetic because I didn't find a way to allow multiple extensions in Unity's file selector API.)
- You need Unity 3.5. The free version should do. I don't have Unity 4.0 at home, yet, so I can't tell if there are any problems. ( http://unity3d.com/unity/download/archive )
- Create a new project.
- Import the unity package. This should give you two scripts.
- The window menu should now have an "import xenogears" option
- Use "choose disc image" to select the disc images. The code takes a sniff at the file system and automatically detects disc1/disc2 of the US NTSC version.
- Select "Import". The importer unpacks the disc images into individual files and then imports field, battle stages, worldmap and a bunch of TIM files. This takes ages, and unfortunately I can't display a progress bar because much of the UI is blocked.

There will be unity scenes for the field and battle backgrounds and the terrains that can be opened, alternatively you can browse the models in the project view. I didn't create scenes for the imported images.

Let me know how it goes.
(I don't plan to make this playable, that time would be better invested into q-gears.)

Update:
- it's now a unity package
- tweaked the instancing code for field scenes
- added hierarchy for battle scenes
- added scene models (mostly gears and spaceships)

23
I think field.bin stores both position and size... it has been ages since I looked at it, though. You could try to match the whole table of position/size against the disc image and the directory to confirm.

24
Where might we find a copy of this tool?
On my hard disk. :)
This is in part of my testbed of apps I use to tinker with the FF7 data. You're not missing anything, though, I assume Akari's tools in q-gears are more complete by now.

25
I'm using this code to open field.bin:
Code: [Select]
import zlib, struct

def loadBin(name):
    # read compressed data
    f = open(name, "rb")
    buf = f.read()
    f.close()
   
    (size,) = struct.unpack_from("<I", buf, 0)

    data = zlib.decompress(buf[8:], 16 | 15)
    if len(data) != size:
del buf
del data
return None
    return data
It skips the first 8 byte and changes the window size.
http://docs.python.org/library/zlib.html#zlib.decompress
I'm not sure where I got the wbits value from, most likely from somebody else's document or decoder.

Pages: [1] 2 3 4 5 6 ... 12