Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    Then you forgot to do the yellow outline thing, look at my previous post. With the images.
     
    Last edited: Sep 6, 2016
  2. NiphFM

    NiphFM Host of the Mega Drive Music Contest Member

    Joined:
    Jun 5, 2015
    Messages:
    430
    Location:
    Music Plant Zone
    I have done the yellow outline for the loops, and it works when I move the levels affected to a separate disasm, but it's still giving me a hard time...
     
  3. GenesisDoes

    GenesisDoes What Nintendont Member

    Joined:
    Jan 2, 2016
    Messages:
    159
    Location:
    Pittsburgh, PA
    Has anyone ever mass imported 256x256 chunks from images into SonLVL for levels? I got a method mostly down for properly setting up the chunk images to be converted into 4bpp and imported properly into the level with the level's palette. The problem is, however, upon importing of the processed chunk art files, I keep getting dithering of random dots in 16x16 blocks for some levels which have a lot of graphical activity, which causes SonLVL to freak out and creating a lot of similar (but not exact) duplicates of blocks (due to the random pixels). In the level I am trying to import, the 16x16 blocks which have brick art cause the problem. By the time I am done importing act 1's art, I nearly max out the $400 blocks limit, and by 1/4 through act 2's chunks, I max out.

    Bad.png
    0C.png

    What am I doing wrong in my process (below), and are there any better methods or software to convert the images into 4bpp with palettes? I heard RetroGraphicsToolkit recently got LUA support and a command-line based "headerless mode" which could be used for batch processing of images, however, I need to crawl through the vague documention and learn how to setup a batch script with it.

    My method:
    • Notes
      • Chunk images are 256x256 24bpp png files. Only processing FG chunks for now.
    • Steps:
    1. Setup the palette in SonLVL for the FG & BG layers (pal lines 3 & 4).
    2. Use PCXPal to convert the FG and BG palette lines from the level's MD palette file into 2 separate, single palette line JASC pal files, one for each layer
    3. Using IrfanView 32-bit, use the batch conversion feature to convert all of the chunk image's color depth to 4bpp png files and save the art files into another folder.
      4bpp.png

    4. Copy the FG JASC palette file from Step 2 into the folder from Step 3

    5. Create a batch file with the following command in the folder from step 3, and run it.
      "i_view32.exe *.png /import_pal=FG_Jasc.pal /convert=C:\temp\*.png"
      This converts the 4bpp chunk art files from Step 3 to have its scrambled palette to be properly aligned with the level's MD palette (FG_Jasc.pal), and places the properly processed files into "C:\Temp" folder

    6. Import the chunks art files from Step 5 into SonLVL. The 16x16 block's tiles will be set onto palette line 1, but have the proper palette indices. Modify all 4 tiles in the blocks to be on palette line #3, and the colors will be correct (although with the mysterious dithering)
     
  4. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    I don't think SonLVL has the ability to dither and it may come from IrfanView. I also think you should try copying all your chunk files into one image and then working with it from there. That way you can use the editor to work with all the chunks at the same time instead of resorting to using batch files. Another thing is that I don't understand why palette line 1 is used. Even when import something with an assigned palette to SonLVL, it uses the most appropriate palette line. If it has to do with important an image with more than 16 colors then either just add 32 (or is it 31?) filler colors at the beginning of the palette or just use no palette line at all.
     
  5. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    SonLVL does have an option to export a JASC-PAL for individual palette lines or the entire palette, so using PCXPal is not necessary.

    When importing 4bpp images, SonLVL automatically sets the blocks' palette index to whichever line contains the currently selected color in the palette editor. So if you want to import images to palette line 3, have a color on line 3 selected before importing.
     
  6. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    basicly lately I decided to work on trying to make the rings in sonic 1 have more frames. I add a few more tiles to the ring animation so I had to move the ring's location in the vram to a place with more space and I did. basicly right now the ring it self works great and does not get over written in the normal stages. however in the special stages the rings won't load it's art since it gets over written by the other special stage art. I do not know what to do about this. is there a way I can I can change the ring's tiles location when entering a special stage or maybe there is a much better method of doing this? I am not sure
     
  7. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    You could easily just free up VRAM in the special stage by getting rid of the unused ZONE blocks, the W block, and the 1-Up block in the PLCs.
    From there, you'll have plenty of room to put your rings.
     
  8. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    ok, but my main problem is that I don't know how will I change the ring's location when entering the special stages to that location
     
  9. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    EDIT: Nevermind.
     
    Last edited: Sep 9, 2016
  10. GenesisDoes

    GenesisDoes What Nintendont Member

    Joined:
    Jan 2, 2016
    Messages:
    159
    Location:
    Pittsburgh, PA
    Confirmed that my issue was with Irfanview's decrease color depth feature (it doesn't have any direct color dithering algorithms, which was what I needed to process the chunks). Used RetroGraphicsToolkit and its direct color algorithms to properly dither each chunk file to the FG palette, and then exported out the processed chunk art files to 4bpp paletted chunk files. They import perfectly into SonLVL without random dither pixel like before
     
  11. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    I can't seem to figure what is the special stages vram location. sorry if this sounds to basic
     
  12. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    You are incorrect. Special stages don't use Obj25 for rings. In fact, it doesn't use a standard object for rings (or any of the other items, really). The only actual object that is used is the Sonic object for special stages, which helps control how the special stage works.

    What you actually need to do is go to "Special Stage Mappings & VRAM Pointers.asm" in the _inc folder and change all the VRAM locations under every "dc.l Map_Ring+XXXXXXXX" to the location you want (well it's not really a VRAM location, it's the tile ID + $2000 to make it use the second palette line).

    After that you just need to load the rings in the special stage PLCs to the location you want. Remember to reload the rings back to the VRAM location for the levels when you go back to a level.

    If you're looking to find a location, you can always overwrite unused art. Find the location in the special stage for something unused and divide it by $20 to get the tile ID.
     
    Last edited: Sep 9, 2016
  13. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Oh. Sorry then, @Baraksha.
    I actually didn't know that the Special Stage had its own ring handling, so I guess you do learn something new every day!
     
  14. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    omg i'm so stupid, this whole time I kept looking inside "Pattern Load Cues.asm" and didn't though of looking at the other files inside _inc.

    EDIT:
    ok, so it did seem to change the location of where it loads the rings from, but I still don't know how do I make it load the rings art in that location

    EDIT 2:
    oops, didn't fully read your post there, well I am not sure where is the special stage PLCs.
     
    Last edited: Sep 9, 2016
  15. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    You go to "Pattern Load Cues.asm" in the _inc folder. The PLC list for the special stage is called PLC_SpecialStage.
     
  16. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    @Baraksha

    You can also use this guide to free up a ton of vram.

    It doesn't tell you how to edit the tiles for the guide though, so I recommend grabbing the special stage wall art from ReadySonic.
     
  17. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    actually I noticed this guide myself before asking my question, and i'm planing to do that.

    I also got another question, after I made some level design changes in SonLVL I somehow caused the tiles for the giant ring's shine to not apear, I am not sure how they got over written or not, but they seem mixed with the chameleon enemy's tiles

    and one more thing @Ralakimus I am not sure what I need to do here, I see the special stage plc's, and I don't see anything in it regarding the rings. do I need to add in the ring's plc's myself?
     
    Last edited: Sep 9, 2016
  18. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Yes, he's telling you to add to it.
     
    Soldaten likes this.
  19. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    Ummm, I tried, and it didn't work. Just to confirm this is what I did.
    upload_2016-9-9_15-29-37.png
    I also changed the value above from $10 to $11
     
  20. Sheeracali

    Sheeracali Newcomer Trialist

    Joined:
    Sep 4, 2016
    Messages:
    9
    I have a couple questions regarding sonlvl and the level converter. I'm fairly new with sonlvl and I have everything pretty much figured out except how to import a level converted with LevelConverter. I also wonder why in S3K only a few objects show up. Do I have to add definitions somewhere? Thanks