Author Topic: Working on Field models.  (Read 19495 times)

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Working on Field models.
« on: 2008-01-19 05:53:12 »
At last I start to understand what is going on with models during field loading.
Flow of loading is simple:
- Field DAT (data)
- Field BSX (models)
- All global models.
- Textures for global models.

After that field is running and it starts to load MIM file (background textures) for field loaded with closest gateway trigger. If you get close to another gateway trigger is starts load it's MIM.

The hardest thing is to understand how global and field models work together, because they are loaded to different location.
FFVII team use additional description structure. They copy all offsets from BSX and BCX (global model) and data about bones, model parts and animation there (they not copy data itself such as vertexes texture UV and angle, only header data like number of those things and offsets). It seems that data left in files not used at all. Now I stopped at bones structure initialization. After finishing initialization I can start working on animation and texture assign itself, and maybe start extracting them.

Salk

  • Insane poster
  • *
  • Posts: 440
  • Karma: 12
    • View Profile
Re: Working on Field models.
« Reply #1 on: 2008-01-19 07:46:57 »
Good luck with this new challenge and thanks for keeping us updated.

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #2 on: 2008-01-25 19:39:41 »
This week gives a good amount of results.

I understood animation routine. It's really simple, but I didn't wrote documentation yet. Mainly it just increase frame value. Depending on on current state it can stay in last frame or reset to zero. All opcodes play animation only once. Next they could return to usual routine (state 0), or stay in last frame (state 3). In last case you must call one more opcode to finish it. Of course all states reset to 0 if we set movement to manual.

And I mainly understand how animation format works. Now I in the middle of reversing function that sets transformation matrixes for bones. Animation sets not only by angle, but with translation too. For example all walking characters has root bone moving by Z axis. I wonder if it was found in PC version.

Next week I'll try test this in old Q-Gears code without exporting it.

ps: http://community.livejournal.com/q_gears/

Borde

  • Freak
  • *
  • Posts: 898
  • Karma: 24
    • View Profile
Re: Working on Field models.
« Reply #3 on: 2008-01-27 21:05:42 »
Yes, the PC version animations also keep the Z axis root position for every frame.

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Working on Field models.
« Reply #4 on: 2008-01-28 01:01:10 »
The BSX files include animation sequences for field models for each location yes? (not character ones obviously)
Are the animations used for the character models in field therefore in the BCX files and run by the scripts? I suspect that's what they did.
Merely wanting to confirm I am not out in left field :D

Cyb

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #5 on: 2008-01-28 02:24:12 »
The BSX files include animation sequences for field models for each location yes? (not character ones obviously)
Are the animations used for the character models in field therefore in the BCX files and run by the scripts? I suspect that's what they did.
Merely wanting to confirm I am not out in left field :D

Cyb


Each BCX contains only 3 animation for character (stand walk and run). BSX contains additional animation used in field.

Olie

  • Cool newbie
  • *
  • Posts: 63
  • Karma: 0
    • View Profile
Re: Working on Field models.
« Reply #6 on: 2008-01-31 06:36:12 »
this makes very interesting reading.
good luck. what are you guys wanting to achieve when your finished? (sorry cant remember what FAQ said)

yoshi314

  • Insane poster
  • *
  • Posts: 319
  • Karma: 2
    • View Profile
Re: Working on Field models.
« Reply #7 on: 2008-02-01 10:02:47 »
Quote
good luck. what are you guys wanting to achieve when your finished? (sorry cant remember what FAQ said)
working ff series engine that would support psx and pc data.

so far most effort is put into figurinn out ff7 and ff9 data, there is also some small progress on fft and xenogears.

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #8 on: 2008-02-01 17:25:46 »
This week update will be with screenshot =)



This is test I create using q-gears 0.13. There is no opcodes in there but Models can play animation, so if anyone interested - he can implement everything =) I will only do this for new Q-Gears. I finish revercing of bone matrix creation. This is function that go through all bones and create transformation matrix for specific bone acording to all animation, translation, rotation, camera, offset and many many other data used in engine. So animation is finished. But not all models in game displayed correctly. Mainly because rendering is not understood yet. I just start working on it, so it doesn't display textured poly and doesn't has light anf other effects. This is next few weeks task.

Now I start work on KAWAI opcode. This opcode was created by Hiroshi Kawai who was character programmer in FFVII. Using this opcodes you can create effects like blinking or effect when character looks like he is in water. Thats all for this week =)

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Working on Field models.
« Reply #9 on: 2008-02-01 21:03:51 »
Interesting I look forward to the information regarding the code used for animation.

I am very interested in that part of the script engine.

The bone matrix transformations are also of interest too me because I never got those correct (sad).

Cyb

Myria kitty

  • Fast newbie
  • *
  • Posts: 42
  • Karma: 0
    • View Profile
Re: Working on Field models.
« Reply #10 on: 2008-02-04 00:11:46 »
When you make these changes do you commit them to Subversion?

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #11 on: 2008-02-04 19:39:32 »
When you make these changes do you commit them to Subversion?

No, I'm bit lazy for that, and besides I can't upload it to main branch because game itself not working. I can ask G to upload it somethere.

halkun

  • Global moderator
  • No life
  • *
  • Posts: 2111
  • Karma: 20
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Working on Field models.
« Reply #12 on: 2008-02-05 01:29:53 »
Feel free to use to create a branch in the q-gears SVN if you want.

Olie

  • Cool newbie
  • *
  • Posts: 63
  • Karma: 0
    • View Profile
Re: Working on Field models.
« Reply #13 on: 2008-02-05 12:39:54 »
Quote
good luck. what are you guys wanting to achieve when your finished? (sorry cant remember what FAQ said)
working ff series engine that would support psx and pc data.

so far most effort is put into figurinn out ff7 and ff9 data, there is also some small progress on fft and xenogears.


that sounds pretty cool, where the xenogears that game rocked. :D so you re-create the game engine that would achive? better performance and gfx and gameplay etc?  since the FFVII works fine for me :D :D :D

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #14 on: 2008-02-05 18:45:47 »
Quote
good luck. what are you guys wanting to achieve when your finished? (sorry cant remember what FAQ said)
working ff series engine that would support psx and pc data.

so far most effort is put into figurinn out ff7 and ff9 data, there is also some small progress on fft and xenogears.


that sounds pretty cool, where the xenogears that game rocked. :D so you re-create the game engine that would achive? better performance and gfx and gameplay etc?  since the FFVII works fine for me :D :D :D

I don't think many people need engine that simply runs game on PC. There are a lot of great emulators that can do this. My goal is to create engine that allow you to create your own game with all posibilities which square engine has. FFVII will be run on that engine too. Most likely it will be like sample project.

yoshi314

  • Insane poster
  • *
  • Posts: 319
  • Karma: 2
    • View Profile
Re: Working on Field models.
« Reply #15 on: 2008-02-06 15:41:09 »
Quote
I don't think many people need engine that simply runs game on PC
that's true for windows users. linux folks (like me) are another story, though :]

keeping it as a more generic game engine is a great idea, though - it could be extended to run ff8 as well (since ff7 and ff9 are in the works already), in time, or to make your own rpg games.

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Working on Field models.
« Reply #16 on: 2008-02-07 00:26:28 »
You can't run PCSX or ePSXe versions under Linux? I use too been a while.

Cyb

yoshi314

  • Insane poster
  • *
  • Posts: 319
  • Karma: 2
    • View Profile
Re: Working on Field models.
« Reply #17 on: 2008-02-07 08:54:50 »
of course i can. i'd like a more direct approach though.

Quote
I use too been a while.
what?

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Working on Field models.
« Reply #18 on: 2008-02-07 10:30:40 »
I said I use to run ePSXe and PCSX under linux.
I probably should turn on my linux box, blow dust off it's keyboard, and update it's video drivers for OpenGL (it has now an ancient GF3 in it).

Cyb

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #19 on: 2008-02-09 15:06:54 »
This week brings almost nothing. I'm in the middle of reversing creating packet drafts and filling them with real data. But it liiks like I will need to parse eyes texture loading too. As I can see Square did all rasterization all by themself. During loading for all types of polygon packet draft is created. Packet draft is place in memory where all static data for specific packet is filled (packet header, texture data). During render vertex coords copied in there too and, i suppose, they sent to GPU. A lot of work lies ahead =)

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Working on Field models.
« Reply #20 on: 2008-02-09 16:13:17 »
This week brings almost nothing. I'm in the middle of reversing creating packet drafts and filling them with real data. But it liiks like I will need to parse eyes texture loading too. As I can see Square did all rasterization all by themself. During loading for all types of polygon packet draft is created. Packet draft is place in memory where all static data for specific packet is filled (packet header, texture data). During render vertex coords copied in there too and, i suppose, they sent to GPU. A lot of work lies ahead =)
This is one of the reason why generating the textures for the battle models was hard.
First the TIM data has multiple palettes. At first one would think "no big deal they have a list somewhere right?" No. You have to use the polygon data to guess which palette to use.  So my guess is you have to render your textures like one would have to for battle models. IE render the texture data but iterating through the available data.  As for eye blinking, how is that handled? The mouths aren't animated (let me check) nope not animated in the least. So the script handles the eye blinking or does the game engine (automatically)?

Cyb

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #21 on: 2008-02-09 18:31:44 »
This week brings almost nothing. I'm in the middle of reversing creating packet drafts and filling them with real data. But it liiks like I will need to parse eyes texture loading too. As I can see Square did all rasterization all by themself. During loading for all types of polygon packet draft is created. Packet draft is place in memory where all static data for specific packet is filled (packet header, texture data). During render vertex coords copied in there too and, i suppose, they sent to GPU. A lot of work lies ahead =)
This is one of the reason why generating the textures for the battle models was hard.
First the TIM data has multiple palettes. At first one would think "no big deal they have a list somewhere right?" No. You have to use the polygon data to guess which palette to use.  So my guess is you have to render your textures like one would have to for battle models. IE render the texture data but iterating through the available data.  As for eye blinking, how is that handled? The mouths aren't animated (let me check) nope not animated in the least. So the script handles the eye blinking or does the game engine (automatically)?

Cyb

Blinking handled by engine, you only can turn it on/off from script. I don't found this yet, but it's not high priority.

The main problem not the textures, but dynamic model changing using KAWAI opcode. I dont fully understood it yet, but it is a sequence type opcode (as I understood). It copy control byte to header for model related data (can be 0-D) and copy pointer to folowing data. This pointer is read during kawai parsing on every model render. There are really great amount of hard to understand code. So first I try to understand how usual routine work.

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #22 on: 2008-03-14 18:31:24 »
Local field textures working. Now I try extract models and working on global eyes texture.

Screen of Potion in Ogre mesh viewer.


Door with texture.


Treasure chest.

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Working on Field models.
« Reply #23 on: 2008-03-14 21:19:17 »
Akari have you defined an interface betwixt Q-Gears and the Ogre VI you are using or are they mingled together?
IE something akin to this (simplistic but affective)
Code: [Select]
for(index = 0; index < ggears->scene->object_count(); index++)
 Ogre->CurrentScene->AddObject
  (
  qgears->create_object
   (
   qgears->scene->get_model(index)
   )
  );
Where create_object makes an object that the Ogre object can convert to whatever internal format is used (for Ogre).
A lot of 'magic' OOP stuff going on obviously in the background.
I can't remember if C++ (Gcc variant) allows properties. I know VC++ uses something like that and Borland C++ does as well.

Cyb

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Working on Field models.
« Reply #24 on: 2008-03-29 21:03:04 »
Last two weeks there is no much progress. I working on two separate task: first - I continued working on exporting models in Ogre format. This two screenshots shows some progress. I correctly exported animations and now work on exporting textures. PSX can set different rendering attributes per polygon but I cant do this using standart render, so I deside that I will use simple shader that will render texture using this additional data which will be stored with vertex. There one more problem with savepoint model (it has two same submeshes one move clockwise, other - anticlockwide, but they colated in same plase so there are a lot of z-fighting and other gliches) - i will solve this after shader =)




Second task - I continue reversing of battle algorithm. There are great amount of hacks  and I still don't know meaning of some structures so it not moving forward very quickly. Mainly I reversing battle initing and sense function.