Flex
about
Flex is a web based mapping / tile / DPLC editor written in javascript. It kinda spawned from GSXPwn and my desire to have a decent method for appending imported art with user defined mappings that didn't seem to already exist.
It is a work in progress, I plan to add more stuff on it in the future. I'm posting it now because it covers all the 'basics' required of a decent mappings editor.
features
As well as attempting to replicate the behaviour of SonMapEd, Flex has some additional features.
You can directly edit the tiles in the editor by right clicking on them in the tile list, mapping area or dplc list.
You have raw access to the mappings and DPLCs data to manually edit them. Manual tweaking of this now allows you to cut out a lot of superfluous DPLC requests for optimisation. This may be automated in future.
Mappings formats that SonMapEd has trouble with should run fine in Flex. SonMapEd has trouble with headers that are set to zero and frames that have unequal DPLC/Mapping quantities.
Mapping/DPLC output format is optimised.
Art compression is based on kensc.js. This is flamewing's C++ compression programs ported to javascript by FraGaG with emscripten and comes with the same optimisations that modern KENSC does.
Colour select will now only give a selection of Megadrive/Genesis compatible colours.
Since Flex is browser based, it is platform independent and open source.
Multiple sprite frames can be previewed as animations.
Guidelines can be used to line up sprites from different frames.
User guided tile importing mapping generation - see example video below
usage notes
Flex will save your current state when you leave the page and restore it when you return, much like SonMapEd. In addition, you can save and load your own states manually.
When importing sprites in PNG format, transparent tiles will be ignored and colours not found in palette line 0 will import as colour 0.
In the tile list; left click will alow you to choose a mapping piece to add to the current sprite, right click will allow you to edit the tile, and doubleclicking on it will allow you to delete the tile. Mapping and DPLC art pointers will be adjusted to account for the removal.
In the DPLC list; left clicking will allow you to add a mapping piece from the dplcpseudovram area without adding an extra DPLC request. Right clicking will again allow you to edit the tile.
In the mapping area, mousing over the pieces will show how the mappings are arranged, and clicking on one will select a piece. Double clicking in this area will deselect the active piece.
Here are the list of keyboard shortcuts I currently have;
[ and ] - traverse mapping frames
{ and } - swap mapping frames
ctrl+ins - add mapping frame
shift+ins - duplicate mapping frames
ctrl+del - delete mapping frame
del - delete mapping piece
space - select first mapping piece
esc - deselect mapping piece
< and > - cycle palette order left and right
h and v - mapping piece flipping transformations
p - mapping piece palette line modifier
f - priority flag
, and . - traverse mapping pieces
~ - remove last mapping import selection
pgup and pgdn - traverse 8 mapping frames
home - see first frame
end - see last frame
up/down/left/right - move mapping frame/piece by 1 pixel
Holding ctrl down before an arrow key will change the pixel movement count to 8.
alt+p - export to PNG
ctrl+m - change game format
shift+a - load art
shift+m - load mappings
shift+d - load dplc
shift+s - load state
shift+I - import art
shift+(0-3) - load palette line 0-3
Prepending the preceeding commands with alt will make them save the related assets instead.
backspace+u - delete all unmapped tiles
backspace+a - unload art
backspace+m - unload mappings
backspace+d - unloaddplcs
backspace+x - unload_all
If you want to define your own keyboard shortcuts, download a local copy and scroll to the bottom of keyboard.js to redefine the keys.
I don't use any media queries or anything and I haven't tested this extensively with different browsers/OSs. If you're having trouble, adjusting browser zoom may help.
I've included the level select cheat.
other notes
If it takes a long time to load the first time it's the compression library being cached, it's 3.5MB
If you want to generate mappings and dplcs that are compatible with SonMapEd, append ?sonmaped to flex's URL like so: http://snk.digibase.ca/flex/?sonmaped
If you're having display problems, make sure your browser is up to date and you've downloaded enough RAM. I have no idea if this works in IE or not.
The javascript console can be used to automate tasks for you. However, if there's something like this you use a lot let me know and I'll just add it as a feature.
Flex stores the current state in LocalStorage. If it's failing to reload correctly you might want to read more here.
future versions
Flex isn't finished yet, I only started working on this project very recently and there's a bunch of stuff I still need to/want to add. Here's my list; please let me know if you need any of these specifically or think of anything else you want and I'll try and do that first.
Arrange tiles by sprite order
Delete duplicate mapped tiles
Highlight active tiles
Visual DPLC editing
Ctrl+Z
Delete unused art function is inefficient and slow (needs a rewrite)
Virtual Keyboard
Ability to specify custom mapping formats (Rewrite of map.js will manipulate data in an intermediate format)
Ability to convert mapping files alone to mapping files with exact DPLCs and back again
Exporting and importing of sprite sheets instead of single sprites
DPLC auto optimisation
Sprite rotation
Sprite piece stacking order management
thanks to FraGag, flamewing, MainMemory, MarkeyJester, cwfluff and Xenowhirl for help with various aspects of development


00