don't click here

SonLVL

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Feb 7, 2011.

  1. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Ah. That explains it then. I'll await the update.
     
  2. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Vital double post. I've found an error with the DPLC converter that can spell trouble for anyone who uses it.

    In a Sonic 1 disasm, I converted "Sonic - Dynamic Gfx script.asm" to .bin format. Here is a BEFORE and after of what I got.

    FIRST DPLC REQUEST - BEFORE (WHILST IN ASM FORMAT)
    Code (Text):
    1.  
    2. SonPLC_Stand:   dplcHeader
    3.     dplcEntry   3, 0
    4.     dplcEntry   8, 3
    5.     dplcEntry   3, $B
    6.     dplcEntry   3, $E
    7. SonPLC_Stand_End
    8.  

    FIRST DPLC REQUEST - AFTER (CONVERTED TO .BIN)
    Code (Text):
    1.  
    2. 04 30 00 80 03 30 0B 30 0E
    3.  
    The above converted .bin is incorrect. The output should be as follows:
    Code (Text):
    1.  
    2. 04 20 00 70 03 20 0B 20 0E
    3.  
    The nybbles that were changed, are the number of tiles to load - 1... the conversion is leaving that variable as is, and NOT subtracting 1... resulting in 1 extra tile loaded for EVERY request when this is applied to your hack.

    Now, converting my new tainted DPLC back to ASM (w/ Macros) format, does NOT result in any kind of bug, as you can see below.

    BEFORE (BIN)
    Code (Text):
    1.  
    2. 04 30 00 80 03 30 0B 30 0E
    3.  
    AFTER (ASM)
    Code (Text):
    1.  
    2. SonPLC_Stand:   dplcHeader
    3.     dplcEntry   4, 0
    4.     dplcEntry   9, 3
    5.     dplcEntry   4, $B
    6.     dplcEntry   4, $E
    7. SonPLC_Stand_End
    8.  
    That result is technically correct, as the .bin is supposed to give that kind of output... so the error is with converting from ASM to .BIN... I only tested with ASM to BIN for Sonic 1... so the others might need double checking as well.
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I've uploaded a new version of the MappingsConverter set that fixes the problem.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I've just released SonAni, an animation editor, via SonLVL's updater. Its setup is similar to SonLVL in that it reads an INI file with entries for multiple animation sets.
    Here's an example I used for testing because the animation set was already split to a separate asm file and the mappings weren't merged with Super Sonic's:
    Code (Text):
    1. game=S3K ; can be any game SonLVL supports
    2. mapfmt=ASM ; one of: Binary, ASM, Macro
    3. dplcfmt=ASM
    4. animfmt=ASM
    5. [Knuckles]
    6. art=General/Sprites/Knuckles/Art/Knuckles.bin ; same format as SonLVL, supports multiple files
    7. artcmp=Uncompressed
    8. palette=General/Sprites/Knuckles/Palettes/Main.bin:0:0:16
    9. map=General/Sprites/Knuckles/Map - Knuckles.asm
    10. dplc=General/Sprites/Knuckles/Knuckles pattern load cues.asm
    11. dplcgame=S2 ; S3K players use S2 format DPLCs
    12. anim=General/Sprites/Knuckles/Anim - Knuckles.asm
    13. ; not shown: startpal=0 ; starting palette line
    Once you've opened the animation set, you can select an animation from the list on the left, or add a new one. Then you can change the animation's label and speed, click and drag to reorder frames, delete frames with the delete key, drag frames in from the frame list on the right, change what happens when the animation finishes, preview the animation, and export to GIF.
     
  5. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Love to finally see an animations editor! Can't wait to give it a go.
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Whoops I forgot half of the animation end types, redownload.
     
  7. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    I had an error with the SonAni app. Tried to post the code here. But you know what, here are the files in an RAR. This post editor is really starting to piss me off... I just spent 20 minutes trying to fix the code text so it wouldn't all be in one line. Fuck that.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Assuming you're using the most recent Sonic 1 disassembly, Sonic's animation file uses frame IDs, which SonLVL's ASM parser can't understand. There's an alternate version that doesn't use them, but even then you'll lose all the animation IDs in the ASM when you edit it, so you'll have to add those back every time.
     
  9. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Ok. I'll try again but I got a similar error when using files for the Yadrin badnik (random test subject). I'll report back after.
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    It seems that all the animation files at least use constants for the end flags, which makes SonLVL's parser unable to read them. I guess I'll have to hardcode those in.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    The .NET Framework's default settings system was causing problems for a Linux user, so I have switched SonLVL to storing settings in an INI file. All the settings will be imported from the old file if SonLVL.ini doesn't exist in the program's folder.
     
  12. Andrew75

    Andrew75

    Technical Artist Member
    2,030
    107
    43
    Project AXSX(Sonic Xtreme) + Misc Projects
    Any way to export level chunks with their given names? instead of 1 2 3 4 5 ect ?
    looking for names like 5E 5F ect ect
    Also any plans for exporting the collision solids along with proper names?

    Edit: hmm I have another feature request when editing levels using the forground or background editor, would it be possible to show the chunk names when hovering over the chunks to be selected (or perhaps are already selected?) on the map editor interface.
    If a floating pop up isn't posible, maybe as a log entry or on the toolbar somewhere?
     
  13. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    808
    201
    43
    Lyon, France
    Sonic 2 Long Version
    Another request (if possible): if you delete a chunk or insert a new one that is not at the end of the chunks list, this should update all acts level layouts of your current zone. For now, this only updates the act you are currently editing, and scrambles the other acts of the zone entirely.
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I've thought about that for a long time, but I've never been able to figure out how to make it work. I suppose the only real solution would be a list of extra layout files for each level which would all be loaded and modified when the chunk list changes.

    SonLVL Update:
    All View and Export settings are now saved. The current tab, window mode (normal, maximized, fullscreen) and menu visibility are also saved.
    Added ability to export only collision of blocks and chunks, ability to export solidity maps, and ability to export files with hexadecimal indexes.
     
  15. Andrew75

    Andrew75

    Technical Artist Member
    2,030
    107
    43
    Project AXSX(Sonic Xtreme) + Misc Projects
    Perfect ! thanks a lot ! I'll put it to good use !
     
  16. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    Is there, or will there ever be, support for user-definable S2-style layout row sizes? I'm currently using a hybrid S1-S2 layout format in my hack, which is mostly S2, but with a row size of $40 bytes/chunk entries, over Sonic 2's $80, this following Sonic 1's background/foreground interlacing pattern. Understandably, SonLVL is having none of it.
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    There already is, actually. Place a C# or VB.NET code file in the ini file folder with a class that inherits SonicRetro.SonLVL.API.S2.Layout and override the MaxSize property. Then in the ini, add layoutfmt=Custom, layoutcodefile=CustomLayout.cs, and layoutcodetype=CustomLayout.CustomLayout.

    The code would look something like this:
    Code (Text):
    1. namespace CustomLayout
    2. {
    3.     public class CustomLayout : SonicRetro.SonLVL.API.S2.Layout
    4.     {
    5.         public override System.Drawing.Size MaxSize { get { return new System.Drawing.Size(64, 16); } }
    6.     }
    7. }
     
  18. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    There appear to be some errors in your S1 Git INIs:


    In both revisions, the ending uses

    Code (Text):
    1. tiles=artnem/8x8 - GHZ1.bin|artnem/8x8 - GHZ2.bin
    When it should use

    Code (Text):
    1. tiles=../artnem/8x8 - GHZ1.bin|../artnem/8x8 - GHZ2.bin

    In REV01, LZ3 calls for:

    Code (Text):
    1. fglayout=../levels/lz3 (JP1).bin
    But there's no such thing. According to the bit-perfect REV01 builds, REV01 uses REV00's. So at some point the JP1 file was removed without the INI being updated.



    EDIT: Just noticed, you must have meant to put the "(JP1)" on this line:

    Code (Text):
    1. objects=../objpos/lz3.bin
    Since there exists a JP1 variant of the file that isn't used in the REV01 INI.
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Thank you for pointing that out, the issues have been fixed.
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I have completely overhauled the editors for chunk blocks and block tiles:
    [​IMG]