SonLVL

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

  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    SonLVL can import palettes from an image, either by taking the palette from an indexed color image or by reading 8x8 squares of color (really just every eighth pixel). Right click on the square in the palette where you want the import to start.
     
    LordXernom likes this.
  2. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    So I just have to line up all the colors I'll need in the image in the upper right corner, and let the palette import work its' magic? It'd be convenient if there were an option for it to search out all the distinct colors in the image, but I imagine that would be really annoying to code, so don't feel obligated to change anything if you feel it's not necessary. Thanks for the tip :3

    EDIT: After carefully examining your post further, you say that it only reads every 8th pixel, meaning that if I wanted to create a proper palette, I'd have to do it in 8x8 squares of color, or something similar. Is it possible to add an import function that just takes a line of single pixels as its' colors? That would be great :D
     
    Last edited: Jul 11, 2016
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    That should be a feature of your image editor. Besides, how does SonLVL know which color you want where? You could end up with the transparent color (if there is one) as the fifth color in the palette. Granted an image editor could do the same thing, but it just doesn't care at all what order your colors are in.
     
  4. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I've added GetArt.NET to the updater, and fixed SpriteSheetGen's center-point calculation. I've also made a new tool: SpritePlotter.NET. Yes, once again taking one of MarkeyJester's tools and making my own version, with SonLVL's API and extra features (though the script support is missing from mine). SpritePlotter.NET has a few features over the original:
    • PNG/GIF/JPG support
    • support for indexed color images
    • outputting to binary or ASM with macros (not that anyone besides me uses the macros)
    • automatic art compression
    • multiple palette lines (though using multiple lines within a sprite is inadvisable, unless you know exactly where the tile divisions are going to be)
    • layering high and low priority sprites
    • specifying the center point of each sprite via an image like the one SpriteSheetGen creates
    Unlike the original, SpritePlotter.NET is a purely command-line tool, so you should definitely read the help (just run the program without arguments).

    Special thanks to MarkeyJester for (repeatedly) explaining to me how Sprite Plotter works.
     
  5. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I'm having a very odd issue with SonLVLs' import chunks from image feature that I can't reasonably explain. A couple months back, I decided to create some custom chunk artwork and add it to my level. However, although I had designed the art to work with palette line 3, some of the blocks used similar colors from palette line 2, even though exact, spot on colors existed in the third palette line. Normally, this wouldn't be too much of a nuisance, but the level in question has rotating palettes on the second line, resulting in specific pieces of my artwork flashing unintentionally.

    After trying to re-import (which didn't help), I decided to just leave the issue and work on other things. However, now that I've come back to it, I've found that not only does the issue still exist, it's worse then I thought. In an attempt to force the art to import to palette line 3, I completely filled the second palette line with the same shade of hot pink, which does not appear in my artwork in any way, shape, or form. However, it still uses the second palette line in various places, despite the fact that the artwork ends up entirely pink :eek:.

    Here's the pic I'm trying to import:
    [​IMG]

    And this is how it imports into SonLVL:
    [​IMG]

    I've attempted saving, restarting, deleting all previously ported chunks/blocks/tiles and re-importing, restarting SonLVL, using the latest update...

    I'm out of ideas :(

    EDIT: On further inspection, the tiles have multiple different "colors" in them, mapping out where the other colors in the art would have gone... If it were not all pink :I
     
    Last edited: Jul 18, 2016
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Can you give me the palette for the level?
     
  7. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
  8. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    To be honest, I'm not entirely sure what was going on, but I seem to have fixed it, and an error in SonLVL's post-import checks that made it unable to import if the number of existing chunks/blocks/tiles plus the number of new chunks/blocks/tiles were equal to the maximum count.
     
  9. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    It works just fine for me now, thanks for helping :D
     
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I've updated GetArt.NET and SonLVL to better handle importing from non-paletted images when there are multiple palette lines (which Pacguy already knows).
    I've also added a feature to SonLVL that allows you to import an image over an existing chunk/block/tile. This feature will only replace the contents of the tiles used in the selected item, not any properties in blocks, it won't optimize art, and any tiles that are reused multiple times in a chunk/block will only use the first imported tile.
     
  11. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    EDIT: Nevermind, "dc.w Map_Sonic-Map_Sonic" makes SonMapEd freak out.
     
    Last edited: Jul 24, 2016
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    More updates:
    • Improved collision picture drawing.
    • Reduced flicker in chunk/block/collision pictures.
    • Fixed support for XML definition subtype without image.
    • Made collision overlay on block image white, instead of yellow.
    • Added support for custom object formats.
    Adding a custom object format is much like a custom ring format: add lines for objectfmt=Custom, objectcodefile=CustomObject.cs, and objectcodetype=CustomObject.CustomObject. Your file must define a class that inherits from ObjectLayoutFormat, which in turn will refer to a class that inherits from ObjectEntry. Examples can be found in SonLVL's source code.
     
  13. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    I don't know whether you take suggestions for features, but the one thing that stops me using this over SonED 2 is the fact I have to operate 3 tabs for editing zone art. I'm not keen on having to open the tile editor to edit tiles, to then switch to the blocks editor to piece them together, to then have to open the chunk editor to piece those together. I much preferred how SonED had it all within a single window which meant I could fit parts together quickly as I was building zones. Is there any way you can make an option to put all 3 editors together in a single window, like how SonED 2 handled it, or is that too much work to get working?

    Also, I'm not a fan of having the editor automatically place a tile under the current cursor when I select one. It's led to me accidentally overwriting a tile in the chunk editor when all I want to do is select one for placement. Left clicking a tile to just select it ready for placing I feel would be much better, and then placement could be handled by left clicking in the chunk like it currently is.
     
    LordXernom, Pacca and FireRat like this.
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I cannot conceive of how one would be able to fit all of the edit controls onto one page. For the speed problem, have you considered the art importer? If you do it right, you can import chunks with priority and collision settings, or even entire sections of layout.

    As for your selection/placement issues, if you're referring to the block list on the chunks tab, that exists solely for the purpose of editing the block index of the selected chunk block(s).
     
  15. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    [​IMG]

    I've had a think about a layout, having looked at the options you have available on each tab, and I think something like this could work. One of the things I notice with the editors is that there seems to be a lot of space waste. The size of the 8x8s and 16x16s in their respective displays is a lot bigger than it really needs to be. As long as each is visible to the point where they can be worked with, then that is sufficient. SonED 2 does display the 8x8s too small which makes it a pain to able to see what they are at times. In this mockup, I reduced the 8x8s to half of their size, and applied the same to the 16x16s. This leaves a large amount of space on the right (in the blue square) which could be used to display the 128x128 (or 256x256) list. Again, they don't need to be full size displays, just good enough to be able to see a representation of the tiles. For the options regarding the tiles and chunks, these can be placed on the left hand side along with the block editor. There should be adequate space there for the 8x8 editor, and possibly a chunk editor. You may need to play with the positioning of the tile display windows, and you may even be able to put their respective editors in the empty spaces I marked with the arrows. Again, this is just a suggestion. When all is said and done, I don't know how feasible this is and it's your program after all, but I think in its current state, it's taking me longer to perform basic art edits than in SonED 2, and as I'm often stuck for time, it's quite a big deal for me.

    Regarding the auto-placement, I will try to clarify my issue. As you can see on the enlarged block view, the top left tile is the selection and has a faint white box around it. Now, what I want to do is change the bottom right tile. The way it is now, I have to right click that bottom right corner before clicking the tile I want to replace it with, because if I just left click the tile I want to use as the replacement tile, the top left one will be overwritten. This feels a bit backwards to traditional editors, where you would select your tool (or in this case, your replacement tile) before drawing it into the piece. In that respect, I feel it makes more sense to left click the replacement tile first to select it, and then left click in the enlarged version to place it where I want it. There have been a few instances while playing about with this where I have been trying to quickly build blocks up and have been overwriting tiles I didn't want to, just because I was forgetting to move the cursor before selecting a tile. It started to become a bit of a pain.

    Anyway, those are just my thoughts, what you do with your program is ultimately your choice. Nice tool anyway, some decent features in there which could be useful.
     
    TheStoneBanana likes this.
  16. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    If I do this, it won't be possible to change the block index of the current chunk block(s) by selecting a block visually.
     
  17. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Fair enough, not to worry, it was just a thought. I've still got SonED2 I can use for my art editing and I can use SonLVL for any importing, object editing and such, so it's not too bad.
     
  18. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I suppose I could just work around that "issue" by adding a double-click action in the block list to change the block index in the current chunk block. (How many words can I attach to "block" and still understand what I'm saying?)

    Once I finish a few things I'm doing right now, I'll make a branch of SonLVL and try to squish all the art editors into one tab. If I succeed, I'll post a temporary build for people to try, and if enough people like it, then I'll merge it to the master branch.
     
    StephenUK and LuigiXHero like this.
  19. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    That's great, thanks for taking the time to look into this. Believe me, it's very much appreciated.
     
  20. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    This layout won't work, it'll be way too tall if I stack all the editors vertically like that (the chunk editor alone is already really big). I could stack them horizontally, but then it'd be way too wide with all the lists there too. I could do like SonED2 and put all the lists into the same space with a tab system, but I don't know if that would even be worth it at that point.