don't click here

SonMapEd (Sprite Mappings Editor)

Discussion in 'Engineering & Reverse Engineering' started by Xenowhirl, Dec 29, 2006.

Thread Status:
Not open for further replies.
  1. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    Get SonMapEd 1.05 here. Some peripheral features are missing or incomplete, but it's decently functional as it is. Read this for the basic idea of this program if you don't know what I'm talking about. No support for animations has been added yet, but one possible surprise is I added a ROM extracter dialog so you can load things (including compressed graphics) straight from a ROM, along with preset locations to choose from for certain ROMs as decided by the included offsets.txt file. You can use it with SMD format ROMs and locked-on ROMs too.

    I have no documentation for it, but familiarize yourself with the menus and you'll know most of the available commands. You should be able to do most things with the keyboard alone once you know the menu shortcuts well enough. Only the mouse-using commands for adding piecs or selecting tiles are not in the menu. To add a sprite piece, click on the start tile at the bottom, then click on a pattern on the top left. It will advance the appropriate number of tiles forward so you can usually add the next piece without choosing a tile again. Shift+Click to go backward instead of forward. Right click instead of left click to advance the selected tile without actually adding a sprite piece. Use the arrows keys (hold Shift for more precision) to reposition the active sprite piece. You can also select multiple tiles. Ctrl+Click selects or deselects multiple noncontiguous tiles, Shift+Click selects or deselects multiple contiguous tiles. There is no support for clicking on sprites or sprite pieces on the top-right, use their menu shortcut keys([] and ;') to move between them. There is no standard Undo, but there are emulator-style savestate slots to save or load the state of everything loaded in the program.

    I suggest pressing O after you load tile graphics to choose the orientation that looks clearest. To scroll up and down (or left and right) if the tiles don't all fit in the window, hold Ctrl+PageDn or Ctrl+PageUp. If you want to scroll less than a single tile (offset < 0x20) you can use the ROM extracter to load the graphics at a different offset. Everything in the "Transformation" menu applies context-sensitively to the selected sprite piece or to the entire sprite depending on if you have a single piece selected or the whole sprite, including movement and horizontal and vertical mirroring of the entire sprite.

    You can choose between binary or asm format for saving graphics, mappings, and dynamic reloading cues, simply by saving it with a .asm filename extension if you want it in asm format. Sonic 1/2/3K are supported for saving and loading, with experimental (read: probably broken) Crackers support. That means you can open a Sonic 3 sprite, change the mode to Sonic 1, and save as a Sonic 1 sprite, to get instant conversion between games. Palette rearrangement is also supported, with or without changing the image to match the new palette. You will have to remember to save each type of data file individually to the appropriate places after you make changes, there is no "save everything to where I loaded it from" feature. (However, you can approximate this by making a batch file to copy save state files to locations of your choosing.)

    If you've any questions on how to use it, that I didn't already answer, post them here.
     
  2. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    This is impressive. Really impressive.

    One feature that would be interesting to see would be seeing the animations running in a preview window.
     
  3. Cinossu

    Cinossu

    Administrator
    2,832
    44
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    Small problem, it seems that the Sprite Dynamic PLC support is a little messed up..

    [​IMG]

    The dPLC isn't in ASM format.
     
  4. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    I don't know what files you've loaded there (a Tails you have put in Sonic 1?) but Dynamic PLC does work for Sonic in Sonic 1, Sonic and Tails in Sonic 2, and Sonic and Tails in Sonic 3.
     
  5. Cinossu

    Cinossu

    Administrator
    2,832
    44
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    It's a set of mappings for Tails in Sonic 1, a dynamic PLC set for Tails in Sonic 1, and an artset too.
     
  6. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    I put together a set of files to load for Tails in Sonic 1 format: here. You could see how they differ from your own. [I initially cut off the tile data 0x20 bytes too early; re-download it if you see any red stripes.]

    [​IMG]
     
  7. CloverCC

    CloverCC

    Member
    So, Xeno, I take it that the s3k section is still being done, or something? Because it feels a bit incomplete. And as for everything else, It's awesome.
     
  8. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    Look in the offsets.txt file, it says it's incomplete (basically an example) and where that data came from. You are free to edit it to make it complete, I don't know where all the stuff in the S3&K ROM is.
     
  9. Cinossu

    Cinossu

    Administrator
    2,832
    44
    28
    London, UK
    Sonic the Hedgehog Extended Edition
    .. ha ha, realised the problem. I forgot I changed the dPLC format to the one used in Sonic CD/Sonic 2.
     
  10. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    Oh, okay. In that case you have to choose Sonic 2 mode before you load the dPLC, even if the other mappings are in Sonic 1 mode (you probably realized that too).
     
  11. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,611
    93
    Working on my art!
    So could I edit the Sonic 3 and Knuckles title screen art using this editor, or is that not functional yet? (No way in hell I'm going to edit art using TLP D:). If I could do that, that would come in handy for my hack (I want to not only change the wording on the title screen, but change the Sonic on the title screen from the one from Sonic 3 to the one from Sonic and Knuckles)

    untitled.PNG

    ORLY? Why is the Sonic 2 sign art showing in my S3&K ROM (While I do want to edit the sign so it did look like that, I didn't touch anything yet). Also, why can't you just save the ROM as it is. You have to upload it to the game or something. Annoying. Nice job on the program though.
     
  12. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    You can create sprite mappings for it to a new frame, then use Export Sprite, edit the full picture in MSPaint, then Import Sprite. If you can find sprite mappings in the ROM for it you don't have to create them, but there is possibly no sprite corresponding with the title screen art. It's more inconvenient if you don't have the sprite mappings, but this is a sprite mappings editor, not a non-sprite tile patterns editor.

    This is intended for use with a split disassembly, not for editing a ROM in place. The program can't save ROMs because it does not edit ROMs. The ROM import is sort of a bonus feature, to aid with moving stuff from another game into your disassembly. However, if you know what you're doing, you should have no trouble "uploading" data to the game after saving it in binary format.
     
  13. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    Something else I feel is missing is better control over the artwork - an excellent mappings editor would be able to swap sprites around with their corresponding artwork.

    That's probably not so clear, so I'll try to demonstrate: if you load the Sonic sprites from Sonic 1 you'll notice the four unused warping animations. Let's say I wanted to swap those for the Sonic 2 spindashing sprites, which number six. I can't at the moment easily cut out their art and remove it along with the corresponding sprites, nor can I easily import the spindash artwork and sprites from somewhere else (I'd have to edit the artwork file elsewhere and insert the art, then rebuild the spindash sprites from scratch as well as fix the other sprites if the number of art blocks turned out different between the two.

    It's also not clear what the program takes as input when formatting a sprite sheet as sprites.
     
  14. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    Sure you can. Delete Sprite, Select Unused Tiles, Delete Selected Tiles. You can insert new empty sprites in their place if you want the indexes of the following sprites to stay the same.

    If "somewhere else" is another Sonic game then simply append its art to the tile graphics (this feature is missing so just copy-paste in a hex editor) before using it to make mappings. If you only have a bitmap file of spindash images, that's what Import Spritesheet is for, but that feature is incomplete so you can instead append dummy tile data for your mappings and later use Import Sprite. Now to make the actual mappings, that's a click-click-done type of operation, especially for something as simple in shape as a spindash.

    I can think of some ways to make it marginally easier, but I'm interested to hear how you think this importing process should ideally work, what inputs you would like to be able to give to merge in the spindash.

    Why would you need to do that?

    Something like this, which becomes this. As you can see, it says "incomplete" for a reason.
     
  15. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    I was thinking more that when you hit Delete Sprite it automatically removes the tiles you haven't used.

    What if I don't want the art tacked on the end? I want my artwork to be as beautifully organised as when it's actually viewed ingame. I thought tacking things on the end of the file went out with disassemblies.

    Possibly some way of saving a mapping with its art as a coherent unit, so that you choose a tile and then import that mapping/art combo file - the art is inserted after the selected tile, the mapping is inserted after the current mapping and all the mappings have their art references changed to match.

    Remove 8 tiles from the middle of the file and put 17 tiles in their place. The tiles after those are now offset forward by 9 tiles, and the program doesn't account for that so all the sprites which use tiles after the edited ones are buggered.
     
  16. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    I wouldn't want it doing such a thing for me, but I see no harm in making it optional.

    It's already on my todo list, but I consider it a "peripheral feature", not necessary for anything. More important to me is being able to rearrange small groups of tiles to change what height of piece size they will fit inside, then maybe an auto arrange feature.

    It can't account for that when you do it manually, although I meant you won't run into that problem if you add them to the end. Deleting tiles correctly updates the tile numbers and inserting will likewise when I add it.
     
  17. SMTP

    SMTP

    Tech Member
    Problem. SonMapEdit just NEVER wants to create mappings for me.. ( I am editing the moving platform to look decent in ICZ)

    I start by switching to Sonic 2, load the art and then the palette. I then load the mappings from a clean rom of the object I am going to edit. I rearange everything to how I want it:

    [​IMG]

    I then hit savedata -> save mappings. I get this:

    Code (Text):
    1. ; --------------------------------------------------------------------------------
    2. ; Sprite mappings - output from SonMapEd - Sonic 2 format
    3. ; --------------------------------------------------------------------------------
    4.  
    5. SME_oDnhz: 
    6.         dc.w SME_oDnhz_2-SME_oDnhz 
    7. SME_oDnhz_2:    dc.b 0, 5  
    8.         dc.b $F4, $D, 0, $11, 0, 0 
    9.         dc.b $F4, $D, 8, $11, $FF, $E0 
    10.         dc.b 4, 9, 0, $21, $FF, $E0
    11.         dc.b 4, 9, 8, $21, 0, 8
    12.         dc.b 4, 5, 0, $1B, $FF, $F8
    13.         even
    I remove the old mappings and add these in its place. I change to pointer so it will load in game.
    And This is what I end up with:

    [​IMG]

    What exactly am I doing wrong?? I've been trying different things for the past 2 hours now..
     
  18. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    I think you are doing nothing wrong and SonMapEd is somehow forgetting to output the player-2 mappings data. Sorry. See if this works:

    Code (Text):
    1. ; --------------------------------------------------------------------------------
    2. ; Sprite mappings - output from SonMapEd - Sonic 2 format
    3. ; --------------------------------------------------------------------------------
    4.  
    5. SME_oDnhz: 
    6.         dc.w SME_oDnhz_2-SME_oDnhz 
    7. SME_oDnhz_2:    dc.b 0, 5  
    8.         dc.b $F4, $D, 0, $11, 0, 8, 0, 0   
    9.         dc.b $F4, $D, 8, $11, 8, 8, $FF, $E0   
    10.         dc.b 4, 9, 0, $21, 0, $10, $FF, $E0
    11.         dc.b 4, 9, 8, $21, 8, $10, 0, 8
    12.         dc.b 4, 5, 0, $1B, 0, $D, $FF, $F8 
    13.         even
    [This is a bug in the ASM exporter, so if you save it as BIN and incbin that file it should work. Or download the newer version where the bug is fixed.]
     
  19. SMTP

    SMTP

    Tech Member
    Yes! It worked perfectly.

    I wonder why it wasn't outputting the 2P data..?
     
  20. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    Because I was an idiot and disabled some code I shouldn't have. Here's version 1.01, fixes that bug and a crashing bug if you add a sprite piece with 0 sprites, and adds some KosinskiM support I forgot about.
     
Thread Status:
Not open for further replies.