nunuhara / xsystem4

Cross-platform implementation of AliceSoft's System 4 engine
GNU General Public License v2.0
44 stars 3 forks source link

Z-ordering of PartsEngine #180

Open kichikuou opened 2 weeks ago

kichikuou commented 2 weeks ago

In Rance Quest, after the very first message, "閃きの迷宮" is highlighted on the map. System4

However, in xsystem4, the frame behind the text is not shown. xsystem4

Looking at the scene info in xsys4dbg, the background is a normal sprite with Z=8001, the frame is in Parts with Z=8002, and the text is a normal sprite with Z=8004.

background frame text

Xsystem4 represents PartsEngine as a virtual sprite with Z=0, but this makes me think that the normal sprite and Parts should share one Z-space. @nunuhara have you seen any counter example?

nunuhara commented 2 weeks ago

If I remember correctly, I had tested the relative Z-ordering on the Shaman's Sanctuary .exe, and based my implementation on that. However, I just ran that game in xsys4dbg and it looks similar to what you found in Rance Quest, with sprites and parts seeming to share one Z-space. So it might not be necessary to implement it that way I did, even if the .exe works that way.

kichikuou commented 2 weeks ago

In Shaman's Sanctuary .exe, by inserting the following code at the beginning of 01/プロローグA(), I was able to create a sprite whose Z-order is between two parts:

    int nSp = ChipmunkSpriteEngine.SP_GetUnuseNum(1);
    ChipmunkSpriteEngine.SP_Create(nSp, 600, 600, 255, 0, 0, 255);
    ChipmunkSpriteEngine.SP_SetPos(nSp, 100, 0);
    ChipmunkSpriteEngine.SP_SetZ(nSp, 300);  // between 201 (background) and 550 (message window)

Mankuchu_exe parts1 parts2

So, it is probably the correct behavior for sprites and parts to share one Z-space.