sonicretro / SonLVL

SonLVL
http://info.sonicretro.org/SonLVL
58 stars 27 forks source link

LevelConverter won't convert Sonic CD (1993) levels properly #128

Open ghbbeep opened 2 years ago

ghbbeep commented 2 years ago

Using Ralakimus' disassembly, the levels seemingly refuse to convert fully. Here's the log:

Program: LevelConverter Build Date: 10/12/2021 18:23:20 OS Version: Microsoft Windows NT 6.2.9200.0 Log: Opening INI file "C:\Users\Owner\Downloads\sonic-cd-disassembly-main\sonic-cd-disassembly-main_SonLVL\SonLVL.ini"... Game type is SCD. Loading Present... Loading palette file "../Level/_Objects/Sonic/Data/Palette.bin"... Source: 0 Destination: 0 Length: 16 Loading 256x256 chunks from file "../Level/Palmtree Panic/Data/Chunks (Act 1 Present).bin", using compression Uncompressed... Loading 16x16 blocks from file "../Level/Palmtree Panic/Data/Blocks (Act 1 Present).nem", using compression Nemesis... Loading palette file "../Level/Palmtree Panic/Data/Palette (Present).bin"... Source: 0 Destination: 16 Length: 48 Loading palette file "../Level/_Objects/Sonic/Data/Palette.bin"... Source: 0 Destination: 0 Length: 16 Loading palette file "../Level/Palmtree Panic/Objects/Amy Rose/Data/Palette.bin"... Source: 0 Destination: 16 Length: 16 Loading palette file "../Level/Palmtree Panic/Data/Palette (Present).bin"... Source: 16 Destination: 32 Length: 32 Loading palette file "../Level/_Objects/Sonic/Data/Palette.bin"... Source: 0 Destination: 0 Length: 16 Loading palette file "../Level/_Objects/Level End/Data/Palette (Flower Capsule).bin"... Source: 0 Destination: 16 Length: 16 Loading palette file "../Level/Palmtree Panic/Data/Palette (Present).bin"... Source: 16 Destination: 32 Length: 32 Loading FG layout from file "../Level/Palmtree Panic/Data/Foreground (Act 1 Present).bin", using compression Uncompressed... Loading palette file "../Level/_Objects/Sonic/Data/Palette.bin"... Source: 0 Destination: 0 Length: 16 Loading palette file "../Level/Palmtree Panic/Data/Palette (Present, Prototype).bin"... Source: 0 Destination: 16 Length: 48 Loading 8x8 tiles from file "../Level/Palmtree Panic/Data/Tiles (Act 1 Present).nem", using compression Nemesis... Loading BG layout from file "../Level/Palmtree Panic/Data/Background (Act 1 Present).bin", using compression Uncompressed... Loading objects from file "../Level/Palmtree Panic/Data/Objects (Act 1).bin", using compression Uncompressed... Loading start position "Level Start" from file "../Level/Palmtree Panic/Data/Start Position (Act 1 Present).bin"... Level loaded in 0.084902 second(s). System.InvalidCastException: Unable to cast object of type 'SonicRetro.SonLVL.API.SCD.SCDObjectEntry' to type 'SonicRetro.SonLVL.API.S2.S2ObjectEntry'. at SonicRetro.SonLVL.LevelConverter.MainForm.ConvertLevel() in D:\Programs\SonLVL\LevelConverter\MainForm.cs:line 815 at SonicRetro.SonLVL.LevelConverter.MainForm.button1_Click(Object sender, EventArgs e) in D:\Programs\SonLVL\LevelConverter\MainForm.cs:line 107 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

DevsArchive commented 1 year ago

Sonic CD's object layout format includes information for which time zone an object is placed in and a secondary subtype, neither of which are supported in Sonic 2. The time zone stuff could be worked around easily, IMO, but the secondary subtype isn't.