don't click here

SonLVL

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

  1. MoDule

    MoDule

    Tech Member
    327
    24
    18
    Procrastinating from writing bug-fix guides
    I've run into a bit of a problem when trying to rearrange tiles through drag-and-drop with the 2pcompat flag set.

    In the attached example, I've swapped tiles 4 and 6 on an otherwise unmodified EHZ. While it looks like they've been swapped just fine under the tiles tab, selecting either one will show the original tile in the art editor. In other words, the tiles weren't actually moved. Also, tile 2 somehow got messed up in the process, even though I never touched it.

    I can get around this by deactivating 2pcompat and moving the 8x16 tiles as two separate 8x8 tiles, but it's not exactly comfortable...
     

    Attached Files:

  2. Cioss

    Cioss

    Member
    10
    1
    3
    France
    i'm trying to import this background into labyrinth zone, however it comes out crusty and tiles are broken, is there a way to opimise the amount of tiles created? or is there an alternative way to not have it broken?
    0.png (i dont have the broken bg screenshot sadly, however it uses other art tiles from the level, like the conveyor belt and such)
     
  3. Spicy Bread SSR

    Spicy Bread SSR

    You can call me Mal if you like Member
    10
    7
    3
    Is there a way to alter the Sonic 2 animated blocks in SonLVL? I made the OOZ Pulsing balls use PAL2 in game, and there's clearly a file that outputs the animated tile block onto SonLVL (AnimatedBlocks.bin), but no way to alter the files from my knowledge. And yes, I know that altering said files wouldn't effect the in game version like Sonic 1 and 3k, it's just that having the option would be nice
     
  4. Huh. So SonLvL just suddenly decided to delete itself off of my computer again. This is 2 times now. Anyone know what's up?

    Edit: looks like my computer thinks it's a virus, when I've been using it just fine until now. I'm trying to download it again, but the only links are a loop between MainMemory's site and Sonic Retro. No downloads are working :/
     
    Last edited: Sep 9, 2021
  5. Brainulator

    Brainulator

    Regular garden-variety member Member
    I personally have the same problem. My antivirus sees it as malware and refuses to let it install.
     
  6. Hivebrain

    Hivebrain

    Administrator
    3,047
    154
    43
    53.4N, 1.5W
    Github
    I re-added SonLVL INI files to my disassembly:

    https://github.com/cvghivebrain/s1disasm/tree/main/SonLVL INI Files

    Because I'm using ASM and macros more extensively, I couldn't load object positions, start positions and sprite mappings from the disassembly itself, and had to load them from the INI folder instead.

    I made a few improvements to the object defs (which I have to say is quite a fiddly process). Someone might want to copy them over to the Sonic Retro Github.

    • Fixed Batbrain and shooting Newtron which used the wrong palette.
    • Added GlassBlocks.xml for MZ.
    • Added ChainStomper.xml for MZ (I had to edit the mappings to get spikes to show up properly).
    Is there a way to draw a rectangle on a sprite using xml? I'd like to add a visual indication to how moving blocks move.
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    There is support for line drawing within the <Display> section:
    Code (Text):
    1. <Line color="4" x1="-10" y1="-10" x2="10" y2="-10" />
    2. <Line color="4" x1="10" y1="-10" x2="10" y2="10" />
    3. <Line color="4" x1="-10" y1="-10" x2="-10" y2="10" />
    4. <Line color="4" x1="-10" y1="10" x2="10" y2="10" />
     
  8. Hivebrain

    Hivebrain

    Administrator
    3,047
    154
    43
    53.4N, 1.5W
    Github
    Code (Text):
    1.  
    2.   <Display>
    3.     <DisplayOption>
    4.       <Condition property="Movement" value="Large"/>
    5.       <ImageRef image="img2"/>
    6.     </DisplayOption>
    7.     <DisplayOption>
    8.       <Condition property="Movement" value="Down -> Up slow"/>
    9.       <ImageRef image="img1">
    10.         <Offset X="0" Y="-48" />
    11.       </ImageRef>
    12.       <Line color="4" x1="-32" y1="48" x2="32" y2="48" />
    13.     </DisplayOption>
    14.     <DisplayOption>
    15.       <ImageRef image="img1"/>
    16.     </DisplayOption>
    17.   </Display>
    18.  
    Do I have this right? I'm not seeing a line. I'm also not sure what color="4" would mean.
     
    Last edited: Apr 3, 2022
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Oh. Turns out I never actually implemented the part where it draws the lines, oops.
    The color, for what it's worth, is from the 256 color palette used to display the level. 0-63 are the four regular palette lines.
     
  10. Hivebrain

    Hivebrain

    Administrator
    3,047
    154
    43
    53.4N, 1.5W
    Github
    One more question: How do I use xflip/yflip as display conditions? Some objects use those bits for things besides flipping the sprites.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Code (Text):
    1. <Condition property="XFlip" value="True" />
    You'll probably also want to put
    Code (Text):
    1. xflip="NeverFlip"
    on the ImageRef element.
     
  12. Brainulator

    Brainulator

    Regular garden-variety member Member
    Good news here; as of yesterday, Bitdefender no longer sees SonLVL as a virus, so I can actually use it now!
     
  13. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    806
    200
    43
    Lyon, France
    Sonic 2 Long Version
    I have been using SonLVL a lot recently (S2 levels). There is something very annoying that happens when you import new blocks / chunks from PNG. Graphically identical blocks or chunks are duplicated because of other parameters not matching the default: chunk solidity, block prority flags, block collision indexes. Let's explain with an exemple on blocks:
    1. Import chunk #1: block #1 is created automatically.
    2. Change priority and collision indexes of block #1.
    3. Import chunk #2, which also contains block #1: new block #2 is created, same as block #1 but with default priority (low for all 4 tiles) and collision indexes (00).
    What is expected here is that when you import chunk #2, no new block is created and block #1 is reused.
    Another example with chunks:
    1. Import chunk #1.
    2. Change chunk solidity data.
    3. Import chunk #1 again: new chunk #2 is created with default chunk solidity data (not solid everywhere).
    IMO, this is a duplicate of chunk #1 and chunk #2 shall not be created.
    I think chunk solidity, block prority flags and block collision indexes shall not be taken into account while importing from PNG and matching existing blocks and chunks. Or at least, make it an option somewhere.
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    That's a little complicated, as the importer can in fact import collision and priority data using additional images, but I'll see if I can make something so it doesn't account for that when that info isn't provided.
     
  15. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    806
    200
    43
    Lyon, France
    Sonic 2 Long Version
    Ho, I was not aware of that feature! I just saw the option in the "Export" menu... This is pretty cool.
    Still, as you say, when the info is not provided (option not enabled perhaps), it will be better to not take collisions and priority into account.
    Anyway, thank you for your awesome work.
     
  16. Bobblen

    Bobblen

    Member
    373
    187
    43
    I was wondering if it's possible to use the functionality to edit Sonic CD PC 1995 levels in the latest version? I can see from the SonLVL.ini for this game that only PPZ1 is supported, but the list of required files is far longer than what I can see in the R1/11A folder in my copy of Sonic CD. Is there a tool somewhere which extracts the additional required files?

    Fully aware that this is an experimental feature, I just enjoy mucking around with this stuff!
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Yeah, if you use Stealth's ROMulan tool, it can extract the data from the game. However, by default the program also converts the game's formats to match with the other games, which SonLVL doesn't need, so you may want to edit the script so it only extracts data without converting.
     
  18. Bobblen

    Bobblen

    Member
    373
    187
    43
    Thanks @MainMemory , it took a bit of fiddling with the Romulan script to work out which files corresponded to their SonLVL equivalents (and as you said, to shut down the post processing that Romulan does) but I got something working in the end. I'm going to assume the misaligned object graphics is my doing I think!
    upload_2023-4-20_11-5-46.png
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    No, the definitions are just broken.
     
  20. Bobblen

    Bobblen

    Member
    373
    187
    43
    Not to worry, anyone who wants to keep their sanity would be wise to use SonLVL-RSDK to mod the Taxman version instead. I just get a kick out of changing things in the version I first got my hands on when I was a kid!

    Given that Romulan seems to spit out files for every level, I could throw together some basic definitions for additional acts beyond PPZ1A and see how SonLVL gets on with them.