Ikachan Map Editor

Discussion in 'Other Games by Pixel' started by gamemanj, Aug 3, 2014.

Old topic!
The last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.
  1. Aug 3, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    I've found out the Ikachan modding scene is dead,and I don't want to bump a thread(especially since the only applicable one is a guide),
    so here I am,posting a new topic.(NOTE:Download at the bottom if you hate the Great Wall Of Text.)
    I decided to write a map editor.
    Well,it was originally intended to be a full NX-engine like thing for Ikachan,
    but I gave up on that after...I guess you could say losing sight of where the end would be.
    (Never mind the fact I decided not to use cheat engine to look at the code and figure out how the physics engine worked.)
    The map editor is written in java,and source is included,along with a guide on NPChar.dat(fixed point decoder included,encoder:see source)
    I hope this turns out to be useful to the Ikachan modding scene-and I also hope one actually makes itself apparent [ :)]
    Read note.txt before use.The key bindings are a bit more sane after a bit of 'restructuring' (read:rehaul of the keyboard input abstraction layer I use for portability)
    Warranty stuff:
    If anything happens,not my fault.Although it shouldn't happen,I have to write this in case lawyers come to my door.
    I will listen if you tell me of such a case(at least unless I have too much to do to handle it),but this shouldn't have any problems.
    Do not try to save maps larger than the default.If you think it's safe,go and ask somebody who knows Java to 'fix' it.
    If there's problems loading maps larger than the default,you'll know why I decided not to allow saving them. 4-byte padding is a pain in the neck,isn't it...
    Quicknote:
    Do not allow Ikachan above the map's ceiling-that causes the ending.
    Ikachan's spawn point is clearly visible(it's a picture of Ikachan.)
    If Ikachan's spawn point can be changed,nobody told me.
    Bit of a long post,time to finish off by attaching the zip with source and jar file.

    In case of problems:
    If you don't know how to run a jar file,then please go into command prompt,CD to the directory,and type 'java -jar IkachanMapEdit.jar'
    and hope your java is in the PATH.
    If you don't know how to do that on your operating system,it's called a terminal there.
    If you don't know how to do that,please get some technical experience before usage of this program.
    If that doesn't work,make sure you have java.
    If that doesn't work,double-check if Java's in the PATH.
    If that doesn't work,make sure your Java version is 6 or above(built under 7,but it's compiling to 6)
    If that doesn't work,please send me the error.
    If there wasn't any error message,how should I know what's wrong?
    Okay,finally,the download.
    Again,sorry if anything goes wrong,and BTW,backup your Pbm and NPChar.dat files before use.
    For those on case-sensitive systems(GNU/Linux,hi!),I used the full english translation for the names of files.
    So if a file isn't found,then go check the case-sensitive name in the error message and compare.
    Yes,I am consistent with the case,I wrote this on a case-sensitive system so I had to be.
    Got to stop writing notes and actually get on with posting now [:)]
    (license and keybindings are in note.txt,source is in src,Ikachan Pbm folder required for use)
    --For those who don't want to read all of that--
    Source in src,license is a slightly modified DWTFYWTPL(replacing the wtf with "whatever".This means you don't need permission for anything.Please don't rebrand it and call it your own though.),
    you move about with the left,right,up,and down keys,in NPC mode you can select a NPC with Z,
    see Help(mode name).png for a quick description of what is on screen.
    I keep an archive of all previous versions apart from original v6 and original v9(V6 had bad source folder,fixed in 6.1.V9 had direction blocks not being recalculated after I adjusted tick length-causing any attempt at reaching Pinky to fail short of a TAS or a keyrepeater.Fixed at v9.1),so if you really need a specific version badly,mention.
    V16.2: View attachment IkachanMapEdit16.2.zip

    V13.1 (Before the V14 NPC UI change, in case you're used to it, or accidentally deleted a NPC and have to rewrite all the TSC, which BTW was why I didn't make that UI change earlier.)
    https://20kdc.duckdns.org/Public/IkachanMapEdit13.1.zip
    (Note: URL changed due to Dropbox killing Public folders in March 2017. Writing this in Dec. 2016.)
     
    Last edited: Dec 19, 2016
  2. Aug 3, 2014
    IdioticBaka1824
    Um... Chosen One? Yeah that'll work. : P
    "Keep on rollin'!"
    Join Date: Oct 7, 2013
    Location:
    Posts: 439
    This is pretty good, no bugs that I know of, fun interface. Easier than going through map1.pbm in a graphics editor. But I don't really understand how to use the NPC editor, it's sort of complicated. You should try looking at Cave Editor for Cave Story, it's quite intuitive/understandable. Simple editable text boxes for values would be nice. And perhaps a scroll bar would be convenient. Maybe a script editor as a future goal? Ikachan scripting (and many other things) are quite well-documented here.
     
  3. Aug 3, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    ED: This applied in version 1 of the editor-version 2 went through a bit of a redesign in the NPC editor.However,these still apply: NO==NPC ID,SW==checkbox right below NPC ID,TY=COLLISION,and EV=EVENT.
    It works the same as the official in-game editor.
    Basically,if you learn the Ikachan In-Game Editor(see tribute site/other games by pixel,or the link below to another thread),you won't have any learning curve to this one.
    See here(Note-in-theedit:This is the same guide that you mentioned!):
    http://www.cavestory.org/forums/threads/1895/
    But I believe an explaination is in order,so:
    "NO":The Npc's ID.Left click increases,right click decreases.
    "CH":The Npc's type.Same controls as the NPC ID...
    "X":The Npc's X position,can only be changed by clicking in the map.
    "Y":The Npc's Y position,can only be changed by clicking in the map.
    "SW":Does the NPC actually exist? Left click in the map sets X,Y and this(to 1),right click sets this to 0.
    "TY":This is mentioned in the modding guide that I used to create this program,but here's a quote from the guide mentioned above:
    "- NULL: Runs event, but not a solid object. Used for fish remains and signposts.
    - BLOCK: Not solid, doesn't run event.
    - ENEMY: Normal enemy behaviour, runs event on death. Used for Crabs, Fish, Porcupinefish and Attack Stars.
    - EVENT: Runs event and is solid. Used for friendly sea creatures and the Ship."
    Again,left click moves forward in the list,right moves back.
    "COL":Not used.
    "EV":Event number.Again,left moves forward,right moves back.

    There's a second set of coordinates NPCs have:I call it the offset,but it's also known as the 'subtype'.
    The offset decides which image a NPC uses.I don't know why Pixel did this,but it works,so...
    When you place an NPC(see SW),if you drag to the right,you will get all the different images.
    Sometimes this doesn't work exactly as it should due to my NPC draw code not being exactly like Pixel's,but that only happens when you try something crazy like giving a offset to a crab.
    If you just use it where it's supposed to be used,there won't be a problem.

    I might copy this and move it to note.txt :)
     
  4. Aug 3, 2014
    IdioticBaka1824
    Um... Chosen One? Yeah that'll work. : P
    "Keep on rollin'!"
    Join Date: Oct 7, 2013
    Location:
    Posts: 439
    I know, but all in all it's sort of complicated to learn and use. What I meant to say was, wouldn't it be better to make a completely different and simple interface? Sorry for not being clear. Also I mentioned some more things which you might want to consider?
    But my favorite thing about this editor is the bubble animation.
     
  5. Aug 3, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    The bubble animation should be the same as the normal bubble animation in Ikachan-one of the key features of this editor is that I tried to make rendering as close to full real Ikachan as possible due to the project's original goals(Which got abandoned when I gave up on the physics engine.)
    I'm thinking of a interface,but you'll still have to deal with some of the problems-Mostly it'll be the same,but you won't have to do the 'drag for subtype' thing,or play Guess The ID Number Of The NPC You Want-there'll be a nice menu to the right of the NO,EV,and TY boxes.Yes,there will be a scroll bar.

    ED:Ready! Basically I made choosing the NPC type easier.Hopefully that's at least a bit better.
     
  6. Aug 3, 2014
    IdioticBaka1824
    Um... Chosen One? Yeah that'll work. : P
    "Keep on rollin'!"
    Join Date: Oct 7, 2013
    Location:
    Posts: 439
    Yeah, that helps. But don't you think clicking to increase/decrease a value one by one is sort of cumbersome?
     
  7. Aug 3, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    Okay,released another update.Here I expand IGraphicsDriver so that it supports the backspace key and the number keys at the top of the keyboard.I was hoping to make this a portable program by using as little keys as possible(more keys=more wasted screen space on tablets).Oh,and I make it so the only method of number entry into the EditorGame object is through the new number key interface.(Yes,I left a note in note.txt,anybody who bothers to read it can see.)(ed:Note that although support for tablets seems useless for editors,EDIT2:it might be useful for a portable version of the Experiment.The original mentioned the 'unused code',but the Experiment is simply said code put to use.)
     
  8. Aug 4, 2014
    IdioticBaka1824
    Um... Chosen One? Yeah that'll work. : P
    "Keep on rollin'!"
    Join Date: Oct 7, 2013
    Location:
    Posts: 439
    I'm doing something wrong. How come all NPCs seem to have the same values?
     
  9. Aug 4, 2014
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 6057
    Age: 32
    Permission to add this one to the site?
     
  10. Aug 5, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    Do you mean NPC types(as in those selected on the page at the right) or NPCs as in the NPCs in a vanilla NPchar.dat?
    Remember that the scroll bar won't autoscroll to the currently selected NPC type when you change the ID(this will be fixed in V4,along with the problems people may have actually finding these NPCs)

    Andwhyisit,I'm going to release another version first-I think there may be a small problem with the interface when it comes to finding NPCs,and as for 'all NPCs have the same values',I didn't remove the mouse tile X and mouse tile Y values,which could easily be confused with NPC position.It doesn't help I removed the X and Y fields with the interface update...
    EDIT:Uploaded V4,explicitly stated the license in the OP(see note.txt inside for full license),added experimental support for multiple map widths,and moved the mouse position indicator so it doesn't get confused with the now re-added NPC position indicator.
    doubleedit:Andwhyisit,yes,this means you have permission to upload V4 to the main site.You can upload V3,but please state it's an older version.
    Tripleedit:Sorry-forgot the invisible trigger...Yes,I know,ton of edits I know...How did I forget the invisible trigger in the NPC menu???

    Sorry about the complete and utter mess that happened with my last post-first I needed to do V4 to finish some stuff,then I forgot the invisible trigger.
    Yes,you do.V5's up,so invisible triggers can be added.
     
  11. Aug 5, 2014
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 6057
    Age: 32
    A few suggestions:

    1. A way to zoom in and out between 2x (1 in-game pixel per 2 editor window pixels) and 1x (1 in-game pixel per 1 editor window pixels) on the map would be handy, just so you can view a wider area.
    2. While the 2x pixelated look for the controls might look good it makes it difficult to tell what everything does. Using a 1x HUD would allow you to convey things with ease. EV becomes "Event", TY becomes "Type" and the mode switch button becomes more readable.
    3. Vertical scrolling using the up and down keys would be neato. Plus horizontal scrolling with a and d, or x and c for consistency.
    4. A 1px border around the tile selection area would make it discernible from the bg tiles. And rather than displacing the selected tile fully surround the selected tile with a 1px red border like so:
    [​IMG]
    5. How do I edit or move existing NPCs? Or add more than one new NPC?
    6. The scrollbar doesn't really bounds check. I can pretty much scroll forever.

    In any case this is looking awesome.
     
  12. Aug 5, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    1.Can be done with a edit to the launcher class (javachan.SwimIkachan) for a permanent switch,but that's not really a good method-

    But reinitializing graphics doesn't sound too good either.So I'll likely add yet another function,this one to set the 'graphics mode' (width,height,scale).Thing is,graphics scaling is applied to everything.See javachan.AWT_GraphicsDriver for details.(EDIT:Well,as of v7,we have a fully finished 1x GUI.There's no 2x GUI anymore,so expect scrollbars to be longer.)



    2.The 2px look is a result of the aforementioned 'global scale' effect-I'll probably increase the size of TileEditor.png anyway,so I'll make room for this while I'm at it.I'm sure the mode switch button,and main NPC control panel,should definitely be doubled in width.

    May as well fix up the NPC type panel as well-half of it's code contains magic numbers(6 and 3)

    (NOTE:Forgot to add this reply.May as well note that:At 1x,I had 'fun' reading the text.As in,I couldn't.At all.So I'm adding a config box to make it customizable.)



    3.I get the feeling I may as well just burn the old keyboard handler code (IGraphicsDriver explains) in a fire-Better do it now anyway,before it becomes such a problem I go insane.(EDIT:As of v6(written at V7),Yep!)



    4.I tested the system for usability.I also found this a problem-I could probably just stick a dark background over the whole panel at all times,it's better than having to add a ton of different background panelling systems.Course,it'll be checkers.(EDIT:As of v6(written at v7)? Yep,added! However,I actually dropped the selected border at v7 when I overhauled everything-it was simpler than actually re-adding it,and it's very visible.)(EDIT:As of v8,the selected indicator is now a lit-up background behind whatever it is.



    5.Some notes:

    Control over NPCs is mostly the same as the in-game editor.Mostly the NPC editor is what happened when people kept requesting edits to the in-game one I copied.



    And the trouble is,as insane as it seems,the ID interface (of the original in-game one) actually makes sense for the way Pixel working on Ikachan would use it.And holding down a button to scroll through IDs would make finding a blank ID a lot easier.



    If you delete/move/whatever an NPC,you don't want to have to reset every single script value revolving around that NPC-right? Also,the EV number is *NOT* how you would refer to it from code-that's just which event gets called-It must be the ID number. Which means any nice cutesy interface involving deleting and adding NPCs without control over ID allocation is a pain in the neck to actually use.

    I admit you have to currently guess a NPC's ID number to modify it-If you want to delete all NPCs,just delete NPChar.dat(the editor will just blank it and leave a nice message for you in the console if you're using one)(EDIT:As of v7,just press Z while hovering your cursor over any NPC and you will magically get the ID number!).

    The thing to the right of the 2px HUD is the NPC type changer.NOT a NPC selector-it's a type changer.Thus,when you enter an ID,it will autoscroll to the type of the NPC.(Whoops,didn't put the autoscroll in V7's overhaul-but when you enter an ID it still selects the type of NPC.)

    6.No,it doesn't! Fun,right? Don't worry,the drawing code for the NPC menu DOES bounds-check.(EDIT:Fixed as of V7.)



    EDIT of the edit:V7's up now-I overhauled stuff so the GUI code should be easier to look at,made the help pictures clearer,made it so that you can get the ID of any NPC with Z,added a Tile ID number display so that <pc is easier to use...
     
  13. Aug 11, 2014
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 6057
    Age: 32
    Wow, that Z key selector seriously works wonders. Thanks.

    I've put it up onto the site by the way.
     
  14. Aug 11, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111

    It even works on the 'misplaced' NPCs(Not sure if it's my code or Pixel's that causes this,but some NPCs have 'biased' positioning) which are 1 pixel off.It does this by comparing rectangles instead of just mouse tile position == NPC tile position

    Of course,if two NPCs share the same square,there could be trouble.

    Probably going to patch that next update if anybody needs it.Should be simple enough-start at selected NPC + 1,and wrap around,stopping at the selected NPC's number,so it selects in ID order. At the moment it just stops at the first 'okay' NPC.

    Something like:

    for (int id=selectednpc+1;id<100;id++) { <Do the check,etc.if this succeeds break and set notsuccess to false> }

    if (notsuccess) {

    for (int id=0;id<selectednpc;id++) { <again> }

    }

    should do it.

    (EDIT:Forgot to mention:V7 stops using the OX field by default for NPCs I haven't added as specific cases.Why Pixel had set these fields,I do not know-assuming he used the in-game editor it could be a accident.)



    (EDIT2:V8 has been released,so it will cycle through NPCs,horizontal list code looks better,and there's now a experiment.Will you use it? Will you just laugh at the fact it crashes without a physics engine? Will you explain how the Ikachan one works? Whatever you do,it's a experiment,okay?)
     
  15. Aug 13, 2014
    trickybilly
    Hyperbolic
    "What're YOU lookin' at?"
    Join Date: Jul 10, 2009
    Location:
    Posts: 1004
    Age: 32
    Keep up the good work.
    Some good Ikachan mods would bring life into these forums.
     
  16. Aug 18, 2014
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 6057
    Age: 32
    Woo! Hooray for breaking stuff.

    Has anyone ever documented Ikachan's rate of acceleration?
     
  17. Aug 19, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111
    No.Also,it only breaks stuff if you use it,otherwise it shouldn't. If it does break stuff outside where it should... :)
    The experiment's been in the code since release 1:The original purpose of Ikachan Map Edit wasn't to be a map editor at all.
    I eventually hit codewriter's block on the physics engine...
    Also,the script interpreter will spit 'NYI:(command)' into console a few times,because I haven't implemented the whole Ikachan TSC instruction set.
    ...I'll leave a EDIT note here when I'm done implementing at least Ikachan's movement at a basic level.I guess I should have finished the basics of the experiment first,but I wanted to see if anybody could give details...

    Anyway,here's the release plans.Note a heavy switch of development focus has been ordered(quickedit:By myself to myself.):
    V9 plans:
    Make Z give you a blank ID if aimed at nothing to make editing easier.The indicator below ID already indicates if the selection is unused,so get back to physics engine V1.Make the game winnable if horribly buggy/missing NPC AI physics wise.Refactor NPC code to use a BasicNPCType system(like blocks) here or in V10.NPCs all require basic physics by this point due to 2 scenes where Ikachan uses this,AI not needed.!This may have to be spread out over two releases!

    (EDIT:News update! I have basic gameplay in place,although you can't die yet,there's no levelling,Ironhead is absent-as per usual,and physics is buggier than Windows ME.Add in the fact the X window system just loves to repeat keys in the worst way possible (undetectably) and there's nothing I can do about it short of 'xset -r' for more fun.NPCs need to be moved into their own seperate types,which means rendering code may need to be edited,capacitor is also missing,and also as of this moment all NPCs mysteriously have full physics even when they shouldn't.But at least the Curiosity trap works properly,and sponge blocks seem to prove my theoretical collision engine design works.At least something works.)

    (EDIT:News update 2! Almost ready for release of the next version.I've relocated experiment to launcher so that it will automatically set the graphics mode to 320x240x2,the way it should be.
    Game is relatively playable up to Ironhead battle(yep,still no ironhead),but capacitor is implemented as a 'you can destroy sponges from the sides' at the moment,save/load is still missing,the item screen is also missing,and leveling/damage is also missing.A lot is missing!

    The X Window System's habit of repeating keys when I don't tell it to is a very good way of destroying a project-
    it was okay up to this point though.Just meant that it was easier to glitch through walls because the X window system has superhuman Z key pressing.
    In future,I may have to advise the usage of xset -r when using this.Or GNOME 3,susceptible to crash bugs(especially near Wine,which is just great when comparing games!) as it is.)

    (EDIT2: V10:Ignore that stuff about the X Window System-I worked it out while finishing the capacitor.Any key won't be released and then pressed in the same frame unless a keyrepeater did it.So basically,if the previous frame has the key on,then any presses that happened on the current are completely fake.Left,Right,and Items keys don't really matter,but I might just move filtering to the AWT graphics driver.Some place where I don't have to leave stuff like this in the IPhysicsEngine implementation.)
     
  18. Aug 21, 2014
    Jazz Jackalope
    Senior Member
    "Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
    Join Date: Jul 29, 2009
    Location: The Surface
    Posts: 236
    I'm finding that any window size above "bit tiny" makes a window size horrendously too large for my screen. Is this just a by-product of my resolution, or a problem that may need fixing? (My laptop's res only goes as high as 1366 x 768, and the attached screencap is "Normal!" taking up my entire screen) Bit tiny works good for me, so no biggie.

    I adore that moving tiles on the map are represented by, well, movement. That's a great feature in editors.

    By the way, some keyboards/computers have this thing where they won't register more than a few keys at once; mine's upper limit is three. So I can't open the Experiment, but I figured that once it's done, you plan to make it openable in an easier way.

    oversized.png
     
  19. Aug 21, 2014
    gamemanj
    Senior Member
    "This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
    Join Date: Aug 2, 2014
    Location: In a world full of people who want every piece of
    Posts: 111

    Good news! I made it openable from the launcher in V9.

    Advice for versions < V13

    (EDIT:The listbox to the left is just for controlling window scale.Internal resolution should be set to the resolution you want,and if that's too tiny on-screen,you use window scale to make it bigger.If THAT's too large,decrease internal resolution.

    E2:Basically,if you want 2x scale,then divide the size of the window you want by 2,then put that into Internal resolution.

    Then set it to 'Normal'.The Experiment will override these options and give you 320x240x2.

    Version V13 uses a simple menu.Basically,there's 3 options:320x240 Mapedit scaled up to 640x480 for usability,800x600 Mapedit,and 320x240 Experiment scaled up to 640x480. In that order.I messed up the labels a bit(800x600 is written as 640x480),and only found out now...
     
  20. Apr 14, 2015
    q3hardcore
    Senior Member
    "Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
    Join Date: Jan 22, 2015
    Location:
    Posts: 231
    Seems the latest version is missing the source. (Also, bump! - sorry.)