Author Topic: How does the field coordinate system work?  (Read 3321 times)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
How does the field coordinate system work?
« on: 2011-06-22 00:05:54 »
The values for the coordinates of main character are around here at run time:  CC167D memory

However I haven't got a clue how it works. Makou reactor mentions X,Y,Z and ... triangle ID?  All of these seem to be linked to the walkmesh of a particular field map?

Does this mean it is impossible to work out where you are on screen with this system without knowing and seeing the walkmesh?

If anyone can shed some light on the workings of this coord system I would be much obliged.

Akari

  • *
  • Posts: 766
    • View Profile
Re: How does the field coordinate system work?
« Reply #1 on: 2011-06-22 05:54:04 »
The values for the coordinates of main character are around here at run time:  CC167D memory

However I haven't got a clue how it works. Makou reactor mentions X,Y,Z and ... triangle ID?  All of these seem to be linked to the walkmesh of a particular field map?

Does this mean it is impossible to work out where you are on screen with this system without knowing and seeing the walkmesh?

If anyone can shed some light on the workings of this coord system I would be much obliged.

Walking algorythm uses both X Y and triangle ID. Z calculates after move calculation based on triangle you standing. If triangle ID not set - game cant determinate where you are and model will not move. Without walkmesh model can't move, because all movement calculation uses walkmesh. You still can CLIMB and JUMP though cause it doesn't use triangle ID. But after fimish jumping or climbing it tries set you on walkmesh.

I programmed this twice already, you can look at Q-Gears source =D

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: How does the field coordinate system work?
« Reply #2 on: 2011-06-22 13:08:19 »
The problem is I need to place objects on the field in makou reactor and if I don't know the correct coords it just ain't gonna work.  So what you are saying is, the Z is in fact determined by X,Y and T?

If you would, have a look at the exe with the address I gave, and run me through it?  Edit: Also where is the relevant source?  Maybe send me it here if it isn't too big?
« Last Edit: 2011-06-22 14:49:41 by DLPB »

Akari

  • *
  • Posts: 766
    • View Profile
Re: How does the field coordinate system work?
« Reply #3 on: 2011-06-22 17:25:35 »
The problem is I need to place objects on the field in makou reactor and if I don't know the correct coords it just ain't gonna work.  So what you are saying is, the Z is in fact determined by X,Y and T?

If you would, have a look at the exe with the address I gave, and run me through it?  Edit: Also where is the relevant source?  Maybe send me it here if it isn't too big?

It's sad but you need to know at least X and Y. Maybe someone can write editor to place models on walkmesh...

There are few ways to put model on walkmesh as I remember:
1) By X, Y and triangle id - Place on walkmesh with given X and Y. Calculate Z by triangle id.
2) By X, Y - Look for top triangle in walkmesh that have same X and Y and calculate Z for that triangle.
3) By X, Y, Z - Look for top triangle in walkmesh that have same X and Y, but locates lower than given Z and calculate new Z for that trialgle.
I don't remember it exactly though. You can look through reverse files. Walking are compleatly reversed in FFVII.

For the src look at http://q-gears.hg.sourceforge.net/hgweb/q-gears/q-gears/file/72f9c5346fdb/src_old/field/FieldModule.cpp function SetNextStep(const int model_id, const Ogre::Vector2& move_vector). It's not exactly like the one in FFVII (http://q-gears.hg.sourceforge.net/hgweb/q-gears/q-gears/file/72f9c5346fdb/reversing/ffvii/ffvii_field/movement/ffvii_move_step.cpp)? but a lot like it.


DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: How does the field coordinate system work?
« Reply #4 on: 2011-06-22 17:35:12 »
Cheers.  Seems like this system is a ballache...  however that memory address i wrote on first page may provide the current details :) or at least it should.  But yeah need an editor with visual placement options.