SonLVL

Discussion in 'Utilities' started by MainMemory, Mar 29, 2011.

  1. Novedicus

    Novedicus Peace is better than chicken and rice Member

    Joined:
    Aug 26, 2013
    Messages:
    910
    Is it possible to include DPLC data (in ASM format) in an XML file? I attempted to use dplcfile, but it just results in an error describing that there's an invalid index in a source array.
     
  2. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    The DPLC file must be in the same format as the mappings file.
     
  3. Novedicus

    Novedicus Peace is better than chicken and rice Member

    Joined:
    Aug 26, 2013
    Messages:
    910
    Both the mappings and DPLCs are in ASM format.
     
  4. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    I'm not sure what the problem would be then, other than a bug in the parser, an invalid frame number, or if you're using S3K mappings with S2-style DPLCs.
     
  5. Novedicus

    Novedicus Peace is better than chicken and rice Member

    Joined:
    Aug 26, 2013
    Messages:
    910
    What do you exactly mean by that? Aren't S2 and S3K DPLCs the same format or are you referring to how the S2 disassembly uses binary mappings?
     
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    No, S3K has two types of DPLCs, the ones used by the player characters (and possibly something else) which are identical to the format used by Sonic 2, and ones used by other objects which use a brand new format. SonLVL defaults to the object format in S3K, you need to specify dplcver="S2" to use the player format.

    If you're wondering what the differences are, S2 has a range of 0-65535 entries per frame, while S3K has a range of 1-65536 entries per frame, and S2's entries have the tile count in the first four bits, while S3K's have the count last.
     
  7. Novedicus

    Novedicus Peace is better than chicken and rice Member

    Joined:
    Aug 26, 2013
    Messages:
    910
    And that fixed it for the XML file, so, thank you!

    However, one more problem. I did the same for the INI file since certain objects would not show up, and out of the three I defined, only one actually worked. The others just spit out the same error as before.

    Code:
    System.ArgumentException: Source array was not long enough. Check srcIndex and length, and the array's lower bounds.
       at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
       at SonicRetro.SonLVL.API.LevelData.ProcessDPLC(Byte[] artfile, DPLCFrame dplc) in C:\Users\Devon Artmeier\Documents\SonLVL-Owari\SonLVLAPI\LevelData.cs:line 2082
       at SonicRetro.SonLVL.API.LevelData.MapFrameToBmp(Byte[] art, MappingsFrame map, DPLCFrame dplc, Int32 startpal, Boolean priority) in C:\Users\Devon Artmeier\Documents\SonLVL-Owari\SonLVLAPI\LevelData.cs:line 2095
       at SonicRetro.SonLVL.API.ObjectHelper.MapDPLCToBmp(Byte[] artfile, Byte[] mapfile, EngineVersion mapversion, Byte[] dplc, EngineVersion dplcversion, Int32 frame, Int32 startpal, Boolean priority) in C:\Users\Devon Artmeier\Documents\SonLVL-Owari\SonLVLAPI\ObjectHelper.cs:line 36
       at SonicRetro.SonLVL.API.ObjectHelper.MapASMDPLCToBmp(Byte[] artfile, String mapfileloc, EngineVersion mapversion, String dplcloc, EngineVersion dplcversion, Int32 frame, Int32 startpal, Boolean priority) in C:\Users\Devon Artmeier\Documents\SonLVL-Owari\SonLVLAPI\ObjectHelper.cs:line 70
       at SonicRetro.SonLVL.API.DefaultObjectDefinition.Init(ObjectData data) in C:\Users\Devon Artmeier\Documents\SonLVL-Owari\SonLVLAPI\ObjectDefinition.cs:line 530
    My DPLCs looks like this:
    Code:
    ; --------------------------------------------------------------------------------
    ; Dynamic Pattern Loading Cues - output from SonMapEd - Sonic 3 & Knuckles format
    ; --------------------------------------------------------------------------------
    
    SME_4L7nY:  
            dc.w SME_4L7nY_2-SME_4L7nY  
    SME_4L7nY_2:    dc.b 0, 1, $F0, 0  
            even
     
    Last edited: Nov 8, 2018
  8. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    Well assuming you've set that to S2, the only other thing it could be is that there aren't enough tiles in the art file to cover the range used by the DPLC.
     
  9. Novedicus

    Novedicus Peace is better than chicken and rice Member

    Joined:
    Aug 26, 2013
    Messages:
    910
    Yeah, it turned out my DPLCs were shite. Thanks SonMapEd!
     
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    So thanks to @Samey, the project files for the S1 2005 disassembly have been updated and are not only fully compatible with the current version of SonLVL, but they've been updated so they have all the same information as the GitHub disassembly's project files.
     
    Samey, Calvin, EMK-20218 and 2 others like this.
  11. TheFieldWarrior

    TheFieldWarrior Well-Known Member Member

    Joined:
    Oct 9, 2015
    Messages:
    91
    Location:
    United Kingdom
    So I decided to do some level editing in Sonic 2 but there are missing object definitions now, the bridge in Emerald Hill, the path swaper and the twisting pathway object are the biggest examples of this though I did check other levels and most of them have a least 1 missing object definition, also in Sky Chase the Balkries and Turtleroids are silhouetted out.

    I think all of this has something to do with my attempt to download an update for SonLVL which failed and gave me a "Can't download file" message

    EDIT: I just had to download the new Sonic 2 Git INI files, I only just noticed that the Shellcracker doesn't have art but it has it's name listed and the Balkries and Turtleroids in SCZ are still silhouetted out. Is there a way I can add the art for these objects myself?
     
    Last edited: Dec 16, 2018
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    Shellcracker does have art. Balkrie and Turtleroid being black has been fixed.
     
  13. EMK-20218

    EMK-20218 Eduardo Knuckles Member

    Joined:
    Aug 8, 2008
    Messages:
    1,009
    Location:
    Jardim Capelinha, São Paulo
    Man, I have a suggestion for the games in general. I'm editing a level here and I'm confusing about which collision solids are being used and which ones aren't. Would by any chance be added a function that could check which ones are unused so that we could clear all the unused with just one click? I mean, perhaps in a way similar to the "Delete Unused" function that exists with tiles, chunks, and blocks, but just clearing the unused collision solids once the deletion of them isn't a good idea.
     
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    Um. Collision data is normally game-wide, so just clearing out anything that's not used in the current level would have an adverse effect on all other levels. I believe the Usage Counts window will show you which collision indexes are being used by the current level, if you really must know.
     
    Pacca and EMK-20218 like this.
  15. EMK-20218

    EMK-20218 Eduardo Knuckles Member

    Joined:
    Aug 8, 2008
    Messages:
    1,009
    Location:
    Jardim Capelinha, São Paulo
    Another little suggestion.

    Addition of a "Export selected chunk" option in this context menu, so we could straight export a specific chunk, tile or block to edit the same way as we can import instead of having to export the whole tileset for just edit a single chunk, block or tile. So we could edit it straight without to mess up the palette.
    [​IMG]
     
  16. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    789
    Location:
    Portland, Maine
    I second this. It would be great if you could export a selection, too. There were several times where I had to temporarily delete a background and replace it with some specific chunks so I could just export those chunks. It would be convenient to have a quicker way of doing that.
     
  17. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    It is done.
     
    ProjectFM likes this.
  18. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Can you add the option to import .pal files for palettes? I can't seem to find a way to convert a .pal file to an image that can be imported into Sonlvl without just doing it manually, which seems like a waste of time...
     
  19. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    857
    What kind of .pal file? YY-CHR .pal? JASC-PAL? Both? Something else entirely?
     
  20. MEGALOMANIA

    MEGALOMANIA Feel free to criticize me Member

    Joined:
    Aug 22, 2018
    Messages:
    58
    Location:
    Brazil Bad Future
    Besides I LOVING SonLVL, nothing is perfect, but I think it's like, 85% perfect for me.

    One of the things that it didn't looked good was some of the custom letters, so they're revamped now.
    btw, with all those years of SonLVL, I think it's kinda strange no one approached to help with this lil' issue. :^P

    Also, if someone else wants to use them as well, feel free to do so! ^u^
    Obviously, this was made by me.
    EDIT: if you're going to have some trouble by putting the new Q, don't worry, the original one isn't that bad either.

    upload_2019-8-20_21-41-30.png
     
    SMS Alfredo and MarkeyJester like this.