Sunday, July 28, 2013

Music stuff

This should be an amusing experiment, when I get around to it.

Thursday, July 25, 2013

God damnit, Secret of Mana.

So, I figured out the reason map 258's collisions look wrong.  Some maps are set to use layer 2 for collision data instead of layer 1.  This is all well and good, except the bit that controls this isn't on the map, it's on the DOOR LEADING IN.  So theoretically, a map could have either state.  I'm hoping none do, because the collision data is what's originally used to determine where doors are.

So to determine the right collision state for a map, now I have to pick through all the doors leading to it, and see what the value of this bit is.

Edit: I ran a quick loop, and there are no two doors leading to the same map with different collision flags.  Why the fuck store this on the door then, when it's clearly a property of the target map.  Another thing for me to move to make everything properly editable...

Oh, and on a completely unrelated note, as a child I always thought there was something secret in this door in Northtown that I could never figure out how to get to:

Turns out, there isn't even a trigger on that spot.  More disappointment.

Wednesday, July 24, 2013

Positionable Composite Map Triggers

The first draft of this is in, with a few hundred new bytes of som-code generated by the editor if you change the composite maps.  Triggers can now be placed freely, rather than dealing with tile types.  After hours of crashing, it plays smoothly now and behaves at least somewhat like the original.

Waterfall maps work fine... I can play to Potos and kill the Mantis Ant.

Potos Inn takes me to Northtown.

Huh.  Close enough?

Edit:  Found what's causing this.  Fix tomorrow.

Saturday, July 20, 2013

Build 0210

More things.

 - Change "Doors" checkbox to "Triggers" on Composite Map Editor.
 - Fix issues with display of Tileset 8 flags.
 - Add checkbox to view 3BPP tiles as second half of palette in
   raw tiles editor.
 - Add/implement some new edit linkages between tileset screens.
 - Fix issue where flipping to the Tileset16 editor from the
   composite map editor would not update the selected tile16 index
   and such correctly until you clicked on them.

Friday, July 19, 2013

Build 0209

Goddamn mouse wheel.

 - Fix failure to update scrollbar size for events list when window resizes.
 - Implement File->Exit that for a long time did nothing.  Oops.
 - Fix issue where spamming the mousewheel on the event editor would crash
   the application under Windows 7.
 - Fix issue where scrollable area less than the size of the scrollbar would
   sit at the bottom/right instead of top/left.
 - Fix issue where map piece width/height were not adjustable.

Thursday, July 18, 2013

Build 0208

A few more minor fixes.

 - Fix some exceptions when changing tilesets on map pieces editor.
 - Remove outdated event editor options and add option to show dialogue
   and non-dialogue events with either in-game font or Courier New.
 - Change sprite exception that comes up often for non-working sprites
   to a debug log message so it stops spamming the messages area.
 - Fix exception if trying to "Open in another window" with nothing
 - Tweak handling of horizontal scrollbar for music view; it should be
   a little more accurate now.
 - Fix positioning of text on samples screen about how sound effects samples
   don't work yet.

Build 0207

Fixing stuff as I find it.  Trigger refactoring stuff is not in this build.

 - Fix miscalculation of code size for modified trigger data.
 - Fix issue where clicking a trigger would throw an exception.
 - Fix incorrect calculation of scrollbar maximums for composite maps.

To the guy who's having .NET problems, here's a link to a map editor app I wrote for a lesser-known MMORPG that I play called Darkages.  It won't fully function without the game's data files, but it should open to a big white screen with some controls and a title that is a random Mitch Hedberg quote.  Does this one run for you?

Tuesday, July 16, 2013

Build 0206

Includes the following:

 - Add options for detailed debug logging in somedit config.
   Detailed logging added for music and map pieces for now.
 - Fix bug that caused music to overwrite part of the world map.
 - Fix bug that caused an audio glitch in the town theme.
 - Fix bug in event editor where closing the popup with the "X"
   instead of the cancel button caused problems.
 - Fix bug that caused unknown/raw event editor to throw exceptions
   a lot when you cycle through the type.

Next up: refactoring how they store their triggers.  These are the spots on a map that cause things to happen, like door transitions, or events.  Right now it's 2 bytes each, with a flag for whether it's a door or an event, then the index for which one.  There is no x or y.  The position is determined by seeking all the way down the map, looking for tiles of a certain type, and placing the triggers one by one in the map load routine.  This is accomplished by changing the tile value to 0xC0 (the upper limit of actual tile values) through 0xFF.  If you step on a tile with a value >= 0xC0, it executes the trigger (value - 0xC0).  Why anyone thought this would all be a good idea or how they designed their maps under a system like this are beyond me.

The new plan is to expand triggers from 2 bytes each to 4 bytes each, with a new x and y value for each.  The existing loop over every tile will be removed, and replaced with a loop over every trigger, that will simply write the trigger 0xC0+ marker value as it is now at the associated x,y based on the two new bytes.  Everything else should work the same as it does now after that point.

This should make map editing a lot easier, since you can just place triggers wherever the hell you want.

Monday, July 15, 2013

Music problems

Music data is no longer overwriting the world map tiles, but there are still some minor problems.  Loop points sound a little funky, and sometimes the song just continues into other songs at the end.  I suspect I'm off by a little in the song/channel lengths that I store, and it's just continuing on to shit in SPC RAM that was there from a previous song.

Should be fixed soon for the next build~

Edit: fixed, the value I was writing for the total song length was off by 20, the header size.

The only thing I've noticed wrong in the music now is there's one bad note in the town theme right after the loop point.  That problem's been around for a long time, but I'd like to fix it already. Think it's just slightly incorrect handling of their looping.. causes one note to be off by one octave.  You can hear it in the editor playback too.

Edit: fixed that too.  Release soon.

Sunday, July 14, 2013

Debug logging

There are logging options for more detailed debugging now.  If you pass "debuglogging" on the command-line (to enable all file logging) it will pull data from the properties file to determine which types of log messages you want to see.  For example, if you want music debugging, put in the properties file, and next time you run, you'll get a shitload of music data in the log.

By default, it puts =no for each of these in the config file, so it's just a matter of switching them to "yes" to see what you want.  Not everything is logged yet (map decompression, and as of recently, music processing, are logged pretty well so far).  The ones that are, are logged in great detail (byte by byte) and slow things down considerably, so I'd recommend keeping them all off unless you need them.  They are intended to be enabled only if the editor is corrupting your ROM and we need to figure out why. 

None of them will do anything if you don't use the command-line parameter.

Music is still an issue.  It's being worked on for the next build.  Don't use the music editor for now, you'll screw up your world map.

Friday, July 5, 2013

Future things

Here is a list of things I plan to work on in the future, in-order. Mostly for my own reference since my memory is shitty, but feel free to vote things up or down. Will be edited as it changes.

- Bugfixes as they come up
- Usability/UI improvements
- Rewriting their trigger handling code to allow them to be placed at a specific location, rather than automatically on certain tile types.  This should make maps a lot more "editable."
- Handling of European roms and DTE in general. Maybe Japanese rom as well.
- Other misc numeric data editing like enemy stats
- Map bugfixes, like figuring out what's up with map 256, animation (and palette change) handling, and various minor rendering issues
- Automated fixes for some current in-game annoyances, like computer-controlled P2 and P3 getting stuck on shit.
- Ensure roms work on more strict emulation systems than ZSNES and Snex9x, and give the option of writing back the new CRC so you don't get "bad rom" when loading.
- An option to generate an IPS patch file.
- Menu graphic editing and various other little in-game graphics
- Boss graphic editing
- Spell sprite editing (this is already sort of halfway done)
- Weapon sprite editing
- Remapping SPC RAM to allow songs and samples to be more "expandable"; also allow samples to be dynamically resized. Currently, a song that is slightly longer than the mana beast theme (the largest existing song, and apparent basis for their current allocations) will simply not play correctly.
- MIDI importer improvements
- Figuring out what's up with the title screen scrollytext, and why adding lines to it causes graphical glitches. Chances are there are just some timing settings that need to be adjusted.
- Enemy AI table editing
- Boss AI table editing
- Sprite animation editing
- Allow adding elements beyond current maximums. For example, if you wanted to keep all the current maps, but just add new places. This will include some serious code mods for certain things (events, maps) since many references to these elements are tightly-sized based on the current maximums (11-bit event IDs, for example).  These will probably take some time. Other things (like character exp levels & associated stats) may be easier to extend.
- Sound effects editing
- Title screen tree graphic editing. Importing new JPEGs and such.
- Editor text translations (I'd prefer this be done after I get a majority of the features in, so it only really has to be done once. I don't speak anything but English, so I either have to use the one of the generally-shitty automated options, or have someone do it for me)
- ExHIROM test/debugging. It will currently try to do this conversion if you exceed 4 MB of rom data, but it really hasn't been tested very much yet.

Things I don't really plan to ever deal with, but if you want to work on them, do feel free:

- Having more than three main characters. I am expecting the memory reallocation (RAM, ROM, and Saveram) and code changes associated with this to be way more trouble than it's worth. MAYBE having only 3 in the party at the time but having them swappable (like Chrono Trigger, for example) would eventually be doable.
- Along similar lines, the ability to have more than 3 enemies onscreen at once, though this is probably easier than > 3 main characters.
- I always thought it would be nice if I could borrow Tales of Phantasia's system for streaming SPC samples in and out of the SPC700's unfortunately-small memory on demand (they use this to play a fully-vocalized song, for example), but to say that I don't want to deal with all the changes that would be involved with this is quite an understatement.

Tuesday, July 2, 2013

Next up

User interface/usability updates.  The title screen editor needs at least a copy/paste or something.

Also fixing problems as people report them.  I'm not really using this thing beyond briefly testing new changes so I'm relying on you guys to report broken stuff.

Monday, July 1, 2013

Build 0205

This one has debug logging.  If it won't start for you, give me the last line that shows up in the somedit.log, and we'll figure out what's going on.

Debug logging is disabled by default.  To enable debug logging, pass "debuglogging" as a parameter on the command-line.  It should write to a log file in the same directory.

If you don't know how to do this, make a new text file in the same directory as the EXE, and in it put:
"someditc debuglogging"
Name it someditWithLogging.bat and run it instead of someditc.exe.

Logging is the first thing I set up, so if you don't see ANY logging, then you probably have issues with the .NET runtimes.

I also added a little more information to the events help page.