Q-Gears.0.11

  • Thread starter Thread starter Akari
  • Start date Start date
Status
Not open for further replies.
Awesome akari! This is great work :-P It looks accurate enough for me, what's wrong with it? :|
 
Not perfectly, but fits. I leave it this way for this release (0.10) And start to work on scrolling.
Great hmm I might be able to tweak it some.  I suppose putting a fake window port somewhere on the screen might be interesting as well.
IE instead of actually scrolling the background scroll a highlighting edge window for testing purposes.  I think that will give us a clue how it worked originally.
ps: Someone can add this things to q-gears website to show our progress. =)
pss: 2 einherjar: Show even minor changes in view. This can keep people interest =)
And don't forget to write Changelog  :-P
That would be web miester's job.
Erstwhile if you want me to add some detailed comments to the code that reads the background information I can do that much at the very least.

Weren't we going to use doxygen? I have to go and look at how that is supposed to work.

Cyb
 
I've added .MAP file loading and some data structure to handle world map in q-gears
I've also modified world map module to make it draw the said structures:

worldmap-wireframe.png


I admit it's not really sexy :| but it's a first step. I will immediately start working on
speeding up the whole a little: it's around 4 fps on my P4 2.5Ghz / GeForce 6600 GT...
 
Last edited:
Yes... needs to be 30 fps to at least be on par with FF7's field speed. :)

Speed ups
Abuse FF7 type fade geometry.
Use multiple DLists in sections, then use said DList when that section is viewed.
Add a horizon (IE fake curvature like FF7 used part of fade geometry).

If I remember correct FF7 loaded sections of the map and unloaded sections of the map as one traveled over it.  It always loaded in the direction you were going and dumped in the direction you had been.  I believe it only showed a 5x5 grid of sections and cached left over sections. This kept loading mostly in the background as you moved through the map.
Something like
Code: [Select]
Code:
000 001 002 003 004040 041 042 043 044080 081 082 083 0840C0 0C1 0C2 0C3 0C4100 101 102 103 104
If you moved for example from 082 to 043 the top row would be the wrap around data FC1 FC2 FC3 FC4 FC5, then 005 045 085 0C5 would be loaded.
000 040 080 0C0 100 101 102 103 104 would be dumped or left in the cache as long as possible.
That's the idea at least I think they used.
Each section begins on a 2K boundry in the PS1 right? If so that means they used a sector seek to find data chunks (par for the system they used).

Cyb
 
Wow... keep it up and we can do anything =)
There still a lot of time till the 0.10 release.
I finished with scrolling and screen based function (1st implementation) and start working with LINE and LADDER opcodes. (Synergy Blades - stay alert.. I will come with a lot of questions  :-P) This opcodes needed for moving through some maps in first mission  :|
 
Yes... needs to be 30 fps to at least be on par with FF7's field speed. :)

Speed ups
Abuse FF7 type fade geometry.
Use multiple DLists in sections, then use said DList when that section is viewed.
Add a horizon (IE fake curvature like FF7 used part of fade geometry).
I've added a "low-level display-oriented not-editable" mesh data structure that uses a
prebuilt vertex array. With this I get 60/90 fps on my machine. It is a GL-oriented structure,
in the sense that it is *not* an interleaved array, which is the prefered way of DirectX;
I don't know if it may be a problem...?

I am planning to do frustum culling, which is totally equivalent to what you propose.
I've built the bounding box of each mesh/cell, all we need is a camera with an explicit
frustum volume.

If I remember correct FF7 loaded sections of the map and unloaded sections of the map as one traveled over it.
This kept loading mostly in the background as you moved through the map.
This was/is certainly a way to minimize loading time (CD access actually) and memory usage (PS1... :) ).
It is pretty elegant, but right now I will focus on textures, as memory is not really a problem today,
and loading time is ... ah... "acceptable" when using PSX CD, and invisible using PC/HD version.
 
I finished my part already and now merging changes with trunk.
Not that much was finished, but this is all that can be done till the ends of the year.
 
Hmm. there is a trouble with worldmap module. It crash the game sometimes. When I run it from my working directory - everithing fine, but when I copy it (the whole dir) somewhere it crushes somewhere during LZS extruction. I turn it off for now. (comment M button handling in DisplayTest).
 
New version of binaries on sourceforge.

Changes:

2006/12/13
    - [ffvii] Fix init_state in WindowManager was u8 size and can't handle string larger than 255 symbols. [Akari]
    * [ffvii] Add LADER (0xC2) field opcode support. [Akari]
    * [ffvii] Add ladder mode and ladder moving to ObjectManager. [Akari]

2006/12/12
    + [ffvii_content] Level ELEVTR1 now can be passed to next map and back using LINE and MAPJUMP opcodes. [Akari]
    * [ffvii] Add LINON (0xD1) field opcode support. [Akari]
    + [ffvii] Make that PositionByXZ positioned entity in top triangle with this coords. [Akari]
    - [ffvii] Fix MAPJUMP was not working correctly. Missed KERNEL coords setting. [Akari]
    * [ffvii] Add LINE (0xD0) field opcode support. [Akari]
    + [ffvii] Create OnEnter and OnLeave action for triggers, gateways and line. [Akari]

2006/12/11
    - [ffvii] Fix small error with vector for WaitForScroll entity. (was used s16 instead of s8) [Akari]
    + [ffvii] Make SCR2DC (0x66) smooth scrolling with slow start and end. [Akari]

2006/12/08
    * [ffvii] Implement screen and loading of screen range DAT. [Akari]
    * [ffvii] Add SCRLW (0x67) field opcode support. [Akari]
    + [ffvii] Remove poping of Field module when go to battle. Now state of field stored corectly. [Akari]
    + [ffvii_content] Change walkmesh and counter to show entity 1 triangle is. [Akari]
    * [ffvii] Add GETAI (0xB9) field opcode support. [Akari]
    + [ffvii_content] Add CC to STARTMAP.xml to switch player entity to Akari when talk to it. [Akari]
    * [ffvii] Add CC (0xBF) field opcode support. [Akari]
    + [ffvii_content] Add MENU2 to MD1STIN.xml like in the real map. [Akari]
    * [ffvii] Add MENU2 (0x4A) field opcode support. [Akari]
    + [ffvii_content] Add PRTYE to MD1STIN.xml like in the real map. [Akari]
    - [ffvii] Fix wrong character slot check in PartyMenu. [Akari]
    - [ffvii] Fix wrong matrix pushing in gui elements. [Akari]
    * [ffvii] Add PRTYE (0xCA) field opcode support. [Akari]

2006/12/07
    + [ffvii_content] Add UC opcodes and disables character moving until scrolling finishes. [Akari]
    * [ffvii] Add UC (0x33) field opcode support. [Akari]
    + [ffvii_content] Add SCR2DC and SCR2D opcodes to MD1STIN.xml like in the real map. [Akari]
    + [ffvii_content] Add start dialog to STARTMAP.xml that describes last changes. [Akari]
    * [ffvii] Add SCR2DL (0x68) field opcode support. [Akari]
    - [ffvii] Fix that GetMemoryBank u16 in Kernel do not returned immediate value larger than 254. [Akari]
    * [ffvii] Add SCR2DC (0x66) field opcode support (linear scrolling for now). [Akari]
    * [ffvii] Add SCR2D (0x64) field opcode support. [Akari]
    * [ffvii] Add screen border to field module. [Akari]
    * [ffvii] Sync background scrolling and walkmesh scrolling. [Akari]
    * [ffvii] Add scrolling background posibility to field module. [Akari]

2006/12/06
    + [ffvii_content] Add for more choises to Yuffie dialog for mapjump to newly added maps for testing. (this will be remove before release) [Akari]
    * [ffvii_content] Add NMKIN_2, NMKIN_3 files for 0.10 release. [Akari]
    * [ffvii] Add perspective matrix loading from Camera in DAT file.. [Akari]

2006/12/01
    + [ffvii] Combine UnitManager and ScriptManager. Create ObjectManager that manages all object on field. [Akari]

2006/11/28
    + [ffvii] Remove printf when window status updates. [Akari]
    + [ffvii] Change output from Script from prinf to Logger and add flag to config "DUMP_SCRIPT=false". If setted to "true" output all script to log file. [Akari]

2006/11/28
    + [ffvii] Change entity class makes sync opcodes alowed in init script. [Akari]

2006/11/27
    + [ffvii] Remove unnesessary DropInput methods in UnitManager and FieldModule. [Akari]
    + [ffvii] Make move in UnitManager works with repeat input event. [Akari]
    + [all] Cleanup input module alittle. [Akari]
    + [all] Rework input module. Make it reported not only FIRST_PRESS and RELEASE event but REPEAT too. [Akari]

SVN was updated last weekend.
 
When I run it from my working directory - everithing fine, but when I copy it (the whole dir)
somewhere it crushes somewhere during LZS extruction.
It looks like a file access / path problem. Could you please show the last lines of the log file?

Does it SEGV or does an assertion fail?
Could you precise the "crashes sometimes": does it always crash when running in a specific directory, and does it never crash when running in another?
 
Last edited:
When I run it from my working directory - everithing fine, but when I copy it (the whole dir)
somewhere it crushes somewhere during LZS extruction.
It looks like a file access / path problem. Could you please show the last lines of the log file?

Does it SEGV or does an assertion fail?
Could you precise the "crashes sometimes": does it always crash when running in a specific directory, and does it never crash when running in another?
Nope it's not file access trouble. It writes LOGGER->Log("Warning: extract failed, this is not lzs!"); many many times. Nothing else. Crushes sometimes during this.

I really don't know how could it be. I move everything.. all librarys, files... and it crushes =|
Not trying to debug it though.

If you post description of format on wiki - I could try to solve this.
 
Last edited:
Does it SEGV or does an assertion fail?
Could you precise the "crashes sometimes": does it always crash when running in a specific directory, and does it never crash when running in another?
It writes LOGGER->Log("Warning: extract failed, this is not lzs!"); many many times. Nothing else.
This is "normal", considering that the size of the lzs section is not known a priori, so the lzs extractor
is asked to guess all alone the size of the data to extract by reading the first bytes in the header.

Crushes sometimes during this.
OK will check this.
 
You should also make sure all files get loaded correctly, maybe it tries to load a lsz you haven't copied from the psx cd, or maybe some dir is wrong...
 
You should also make sure all files get loaded correctly,
Actually we do not have a way yet to check if a File was opened
correctly except looking at the log file. Or checking the file size,
but it supposes that it is known at compile time. Hmmm, interesting
point.

maybe it tries to load a lsz you haven't copied from the psx cd,
(I'm directly accessing the PSX CDs in my CDROM drive)

OK I think I have tracked it down. I've launched valgrind, and (... drums ...):

Code: [Select]
Code:
== 1 errors in context 2 of 37:== Mismatched free() / delete / delete []==    at 0x401CCBC: operator delete(void*) (vg_replace_malloc.c:244)==    by 0x808E9C6: MapFile::ReadMap(StdString::CStdStr<char> const&, unsigned, unsigned, unsigned) const (MapFile.cpp:57)
Indeed: in revision 109, to make VS2005 build q-gears, the following (ffvii/worldmap/MapFile.cpp):

Code: [Select]
Code:
uint8_t cell_data[sizeof_cell];
was replaced by:
Code: [Select]
Code:
 uint8_t *cell_data = new uint8_t[sizeof_cell]; // ... delete cell_data; // should be `delete [] cell_data'
Ouuups :-D

Did the former code generate an error or a warning in VC++? Let me know so that I will not rewrite it (g++ does not complain at all)

Akari, could you give it another try? Thanks in advance!

If you post description of format on wiki - I could try to solve this.
Yeah, I get the message  :wink: As soon as I have a write access (which I just have requested), I describe it in the wiki.
 
Last edited:
Oh yeh... vc isn't able to allocate a fixed-size array from a variable... :/

c:\qgears\svn_original\src\ffvii\worldmap\mapfile.cpp(38) : error C2057: expected constant expression
c:\qgears\svn_original\src\ffvii\worldmap\mapfile.cpp(38) : error C2466: cannot allocate an array of constant size 0
c:\qgears\svn_original\src\ffvii\worldmap\mapfile.cpp(38) : error C2133: 'cell_data' : unknown size

EDIT: updated the vs2005 files for the latest source changes and added a missing "return ret;"
 
Last edited:
What would be cool is to see a render of the whole worldmap with the walkmesh attibutes coloring the polygons. That may answer some questions over what each does....
 
What would be cool is to see a render of the whole worldmap with the walkmesh attibutes coloring the polygons. That may answer some questions over what each does....
Hmmm... so you want a 2d map with polys colored based on the walkInfo attribute of the triangles?
0x20 = Green
0x21 = Yellow
0x22 = Orange
0x23 = Red
Would that work? I think I can just write a quick util that will export a POV scene for that. (Quick is relative I might point out ;) ).

einherjar
As for 0x21 and 0x22 being the same, that might be a tiny bronco difference on the water. I know one can't walk over mountains etc on the land.

Was there any information for Field locations in the walk map? For example Costa Del Sol, Junon, North Corel Mountains, Kalm etc. are all Field locations that are referenced from the world map somehow.  Where are the models coming from that are on the world map? Could that be the BOT files?  I wonder if those are similar to the entities used in the field areas.  IE you run into the entity on the world map it executes a MAPJUMP for the field location.  It would make sense to do this on the world map.  The BOT file may contain the battle information for the field as well. IE load what battle scene etc.  I may have to do some checking with the rest of this.

Cyb
 
New version at last =)

[ffvii] v0.11

2007/01/26
    + [ffvii] Change version number to v0.11. [Akari]
    + [ffvii] Change help to all modules. [Akari]
    - [ffvii] Fix error when we add more and more elements to global g_SpritePoly from BackgroundManager
              when called it constrictor. [Akari]

2007/01/25
    - [ffvii] Fix bug when two field modules called togather. When one was deleted,
              static script member was also deleted, making it unavailable for second field module. [Akari]
    + [ffvii] Make Field as start module to q-gears. [Akari]
    - [ffvii] Fix conditional jump opcodes. [Akari]

2007/01/24
    - [ffvii] Fix ladder movement to start position. [Akari]
    * [ffvii] Add AXYZI (0xC1) field opcode support. [Akari]
    - [ffvii] Fix TimFile loader. [Akari]
    - [ffvii] Fix background viewing (transparency issue). MimFile loader was incorrect. [Akari]

2007/01/23
    + [ffvii_content] Add NMKIN_4 and NMKIN_5 maps. [Akari]
    * [ffvii] Add JUMP (0xC0) field opcode support. [Akari]
    * [ffvii] Add base implementation of jump mode. [Akari]
    + [ffvii] LADER now is waiting-type opcode. [Akari]
    * [ffvii] Implement ladder climbing buttons. [Akari]

2007/01/22
    + [ffvii] Make line script activation like Synergy Blades says. [Akari]
    * [ffvii] Add SOLID (0xC7) field opcode support. [Akari]
    * [ffvii] Add TLKR2 (0xD6) field opcode support. [Akari]
    * [ffvii] Add SLDR2 (0xD7) field opcode support. [Akari]
    * [ffvii] Add TALKR (0xC7) field opcode support. [Akari]
    * [ffvii] Add SLIDR (0xC6) field opcode support. [Akari]
    + [ffvii] Gamestate and Database now accessable directly like KERNEL and not accessible from KERNEL anymore. [Akari]
    * [ffvii] Add IFKEYOFF (0x32) field opcode support. [Akari]
    * [ffvii] Add IFKEYON (0x31) field opcode support. [Akari]
    * [ffvii] Add struct that holds state of game button to KERNEL. [Akari]

2007/01/19
    * [ffvii] Add IFKEY (0x30) field opcode support. [Akari]
    + [all] Add IsButtonPressed method to InputFilter class. [Akari]
    + [ffvii] ODE removed. Implement range collision detection instead. [Akari]

2007/01/18
    + [ffvii] Make trigger activation works with distance instead of ODE. [Akari]
    + [ffvii] Move WalkMeshTriangle struct to separate class that derives from Actor. [Akari]

2007/01/12
    * [ffvii] Add mark triangle animation to MarkTriangle class. [Akari]
    + [ffvii] Move MarkTriangle struct to separate class that derives from Actor. [Akari]
    * [ffvii] Add showing gateway mark triangle from DAT and XML. [Akari]
    * [ffvii] Add SCRCC (0x65) field opcode support. [Akari]

2007/01/11
    * [ffvii] Add reading of extra mark triangle from XML. [Akari]
    * [ffvii] Add MPJPO (0xD2) field opcode support. [Akari]

2007/01/10
    * [ffvii] Add reading of extra mark triangle from DAT. [Akari]
    * [ffvii] Implement showing triangle that shows gateway on map. [Akari]

2007/01/09
    + [ffvii] Made all Actor->Draw constant method. [Akari]
    * [ffvii] Implement that camera follows character. [Akari]


Additionally I add new screenshots to sourceforge and activate worldmap module.
 
Last edited:
Status
Not open for further replies.
Back
Top