kirjavascript / flex2 Goto Github PK
View Code? Open in Web Editor NEWsega megadrive sprite editor
License: MIT License
sega megadrive sprite editor
License: MIT License
Suggested by Lil-G
When you start Flex2 it is on average using around 300mb of memory, well I've noticed that after a while (30 minutes or so) that it sometimes spikes to 1500mb (when editing mappings) or decreased to as low as 14mb (when in drawing mode). If it helps I can send you the files I'm working with so you can see if you get a similar result.
Creating a new project for trying flex2, I encountered a few issues with regards to usability. The most glaring ones:
If you prefer, I can break this up into multiple issues.
Apparently, the Sonic/Tails Special Stage dplc mappings are in a different format than the normal mappings.
Link: http://info.sonicretro.org/SCHG_How-to:Change_the_Special_Stage_characters_to_use_normal_DPLCs
There should be a way to specify per-project starting directories for picking art/mappings/DPLC/palettes. As is, if you start Flex from explorer, the dialog boxes always default to Flex' directory, making using them painful.
Basically just take my SonAni program and do the same thing here. That way people can have a visual animation editor that's integrated into their sprite mapping editor rather than needing two separate programs with two different project formats.
Self Explanatory, being able to delete certain tiles (without removing all unused tiles) or add tiles arbitrarily would be nice to have as I've found myself needing that function quite a few times.
Whenever I try to import a sprite sheet while using DPLCs, the art tiles and mappings are generated, but the DPLCs aren't modified properly (which results in scrambled frames). This feature works just fine if DPLCs' are disabled. I'm using uncompressed art and Sonic 2s' format for DPLCs' and mappings, if that's any help.
In SonMapEd, you can cycle through the individual sprite pieces of a sprite frame by pressing shift+[
or shift+]
. Having the ability to do similar in Flex would be great, even if the keys used are different. As-is, it is impossible to select one sprite if two sprites overlap at the same location.
TypeError: this.project.cleanup is not a function
at file:///C:/flex2/resources/app.asar/bundles/main.js:192:105519
at we (file:///C:/flex2/resources/app.asar/bundles/main.js:15:6740)
at r (file:///C:/flex2/resources/app.asar/bundles/main.js:15:6636)
at Object.l (file:///C:/flex2/resources/app.asar/bundles/main.js:135:456)
at p (file:///C:/flex2/resources/app.asar/bundles/main.js:135:599)
at file:///C:/flex2/resources/app.asar/bundles/main.js:135:745
at m (file:///C:/flex2/resources/app.asar/bundles/main.js:135:831)
at at (file:///C:/flex2/resources/app.asar/bundles/main.js:135:16359)
at ot (file:///C:/flex2/resources/app.asar/bundles/main.js:135:16169)
at lt (file:///C:/flex2/resources/app.asar/bundles/main.js:135:16525)
If possible, it would be nice to have some configuration options like SpriteSheetGen for background color, sprite distance, whether to use a grid, image size/number of columns.
While trying out the new release, I noticed that the fix for issue #45 unfortunately seems not to pick a good zoom at all. This is more apparent for larger sprites, such as Vector in the this screenshot:
In comparison to the previous version, the sprites in the right strip all have the same zoom level (which is great) but almost all of the frames visible are cropped.
TypeError: this.project.cleanup is not a function
at file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:192:105519
at we (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:15:6740)
at r (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:15:6636)
at Object.l (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:456)
at p (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:599)
at file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:745
at m (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:831)
at at (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:16359)
at ot (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:16169)
at lt (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:135:16525)
Hitting "Save Data" before "Load Data" changes all files to be 0 bytes. Seems like there should be something preventing that...
I make a sprite edit in Sonic 1, i saved the mappings and at the moment to compile shows errors in the mappings
If you wanna see the error i adjunt the Errors.txt
errors.txt
Loading invalid files (such as uncompressed files when compressed files were expected) can cause Flex2 to crash. Instead, Flex2 should attempt to detect when files are not valid or cause erratic data to be spit out, it should warn the user about it instead.
15:58:44 <%MainMemory> snkenjoi: can you add support for S&KC sprite mappings/DPLC, it's the same as S3K but in little endian
Using Ralakimus' disassembly, I opened all the files required, and the sprites will either:
-Work fine
-Take parts of themselves and mash them into one sprite
-Slice themselves apart and rearrange themselves slightly
Yeah uh this tool looks really amazing, but where do I open an actual rom file? There's no actual guide on how you edit the in-game's sprites anywhere. I'm practically left in the dark here!
When using "Import Over Sprite", index 0 from the palette isn't being considered as the transparency colour at all, making it impossible to use an opaque image for any small changes.
This isn't the case for the "Import spritesheet" function, which automatically assumes the background colour as transparent.
This can get really annoying for updating any existing sprites when you mainly use a tool that doesn't support transparency (such as MSPaint) and have to rely on a separate program to remove the background colour.
SpritePlotter.Net's output of this format gets really buggy if the first sprite is null despite working fine when implemented in a ROM hack
Example of generated DPLC :
DPLC_Gatoslip_Overworld_dplc:
dc.w DPLC_Gatoslip_Overworld_dplc_Null-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_0-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_1-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_2-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_3-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_4-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_5-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_6-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_7-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_8-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_9-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_10-DPLC_Gatoslip_Overworld_dplc
dc.w DPLC_Gatoslip_Overworld_dplc_11-DPLC_Gatoslip_Overworld_dplc
DPLC_Gatoslip_Overworld_dplc_Null: dc.w $FFFF
DPLC_Gatoslip_Overworld_dplc_0: dc.w 1
dc.w $F
dc.w $102
DPLC_Gatoslip_Overworld_dplc_1: dc.w 2
dc.w $13B
dc.w $1F1
dc.w $212
DPLC_Gatoslip_Overworld_dplc_2: dc.w 2
dc.w $247
dc.w $2C8
dc.w $350
DPLC_Gatoslip_Overworld_dplc_3: dc.w 1
dc.w $36F
dc.w $463
DPLC_Gatoslip_Overworld_dplc_4: dc.w 1
dc.w $4AF
dc.w $5A2
[...]
What Flex2 does after loading the file and saving:
DPLC_Gatoslip_Overworld_dplc:
DPLC_Gatoslip_Overworld_dplc_0: dc.w DPLC_Gatoslip_Overworld_dplc_2-DPLC_Gatoslip_Overworld_dplc
DPLC_Gatoslip_Overworld_dplc_2: dc.b $0, $2C
dc.b $0, $2
dc.b $1, $3B
dc.b $1, $F1
dc.b $2, $12
dc.b $0, $2
dc.b $1, $3B
dc.b $1, $F1
dc.b $2, $12
dc.b $0, $2
dc.b $2, $47
dc.b $2, $C8
dc.b $3, $50
dc.b $0, $1
dc.b $3, $6F
dc.b $4, $63
dc.b $0, $1
dc.b $4, $AF
dc.b $5, $A2
dc.b $0, $2
dc.b $5, $DB
dc.b $6, $90
dc.b $6, $A1
dc.b $0, $2
dc.b $6, $C7
dc.b $7, $48
dc.b $7, $D0
dc.b $0, $2
dc.b $7, $EB
dc.b $8, $A2
dc.b $8, $D1
dc.b $0, $1
dc.b $8, $FF
dc.b $9, $F2
dc.b $0, $2
dc.b $A, $2B
dc.b $A, $E1
dc.b $B, $2
dc.b $0, $3
[...]
Here's what it looks like when importing the file as is:
And this is what it looks like after changing the first entry of the DPLC with the same as the second
The differences between this and the S2/S3K Player DPLCs:
It would be convenient to have imported sprites organized into rows and sorted by their position within the rows, as SpritePlotter.NET does.
The sprite strip on the left side uses a different scaling value for each sprite frame. There should be an option to have them all use the same scale, and maybe it should be on by default. As is, it makes it difficult to judge if the sprites are of the appropriate size.
at wasm-function[151]:0x8d8a
at wasm-function[95]:0x6ae3
at wasm-function[81]:0x664e
at wasm-function[1017]:0x3f5e9
at wasm-function[972]:0x39faf
at Te (file:///<path>/tools/flex/resources/app.asar/bundles/main.js:160:18124)
at file:///<path>/tools/flex/resources/app.asar/bundles/main.js:160:18750
at Be (file:///<path>/tools/flex/resources/app.asar/bundles/main.js:160:18773)
at et.<anonymous> (file:///<path>/tools/flex/resources/app.asar/bundles/main.js:160:31206)
at we (file:///<path>/tools/flex/resources/app.asar/bundles/main.js:15:6740)
<path>
was redacted for simplicity. Got this error with these settings:
On an otherwise empty project. Using Windows x64 version, on Windows 10 v2004.
There seems to be an issue when trying to load KosM art in the latest release. Nothing appears to get loaded. Nemesis and uncompressed work fine, so it's probably an issue with the decompressor? This problem didn't occur in v0.0.6. I'm running Windows 7 (64-bit) and the issue persists with both the x86 and x64 releases of Flex2. Below is an image of what it looks like:
When trying to import over a sprite or import a spritesheet, it will remember that file the last time you used it to import.
Say you have it open in a image editor and you change one or two pixels, perhaps a whole tile worth of changes while Flex2 is still open after having imported that same file before making changes, it will use the old incorrect version of the file it had loaded beforehand and not reload the file, having to resort to either renaming the file or closing and re-opening Flex2 to get around it, which is annoying.
Hopefully the explanation is sufficient, It's 11PM and I'm kinda tired so I apologize for any misinterpretations!
I want to use this to make a ROM hack to modify a sprite (say, of Sonic standing). How do I go about this? There doesn't seem to be any documentation.
You can move the selected mappings in any direction, but if you try to move the selected mappings up or down by more than one pixel by typing in the multiplier then pressing the arrow key, the following error occurs:
TypeError: Cannot read property 'preventDefault' of undefined
at Object.func (file:///resources/app.asar/bundles/main.js:160:375730)
at file:///resources/app.asar/bundles/main.js:160:389219
at et. (file:///resources/app.asar/bundles/main.js:160:33458)
at we (file:///resources/app.asar/bundles/main.js:15:6740)
at et.r (file:///resources/app.asar/bundles/main.js:15:6636)
at Ix (file:///resources/app.asar/bundles/main.js:160:389157)
at u (file:///resources/app.asar/bundles/main.js:20:4141)
at y.t._handleKey (file:///resources/app.asar/bundles/main.js:20:5384)
at y.handleKey (file:///resources/app.asar/bundles/main.js:20:2280)
at HTMLDocument.h (file:///resources/app.asar/bundles/main.js:20:4392)
Trying to report the error would give you another error:
Error: Failed to open
TypeError: Cannot destructure property 'top' of 'o.init[n]' as it is undefined.
at file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:487423
at Array.forEach ()
at hn. (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:69470)
at z (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:16:18016)
at hn.n (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:16:17620)
at HTMLDivElement. (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:487392)
at gC.apply (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:453444)
at g_ (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:442243)
at Object.a (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:456039)
at d (file:///C:/Users/Administrator/Documents/GitHub/S2-Full-Throttle/Tools/Flex/resources/app.asar/bundles/main.js:146:454887)
Doesn't seem like this is still being worked on but might as well bring this up.
Remapping frames is pretty tedious in this program atm, You have to click and drag sprites which is fine and all but it's really hard to do it when the destination you want is far away. Like for instance Sonic's standing frame is 1 and if you import a new sprite it'll put it down at the bottom, let's say $84. You then have to drag it up super slowly but holding it on the top of the screen or try the page up buttons which only works like once or twice before you have to set the frame down and try again.
My suggestion is to have a box that has the frame number in it and you can type what you want it to be. If you go over max either have it cap off or create empty frames. (could even ask you)
Some objects (example: Rexon badnik in Hill Top Zone in Sonic 2) use the foreground or background palette lines (lines 2/3). These palette offsets are coded into the game, so that directly loading the mappings with the level palette will be unable to display them with the correct colors. It can be worked around by splitting the palette lines, or by editing the game to use palette line 0 and bake the palette into the lines, but having the ability to add a palette offset for all frames of a given object would make things simpler.
As of version 0.0.8, Flex 2 has various usability issues, at least when run under Linux.
The main window has no close/maximize/minimize controls and is not resizable, as seen on the screenshot below:
Moreover, the window doesn't even appear on the task bar, so it's hard to find when it's masked by other windows.
What's worse, since window doesn't enable closing, there's no way to normally quit Flex 2 other than manually killing its process.
Improper termination of the application, in turn, soon leads to even worse side effects, like Flex 2 unable to load at all on the next launch (all I see is empty window with the background), until application data (including local storage) is cleared manually.
This makes Flex 2 almost unusable on Linux.
I'm currently running it on Ubuntu 18.04-based distro.
Error message as follows:
Could not find 'scripts' directory for mapping definition files
Searched in;
/private/var/folders/z4/nygrnkmx2f577m152mz9zjkh0000gn/T/AppTranslocation/3C937884-4C8C-4995-919B-2511A8349ACA/d/Flex2.app/Contents/Frameworks/Flex2 Helper (Renderer).app/Contents/MacOS/scripts
/scripts
Some objects need the ability to load multiple art files, or have a range of blank tiles added before or after the art, similar to what is done for palettes. A couple examples of objects that require this feature:
There are more, but these should suffice to test.
So I'm trying to make a Sonic 2 ROM Hack, and I found that Flex 2 would be a good tool for graphics hacking. I'm using Ubuntu 18.04 LTS 64-bit. When I try to run the Flex2 executable, it gives me this error:
Flex2: Flex2: cannot execute binary file
Am I doing something wrong?
I've only encountered this recently and I asked around the Sonic Retro Discord server looking for help with this bug, but whenever I edit a piece of art using offsets, mappings, dplcs and palletes, I try to save my work and I keep getting this message. I'm working with a Sonic 1 dissassembly and no matter what I edit from the disasm, I keep constantly getting the same issue. Is there any fix for this?
I know I've suggested this on Discord like three times, but it really would make aligning sprites slightly easier. Might try to do it myself and submit a pull request, but I have zero experience working with Electron, so that's not a guarantee.
Maybe right-clicking on a frame or pressing 'o' in the editor could do it? Add a box for what frame to display in the control list, maybe?
Similar to the option in PlaneEd and SonPLN, it would be nice to have an option to specify at what tile the mappings expect the art to start at and automatically adjust the mappings' tile indexes by that amount on load/save, so that e.g. people could edit the HUD (at least the parts that use compressed art) without needing a full VRAM dump.
Is this compatible with other games like Streets of Rage, Shinobi, Golden Axe, Rocket Knight Adventures, Soleil and The Story of Thor using the custom mappings option?
Flex gets stuck saving if you try to save kosinski art, and it also keeps you from saving any other files that were loaded with the object, even if the Kosinski file is cleared.
There are a lot of common shortcuts that people use to make working on things easier. Flex2 seems to have poor support for these shortcut key combinations at the moment. For example, CTRL+S, CTRL+N and CTRL+O could be useful additions to the program.
Flex2 freezes when trying to load the mappings for Sonic 2's level select icons. (mappings/misc/Level Select Icons.bin)
I have tried from multiple different sources, and could not get them to load.
originally reported here by ProjectFM
minimal example .png;
output;
workaround: use the top left pixel as the background colour for now
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.