Notes of things found while playing through the fields that still have to be reviewed.
Some scenes in chrin_1b (the opening, and the ones after it) wait a long time between messages, so it looks as if the game had frozen. Not investigated yet.
Suspects:
ScriptManager::Update: a script that yields with wait(0) now lets the
next script of its entity run in the same cycle.INTERACT_SCRIPT_PRIORITY in EntityManager.cpp.WAIT and script:wait that the installer converts (frames to seconds).First step: play the scene with log level 3 and look at the time between the dialog_open and
Start script lines.
BGPDH and BGSCR are converted, but the meaning of their values (ratio = distance / 4096, speed in
1/256 of a pixel per frame, sign of the speed) has not been checked against the original game. The far
layer of mds5_4 has no such opcodes and still scrolls with the rest, and it is not known why it should
not.
Not done yet (kernel data in ff7.exe, ids 170-176, see get_special_limit in battle_ui.lua):
The terrain of WM0 is built as one ManualObject per texture for the whole map (CreateWorldMap), so
its bounding box is the whole map and Ogre never culls it: every frame draws all of its ~142,000
triangles in ~320 batches, however little of it the camera sees. With the entity debug off it runs at
about 110-140 fps in the tests. The search of the triangle under a position was the bigger problem and
is solved (spatial grid, BuildTerrainIndex).
Not planned for now. If it is needed: build the geometry per block or mesh (one object per mesh and texture), so the frustum culling skips the ones that are out of view, and measure the number of batches afterwards, because it can grow. Loading and unloading blocks around the player is the next step after that, but the whole map fits in memory, so it should only be for the load time. The 6 alternate blocks of WM0 (story shapes) are not loaded now and would have to be handled.