This requires Java 1.6,and may require Java 1.7-it was built under JDK 1.7 targetting 1.6,so if a:
ClassNotFoundException comes along(due to java version or otherwise),then sorry-nothing I can do.
The sources are in src,and should be portable.

The map editor requires the Pbm folder,TileEditor.png,and NPChar.dat,to successfully start.
If you don't care about objects,omit NPChar-it will set up a sensible (blank) default.

As for the Experiment, on top of those, it requires piyoDrums.bin.
There is a blank default for the tilemap.It's completely unusable(0 x 0),but it's there.
Saving map sizes other than the default is untested.So is loading map sizes other than the default.

THE LAUNCHER

Before you get into the actual map editor,you get to see the launcher.
The launcher has 3 options:320x240,640x480,and 320x240 Experiment.
320x240,however,will actually be scaled to 640x480,
so it's mostly useless except for really really big screens.
(any resolution at or below 320x240 is scaled up 2x for sanity.)

Should you not have a mouse,that is unfortunate.
Not having a mouse restricts you entirely from using the main editor.
However,by pressing Enter while holding E,you can still use the Experiment.


THE INTERFACE

Basically,at the top right there is a save button(THIS SAVES BOTH OBJECTS AND TILES),
and a mode switch button.(NPChar.dat means objects,Map1.pbm means tiles)
Moving around is done with Up Down Left Right.Can you guess which does what?
Z will get the ID number of any NPC intersecting the 'mouse box'.
In V8,it cycles through them, while beforehand it would only select the first NPC.
If you're wondering why 'intersecting',it's because all the vanilla enemies seem to have screwed up positions.

THE MODES

NPC
The editor will start in 'NPC mode'.
This is where you edit objects!
To the left is a panel where you edit the EventID,collision type and see which object ID you are manipulating.
Editing the numbers now involves clicking on the number,pressing backspace to 0 it,
and then typing in a replacement in a way a bit like a calculator.
Apart from that,much like the In Game Editor.Below the 'ID' sign is an indicator to show if the object exists.
To the right is the list of object types.(this includes subtypes)
Further to the right,underneath the mode switcher and save button,is a scrollbar for the type list.
To place an object,click somewhere on the map.
The selected object will then be placed-and put into existence if it wasn't there before.
To delete an object,right click anywhere on the map.
The selected object will then be removed from said existence.
This was originally designed to be similar enough to the in-game editor for those used to it to quickly move over,
while dealing with the more complicated parts of the interface.
(Technically,the original design WAS a clone of the in-game editor.)
This has been through multiple iterations.Blame IdioticBaka1824,andwhyisit,
and probably in future anybody who posts on the topic.

TILE
Switching mode will take you to 'TILE' mode.
To the left is a large list of tiles.Above them are category pictures describing what they are.
Essentially,this list is the palette.Clicking in the map will place anything.

Note that all NPCs are displayed in a (hopefully) correct manner.

Portability

The code in src is designed to be portable to Android tablets,applets,
maybe push your luck with JavaME devices,and pretty much anything else that can display graphics,has 5 buttons(if a two button mouse 4 will work),
and a touchscreen/mouse that can display images and 8 pixel text in whatever position I want.
Actually,the 8 pixel text stuff isn't needed for the editor...
There is also a music driver subsystem,but somebody needs to work out PiyoPiyo's format.
Once that's done(note that the sound system I've written uses multipliers of the pitch,
                 so a 400hz sine wave would be 800hz with pitch 2)
Note:

GameStateMap(the save/load part of the tile part of this editor) can save and load any map where the width is a multiple of 4.However,only the default has been tested.
All images are loaded as normal 24-bit images apart from GameStateMap
(which is a really really basic indexed BMP loader)
GameStateMap contains the header and palette from a real Map1.pbm,but not the data.
This is because I am somewhat lazy.
The header is the same as would be generated by writing a proper BMP writer,so it shouldn't matter.

License of all files-apart from GameStateMap.java's pbm header block,which honestly shouldn't matter:
LICENSE--LICENSE--LICENSE--LICENSE--LICENSE--LICENSE--LICENSE--LICENSE--------

       DO WHATEVER YOU WANT TO PUBLIC LICENSE 
                   Version 2, December 2004 
Modified by gamemanj <asdd2808@gmail.com> to remove expletives
Original copyright (C) 2004 Sam Hocevar <sam@hocevar.net> 

Everyone is permitted to copy and distribute verbatim or modified 
copies of this license document, and changing it is allowed as long 
as the name is changed. 

       DO WHATEVER YOU WANT TO PUBLIC LICENSE                      
 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 
 0. You just DO WHATEVER YOU WANT TO.

CHANGELOG---CHANGELOG---CHANGELOG---CHANGELOG---CHANGELOG---CHANGELOG---------
---April 12th,2015---
V15:q3hardcore edition
    + Messed around with physics. Now it's using some values from Ikachan,
      but I'd need to know the framerate for the values to be correct.
    + Version number actually set this time around!
    + Changed all method names and variable names so they actually follow convention.
    + Moved the MinorState system into a separate set of subclasses for readabilty.
      Not perfect, though, since the chat system is so intertwined with everything else it's ridiculous.
---March 28th,2015---
V14:A mythical version shrouded in mystery...
    + Used a lot of knowledge from Cave Story ASM modding to fix Physics.
    + "fixed" NPC editor.
      Feel free NOT to complain when you accidentally delete a NPC,
      and now you have to change your TSC...
---October 10th,2014---
V13.1:Whoops!
    + Fixed the Boss collision routine so the direction is given properly.(read:you can win the Ironhead battle now)
V13:Wow,it's been a long time.About a month.
    + License is now written in a way that makes it more likely to stand up in court.
    + Properly split the code.I now have a sound engine,but it's unused.
      I'm leaving it in because it might be useful to someone who wants to finish this
      (unless I beat them to it,but it's unlikely.)
    + New launcher.This one makes going to the Experiment without a mouse easier-Press enter while holding E.
    + Did some optimization to physics.Not much though,just making the area checked smaller.
      (this was done after trying to use a Android version of the Experiment
       to play Ikachan on the go)
    + The list of NPCs not 'specified' (no specific subclass) is now:Chibi,Dum,Carry,Juel,Ufo
      However,Hari(Globefish by the look of it) is missing AI,bounding box,etc.
      Also,Crab AI is imperfect.
    + Stopped 'ghost' NPC-IS-HERE indicators coming up for NPCs that don't exist.
      Although it doesn't look like a major problem,NPCs you've deleted count.
    This project will be discontinued apart from bugfixes and explicit feature requests,due to:
     - Lack of interest (from all except me,and even then I only occasionally work on it) in the Experiment
     - Lack of interest (from everyone,me included) in the program in general.
       I did not keep track of any total download count;but it wasn't high.
       Perhaps my "release often" schedule is a bit unusual to some people...?
       Either way,if anyone needs me for adding a feature,you'll still be able to contact me.
       I've kept the build environment all sorted on my Dropbox,
       so if I'm needed,it won't be much effort.
       Plus,I'll likely be using some parts of the environment for my other projects(GaBIEn comes to mind),
       so expect any features I add to my personal GaBIEn version to appear in the sourcedump of future versions.
       GaBIEn is under the same license,and is my project to get rid of boilerplate code in my projects.
       It was built out of the AWT_GrInDriver and IGrInDriver code in earlier IME versions.
       GaBIEn stands for "Graphics and Basic Input Engine".
       GaBIen used to stand for "Graphics and Basic Interpreter",
       but that component has been split into it's own package.I may move it back in if I feel the need.
       The source is in src/gabien(note that gabien is the Java package name).
---August 29th,2014--
V12:Work on this is becoming intermittent,but I had to get this release out before Tuesday.
    + Uh,when did I remove the important NPC-Is-Here indicators?
      Well,I fixed it,so nevermind.
    + In my previous log entry,I lied.I did actually rewrite parts of Collision,and do the move to GameState.
      However,it was only a rewrite of the part that needed rewriting-the 'object <-> tilemap' part.
      There were a few changes though-for example:
      The system now moves the object by X,then does a collision check,then by Y,then does another one.
      Then it handles 'soft' collisions.They should really be moved to Gamestate though-
      Collision detection should just be used for pushing the player out of things and 
      relaying when that happens.Rect can do the rest.Not the biggest matter in the world,of course...
    + Added 'Sleep' (savepoint) NPC as it's own class.Which means I can animate it.(And I've done so.)
      Reduced the rectangle to a 12x12 box,offset towards the bottom.
    + Made the default behavior of NPCs to use GravFric(and physics in general).
      I may have to make a flag for GravFric enable/disable.(globefish!)
    + Made Ironhead partially work.First I wrote him hardcoded into GameState,then I subclassed it for below:
    + Added multiple boss support (in theory).
      Adding a new boss should be as simple as subclassing BasicBoss,implementing what you need to,
      (including the 'turn off boss mode' for when the fight is over),making sure TSC uses it,and adding it to Bosses.
      Note that by 'making sure TSC uses it' I mean looking in Event.ptx and checking if the boss is even actually scripted.
      Also,I don't think there's any code referring to the Bosses array in any sense other than as a Iterable,
      so don't panic about ID gaps causing errors-it's fine.
---August 26th,2014--
V11:
    + Added health,XP,levelling,spikes now hurt you,crabs now hurt you,
      Attack Stars haven't been tested,but it's likely they will hurt you.
    ! NPCs I haven't written at least basic code for don't get XP and levelling data.
      Which means that globefish are *useless*!
    ! Unfortunately,spikes now hurt you for hitting the block next to them... *sigh*
      I need to rewrite collision.Again.
    ! I need to make GameState handle ticks-this way Capacitor code can be kept out of the physics code,
      and it makes a complete physics rewrite feasible.
      I will probably also move gravity and friction to GameState.
      HOWEVER,SINCE I CANNOT FIGURE THIS OUT,I WILL NOT BE DOING THE PHYSICS REWRITE.
    + Added the particle system.The particle system itself is finished,but calls to AddParticle need to be added...
    + Game is finishable,but the Ironhead battle is still a placeholder,and several AIs are missing.
    + Finished(?) Crabs-hopefully in their entirety,but if I need to I'll build a room and watch their behavior.
      They seem to work on a 'tape reel',but I can't quite figure out the pattern.
---August 25th,2014--
V10:
    + Fixed Attack Stars(except animation).
      They now act a lot more like Attack Stars instead of the PC with a bad AI.
    + Fixed a bug in which the default to a Y/N question would be the 
      direction of the player(blame it on me not clearing JustPressed.)
    + Made NPC dialogue work closer to the original game.
      This makes the first earthquake work properly(?).
      Note,however,that effects for such are still not in place.
    + <wa now still allows NPCs to move.Enemies won't hurt Ikachan though,
      because that's handled during Ikachan's physics.
      Guess whose physics doesn't get to run during <wa?
    + Added in a placeholder Ironhead.Basically he dies instantly(technically on the first collision with him,but oh well)
    + Finished Capacitor!
    + Game is almost finishable.Only thing stopping you is the lack of any ending :)
---August 20th,2014---
V9.1:Fixed the direction blocks-whoops...
---August 19th,2014---
V9: Experiment edition!
	- Removed original access method for Experiment.
	+ Added new access method for Experiment which sets graphics settings correctly.
	+ Made Experiment playable up to the point where you get the capacitor,
	  There's a workaround in place that allows you to play up to the Ironhead battle though.
	  Note that a ton of stuff doesn't work still,like player health...

---A long time skip to August 16th,2014---
V8:Even more internal changes,but at least I finally managed to:
   ~ Edited the GUI further-Finally unified 'horizontal lists' into one UIPanel subclass,
     using UIHorizontalList.ListEntry to handle different things,and also made them look better.
     Well,'better' here means "scanlines as opposed to checkerboards".But they do look nicer.
   ~ Furthermore,stopped using the GUI backdrop drawing method made ages ago,because now it's entirely useless.
   + Removed helpimagetext about extra blank tiles which had been solved.(removing extra blanks was a last-minute change)
   + Made it so Z will cycle between NPCs sharing the same tile.

   + Added the experiment.To use it,hold all arrow keys,Z,and S,until a screen comes up asking if you're sure.
---DAY 5.---
V7:More changes to internals:

   - Ripped out the entire GUI.I mean,the entire GUI.As in,everything except the world renderer.
   + Replaced it with a much better system that doesn't involve a billion if statements!
     Best of all,there's only minor differences visually!
     (no more having to write the bounding box in two places,updating both to avoid problems)
   + Made the swim key do something useful-in NPC mode anyway.
     In NPC mode,it grabs the NPC's ID number for easier editing.
   + The NPC scrollbar doesn't get any bigger than needed for that particular screen size.
     So if all NPC types are visible,you can't actually use the scrollbar :)
   + Added safety border so that you know where the edge of the map is.
   + Updated help files.
V6.1:AAAAAH FORGOT TO DEAL WITH THE SRC FOLDER! *panics*
     I need to make a script to automate this.
---DAY 4.---
V6:This is a REALLY BIG EDIT relative to most of this thing's history.
   Sure,there was the big NPC editor change,
   but that was just a bit of musical chairs with the textboxes.

   - Okay,fine,LIMITED THE NPC SCROLLBAR.
   ~ Finally ripped out the bitfield-based keyboard system.Just don't poll 'newly pressed' triggers more than once per frame,OR ELSE.
   ~ Made the layout code a bit saner.Just a bit though.
     Mostly correct though,and good for getting an idea of the general layout.
   - Removed a secret in the TileEditor.png image. Poor Arduino Duemilanove....
   + Made tabs readable by expanding their images to 2x the width.
   ~ Gave the tabs icons in the extra space.There's even a little spaceship for NPCs!
     (Tiles is a part of the Ikachan map-specifically where I had last saved.)
   + Remapped the keys thanks to the new keyboard system.That means better keymapping.
   + Graphics mode switcher! Default scale is 2x,so you can leave that alone unless you have a really small monitor.'Internal size' is before scaling,so 400x300 with 2x scale=800x600 result.
   + There's a background to the GUI,so you can now see what is UI and what is map.(hint:top 64 pixels)
     Sort of Andwhyisit's idea-mentioned a white border on the tileedit UI,
     not a whole background-but this makes things better anyway.
   + Implemented a better way to see which tile was selected.Andwhyisit's idea,again...
   + Made a UI spritesheet twice as big as the leading brand! *
     * may not be twice as big as the leading brand after this update.I seem to be the leading brand of Ikachan editor right now.
V5.Oh-Blast-I-Forgot-The-Invisible-Trigger edition!
   Invisible triggers added.They are right before the dead fish and the sign. Sorry I forgot!
---DAY 3.---
V4.Andwhyisit special edition!
   Also,information on where NPCs actually are.Yay! (also removed idioticbaka tribute)
   Also added different map size saving support-still,width should be a multiple of 4,or else padding(which I don't account for) may need to be added manually.
---DAY 2.---
Nobody annoyed me today!
---DAY 1.(August 1st,more or less?)---
V3.IdioticBaka1824 strikes again and asks for a sensible numeric input system.I comply.
   The likelihood of this ever running under Android drops.Again.
V2.Redesigned NPC editor,see IdioticBaka1824's post
V1.Initial release
