Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Pinkpuff on March 13, 2012, 07:41:05 AM

Title: Developing FF4kster: a comprehensive editor for FF4
Post by: Pinkpuff on March 13, 2012, 07:41:05 AM
Hi folks,

I know it's been a long time since I posted anything here but I've still been lurking a bit. Anyway, I decided a while ago that I want to create an all-in-one comprehensive rom editor / hacking tool for FF4 (well FF2us really, but if modifying it to also accomodate 4j isn't too difficult then I may look into that as well). I already have a start on it and you can right now edit:
Also, I know how to do and will "soon" (read: eventually) have incorporated editing of:
Some unique/interesting things I'm trying to go for with this editor:


 :edit:
This is now being hosted on Romhacking.net!

http://www.romhacking.net/utilities/914/ (http://www.romhacking.net/utilities/914/)

How you can help if you're interested

For starters, you can download the demo and let me know what you think of both the idea itself and the implementation:

Windows XP (http://timecave.net/ff4kster/ff4kster.zip) (though it should work on pretty much any modern Windows)

I can also compile it for Unix if need be.

As well, if you have any information with regards to graphics; where the graphics (and particularly the palette information) for various game objects are stored, that would be most helpful. I know some of that information is posted here already, and I will certainly go digging for it when the time comes, but I think it's mostly related to characters and portraits. It'd be great to be able to read the graphics and palettes for spells, weapons, monsters, map tiles, etc. as well. Alternatively, if you know of a reliable technique for finding this type of information, that would be a great help as well.

Cheers!

The version hosted on the timecave in the link above will still be the more up-to-date one at any given time, but I will definitely be submitting periodic updates to RHDN.


 :edit:
=== FF4kster is now on Github ===

For a variety of reasons, I am no longer actively developing FF4kster. However, I have uploaded all the source code to Github just in case the community wishes to pick up the torch. The code is in FreeBASIC and isn't very well commented, but I will still be actively responding to messages, so feel free to send me any questions you may have and I'll do my best to answer them.

I'm glad to have had the opportunity to contribute to the FF4 hacking community in a significant way.

FF4kster Github: https://github.com/pinkpuff/ff4kster (https://github.com/pinkpuff/ff4kster)

FreeBASIC homepage: http://freebasic.net/ (http://freebasic.net/)
Title: Re: Developing a comprehensive editor for FF4
Post by: koala_knight on March 14, 2012, 02:34:39 PM
Sweet! I always wanted to have something like this. In my case, because I like having all of the game's data in one easy to use spot for my research proposes. Also, I commend you on the use of config files for labels, that makes the creation of new things a helluvalot easier.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 15, 2012, 10:10:00 AM
Thanks!

Please let me know if you find any bugs or anything not displaying properly or if the controls/interface are awkward or anything like that.

Also I just updated; the new one now can edit spells effects, starting spells, and spell progressions.
Title: Re: Developing a comprehensive editor for FF4
Post by: Deathlike2 on March 15, 2012, 09:27:44 PM
I'll definitely look into this when I get the chance.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 16, 2012, 06:10:51 AM
I don't suppose someday you'd be willing to implement a dialogue editor, would you? :happy: Obviously it would only work for FFII US.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 16, 2012, 08:25:26 AM
Yup, dialogue is definitely part of the plan. Thanks for reminding me, I will add it to the to-do list at the top.

What the program will be able to edit will be limited only by my access to the information required.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 17, 2012, 06:58:02 AM
I had a bit of an issue when I used it a little last night. I couldn't figure out how to go back out of the editor to the main page and thus had no way of saving my work.

Furthermore, it might be a good idea to implement hotkeys for the icons.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 17, 2012, 09:30:34 AM
Yeah, at some point I'll put something in the program itself that tells you the keys, but for now:

Always:

ESC: Cancel / go back a menu
Enter: Confirm

In menus:

Arrows: Move among menu options
End: Jump to bottom option
Home: Jump to top option
Tab: If it is a "composite" menu (such as element/status or "can equip" menus), alternate between component windows

In numeric inputs:

Up: +1
Down: -1
Page Up: +10
Page Down: -10
Home: Minimum value
End: Maximum value
Backspace: Divide current number by 10, rounding down (effectively erases last digit)
0-9 keys: Multiply the current number by 10 and add the typed digit (effectively allows you to type out numbers)
Note - some things look like numeric inputs but are actually menus; prices for example, as you can't just put whatever you want as a price

In text inputs:

Letters: Letters
Numbers: Numbers
Symbols: If the symbol corresponds to a symbol in the FF4 font (such as a dash or colon), that symbol; otherwise a "?"
Insert: Insert a special symbol from the FF4 font that doesn't have a corresponding ascii symbol (e.g. weapon icons, magic orbs, etc); the first one will appear and you can cycle through them using the arrows (enter to confirm)
Backspace: Delete last letter/symbol
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 24, 2012, 08:09:01 AM
Updated again; now you can edit actors!

By "actor" I mean, the thing that joins your team. You can edit the battle command menus, the starting equipment, and the initial/shadow data it loads/saves. Right now it doesn't consider the possibility that your rom is using the "extra shadow slots" patch but I might add that functionality at some point. Especially if there's a way to definitively determine whether the patch has been applied or not just by reading the rom!

I found an interesting/odd behaviour when testing this component of the editor. It seems that changing the initial data the actor loads changes which battle command set it points to. If you get the actor to load either a shadow slot, or the initial data they're "supposed" to load, it will point to the correct command menu. I have no idea how or why this happens and thus I can't reflect it in the editor, so if anyone has any insight with regards to this I'm all ears.

In addition I cleaned up my code a bit, and also changed around the setup of the spell set editor to make it a little more intuitive (at least it is to me).

Also, pressing ESC on the main menu no longer quits, you have to select the "Quit" option at the bottom (but ESC will still take you back from an editor to the main menu).
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on April 08, 2012, 10:29:03 AM
The command editor is now done.

You can rename any command, but there are only certain ones that can have their other features modified. This is limited mainly by what information I have been able to obtain about memory locations of the routines for those commands and the addresses for the spells they reference and other values. If anyone has any more information in this regard I would love to code it in.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on April 30, 2012, 05:00:22 PM
I could of sworn I posted in this topic already...

Anyway, great work so far! 
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on April 30, 2012, 05:43:34 PM
An editor that's not in danger of throwing all your work against the wall breaking it to pieces? A comprehensive editor that lets you change so many things in just a few quick keystrokes? Fantastic! You even included commands and the like, wonderful!

Do you plan on adding onto the Commands? For instance changing the % of HP that it takes to use Darkness or Fixing up FuSoYa's Regen? I love that you included Tellah's "Recall" commands and adding all of their possibilities without messy hex editing. (Well you did technically put the ability there and even included the "Freeze" bit on that.)

All in all I am loving where this is going. Finally an editor where I won't have to worry about self-destructing games.

Ah yes, also are you going to look into event editing and map editing to streamline those down the line?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on April 30, 2012, 10:28:19 PM
Whoa, adding new spell sets? That's wonderful! As if this thing wasn't user friendly enough! Just one question... there has to be a logical limit with how many additional sets you can have, but there is no enforced limit as far as I can tell. What is the limit that it would not be safe to cross?
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 01, 2012, 10:40:12 PM
An editor that's not in danger of throwing all your work against the wall breaking it to pieces?

Was this a shot at me?  :P
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 02, 2012, 12:12:18 PM
I had thought your editor was actually pretty stable. It isn't? My comment was moreso referring to Zyrthofar's editors that one version breaks equipment and the other version breaks monster stats. Your editor was a really nice start but was lacking some key information, the map properties thing is a wonderful change, the issue as you can imagine is that it doesn't say which map is which, the same follows with item shops and the like.

So your editor was a great start for its time. This new editor already provides simple and easy ways to modify things that used to require a hex editor (e.g. Weapon sprites in battle, commands, spell-sets, command effects for Medicine, Remember, etc.)

Your Treasure Editor is also a nice attempt. The only issue is documentation. I love that I can change treasure, but I don't know Where I'm changing Treasures.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 02, 2012, 02:29:14 PM
I had thought your editor was actually pretty stable. It isn't? My comment was moreso referring to Zyrthofar's editors that one version breaks equipment and the other version breaks monster stats. Your editor was a really nice start but was lacking some key information, the map properties thing is a wonderful change, the issue as you can imagine is that it doesn't say which map is which, the same follows with item shops and the like.

So your editor was a great start for its time. This new editor already provides simple and easy ways to modify things that used to require a hex editor (e.g. Weapon sprites in battle, commands, spell-sets, command effects for Medicine, Remember, etc.)

Your Treasure Editor is also a nice attempt. The only issue is documentation. I love that I can change treasure, but I don't know Where I'm changing Treasures.

I only jest in the reply.  Mine is probably 90% stable.  Some issues with the character editor sometimes copying character names on top of each other and the magic editor sometimes loves to screw with the spell icon. 

Sad thing is I had a complete log of all the treasure chest and map locations but that has somehow disappeared over time.  I was working on a new editor but now with this one I'll just stop my progress.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 02, 2012, 04:09:14 PM
Hmm, is there any possibility that you could show us what you have? After all your last update to your editor was 8 years ago (wow how time flies) there's a good possibility that your editor would still have some value.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 03, 2012, 06:59:48 PM
Hmm, actually there does appear to be some pretty severe problems with this editor as well. Maybe it's the version of FFIV I'm using? In any case when you go to save rom and play that edited rom the editor seems to throw a bunch of incorrect values in the Weapons/Spells index. The Darkness Sword will Absorb, the IceBrand will be Bolt elemental, the Charm Claws will put Float on the enemy, etc. It seems that it's reading something wrong when you go to save it.

Basically it seems that everything is a couple of bytes or bits off. All Dark elemental swords are Absorb elemental, for instance, Ice elemental weapons become Bolt elemental, etc. This same case follows through with spells as well.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on May 05, 2012, 09:01:20 AM
Thanks for the feedback everyone!

Sorry I haven't updated in a while, I've been working on the event editor and I'll probably be quite a while at that. There are a lot of config files and such to do with those; but I figure it'll be a good one to have out of the way and will help for testing and such (it's a pain to go through that opening sequence all the time just to test simple things).

Thanks for bringing the bug to my attention, I'll investigate it soon. I have a save file that I've been loading to test things and haven't noticed anything like swords absorbing, but I did notice a quirk with the guard captain in Kaipo trying to run away but somehow not being able to. Related perhaps? In any case, this is very much a work in progress, and will probably result in strange things exploding from time to time, so always back up your rom.

The rom I'm using is v1.1 headered, so that's the one I'm mainly concerned about the behaviour in. If I can get everything working in that one I will consider expanding out to get it to be compatible with other versions.

 :edit: Found the problem, fixed it, uploaded fixed version. Even though there is a menu option called "Event Editor" it is currently disabled since it's nowhere near ready.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 06, 2012, 02:21:19 PM
Thanks for your due diligence in getting everything worked out! My internet is running absurdly slow, but I will try to test it out. This in-rom event editor sounds like it will be a very interesting piece of work, I am looking forward to see what you can do with it.

I'll report if there's any other oddities I find along the way.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 06, 2012, 06:20:14 PM
From what I can tell looks like everything seems to work to a T now! Great work!

Oh yes, I did a bit of research onto the magic pointers and I won't exactly say everything is concise, but it is interesting, (at least to me) for people who want to make custom magic effects without having to dig into the system to create new ones from scratch. I haven't finished the section on Pointer 1 yet.

Quote

Weapon Sprites:

Sprite 008 - Thrown Handaxe
Sprite 012 - Thrown Ninjastars
Sprite 014 - Thrown Boomerang
Sprite 016 - Thrown Chakram
Sprite 017 - Thrown Items (Yellow)
Sprite 018 - Thrown Items (Blue)
Sprite 020 - ? (looks to just be glitch graphics)
Sprite 024 - Bow?
Sprite 025 -






I have to wonder if the term "sprite" is a misnomer. Considering that something that couldn't possibly share the same sprite like Peep, Fatal, Float, Quake, etc are listed under the same.

Sprites : 00 Cure1/2/3/4/etc (All to do with Pointer 1 and 2?)
Sprites : 01 Protect/Shell/Blink/Ice1/2/3/Shiva (Summon)/Image
Sprites : 02 Life1/Life2/Asura (RaiseAll)
Sprites : 03 (Looks akin to a Cure graphic)

Sprites : 04 Megaflare/White/Warp/Sleep/Drain/Psych/Nuke/Jinn (Summon)/Flare/Smoke/Sylph (Attack),Bahamut (Attack)/Powder/Disrupt/DullSong/Gas/Demolish/Disrupt(2)/Absorb/Vampire/Digest/Pollen/Fission/MegaNuke/


Sprites : 05 (Same as 03?)
Sprites : 06 Peep/Fatal/Count/Search
Sprites : 07 (Looks to basically be Death Faces from Fatal)
Sprites : 08 Mute/Dispel/Size/Toad/Piggy/Venom/Lit1/2/3/Indra (Summon)/Blitz/Indra (Attack)/Breath/Whisper/Poison/Magnet/Blitz(Enemy)/Thunder

Sprites : 09 (Possibly some explosion graphic?)
Sprites : 10 Stone/Flame/Roc (Attack)/Beak/Petrify/Hug
Sprites : 11 Meteo/W.Meteo/Fire1/2/3/Bomb (Summon)/Chocobo (Summon)/Bomb(Attack)/Jinn(Attack)/Explode/Reaction/Fire/Blaze/Explode(2)/Emission

Sprites : 12 (A breath attack, possibly?)
Sprites : 13 Float/Quake (O...kay?)/Titan (Attack)/Quake(Enemy)
Sprites : 14 Comet
Sprites : 15 Weak/Weak(Enemy)/Storm/Tornado/Glare
Sprites : 16 Hold/Charm/Virus/Mage/Bluster/Entangle/Hold Gas/
Sprites : 17 Fast/Berserk/Wall/Stop (Seems that it's mostly in the pointer 1 for this one)
Sprites : 18 Slow/Heal/Silver Staff/Unicorn Horn/Maser/Heal(Enemy)/Heal (Enemy2)/Beam/Laser/Heat Ray
Sprites : 19 (An explosion of some sort)
Sprites : 20 Hatch
Sprites : 21 Pin/Big Bang/Globe199/Needle/Counter/












Pointer 1: 03 Wall
Pointer 1: 28 Fatal (The rising of the reaper and the energy being taken away animation)
Pointer 1: 37 Quake (To be exact the animation of the chasm)
Pointer 1: 47 Flame
Pointer 1: 48 Flood
Pointer 1: 49 Smoke
Pointer 1: 50 Pin
Pointer 1: 60 Blitz
Pointer 1: 61 Mist (Dragon) (Attack)





Pointer 2: 00 Null
Pointer 2: 01 (The graphic starts from the middle right of the target and descends down slightly before vanishing.)
Pointer 2: 02 Venom/Sleep/Flare/Smoke/Powder/Tongue/DullSong/Gas/Digest/Pollen
Pointer 2: 03 Exit (When you're not actually leaving battle with this, the game gets fairly screwy)
Pointer 2: 04 Meteo/W.Meteo
Pointer 2: 05 Comet
Pointer 2: 06 Drain/Osmose/Absorb/Vampire
Pointer 2: 07 Quake (Shaking of the screen)
Pointer 2: 08 (Looks like a burst of graphic raising upwards coming from the bottom of the screen only ever hitting the party)
Pointer 2: 09 (Graphics assault the enemies and only the enemies)
Pointer 2: 10 Imp (Striking Graphic, over rides defaults Sound choice)
Pointer 2: 11 Bomb
Pointer 2: 12 Roc
Pointer 2: 13 Mage
Pointer 2: 14 Chocobo
Pointer 2: 15 Shiva
Pointer 2: 16 Indra
Pointer 2: 17 Stone/?Jinn?/Ray/Beak/Petrify/Hug/
Pointer 2: 18 Titan
Pointer 2: 19 Mist
Pointer 2: 20 Sylph
Pointer 2: 21 Odin
Pointer 2: 22 Leviatan (Curiously enough there is no sprite or pointer 1 provided for it)
Pointer 2: 23 Asura Cure 3
Pointer 2: 24 Asura Cure 4
Pointer 2: 25 Asura Raise All
Pointer 2: 26 Bahamut
Pointer 2: 27 (Graphic flickers on the target briefly, can be multi targeted)
Pointer 2: 28 (Same as above?)
Pointer 2: 29 Explode
Pointer 2: 30 Reaction
Pointer 2: 31 (Seemed identical to Fission)
Pointer 2: 32 Warp/Demolish/Disrupt
Pointer 2: 33 Nuke/?Jinn?
Pointer 2: 34 Big Wave/Wave (The big difference between this and Leviatan's summon attack is this goes towards the party, though it has pointer 1 as well included in the ability, which doesn't appear to do anything.
Pointer 2: 35 Fire 3
Pointer 2: 36 No graphic even shows, damage just appears.
Pointer 2: 37 White
Pointer 2: 38 Odin (Zantetsuken against party, graphics will glitch if it is not Odin using it)
Pointer 2: 39 Big Bang
Pointer 2: 40 Fission (When used as an ally, the damage effect is shown on the caster and they do the pain animation, does not hurt them though)
Pointer 2: 41 Cure 4
Pointer 2: 42 Glance
Pointer 2: 43 Crush
Pointer 2: 44 (Screen flashes briefly and then it repeats Pointer 2: 27 seemingly)
Pointer 2: 45 Gaze
Pointer 2: 46 Bomb (Summon)
Pointer 2: 47 Blk. Hole
Pointer 2: 48 (No graphic)
Pointer 2: 49 (Crashes emulator)
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 14, 2012, 12:50:12 AM
So far I've tested this app extensively with items and magic and it works very well.  Nice work. 
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 14, 2012, 10:08:12 AM
I now have to say, I absolutely Hate the way this game deals with stat bonuses. +Large amounts  and - fairly large amounts, no room for customization past that.

I thought I saw an editor a while back which listed all of the bonuses. Is the stat bonuses a separate entry somewhere? Or are they hardcoded?
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 14, 2012, 01:35:38 PM
I now have to say, I absolutely Hate the way this game deals with stat bonuses. +Large amounts  and - fairly large amounts, no room for customization past that.

I thought I saw an editor a while back which listed all of the bonuses. Is the stat bonuses a separate entry somewhere? Or are they hardcoded?

I believe the byte just points to a data table which you can edit.  I found something to do with it about 10 years ago but lost the offsets.  We should just find that data again and let the rom hacker edit what stats they want to have without penalty or with what penalty they want.  (ie. +15 STR -10 AGI -5 VIT +5 WIS +10 Will)  Is that what you mean?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 14, 2012, 03:47:04 PM
Yep, having that would add a lot more customizability. I would imagine that each digit (+15, +5, etc) would they be found as their True bytes of 5, 0F, etc? Or since there are only 0/3/5/10/15 would it be a different signifier to begin the search?
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 14, 2012, 04:36:14 PM
Yep, having that would add a lot more customizability. I would imagine that each digit (+15, +5, etc) would they be found as their True bytes of 5, 0F, etc? Or since there are only 0/3/5/10/15 would it be a different signifier to begin the search?

You'd need to account for the negative amounts.  Likely for the game to use 0x40 or 0x80 bits for positive/negative stats. 
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 15, 2012, 02:20:50 PM
Suggestion: Allow both headered and unheadered ROMs? 
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on May 16, 2012, 06:17:13 PM
Suggestion: Allow both headered and unheadered ROMs?

I would like to, but first I'm going to get it working for the headered 1.1, then see about adding compatibility for other versions.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 16, 2012, 10:13:31 PM
Suggestion: Allow both headered and unheadered ROMs?

I would like to, but first I'm going to get it working for the headered 1.1, then see about adding compatibility for other versions.

So far I've been using it on V1.0...  That isn't an issue is it?  lol
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on May 17, 2012, 09:34:38 AM
Suggestion: Allow both headered and unheadered ROMs?

I would like to, but first I'm going to get it working for the headered 1.1, then see about adding compatibility for other versions.

So far I've been using it on V1.0...  That isn't an issue is it?  lol

Not sure, it could be. If you haven't had any issues with it then I guess it isn't. Have you tried the command editor?
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on May 17, 2012, 02:59:00 PM
Not yet. 
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 20, 2012, 04:40:41 PM
The command settings seem to work fine for me. As a test I changed Recall to randomly summon the first eight summons and there is something fairly interesting that happens here.

I have the command on Dark Knight Cecil and when he had used it before I modified things, nothing happened. The game wouldn't even say "not enough MP!" but when I lowered all of the summons that could be summoned to 0 MP, the summons would appear but the message "Not enough MP!" would appear and the summon would de-summon itself as if it was a failed Odin. I'd never seen behavior in that manner before.

This is because the animation of summoning them is separate from the summoning itself. This was tested by changing all MP costs on the Summons themselves rather than their animations to 0 MP except Chocobo and in each case except Chocobo it worked as a proper summmon would.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 19, 2012, 08:28:11 AM
The event editor now appears to be working, though I have only done very rudimentary testing on it so far. It allows you to edit the code for events, but does not currently allow you to edit how or when the events are triggered (though that will be coming eventually). Also, be careful with adding too many lines of code as there are currently no safeguards preventing you from overflowing the events section into whatever comes after it when you save... once again, something I will definitely get to at some point.

The controls for the code editor:

ENTER: Edit the current line (change the function call and/or parameters).
INSERT: Insert a new line of code before the current one.
DELETE: Remove the current line of code (shifting up whatever's after it).
BACKSPACE: Delete all the code for the entire event (don't worry it will prompt you to make sure you really want to do that).
ESC: Return to the event selection menu.

Please let me know if you find any bugs or strange behaviour.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 24, 2012, 11:58:45 AM
Sorry I couldn't help with the Bank 2 problem, but I should be able to test this pretty thoroughly, great work once again PinkPuff!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 25, 2012, 06:39:01 AM
Thanks!

Sorry this one took so long, but I really wanted to get the event editor done before I work on something like the character editor, which in order to test a lot of things like starting stats and xp progressions and stuff I'd have to keep starting new games, which without a way to easily skip past the opening and edit your starting party, would be a very time-consuming and annoying task.

Don't worry about not being able to help with bank 2, I knew before posting it that it would be a shot in the dark; it's a very confusing thing. But I should still be able to make a dialogue editor that will be able to edit the actual text of the messages... the only problem really is figuring out how to reference a particular message from bank 2 so you know what numbers to put in for the events.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on June 25, 2012, 12:39:10 PM
When I get home from work I can fix your dilemma on the new game thing.  :D
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 25, 2012, 06:28:09 PM
I've taken a cursory look and this event editor is absolutely amazing! I did not realize how much FFII used movement commands though, that is literally at least 80% of event instructions if not more.

While this is an incredible step in the right direction it only brings to the forefront how little control there is when you don't have the map characters in front of you. You can poke around and guess a little, but without the knowledge of where each and every individual actor and sprite is it makes it kind of difficult. Though if I recall right there's a document already here somewhere on how to find what actors are in each map so that shouldn't be too much of a problem in the end.

Looking at the bank 2 deals and seeing that it looks for map pointers may lend itself to an eventual answer. For instance "Received Package" is 16 in that. But I have to say at times that the line placement is just random. In the middle of the starting cutscenes there's a Bank 2 reference for something like "Is everyone okay?" Maybe it's referenced later on? No idea why that would be randomly thrown in. And if you change the map, you change the text that goes with it. You figured that out already which is likely the cause for concern.


I was also really excited to see that you could board a ship and move it as you like! But then I tried it out and its clear they never got far with programming it. You go through anything and everything and there's no way to get off of it. It's little surprise it's used in that single solitary event.


EDIT: The map system is a little bit of a hassle, mainly because of how disjointed everything is and how the three main maps, Overworld, Underworld, and Moon are about in the middle to tail end of the maps. Using Phoenix's FFIV Tools as a reference to the maps makes that easier though.

EDIT 2: I spent a good deal of time deciphering what each of the visual effects were, testing them from the airship at the start of the game.

In the end not entirely sure how useful it is but eh... it's there.

It may be more appropriate to rename "Visual Effect" to simply "Cutscene" since that's more or less what the vast majority of these are.


Visual Effect 0  - Red Wings flying back to Baron
Visual Effect 1  - Red Wings landing at Baron
Visual Effect 2  - Bomb Ring (Without the fire and Bombs returning to wreak havoc)
Visual Effect 3  - Airships bombing Damcyan (Also changes the music) (If not used in the Overworld will produce a few glitch graphics)
Visual Effect 4  - Rydia battle? (Includes fighting Rydia, Titan, and the landslide in Mist, seems to freeze the game when not used in its appropriate spot only in a Map. It works surprisingly fine on the Overworld. It may have something to do with a Load Map instruction coming right after though. Regardless even that does not work in a normal map.)
Visual Effect 5  - ? (In a map it shows some sort of static wave on the player that quickly vanishes, also actors don't immediately appear until a few seconds later when the map is first accessed.)
Visual Effect 6  - Using Healing Pots graphic
Visual Effect 7  - Mist Dragon Gathering
Visual Effect 8  - Bomb's wreaking havoc from Bomb Ring
Visual Effect 9  - Prologue (Will lead to a black screen if used outside of its proper event? Not sure how this one works yet.)
Visual Effect 10 - Takes you to outside of Baron Town to the near East. I can't think of it's purpose.
Visual Effect 11 - As above, it seems.
Visual Effect 12 - Being bombarded.
Visual Effect 13 - Nothing, didn't do anything when used.
Visual Effect 14 - Agart Mountain being blown away.
Visual Effect 15 - Part of the Leviathan sequence.
Visual Effect 16 - Second part of Leviathan Sequence.
Visual Effect 17 - Ship being sucked in to whirlpool by Leviathan.
Visual Effect 18 - Kain's Red Wings meeting with Cecil.
Visual Effect 19 - Kain's Red Wings leaving.
Visual Effect 20 - Kain taking Cecil to the Tower of Zot.
Visual Effect 21 - The palette of the map slightly morphs and the text box turns orange.
Visual Effect 22 - The Enterprise caught between warring tanks and Red Wings.
Visual Effect 23 - Cid using the Enterprise to evade the Red Wings Underground.
Visual Effect 24 - Continuing to evade the Red Wings.
Visual Effect 25 - The map disappears beneath the actor's feet. Not sure when this is used.
Visual Effect 26 - A very slight screen tear that disappears as soon as it appears.
Visual Effect 27 - Nothing, it seems.
Visual Effect 28 - Nothing.
Visual Effect 29 - Nothing.
Visual Effect 30 - Screen shake and one explosion.
Visual Effect 31 - Lunar Whale Rising.
Visual Effect 32 - Boarding the Lunar Whale and going to the Moon.
Visual Effect 33 - Giant of Babil awakening and torching the countryside.
Visual Effect 34 - Tanks attacking the Giant of Babil
Visual Effect 35 - Tanks continuing to attack.
Visual Effect 35 - The Airships arrive and attack the Giant.
Visual Effect 36 - More attacks.
Visual Effect 37 - An airship moves out of formation
Visual Effect 38 - And moves toward the Giant.
Visual Effect 39 - The airship moves to the Giant and the screen darkens.
Visual Effect 40 - Nothing?
Visual Effect 41 - Caused all actors to vanish.
Visual Effect 42 - Neutralizing the Giant?
Visual Effect 43 - Not certain, maybe a ship flying away?
Visual Effect 44 - Ship Landing, then warped to the Lunar Whale on the Overworld.
Visual Effect 45 - Same as above?
Visual Effect 46 - Nothing?
Visual Effect 47 - Heading back to the Moon, with the ship entering the screen face forward.
Visual Effect 48 - Lunar Whale taking off, going to the Moon and landing in a specific spot.
Visual Effect 49 - Explosion which caused a strange minor screen glitch.
Visual Effect 50 - Mysidian Legend. (Like the prologue, will lead to a black screen might some of these work the way they do because it's at the end of their respective events?)
Visual Effect 51 - All actors disappear and the music gets quieter.
Visual Effect 52 - Seeing the moon through the Telescope.
Visual Effect 53 - The Lunar Whale returning to Mysidia.
Visual Effect 54 - Explosions to the side of the screen.
Visual Effect 55 - Mysidian Legend IN SPACE!
Visual Effect 56 - Moon goes flying off.
Visual Effect 57 - End Credits
Visual Effect 58 - Explosions on the center of the screen.
Visual Effect 59 - Bizarre. The map pans over a little, glitching the screen in the process and displays the text of Rosa meeting with Cecil in the Baron Castle Hallway, then resets the game.
Visual Effect 60 - Resets the game.
Visual Effect 61 - Decreases the volume of the music.
Visual Effect 62 - Nothing.
Visual Effect 63 - Same Rosa/Cecil conversation without the glitching.
Visual Effect 64 - Giant of Babil exploding, screen flashes black several times and then the screen darkens.
Visual Effect 65 - An NPC started to move strangely and then the system crashed.
Visual Effect 66 - Seems to be a Message Box 2 pointer.
Visual Effect 67 - All Actors vanished.
Visual Effect 68 - System crash.
Visual Effect 69 - Nothing.
Visual Effect 70 - System crash.


EDIT 3: I was looking at some of Phoenix's old notes and I found something that might be relevant in the "NPCs.txt".

"The speech data utilizes events numbers 01-03, which are event code EE message calls:
"Show bank 2 message [hex # xx after event call] from pointer [map#]"
For example, the Old Man wandering in the town of Baron has the following data (at 99EDE-99EEA):
   FE 06 FF 03 FE 0B FF 02 FF 01 03 04 05
This translates to:
   Data      Meaning
   --------   ------------------------
   FE 06      If event flag 06 is set,
   FF 03      load event 03 (i.e. message call EE 02 = message 05 of bank 2)
   FE 0B      (else) if event flag 0B is set,
   FF 02      load event 02 (i.e. message call EE 01 = message 04 of bank 2)
   FF 01      (else) load event 01 (i.e. message call EE 00 = message 03 of bank 2)
   03 04 05   [Hex data following event call]
======================================================================================"

EDIT 4 - I decided to take a look into this issue trying to correlate things from one side to the other.

I used the Old Man from Baron as the test in this. 003 of Bank 2- "Why is the King training soldiers how to use the sword of the dark side?" This goes right with what is in the notes, that the Old Man has 03,04, and 05 as his text depending on the Flag that is set. This one is a prime example because he is set up so close to the beginning of the maps.

I see now! It's all based around maps. Town of Baron - Not coincidentally the first map, has Bank 2 listings from 000 to 011.

Mist's numbers also add up with what the dialogue editor seems to show. It's just done in a different fashion for whatever reason. Whereas the Baron folks used Events 00-03 many of the other NPC's use the later calls for their text.

It may take a while but it should be a simple matter now to decode the Bank 2 calls.

I think I'll have something soon. To start this.






Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on June 26, 2012, 11:06:34 AM
Thanks!

Sorry this one took so long, but I really wanted to get the event editor done before I work on something like the character editor, which in order to test a lot of things like starting stats and xp progressions and stuff I'd have to keep starting new games, which without a way to easily skip past the opening and edit your starting party, would be a very time-consuming and annoying task.

Don't worry about not being able to help with bank 2, I knew before posting it that it would be a shot in the dark; it's a very confusing thing. But I should still be able to make a dialogue editor that will be able to edit the actual text of the messages... the only problem really is figuring out how to reference a particular message from bank 2 so you know what numbers to put in for the events.

Use this IPS on a FF2us 1.0 ROM with no header.  This will significantly make starting a new game for testing much easier.  I use this all the time myself.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 28, 2012, 09:57:26 PM
I've noticed an odd glitch in the editor. If you go to edit one of the "Medicines" in this version (pretty sure it wasn't in the previous versions) and go to "Information" you can do that precisely once, before trying to do so again does nothing. You have to back out of the entire Medicines page and go back to the main choice menu and go back to Medicines before you can edit just one and rinse and repeat.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 29, 2012, 07:24:08 AM
Thanks so much for making that VFX list. I'll make a VFX config file in a future version. Also for the help with bank 2. That table you posted looks familiar, I think I have a file like that in my archive of downloaded FF4 info. It will probably make more sense once I get around to tackling the editing of maps, NPCs, and event triggers.

Thanks for posting the patch. I haven't tried it yet but while skipping the opening is awesome I also need some of the other features that the event editor provides such as configuring my starting party, location, inventory, etc.

That's an interesting bug find. Very mysterious but I do have a suspicion as to what might be causing it. I'll check it out soon and post the fixed version as soon as I can.
 :edit:Bug found, fixed, and fixed version uploaded.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 29, 2012, 09:04:47 AM
Starting items? I had thought because the game starts you with absolutely nothing that there wouldn't be a way to start with items in the inventory? I guess I was wrong? Also for the starting party, since it purely consists of Dark Knight Cecil, you can easily switch that out for anyone you desire with event commands. But I would imagine there's a more intune way to do that, judging by mention of a starting party.

Also you work fast! You fixed that glitch in only roughly 20 minutes. Another thing though. I noticed you included the ability to create more spell sets, but have no way of assigning them. Is that going to be coming in a later update?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 29, 2012, 10:10:17 AM
Starting items? I had thought because the game starts you with absolutely nothing that there wouldn't be a way to start with items in the inventory? I guess I was wrong? Also for the starting party, since it purely consists of Dark Knight Cecil, you can easily switch that out for anyone you desire with event commands. But I would imagine there's a more intune way to do that, judging by mention of a starting party.

That's exactly what I mean by starting party; use event commands in the "opening event" to add/remove actors. Likewise, what I mean by starting inventory is the same thing; using event commands in the opening to add items to the party's inventory.

Also you work fast! You fixed that glitch in only roughly 20 minutes.

It was a simple one-line fix and I already had a rough idea of what would be causing something like that. Normally I don't work that fast (i.e. don't expect the character editor to be done next week or anything)

Another thing though. I noticed you included the ability to create more spell sets, but have no way of assigning them. Is that going to be coming in a later update?

Yup, as part of doing the character editor I will add a component to the appropirate editor(s) for assigning spell sets to battle menus and out-of-battle magic menus.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 29, 2012, 11:20:44 AM
That's wonderful news all around. Glad to see I didn't miss anything in regards to starting party and items, etc.

I've been going through Phoenix's "Location Trigger" document and have been filling in what each of the locations are (what item they correspond to, gil, location warp, event, etc) I was curious to know has this done before? And if not, would this save you some work down the line, if I filled in all of that?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 30, 2012, 04:17:49 AM
Sure, it would mean that instead of a menu that looks like

"Trigger 1"
"Trigger 2"
"Trigger 3"
etc...

It would have meaningful names like

"Trigger for Cid talking to you in Baron"
"Trigger for Mist burning"
"Trigger for taking Rydia to Inn in Kaipo"
...

or something along those lines, which could be altered in a config file.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on July 02, 2012, 03:50:12 PM
I'm making really good progress so far. Did you know that event tiles in FFIV are not in the same table as the normal event files? This caused me a lot of confusion, but I've gone through each tile event and I have an accurate picture (and list) of what each tile event links to a real event.

In addition to that I've also started decoding what tile events need what event flags to trigger, that's in its early phases but I've got a good idea of where to look for each.

Finally there's one map designator that is wrong (that I know of) in the editor. The map "Underground Tunnel background", appears to be a legitimately unused 7F of the Tower of Babil, it even has encounters and exits.

I'm up to map B0 in the Overworld so far. So things are moving along swimmingly.


EDIT: Overworld is finished, now to get started on the Moon. Though I had expected to find triggers for the Overworld but they were conspicuously absent. Do we know where they would be?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on July 06, 2012, 01:16:51 PM
A quick note. I recently came across Phoenix's old event tile info. that was in a random topic (I think randomly enough started by me) and you asked him how the event tiles worked (thereby making that one "table" of mine in that other topic worthless) and he pasted the real table. I've been busy making that more comprehensive by pointing out the event and event flags required for each event, but I came across one discrepancy in the events....

There's an event called "Rosa being captured", but wait... that's covered in the Kain/Cecil battle. So why would that be a separate event and a tile event of all things?

That's when it occurred to me that Rosa being sick in Kaipo is not in the event files so I took a look and it seems that the event "Rosa getting captured" is actually "Rosa sick in Kaipo".



Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 30, 2012, 02:42:58 PM
Nice little program you have here, finally got around to using it the past few days now that I have some of my emulation stuff reinstalled. I'm not exactly thrilled with the keyboard driven interface, but its capabilities make up for that. Monster and action sequence editing are on my wishlist for this.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 02, 2012, 01:23:50 PM
Have you used the event editor at all? I'd say that's one of the largest achievements of the editor thus far. The only thing that bothers me *slightly* about that is the use of plain numbers instead of Hex. For Formation F0 is Formation 240 or something like that, in events. Also the "activate/deactivate" objects make much more sense when looked at in their hex counterparts and makes it very clear what is being removed and added, (through Phoenix's NPC documents) once you do a little bit of calculation.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 02, 2012, 08:15:09 PM
I poked around with it a little bit, nothing serious yet, though. What I'm working on at the moment is kind of low key compared to what I was doing in the past (but, on the upside, has a much greater chance of being completed).
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 02, 2012, 09:25:21 PM
Speaking of that.

http://www.youtube.com/watch?v=xXjZlgaDThE (http://www.youtube.com/watch?v=xXjZlgaDThE)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 02, 2012, 09:53:10 PM
Very nice! Maybe I should scale back my plans as well and wait for the editor to get a little bit further before messing with location triggers and what not (these documents are in terrible need of formatting of some sort) Well I guess Location Triggers is usable... but some of Phoenix's other old notes do not look good in notepad or wordpad.

That's a fun proof of concept though. A battle to prove your worth to a Summon or to get a rare weapon or something. It's a really nice idea. We haven't found anything on how items call events, have we?
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 02, 2012, 11:07:57 PM
Not that I can remember.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 03, 2012, 01:50:05 AM
Dragonsbrethren's work encouraged me to look for what might be calling Item events and to see if more can be added.

We know that the Magazine calls event DB. Dwarf Bread is Event FB (so is Sight, but really that spell is one of the most worthless in the game). Warp is Event 87. I think we can live without Warp, but I can see people's trepidation of living without Exit...

But this all comes back to the main point.

Spells like Sight, Exit, and Warp are all Event based commands, but they're somehow called through the normal event system.

This also applies to Items, but for the life of me I'm not sure how Siren works. It seems to be separate from the other Events.

There's something somewhere that says "This Spell, links to That Event" and the same applies with items, this includes Tent/Cabin as one would imagine.

But I'm not sure how to go about looking for these, however if one could figure out how to make different Items or spells link to other events, then a few more possibilities might open up. As of now there's only really the ability to change Dwarf Bread and the Magazine, and if one were to get rid of either Tents or Cabins, there's a possibility for an extra event there.

Are there any memory editors for SNES emulators? I tried Cheat Engine but that thing was clearly developed for more advanced things than SNES roms.

Oh yes, and before I forget, PinkPuff. There appears to be an error with the Tools section. Changing the name, doesn't actually change their name in Rom, the same applies with Price as well. It's as if the whole page doesn't work.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 03, 2012, 03:51:41 PM
I can confirm the Tools thing.

Edit: A few suggestions.

Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 03, 2012, 06:08:26 PM
Hmm,

Dragonsbrethren what is a good memory editor to use, you would think? I mean which allows you to view the data dynamically in the game's RAM rather than just the ROM, I'm having trouble finding an application of that for the SNES.


EDIT: I found what... I don't know if it's a bug or just not an added capability yet. For events that generally have two outcomes (Mist Dragon battle event comes to mind) That there's a second event box below the initial one, but it can't be interacted with at all. Also adding a Yes/No Box into a normal event doesn't seem to add this secondary box.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 05, 2012, 08:02:17 AM
Hi folks, sorry it's been so long since an update but the past couple of months I've been mostly working on another project (FF-related but not coding related). Your feedback might just inspire me to get back to the grindstone on this though  :wink:

I make no apologies for the keyboard interface; I'm a huge fan of keyboard input in general (plus it's easier to code), and if this were to eventually get mouse support it would probably be one of the last things.

I'll see if I can have a look at that tools-naming issue and track it down. That should be a fairly straightforward fix.

As always, thanks so much for the input and feedback! Glad someone is getting some use out of the tool even if it is in such a buggy pre-alpha state!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 05, 2012, 11:11:58 AM
Hi folks, sorry it's been so long since an update but the past couple of months I've been mostly working on another project (FF-related but not coding related). Your feedback might just inspire me to get back to the grindstone on this though  :wink:

I make no apologies for the keyboard interface; I'm a huge fan of keyboard input in general (plus it's easier to code), and if this were to eventually get mouse support it would probably be one of the last things.
  • Unheadered ROM support is a planned feature but it may be a while before that happens.
  • I think you might be right about the index thing; I'll probably put that in soon-ish, but for now if you want it badly enough you can put indexes there yourself by changing the config files.
  • Hex/Decimal display option: That I think is a really good idea. Once again, I'll get on that soon-ish (sorry I can't be more specific with times but I'm not on a deadline so my progress is strictly dependent on my drive at the time, which can vary a lot).
  • I might be able to add the number-typing feature to some of the numeric inputs but not all. For example, equipment prices are a list of prices, not something you can just type in arbitrary numbers for (e.g. you can't have an item costing, say, 50001 Gil).

I'll see if I can have a look at that tools-naming issue and track it down. That should be a fairly straightforward fix.

As always, thanks so much for the input and feedback! Glad someone is getting some use out of the tool even if it is in such a buggy pre-alpha state!

Glad to hear back from you. This may be asking a bit much in advance, but I was curious to know what will eventually be put into the dummied Character tab?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 07, 2012, 02:01:33 PM
I fixed the tools thing. At least, it's working on my end; please let me know if it's still persisting for you guys.

Glad to hear back from you. This may be asking a bit much in advance, but I was curious to know what will eventually be put into the dummied Character tab?

Not at all! Ask anything you like  :wink:
I have barely even started on characters, but the information I know off hand that is definitely associated with them is level-up data (stat-ups, TNL, etc), and I'm pretty sure the magic set links are associated with characters becuase I seem to remember thinking they would be associated with actors but having to redesign them out of the actor editor... Beyond that I'm not sure, I need to go back to digging into the docs.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 09, 2012, 06:45:33 PM
Sounds pretty extensive. Yeah that seems to be a section that would take a pretty long time to get up and running to exactions. Especially since Level Up data for the first 70 Levels (though I guess there's really only 70 Level stat ups for Rydia, since she's the only character to start at Level 1) is all unique rather than set-level up patterns.

Also tried the new version. The Tools menu seems to work now. Now if Only I could find how they find how events are linked to specific items...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 10, 2012, 06:38:54 AM
Sounds pretty extensive. Yeah that seems to be a section that would take a pretty long time to get up and running to exactions.

It shouldn't be too bad once I actually, you know, get my butt in gear and start working on it. I got a big chunk of work out of the way on the other project yesterday though so now I should be able to focus on this. I'm still trying to work out in my head how the interface is going to look for this component. I have some ideas but I'll have to try a couple and see how they play out to see what I want to go with.

Especially since Level Up data for the first 70 Levels (though I guess there's really only 70 Level stat ups for Rydia, since she's the only character to start at Level 1) is all unique rather than set-level up patterns.

That's true (except Paladin Cecil also starts at L1), but if I'm not mistaken I think I'll be able to make it variable such that you can have anyone start at any level and have the appropriate levelups map correctly, provided there's enough space in that part of the rom to hold the sum total of all the levelup data (so you probably wouldn't be able to have everyone start at L1, but definitely you could have different characters start at levels different from what they would normally start at).

Also tried the new version. The Tools menu seems to work now. Now if Only I could find how they find how events are linked to specific items...

That would be a godsend! And would probably shed light on how the out-of-combat spells are mapped to their instructions as well.

I've actually been compiling a sort of "wishlist" as I've been making this program, of things that I would love to be able to include but I just can't find any information on (and don't have the skill to figure out myself). So far it's just been in the form of a text file, but maybe I should post it here on the forum?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 10, 2012, 09:46:31 AM
For 1 MB of data, this game sure does still have a lot of unknowns. I somehow forgot about Paladin Cecil... heh.

Though for the wishlist you mention, by all means post it! For a game with so much information known about it, to know what's missing from documents and the like would make it easier to search for what remains unknown.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 10, 2012, 10:01:27 AM
True enough. Then, post it I shall! I think I should probably start a new topic for it though since it is kind of a side issue that's technically independent of the editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 15, 2012, 09:05:38 AM
Hey Pinkpuff

1. I'm curious - did you keep monster spells unlearnable in the spell set menu because they show up weird in the spell menus (a problem I don't think we can solve)?

2. In the event editor, is it possible for you to include the bits at the beginning of each instruction (similar to how things appear in Phoenix's FFTools)? this would make it easier to copy one event or part of an event to another.

3. (this might have been asked already and if so, sorry) Is there any plan to include the ability to change the accompanying sprites for each character (battle and map) - not to edit them, but, say, make fusoya look like tellah.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 15, 2012, 09:18:39 AM
Hey Pinkpuff

Hey!  :childish:

1. I'm curious - did you keep monster spells unlearnable in the spell set menu because they show up weird in the spell menus (a problem I don't think we can solve)?

Actually, yes, that is the exact reason.

2. In the event editor, is it possible for you to include the bytes at the beginning of each instruction (similar to how things appear in Phoenix's FFTools)? this would make it easier to copy one event or part of an event to another.

It is possible but I don't really see the point/use of it... copying and pasting event code is a completely separate thing from displaying the underlying hex code. The point of having this kind of tool is so that you don't have to know or understand the ROM or locations or anything, you can just have an idea for a hack, design it with this tool, and it will take care of translating that into the appropriate hex changes for you.

Having a copy/paste feature may happen in some capacity, though if it does it would probably be something like "clone event over another event" and then you can change the details; like if you want a bunch of events that all more or less do the same thing but, say, set a different flag or something, such as the trap door battles or something like that.

3. (this might have been asked already and if so, sorry) Is there any plan to include the ability to change the accompanying sprites for each character (battle and map) - not to edit them, but, say, make fusoya look like tellah.

If it is known how to do that (what the bytes and such are for linking portraits to jobs and map sprites to actors), then sure! Ultimately the kinds of things this editor will be able to change will ideally be limited only by what is known or unknown about the ROM.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 15, 2012, 09:20:11 AM
(a problem I don't think we can solve)?
This is easily solved, you just need to alter the text routines to account for them. The easiest way is to copy those names into a second list that is still eight characters, then alter the existing list so each spell is only six characters long, like the normal character spells. Then you just need to change the routine that displays the name on the right side of the screen in battle. It's been a long time since I looked at the text routines, but it's already set up to load eight characters instead of six after a certain index, so editing that to load the eight characters names from an entirely different offset shouldn't be too hard.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 16, 2012, 12:10:54 AM
It is possible but I don't really see the point/use of it... copying and pasting event code is a completely separate thing from displaying the underlying hex code. The point of having this kind of tool is so that you don't have to know or understand the ROM or locations or anything, you can just have an idea for a hack, design it with this tool, and it will take care of translating that into the appropriate hex changes for you.

Having a copy/paste feature may happen in some capacity, though if it does it would probably be something like "clone event over another event" and then you can change the details; like if you want a bunch of events that all more or less do the same thing but, say, set a different flag or something, such as the trap door battles or something like that.

... It doesn't necessarily have to be the exact hex for what I'm envisioning (though there's no real reason why it specifically couldn't be - hacking ROMs is an activity inextricably linked to hex exposure), it could be as simple as numbering the different instructions in regular old base 10.  The reason I think it would help is... let's say I want to create a flashback scene from the opening events later in the game.  I don't want to clone the entire event, but I also don't want to have to spend all that time writing "main character face up-repeat the following action three times-main character move up..." just to recreate the same actions.

If it is known how to do that (what the bytes and such are for linking portraits to jobs and map sprites to actors), then sure! Ultimately the kinds of things this editor will be able to change will ideally be limited only by what is known or unknown about the ROM.

I feel like I've seen the info somewhere before.  I wasn't looking for it at the time, so I didn't make note of it.  If I can find it again I'll let you know.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 16, 2012, 06:05:53 AM
hacking ROMs is an activity inextricably linked to hex exposure

I completely disagree with the "inextricably" part. I think it is definitely possible to create a set of tools that allows one to hack a rom and not know what the word Hexadecimal even means. And while some kind of game code (hex or any other base) may creep into this editor due to my laziness or lack of creativity, one of my goals is to try to avoid it wherever possible.

it could be as simple as numbering the different instructions in regular old base 10.

This would probably be less useful than straight up hex code in both respects...

The reason I think it would help is... let's say I want to create a flashback scene from the opening events later in the game.  I don't want to clone the entire event, but I also don't want to have to spend all that time writing "main character face up-repeat the following action three times-main character move up..." just to recreate the same actions.

That is a good point. I might make a "copy/paste script section" feature at some point, but it would not display underlying instruction code in any base, and I think scenarios like you describe above would come up seldomly enough that this is a bit lower of a priority for me at the moment. I think right now I need to get the editor to be able to work the basics of as many different kinds of data as possible, then afterwards I can go back and add in neat little features to the existing editors that make life easier in various respects.

I feel like I've seen the info somewhere before.  I wasn't looking for it at the time, so I didn't make note of it.  If I can find it again I'll let you know.

Sweet, thanks!  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 16, 2012, 06:59:02 AM
I completely disagree with the "inextricably" part. I think it is definitely possible to create a set of tools that allows one to hack a rom and not know what the word Hexadecimal even means. And while some kind of game code (hex or any other base) may creep into this editor due to my laziness or lack of creativity, one of my goals is to try to avoid it wherever possible.
well, yes... sort of. your editor (and one or two others I've seen) already do this, to a point.  Will such a tool ever be TRULY comprehensive though? unless your editor automatically performs all of the prework described by Dragonsbrethren above on every ROM it loads, it will never allow the hacker to use monster spells. And I don't necessarily see this as a bad thing. I am not a programmer, and not long ago, my only experience ROM hacking was a cosmetic/text hack of the original Legend of Zelda created over ten years ago (and now, sadly, lost).  I was inspired to try messing around with FFIV after playing Euclid's LoZ:PW (something like, "This is really cool, but I wonder if I could do something similar with a game I like better than Zelda").  If I ever actually complete a FFIV hack (I've been toying around with editing bits and pieces for months and slowly formulating a plan), I now have enough knowledge to hack other ROMs, too, which I wouldn't have if I remained sheltered from hex.
But this is a serious digression from anything I ever meant to get into with you.  The editor is definitely great so far, allows for easy (and reliable) interface with lots of elements of the game that other editors don't even touch on.  I don't want you to think that I am not VERY happy with what you're trying to accomplish here.
This would probably be less useful than straight up hex code in both respects...
Yes, excepting only to the end of NOT exposing the user to hexadecimals  :laugh:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 16, 2012, 08:19:22 AM
Ok I see what you mean now.

First, my goal with this editor isn't for it to be able to do anything with it that you could do with a hex editor. There will likely always be things that you have to either hex-edit or download a separate patch for (such as the monster spell issue you mentioned). Second, it would still technically be possible to create a tool to do literally anything with the ROM without knowing any hex; though it would be more of a programming language than an editor at that point. As an illustration, I'm certain that no one working on this game's initial development typed in any hex code. They would have been using some kind of programming language and compiler that took care of doing all the machine langauge translations for them.

The editor is definitely great so far, allows for easy (and reliable) interface with lots of elements of the game that other editors don't even touch on.  I don't want you to think that I am not VERY happy with what you're trying to accomplish here.

Thanks! It wouldn't be possible without the efforts from all the awesome hackers on this board and elsewhere who have posted the information they've discovered. And don't worry I didn't get that impression at all.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 16, 2012, 10:34:25 AM
I can't recall if I posted this or just thought about it...

With the Mist Dragon Events there are basically two events, one, when you reply yes, is cut off by the "no" event. Though you can see the Yes event in another box below it. Is this unused functionality by the editor at the moment and is it planned that the player will be able to add their own Yes/No options to any given event, down the line?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 16, 2012, 10:39:36 AM
Down the line? It should work right now! If not then that's a bug!

You should be able to switch between editing the two windows using the TAB key. If the main (upper) event code contains a "Yes/No" choice then it will display the bottom box, and that should go for any event.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 16, 2012, 11:18:45 AM
Hah! Well what do you know? I must have missed that little bit of information when you went over the controls all that time ago.

However it seems if you add a Yes/No option to an event, that second box won't appear. Unless I'm missing something other than just adding the instruction?

Oh yes, there is one thing which may want to be reviewed now that I remember. If you delete an event and then accidentally click Enter on the "End Event" section, you're forced to choose an Event Instruction even though there is no "--END--" choice in the Event Instructions menu, so you have to exit without saving, lest one event flow right into another. Easy way to fix this is just include the "--END--" as an available instruction to choose.


EDIT: Ah, I see. You need to save and reload the program to make the second box appear. It's not preferable but it does work all the same.

EDIT 2: I can say with all certainty that this functionality works perfectly! I put a branch for when you reached Mist for the first time. Interestingly enough when you use a branch it will copy the next event, which is actually a bit easier than making a new event from scratch so good insight when you made the split event functionality.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 16, 2012, 11:43:03 AM
You were totally right, that was not at all the intended behaviour.

Should be fixed now though when you have a chance to redownload. Also a Job editing component.  :wink:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 16, 2012, 12:16:51 PM
Glad to see that Job editing made it in! A good use for the spell set menu. I tested it a bit and came back with some not optimal results unfortunately. I gave Cecil a new Spell Set 014 for his Black Slot, added a couple of spells, and one learned spell. When you start a new game and check your spell list you'll see the spells there under Black, but for those they throw out nonsense spells that seem to be reading into the Monster Spells Section, is it that whatever is written to Spell Set 014's original location is being read rather than what the editor says?

So I thought that may have been the case and gave Cecil, Kain's unused spell slot for his Black Magic spells. Filled that in with several spells and one learned one to test that out. While the linking outside battle is perfect, going to Cecil it shows his Black Magic spells instead "Cannot use". Inside of battle he doesn't have any of those spells, nor will he learn the spell he's set to learn. Which leads me to wonder, did you perhaps forget to include the secondary pointer to the in-battle menus for the magic linking?

Also looks like the second window appearing immediately works perfectly. Very nice fix.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 16, 2012, 12:40:06 PM
Good catch! Try it now.

 :edit:
At first I wasn't sure what you meant with the spell set 014 thing but now I see exactly what you're talking about. The whole "adding new spell sets" thing was mostly an optimistic shot in the dark and largely untested. Oh well, I guess I'll have to exclude that funcitonality from future versions now.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 16, 2012, 01:00:56 PM
A shame about the extra spell sets not working out, but not much that can be done there. I guess we could extend the ROM or something eventually, but I think that's beyond us at the moment. Really as far as spells go, there's a fair amount of slots. Rydia's White contains three spells, so that can easily be made use of. Rosa and Porom do not need two sets, considering their spell learning is pretty much the same. Palom and Rydia though should probably maintain a different spell set though since Palom learns a lot of different spells earlier than Rydia. And FuSoYa's White and Black is actually quite redundant. If you give him Tellah's spells set (which by then had already been remembered) then add Nuke, White, and Quake when FuSoYa joins through event then you have FuSoYa's magic set.

So in essence there are...

Kain - Unused
Rydia - White
Porom
FuSoYa - Black
FuSoYa - White

That's five more magic sets if people wanted to give magic or skills to characters that normally don't have them.

EDIT: Oh right, almost forgot to confirm that the changes work perfectly. DarkKnight Cecil has the spells in battle and he learns spells when he levels up appropriately.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 17, 2012, 12:43:38 AM
With your newest update I decided to completely redo spells, who learns what, and what people can and can't use magic. (Well everyone can use MP now, let's just say)

Because of this I found the labels of White/Black/Call to be too restrictive so I changed their names to Charm for White, Spell for Black, and Hex for Call. So Black isn't necessarily considered purely damage and Charm isn't considered purely help, and Hex doesn't mean that there will only be Summoned Monsters within.

However changing the names of the commands only changes it for battle. Would you be able to include the pointer to also change the White/Black/Call for out of battle?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 17, 2012, 07:25:20 AM
If someone were to find/post the addresses I would be happy to!

Also complicating things is that something somewhere changes Edge's status screen "Black" magic set label to "Ninja".
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 17, 2012, 08:43:34 AM
Hmm, you're right. As simple as it seems, it doesn't appear that these instances of White/Black/Call have been located yet. It doesn't seem too difficult to find in essence, I'll take a look and see what I come up with.

Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 17, 2012, 09:04:50 AM
I guess no one ever documented them, but they start at unheadered offset 0x0B1EC. The first two bytes are position, then the text string. If you want to expand these, I'm pretty sure each string has its own pointer (looks like these are null terminated; makes sense, it's not like the main menu where every string is always drawn). I completely forget where the code that handles darkening them is, though, so if you expand over the original five character limit, that text will always be highlighted.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 17, 2012, 10:08:35 AM
OK, sorry my novice is showing here, but can someone please explain to me, when editing events, what the two numbers represent when loading a map?
I always figured they were x/y coordinates, but I never used load map before now.  Turns out they definitely are not x/y coordinates, because no matter what I seem to set them to, they either have no effect on starting location, or an effect that does not correspond to x/y on a 1-1 basis.
 :wtf:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 17, 2012, 10:15:34 AM
Hmm they're supposed to be x/y coordinates... has anyone else experienced this behaviour?

Also I do notice they're not labelled in the editor :isuck:
I'll fix that...

 :edit:
I don't have time to fix the labels right now but I did a quick test and they seem to correspond to x/y for me. Are you saving your changes? Or maybe try re-downloading the most recent version.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 17, 2012, 10:33:23 AM
sorry. I'm a dimwit. I wasn't closing the emu or reloading the rom after making changes.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 17, 2012, 10:45:21 AM
Thanks Dragonsbrethren, I don't think I'll need to change that though.

Oh also I found the four labels (still not sure how the game includes Ninja, it might just be something dealing with Edge's actor)

1.1 Headered ROM

0xB3EE - White
0xB3F6 - Black
0xB3FE - Call
0xB405 - Ninja
0xB40D - FFFF (Unused?)
0xB415 - FFFF (Unused?)
0xB41D - FFFF (Unused?)


From what it seems it appears that there are 3 labels unused. It would appear that at one point they may have intended for there to be more than those four classes of magic.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 17, 2012, 12:37:52 PM
I'm pretty sure those blank slots are used for characters who don't have spells in those slots, since their positioning corresponds to the positioning of the magic category strings. (Also, your offsets are wrong if you plan on changing the pointers. The pointers point to the positioning data, not the text itself.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 17, 2012, 12:43:29 PM
I was just referring to the start of the text, since I assumed that's what the editor looked at rather than strict pointers. But yes, if I'm wrong then it's -2 for all of those, I believe. Interesting bit of info. on the extra identifiers, I'll test that out.

EDIT: Exactly right. They're just blank to show the others properly. Bah.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 17, 2012, 11:12:47 PM
A bug that I've noticed for a very long time but didn't notice until now that it was in fact more serious than I had thought. The Graphic choice in the item menu is all off by one. So if you'd choose Slap, for instance, it would show Powder. It all seems to be off by + one.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 18, 2012, 10:57:43 AM
Fixed the off-by-one error in the medicines menu as far as I can tell, and added X and Y labels to the teleport action in the event editor.

The characters menu is approaching completion as well.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 18, 2012, 11:15:58 AM
Wonderful! I was thinking I was going to have to use some clever editing and give the player 3 Soma Drops at the start to give to Cecil which would vanish when you leave Baron and 3 Soma Drops to Kain that would appear when you leave Baron but disappear after Mist events. If you complete that tab seems I won't have to take that road, hehe.

Though I assume you're waiting to release a fix until the Character Tabs is complete?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 18, 2012, 02:08:40 PM
A fix for what? Giving characters MP? The character editor will be able to give them starting MP as well as MP bonuses on level ups.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 18, 2012, 02:29:12 PM
Oh no, I meant a fix for the Medicines and the X/Y labels in the Event Instruction - Teleport.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 18, 2012, 02:40:26 PM
Nope those should be working now!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 18, 2012, 05:36:39 PM
For some reason I looked to see if the front page had been edited when it just dawned on me that you were referring to the actual program URL being updated so I assumed things weren't fixed yet. Ahem... no matter. Looks like both fixes are working properly.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 19, 2012, 08:24:14 AM
The character editor is now usable, though has only been very minimally tested, so I would not at all be surprised if it is riddled with bugs. As usual, please let me know if you find anything amiss.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 19, 2012, 08:33:34 AM
This has been quite the time in the coming! Can't wait to give this a try. I should probably make good on your warning though and make a backup of my rom.

EDIT : I like how you've put this menu together! I somehow never noticed that a character can gain a stat of +X across the board throughout their levels while playing the game. A simplified way of dealing with that. Also I noticed that you included levelup data for characters that don't have levelups normally from those spots. Are those functional, or will adding them erase data elsewhere?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 19, 2012, 08:53:34 AM
Yes, DEFINITELY BACK UP YOUR ROM! Actually, do this any time you do any kind of hacking or patching...

Anyway if I understand your question correctly you're talking about giving, say, D.K. Cecil levelup bonuses for, say, Level 5? If the editor works correctly then it will ignore anything like that below the character's starting level. However, you can change their starting level. So if you change his starting level to 5 and then give him levelups for 5-9, then it should work. However, be careful of two things: first, I haven't tested doing that yet; and second, there is a limited amount of space set aside for levelups and there is no guarantee that it will all fit if you reduce too many characters' starting levels too far. If it does not fit, the editor does not care and it will bleed into whatever comes after and probably fool up your ROM horribly. It is like adding event code in this respect. I will at some point put in a safeguard against that, but currently it has none.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 19, 2012, 09:58:28 AM
Hmm, well here's a few odd bugs

If you try to change, Cecil's starting level and stats, nothing appears to happen. The data will show that all of that is changed until you reload the editor and it will show that none of that actually went through. Oddly enough this did have the effect of making my level up from 10-11 to be 66467, so because of that I couldn't quite test to see if the level up portions worked.

EDIT: I can say though that changing the established level up stats seems to work fine. Exp gained, HP, MP, all of those involved appear to be altered with little issue.


EDIT 2: I'm still a bit confused on how the game calculates that initial level up. When you start the game Cecil has 334 Exp. to Level 11, but the editor shows that should be 981 or some such. Changing that to 1000 does actually change the amount of exp. needed to level up by what you would expect, but that it is read in that manner is strange. Oh no wait, I see. The TNL in the character's initial stats seems to subtract off of the initial exp to give the amount it would take.

For instance 3000 - 2403 = 697 To reach 1000 from 697 you need 403 which is the exact amount of exp. necessary to actually reach the level. What an odd way to program that.


EDIT 3: It appears that changing the start up values, except for TNL (not even sure if that works right) does absolutely nothing. Is it looking in the right area to modify that?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 19, 2012, 10:40:09 AM
What's this? A bug? Pinkpuff smash!  :banonsmash:

Try it now.

 :edit:
Due to the character editor introducing some large multi-digit numbers, I added functionality to the number inputs to allow you to type in numbers. Now, typing a key from 0 to 9 will multiply the existing number by 10 and add the digit you typed. Typing backspace in a number input will divide the current number by 10, rounding down (effectively erasing the last digit).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 19, 2012, 11:03:23 AM
That was some fast debugging! In any case the start up menu seems to work much better now, as in, it works. I changed Cecil to Rydia successfully, but in that it curiously enough will read Rydia's Level Up Chart when she gains a level. But the actor swapping works very well in that regard. You just have to remember that it's looking at that character's original table, but that might be because I changed the class to Caller rather than Dark Knight, perhaps implying that Levels are linked to Job rather than Actor? Class Changes from that menu also work properly. Stat changes, initial exp and TNL are also working great now.

As for other little things. The game is still looking at some stat chart somewhere for initial HP/MP for instance if you change Cecil's HP to 150, per se he'll still start with 200, but it will be 200/150. The same applies to MP. I guess a trick for that might just be to have an instant HP/MP restore when they join your party to right their HP/MP stats.

Level Ups prior to initial Level Ups are all working properly as well, at least for the one I programmed for Cecil as a test.

Also I was going to complain about cycling through numbers, but seeing that you added PgUp/PgDown Home/End functions, I have no room to complain, hehe. It might be a bit taxing with larger numbers (for say giving FuSoYa a real table) but aside from that looks like this tab is working optimally! Well done!

 :edit: Hah, never noticed that neat little emoticon...esque... thing... ahem! Good choice with the semi-manual entry of numbers, guess I'll try that out then.

 :edit: 2: Oh wow, this ease of control makes things so much easier for the Characters tab. Everything seemed to work great for it, no bugs or crashes that I could see with it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 19, 2012, 11:12:15 AM
That was some fast debugging! In any case the start up menu seems to work much better now, as in, it works. I changed Cecil to Rydia successfully, but in that it curiously enough will read Rydia's Level Up Chart when she gains a level. But the actor swapping works very well in that regard. You just have to remember that it's looking at that character's original table, but that might be because I changed the class to Caller rather than Dark Knight, perhaps implying that Levels are linked to Job rather than Actor? Class Changes from that menu also work properly. Stat changes, initial exp and TNL are also working great now.

I'm not quite sure what you mean... I guess I'll have to toy with it a bit.

As for other little things. The game is still looking at some stat chart somewhere for initial HP/MP for instance if you change Cecil's HP to 150, per se he'll still start with 200, but it will be 200/150. The same applies to MP. I guess a trick for that might just be to have an instant HP/MP restore when they join your party to right their HP/MP stats.

Ok I know exactly what's happening there and it's a quick fix, but I have to go now and don't have time to fix it right away, but probably sometime tomorrow morning I'll get that one out of the way.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 19, 2012, 11:24:46 AM
I just verified, it's Actor that decides level up stats. Class controls Sprite/Magic Links maybe other things. Interestingly enough however one might be able to make a hack that changes a character's class without resetting any of their other data. They'd still keep the same level up tables but have different magic/skills to use dependent on the Class they are at the time. Though it does appear that Commands are tied to Actors as one would imagine.

However this is such a great piece of work! Can't wait to see what you have in store next!

 :edit: I read up a bit on the Level Up Data and it seems that each level is 5 bytes. After the end of the Level Up Data there appears to be at least 112-128 FF Bytes which could be used for additional levels. I guess that's an additional 20-25 Levels one could add without running into the Starting Spell Data?

 :edit: 2 : Reading over some of JCE's old notes there are a lot more targeting options than the editor shows. Are these going to be included later? I for one would love a few of these random choice ones and the "type" targeting, reminds me of Dragon Warrior games in that vein.

 :edit: 3 About what I said with Actors being linked to Level up, I hadn't noticed that in the Actors tab you put a link to Level Up Tables. How interesting! That could really work to have a character switch class/actor and yet still continue with the same growth system. Eventually I'm imagining a true solo game, to where the player at camp maybe (shouldn't be that difficult to make the Cabin/Tent link to a second map) can switch classes/actors to get access to different commands and spells.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 20, 2012, 07:00:57 AM
However this is such a great piece of work! Can't wait to see what you have in store next!

 :childish: Thanks! Next I'm thinking... triggers/treasures? But first I must research the details.

:edit: 2 : Reading over some of JCE's old notes there are a lot more targeting options than the editor shows. Are these going to be included later? I for one would love a few of these random choice ones and the "type" targeting, reminds me of Dragon Warrior games in that vein.

Targeting for what? Spells? If so there's only three bits there for a total of 8 possibilities; exactly what the editor displays... Unless you mean commands maybe? In which case the targeting for those apparently only affects the cursor, not what the command actually targets so I didn't really see the point; though that would be a fairly easy component to add if there is demand for it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 20, 2012, 09:05:07 AM
Oh, are these only referring to Monster Sequences then?

(From JCE's notes)
Target List
===================

Target List (preceded by F8):
00-15:    Specific Character (by Actor Index)
16:    Self
17:    All Monsters
18:    All Monsters 2?
19:    All Monsters of the first type.
1A:    All Monsters of the second type.
1B:    All Monsters of the third type.
1C:    Party's Front Row
1D:    Party's Back Row
1E:    Paralyzed Monster
1F    Sleeping Monster
20    Confused Monster
21:    Critically hurt Monster
22:    Random Character/Monster (including Self)
23:    Random Character/Monster (excluding Self)
24:    Random Monster
25:    Random Monster (excluding Self)
26:    Random Character in the Front Row
27:    Random Character in the Back Row
28:    Entire Party
29:    All dead Monsters


Ah yes, a while back I decoded completely (for the most part anyhow) Phoenix's Location Trigger document and added labels to all of those. As far as I'm aware all of the information you may need could be in that document.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 20, 2012, 09:27:45 AM
Ok yeah that definitely sounds like monster action targeting to me... and yes I have a copy of that event trigger document; I'm reading it right now in fact.  :wink:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 20, 2012, 09:39:29 AM
Hmm, a shame they didn't use that more robust system for spell targeting, since a lot of those seem right out of FFV's playbook and then some.

Glad to hear that document's coming in handy. Though it's probably important to remember that's only part of the info. The other part with the Event Flags are right above that in the post, I believe? Though I'm not entirely sure if you plan on adding that yet.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 20, 2012, 09:50:34 AM
For location triggers/chests, has anyone worked out how the game knows which ones are valid chests? I haven't seen that anywhere. I wanted to turn a few unneeded teleport tiles into chests, but they don't work unless they were a chest originally. I figure there has to be more data somewhere. (Which makes the teleport/other event tiles that can be "opened" as chests even more confusing).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 20, 2012, 09:57:54 AM
I can do a quick test, but it may actually deal with a Chest tile actually being there. In fact let me try that out and see what happens.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 20, 2012, 10:00:17 AM
No, I've tested with chest tiles/other trigger tiles used for chests (like tall grass), and nothing. I thought maybe I was entirely incompetent with coordinates, so I just copied an existing teleport over a chest and chest over a teleport, so they were in the exact same places as they had been on the map, just in a different order in the ROM, and the chest didn't work.

(Sorry to go off topic in your thread, Pinkpuff. I can split these posts out if you want.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 20, 2012, 10:04:10 AM
For something on-topic, some of the equip displays in the editor seem to be off. Index 0 shows it equipped by no one, for example (it's what the Cursed ring uses, so it should be everyone). Statuses are similar, the Heal potion is shown not healing a lot of statuses it does (and healing ones it doesn't).

Edit: You can't turn off zombie race resistance in the armor editor, either.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 20, 2012, 10:19:32 AM
For something on-topic, some of the equip displays in the editor seem to be off. Index 0 shows it equipped by no one, for example (it's what the Cursed ring uses, so it should be everyone). Statuses are similar, the Heal potion is shown not healing a lot of statuses it does (and healing ones it doesn't).

Edit: You can turn off zombie race resistance in the armor editor, either.

Yep, just tested it. No dice. Hmm, does that mean we're missing something else as well? Is there another offset which corresponds to where treasure is supposed to go then? Statuses in the editor are a bit different. For instance when it's healing a status it looks at the status bits *not* executed. So Heal cures all things Except, KO, Berserk, Stun, Charm, etc.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 20, 2012, 10:21:41 AM
For something on-topic, some of the equip displays in the editor seem to be off. Index 0 shows it equipped by no one, for example (it's what the Cursed ring uses, so it should be everyone).

It seems to me that Index 0 is the only one that's messed up. Are there any others you noticed?

Statuses are similar, the Heal potion is shown not healing a lot of statuses it does (and healing ones it doesn't).

Statuses on healing items are inverted. This is because that's how it's stored in the ROM. So an item that only heals Mute will have all status flags on except Mute.

Edit: You can turn off zombie race resistance in the armor editor, either.

Hmm not just zombie either... I'll have to investigate this one...

Thanks for pointing those out!
Title: Re: Developing a comprehensive editor for FF4
Post by: Lenophis on September 20, 2012, 10:26:11 AM
Statuses on healing items are inverted. This is because that's how it's stored in the ROM. So an item that only heals Mute will have all status flags on except Mute.
You could change the wording to something like:
"Recovers all status except..."

Probably the easiest way to do it, though for thoroughness you could invert all of the bits on saving instead I suppose. :omg:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 20, 2012, 10:31:35 AM
Race bug fixed and uploaded.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 20, 2012, 10:34:05 AM
It seems to me that Index 0 is the only one that's messed up. Are there any others you noticed?
Only had a quick glance at them, but no, I think the others are fine.

Statuses on healing items are inverted. This is because that's how it's stored in the ROM. So an item that only heals Mute will have all status flags on except Mute.
I never really had any need or desire to edit these, so I was actually completely unaware of that fact. It would be less confusing if you inverted the highlighting in the editor for these. Helps from a usability standpoint.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 20, 2012, 10:36:58 AM
I think Dragonsbrethren had the right idea when he said to just add "Remove all Status Effects except..." description. It's a lot less work than to have a special case for something people could easily see if they looked.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 20, 2012, 10:50:26 AM
Agreed. I changed the entry in my default config file. Next time I upload it will be fixed.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 20, 2012, 09:32:08 PM
For location triggers/chests, has anyone worked out how the game knows which ones are valid chests? I haven't seen that anywhere. I wanted to turn a few unneeded teleport tiles into chests, but they don't work unless they were a chest originally. I figure there has to be more data somewhere. (Which makes the teleport/other event tiles that can be "opened" as chests even more confusing).
Phoenix posted some files a few years ago in this thread
http://slickproductions.org/forum/index.php?topic=1286.0
The "location triggers" file in the bundle seems to address making active treasure chests, but I haven't tested it personally (I'm currently trying to figure out the NPC data file in the same bundle... with limited success).

EDIT: Just tested it. It does work.  you have to edit the map layout, plus change the location of the trigger in order for it to work.  That is, if you change the location of the trigger (treasure) to a location where there is no object that might contain treasure, the treasure won't be there, but as soon as you put a chest (or pot, etc) there, you can collect the treasure.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 20, 2012, 11:05:42 PM
The NPC Data file is quite important (I thought I had decoded that a fair amount... somewhere?) to understanding what objects are being removed by the "Activate Object" and "Deactivate Object" flags. Not to mention that a lot of NPC's respond differently in regards to what Event Flags are currently set. I know there's an almost proper way to view that document, but I can't recall how off the top of my head.


Is that a separate Treasure Chest Index? What bytes are they comprised of? Earlier today I tried to switch a treasure chest location to no avail, but I forgot about this information.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 21, 2012, 08:41:54 AM
Yeah, Grimoire, the whole thread was pretty much you and Phoenix, but it was several years ago. 
I can't make heads or tails of what to do with the NPC placement document, but the event triggers (which includes exits and treasure chests) is actually very easy to use.  The trigger data is located in A8500 to A981F.  Each trigger is comprised of five bytes: x-position, y-position, type of trigger (exit, treasure, event), trigger details (x/y, treasure contents, event pointer). Phoenix even breaks them down by which map they're (originally) located in.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 09:08:19 AM
Hmm... might you be referring to... http://slickproductions.org/forum/index.php?topic=1734.0

The document for download at the bottom there? Or is there another exact similar location trigger document that I'm missing?

 :edit: I think that came out wrong, I meant to say if the data in another document uses the same formt of X/Y/Event Designator/Treasure Or Event Number/Treasure 2?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 21, 2012, 09:28:55 AM
ah, yes, didn't even see that you had done that.  The file I was referring to was the same one, BEFORE you decoded the whole thing.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 09:30:18 AM
Ah, a quick question. When you moved a treasure did you turn another trigger into a Treasure or did you move one Treasure to another location?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 21, 2012, 11:16:01 AM
ah-ha - good question...
at first, I was just talking about moving the x/y of an existing chest, but I just tested switching a chest with an exit.  Seems if you keep the x/y locations, but change the instructions, the exit will work but the chest will be invalid.  If you keep the instructions but change the x/y locations, they will both work.  It's almost like the ROM checks for all treasure chests first, then when it sees the first non-treasure trigger, it ignores all subsequent treasure triggers.
so:
original
Quote
2A   Castle Baron (1F)            A87EE-A8824   0D 03 FE 00 1E
                           0E 03 FE 80 CE
                           0F 03 FE 80 E2
                           08 00 2B 0E 07
                           01 05 24 CC 0D
                           08 0F 24 8F 12
                           10 0A 24 53 0D
                           05 05 66 04 08
                           0B 05 67 04 08
                           06 0A FF 03 00
                           0E 05 FF 01 00
doesn't work:
Quote
2A   Castle Baron (1F)            A87EE-A8824   0D 03 24 53 0D
                           0E 03 FE 80 CE
                           0F 03 FE 80 E2
                           08 00 2B 0E 07
                           01 05 24 CC 0D
                           08 0F 24 8F 12
                           10 0A FE 00 1E
                           05 05 66 04 08
                           0B 05 67 04 08
                           06 0A FF 03 00
                           0E 05 FF 01 00
does work:
Quote
2A   Castle Baron (1F)            A87EE-A8824   10 0A FE 00 1E
                           0E 03 FE 80 CE
                           0F 03 FE 80 E2
                           08 00 2B 0E 07
                           01 05 24 CC 0D
                           08 0F 24 8F 12
                           0D 03 24 53 0D
                           05 05 66 04 08
                           0B 05 67 04 08
                           06 0A FF 03 00
                           0E 05 FF 01 00
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 11:21:19 AM
So wait, it is that simple? I could've sworn I had tested placing all of the chests in the beginning.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 21, 2012, 11:48:21 AM
what I didn't try (and now that I think about it, what you WERE trying to do from the start) was completely replace an exit with a treasure chest (that is, remove an exit, add a treasure).  This may not be possible without at least removing another treasure somewhere else (?).  I think I remember reading Phoenix saying that the game has a fixed amount of space devoted to treasure locations... though it seems very strange that you wouldn't be able to steal an exit slot to give to treasure.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 12:31:56 PM
Yes, that's precisely what I was referring to. I had thought at first you had come across a document that details this elusive "Treasure Index" that map data seems to contain and only once I remembered that I realized why extra chests couldn't be spawned I realized that was the reason. This Treasure Index thing may have the answers, if we can locate it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 02:28:32 PM
Just from a quick glance, the treasure index may indicate how many chests to skip ahead. Baron is $00, Kaipo Mist is $07. Baron has seven treasures. I haven't tested this yet, but maybe changing Kaipo Mist to $08 will allow Baron to have an additional working chest? It would certainly be an odd way of handling it, but this is an odd game internally.

Edit: Yep, that seems to have done it.

(http://dkk.slickproductions.org/images/ff4/treasureexpansion.png)

The chests do all have to be in the beginning, before the other events. I changed that door into a treasue with Kaipo Mist's index set to $08. It didn't work. I swapped its position with Baron's Inn door (so I wouldn't have to edit the map to make it accessible as a treasure), made the Inn door into a treasure, and it worked perfectly. Changed Kaipo Mist's index back to $07, just to prove we're not idiots, and it stopped working again.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 02:39:27 PM
Well done Dragonsbrethren! That is that long time mystery solved. Does that mean that there's only 255 Treasures allowed though? I always thought there were more chests than that in FFIV.

 :edit:

Quick question though. Did that take a spot from Kaipo? As in did one of those treasure triggers no longer activate?
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 02:44:03 PM
I haven't made my way over to Mist to test yet (yeah, it was Mist, not Kaipo, got my internal order mixed up); hopefully I have a save without those treasures collected.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 02:46:18 PM
Hmm, would an easier way to be to erase the beginning event, load up in Mist and check from there? With the editor I've been finding a bunch of event shortcuts to help with testing all those sorts of things.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 02:52:41 PM
Nah, I had a save. One of the treasures in Mist can't be collected with this change in place. So if you add treasures, you need to update every map's index. Kind of sucks, but it works for what I want to do, it's better than not being able to change them at all.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 02:59:41 PM
That's very true. What an odd limitation for the game to have only 255 Treasure Chests (Maybe 510 if it Underground/Moon uses a seperate index?) available in chests.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 03:05:23 PM
Yeah, I'll check that out in a bit. Can't say I've ever counted the chests/treasures in this game. What's interesting is this means parts of the Sealed Cave, Crystal Palace, and Subterrain (or rather, the maps that follow them) have their index set too high, which is why you can get treasures from other triggers in those maps. The system seems to have been put into place to specifically prevent false positive chests from happening (otherwise, why use an index at all? If you're going to step through this data every time anyway, you could just determine it automatically).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 03:10:57 PM
Oh of course! That fully goes to explain that old bug. That's some pretty good insight into the matter. With that kind of thought process it makes sense that it would be put together that way. Is that also the reason that treasure come first before anything else in the Location Trigger Data?
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 03:17:36 PM
Yeah, I edited that bit into my first post about this, but I guess you didn't see it. Now what I didn't test was changing, say, the second teleport and setting Mist's index to $09.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 03:27:02 PM
Yeah, I edited that bit into my first post about this, but I guess you didn't see it. Now what I didn't test was changing, say, the second teleport and setting Mist's index to $09.

Yep, completely missed it. Went back and looked at it. Very good proof of concept in action. Thanks for the confirmation. Now that's all starting to make sense. Though now the difficulty for PinkPuff is in how to make this all work in the FF4kster editor without becoming a mess. However until that happens we have Hex editors.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 04:04:34 PM
It looks like there are separate indices for the Underworld. They restart from zero at Kokkol's Smith entrance, same as the map indices. The last Overworld entry is F9, so we can probably add a few more chests without removing any. I'm not about to do it unless Pinkpuff can get inc/decrementing these indices automated in the editor; you'd have to be insane to do these by hand.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 04:33:14 PM
Recalculation is the most likely solution, hmm? In theory it doesn't sound that difficult to implement, in practice though, I'm not entirely sure how easy it would be to get that to work. Good to hear though that there is a second index for the Underworld/Moon. I had no idea that those two even used that much treasure. But eh, F9 is... 6 less than FF, I guess that's something. So all 255 Treasures are used on the Overworld then, I take it?
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 04:49:37 PM
F9 is the overworld. I didn't check what the underword/moon end at.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 04:52:14 PM
Oh, I completely misread the above statement as Underworld instead of Overworld. Now that is a relief and leads me to believe that we can expect to have a lot of free space (and some freed up space when you take the Tower of Babil, Crystal Palace, and Sealed Cave wrong treasure indices into account)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 07:43:38 PM
Since we've been on a bit of a Location Triggers binge I decided to clean up the old NPCs document, using Wordpad, a bit of spacing, it looks much more readable (then again its readability problems may have just been caused by my notepad and whatnot. I've started to decode it, and will do so next week, but I'll be away for the weekend, or at least away from my main computer.

Ways to read it. Load it in Wordpad. Go to View, change it to No Wrap, and you should have a properly spaced clean looking document, If there are any problems, please let me know.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 08:01:49 PM
Looks horrid in Notepad++ because I have tabs set to four spaces. I really recommend using spaces instead of tabs, that'll ensure everyone sees it the same way. (Also consider this a plug for Notepad++; it can automate this.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 21, 2012, 08:14:19 PM
The problem with spaces as you can imagine is that it takes even more time to get things positioned while just using tab makes things a simple matter all together.

I didn't count on anyone using it on anything but WordPad. I tried to use NotePad++ to instantly fix it as you suggested it, but I couldn't find anything like that in its Edit feature, maybe I missed something.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 21, 2012, 08:34:49 PM
I don't want to go into the whole tabs vs. spaces argument here, but you mentioned cleaning up the document, and you've made it look worse on my end. Phoenix's wasn't perfect, but the text is even more off now. While you can use Notepad++ to replace tabs with spaces, it's just not going to give decent results in this document. What you can do is use its option to insert spaces instead of tabs:

Settings -> Preferences -> Language Menu/Tab Settings
Tab Size: 8 (or whatever)
Replace tabs by space.

When you hit the tab key, it'll insert the correct number of spaces, working exactly like a normal tab (unlike the replace option, which always inserts X spaces, rather than up to X). It'll take a little work converting manually, but it'll be worth it for ensuring the document looks the same to everyone. Unfortunately, the replace option can't automate this for some reason (you'd think if you told it to replace all tabs with tabs when you had this setting enabled, it would do spaces instead, but it doesn't.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 22, 2012, 05:32:04 AM
Though now the difficulty for PinkPuff is in how to make this all work in the FF4kster editor without becoming a mess.

Doesn't seem too difficult if I understand correctly...

When writing the info back to the ROM it would just iterate through all the triggers in all the maps, counting how many treasures it comes across. When it reaches the end of the list of triggers for a given map, the treasure index for the next map is the current running total. Simple, intuitive, linear running time, and the user doesn't need to worry about it.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 22, 2012, 03:41:57 PM
Hey Pinkpuff,
I just noticed a little bug in the event editor: since the main character and NPCs have a slightly different set of available actions, inputting "You Toggle Visibility" always causes the main character to become invisible.  This is because NPCs can toggle invisibility, but the main character has separate commands to disappear and reappear.  It's just a tiny little thing, but I just spent the better part of an hour trying to figure out why I couldn't make my main character reappear  :eek:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 23, 2012, 07:17:24 AM
I'm afraid I don't understand...
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 23, 2012, 01:22:19 PM
It's not really a bug in the editor as much as it is a peculiarity in the way the game is programmed. If you go to Character Movement, choose You (who I believe is always the main character) there's a slight text error here. Main Character has a different set of animations which begins at C0-CF, as I'm sure you're aware of because you programmed it in that way. Now for their commands you have for C8 - Toggle Visibility, and C9 Do nothing. When in reality it should read C8 - Make Invisible. C9 - Reappear. Or something to that matter. I believe that's all he's referring to.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 23, 2012, 02:32:04 PM
Double Post: Looks like you were right DragonsBrethren using NotePad++ and using the directions you specified did make everything look immaculately nicer in even normal Notepad.

Here's a truly cleaner document which should work fine in any notepad-esque application.

 :edit: Another quick Editor fix. Event 0C which is called "Empty" in Phoenix's Event Editor and "Empty Chest" in your editor, Pinkpuff is actually the "Locked." message for places like the Waterway and Equipment Shop in Baron. Though in theory it should be easy to lock a chest with that message and require a specific item to open it.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 23, 2012, 02:51:54 PM
Yes, that's the right idea...
08, 18, 28... B8 are instructions to make a NPC toggle visibility (becoming invisible if visible, and becoming visible if invisible).
09, 19, 29... B9 are instructions to make a NPC jump two spaces sideways.
C8 is the instruction to make the main character invisible.
C9 is the instruction to make the main character visible. (main character cannot jump two spaces sideways)
As a matter of fact, all main character movement instructions after C7 differ from their corresponding NPC instructions.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 23, 2012, 07:23:47 PM
Alright the NPC document is complete (or as complete as I can get it. I'd rather not waste several hours looking up what each message event is, so I skipped the great majority of those) with information on what each event is and what event flags are necessary to run it. So here you all are. I hope this can help in the editor, somehow.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 23, 2012, 07:37:45 PM
It sure will!

I'm still trying to design the trigger editor. It's not as straightforward as I had imagined somehow.

Anyway I fixed the mislabelling issues on my local copy. Next time I upload they will be correct.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 23, 2012, 08:14:22 PM
Thankfully the Location Trigger data is in nice easy to manipulate chunks of 5. Unfortunately everything else dealing with NPC's and events are not.

Though if I may ask, what design are you currently going for in the Trigger Editor? I know a slight bit about programming, maybe I can help in some way.

 :edit:
There's 2429 free Bytes at the end of events. That's Plenty of room to add anything you want for a very large amount.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 24, 2012, 06:52:24 AM
Thankfully the Location Trigger data is in nice easy to manipulate chunks of 5.

It seemed like that at first glance to me too, except I think that event calls need to be part of this component as well. So when you create or edit an event trigger you should in the same edit box be able to specify the details (what conditions to call what events, etc).

Unfortunately everything else dealing with NPC's and events are not.

We'll get there (probably next) but hopefully by that time I'll have a nice portable "event call editor box" from the trigger editor that I can port over to the NPC editor since it uses the same mechanic as the trigger tiles for calling events.

Though if I may ask, what design are you currently going for in the Trigger Editor? I know a slight bit about programming, maybe I can help in some way.

Thanks, but the programming part is actually pretty straightforward. The part I'm working on is a good way to display/manipulate the data that's both somewhat intuitive and still allows full freedom of editing. I'll come up with something I just need to toy with things a little first and it may take some time.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 24, 2012, 10:21:52 AM
Oh I see. That is probably a much more user-friendly way to go about that then to have three or four separate menus.

So let's see...

There's Treasure/Map Movement/Events and from the Event section is another Sub-section of event triggers that correspond to various step-event triggers, which is little doubt where the complication really arises with all of those "If Event Flag is Set" dealings as those step-event triggers are just as detailed as NPC's and the like.

Yeah, design is something I'm... not the best at so I'll wait to see what you come up with, hehe.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 24, 2012, 12:46:32 PM
If all goes well it will also give you previews of the text from bank 2 when you're entering "data after event call" for those events that use them.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 24, 2012, 12:58:20 PM
Oh that would be nice. Did that information I found a while back help at all with that, or was I on the complete wrong path?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 25, 2012, 05:50:56 AM
The bank 2 info I assume you mean? I'm not there yet but I imagine it will be quite handy.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on December 09, 2012, 08:41:52 PM
Don't know if this is still being worked on but I have a couple of things.

-On the stat bonuses when you select the numbers there isn't a 0/0 option to remove any stats that are there. For example, try and remove the Protect Ring's VIT bonus. 
-Editing the game menus possible in the next revision or three?
-Shop 22 is "Mythril Items".
-On the Edit Medicines page when you are in the Information window the "Visual"  is off by one.  When you select "Heal" for example you get "Life1".
-Are there any key combinations to select item and magic icons while renaming?
-Please offer a 2x or 3x view mode.  Seeing things at the original size font on large screen resolutions is a bit difficult.  :(

Otherwise I haven't seen any game breaking bugs like on my old editor or the two different versions by Zyrthofar.  Keep up the great work!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 10, 2012, 06:24:28 AM
Don't know if this is still being worked on but I have a couple of things.

It is, but I've been distracted with other things lately. I'm currently trying to get my bearings with regards to where I had left off and what needs to be done and how to do it.

-On the stat bonuses when you select the numbers there isn't a 0/0 option to remove any stats that are there. For example, try and remove the Protect Ring's VIT bonus. 

Thanks! Found the problem, it had to do with the way it was reading the armor stat bonuses. Anyway it's fixed now and uploaded, so if you re-download you should be able to turn off the VIT bonus.

-Editing the game menus possible in the next revision or three?

Not sure what you mean... the character battle menus can be edited in the Actor editor. Unless you mean, like, the dimensions and sizes of various game windows? If so, that's not really a high priority for me, sorry. I'm more interested in editing the game data itself, but once I have my main wish list of features implemented I might look into it.

-Shop 22 is "Mythril Items".

Thanks! Shop config file updated in the newly uploaded version.

-On the Edit Medicines page when you are in the Information window the "Visual"  is off by one.  When you select "Heal" for example you get "Life1".

It doesn't do this for me... if you still have problems after re-dowloading please let me know. Perhaps someone else can confirm if this is happening for them as well?

-Are there any key combinations to select item and magic icons while renaming?

Yup! While editing/entering text, hit the Insert key on your keyboard. A colored symbol will come up and you can use the arrow keys to cycle through the various game symbols that don't have an obvious corresponding keyboard key (such as the weapon/armor symbols, item symbols, status effect symbols, etc). When you land on the symbol you're looking for press Enter to insert it into the text.

-Please offer a 2x or 3x view mode.  Seeing things at the original size font on large screen resolutions is a bit difficult.  :(

I imagine it is, but to get such a mode working and tested on my resolution is even more difficult... sorry :(

Otherwise I haven't seen any game breaking bugs like on my old editor or the two different versions by Zyrthofar.  Keep up the great work!

Thanks! Glad to hear people are finding it useful. I'm thinking of perhaps writing a readme and posting it to Romhacking.net once I get the trigger editor done.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 10, 2012, 10:47:55 AM
Hah, I did not know about the "Insert to get game symbols" part. That actually opens up items a fair amount since I don't have to go into another editor just to change the icon.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 10, 2012, 02:30:14 PM
It was in my "keyboard controls" post on page 1...
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 10, 2012, 02:42:47 PM
Ah, about 3/4 down the page. That would explain why I didn't remember it too well.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 12, 2012, 06:52:09 AM
At long last I believe I have the trigger editor working. I have given it some very basic testing, so it is entirely possible that it is riddled with bugs but as far as I can tell, it appears to work correctly so far.

The trigger editor works as follows:

First, select a map. When you do so, you will be presented with a list of triggers associated with that map. In this menu you can press INSERT to create a new trigger or DELETE to delete one. The triggers are currently only named with "Trigger ##" so it may appear as though you're only adding/deleting from the end of the list but this is not the case, as it renumbers the triggers whenever the list is changed.

Once you select a trigger with ENTER, a new menu will appear allowing you to edit various aspects of the selected trigger.

Changing its location will allow you to specify the X/Y coordinates of the tile that will launch the trigger. If you change this, be sure to update the corresponding map tiles accordingly (not possible with my editor currently but I'm pretty sure you can do that with Phoenix's FF4Tools), as only certain kinds of map tiles can launch certain kinds of triggers.

Changing its type will allow you to change whether the trigger is considered a treasure, teleport, or event call.

Changing its parameters will allow you to change the particular details such as which treasure you get or where the teleport will send you. In the case of an event call, you can change which event call is launched, and once  you confirm you will be given an opportunity to change the details of that particular event call. The cursor will move to the list of events that are called by the event call and show you what conditions must be fulfilled to execute the currently highlighted event. You can add new events to the event call with INSERT and delete existing ones with DELETE. ENTER allows you to change the currently selected event to a different one. Use the TAB key to alternate between the event menu and the condition menu. In the condition menu, the controls are similar: INSERT to add a condition, DELETE to remove one, ENTER to change the details of the current condition. Conditions are automatically sorted by truth value, so if your condition jumps around after you change/insert it, that is why.

Please let me know if there are any problems. Happy hacking!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 12, 2012, 08:57:29 AM
I will have to try this out as soon as possible! Glad to see the trigger editor is up and running!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 12, 2012, 10:17:47 AM
Hmm, I noticed that when you get to the Underworld Map trigger listings and onwards nearly each and every teleport marker is labeled incorrectly. Though I probably shouldn't say "incorrectly" but it only seems to be reading these maps as their Overworld varieties, for instance some of the first Underworld maps are Kokkol's Forge, but in the editor it is listed as Kaipo, which corresponds to it's Overworld location. Even setting on one of the Underworld maps will move it to its Overworld comparison.

 :edit: The treasure triggers seem to work fine. I haven't tried moving them but I recall hearing from another forum-goer that it won't work unless you set a treasure tile in that specific spot. Aside from the oddity in the Underground maps, the overworld maps have their teleport triggers working properly.

 :edit: 2 The Event triggers appear to work perfectly! But as above if you want to include new ones or replace a treasure chest with an event you will need to edit the tile it is on.

Very impressive work! Now all we need is a text editor and I think there will be all the tools necessary to potentially make an entirely new game!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 13, 2012, 07:03:22 AM
Hmm, I noticed that when you get to the Underworld Map trigger listings and onwards nearly each and every teleport marker is labeled incorrectly. Though I probably shouldn't say "incorrectly" but it only seems to be reading these maps as their Overworld varieties, for instance some of the first Underworld maps are Kokkol's Forge, but in the editor it is listed as Kaipo, which corresponds to it's Overworld location. Even setting on one of the Underworld maps will move it to its Overworld comparison.

Thanks! It never even occured to me to check that...  :isuck:
Anyway it should be fixed now if you re-download.

:edit: The treasure triggers seem to work fine. I haven't tried moving them but I recall hearing from another forum-goer that it won't work unless you set a treasure tile in that specific spot. Aside from the oddity in the Underground maps, the overworld maps have their teleport triggers working properly.

 :edit: 2 The Event triggers appear to work perfectly! But as above if you want to include new ones or replace a treasure chest with an event you will need to edit the tile it is on.

I mentioned something to that effect:

Changing its location will allow you to specify the X/Y coordinates of the tile that will launch the trigger. If you change this, be sure to update the corresponding map tiles accordingly (not possible with my editor currently but I'm pretty sure you can do that with Phoenix's FF4Tools), as only certain kinds of map tiles can launch certain kinds of triggers.

Very impressive work! Now all we need is a text editor and I think there will be all the tools necessary to potentially make an entirely new game!

Thanks! Actually I think Phoenix's editor allows changing text... so really all mine needs now is NPC editing and then between mine and Phoenix's we've got most of the plot-related stuff covered. Thus, I think I'll wait until I get NPC editing done before I upload this to RHDN.

That said, I think to really make an "entirely new game" I'd like to have some more editors done such as monsters and battle events, and at some point I will probably be implementing my own version of a dialogue editor and even a map editor if I can get the graphics read/displayed properly.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 13, 2012, 06:04:42 PM
Oh I forgot you can't just just transport from the Underworld/Moon Maps to the Overworld maps. That explains the discrepancies.

A slight bit a of a shame, but I guess that can be worked around in some ways.

The real issue I have with Phoenix's text tool is it's speed... it's horrendously slow when you start typing.

I did completely forget about battle events... I know we know Something about them (Various hacks turning event battles into normal battles, etc) But aren't most battle events more or less part of the enemies various AI scripts? (I know it's that way with the Golbez/Shadow battle at least)

A good point on what it would take to make a real new game. The various enemy editors we have now are a bit finnicky as memory serves. Adding NPC's to this though does seem like the next great leap forward. (Did I write up an information sheet on NPC's? I don't recall if I did or not)


Hmm, one thing I must stress. Looks like Phoenix's site is all but down. We should probably upload the editor to the website so it's not lost through the loss of the webpage.
Title: Re: Developing a comprehensive editor for FF4
Post by: Deathlike2 on December 13, 2012, 07:02:09 PM
I did completely forget about battle events... I know we know Something about them (Various hacks turning event battles into normal battles, etc) But aren't most battle events more or less part of the enemies various AI scripts? (I know it's that way with the Golbez/Shadow battle at least)

There are a few types.

1) Auto-battle. Things like the initial airship battle sequences are scripted. Those can be customized, but require some extra work.

2) Battle specific scripts - Despite being the same monster, Rubicante does different stuff to Edge, based on the battle formation #. This is written into its battle script, including such bosses as the Dark Elf (which is event based scripting whether or not you have the Whisperweed) and the FlameDog in the special treasure chest in the Tower of Zot.

There are special designations to certain battles... like forcing a back attack in the undead Scarmaglione battle... but something more complicated happens in Zeromus's final battle (the one where Cecil must use the Crystal), or the underground Golbez battle. Golbez's battle has "two versions" as the one that went unused has some odd bugs in it (it seems to "work in reverse" with regards to Golbez's invicibility). It probably has some hardcoded Hide for Rydia to start the battle (she is added behind the scenes there), so it depends on what you're accomplishing there.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 13, 2012, 11:01:19 PM
Quote
Hmm, one thing I must stress. Looks like Phoenix's site is all but down. We should probably upload the editor to the website so it's not lost through the loss of the webpage.
Wow, you're right. That's a shame... FFTools is still available through romhacking.net, though.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on December 15, 2012, 11:26:30 AM
Shame Phoenix didn't add more to the FFTools.  I liked it for creating events and maps.  :)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 27, 2012, 10:33:18 AM
Ok, the NPC editor is done, and as far as I can tell it is working. By all means, try it out and prove me wrong so I can fix it.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on December 27, 2012, 08:14:14 PM
Awesome, I will try it this weekend.  :)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 30, 2012, 08:47:26 PM
Been away for the holidays and missed this update! I will definitely try this out and tell you how it goes.

Hmm... there are a few noticeable issues.

The first entire menu works, X/Y/Speed, etc and you can change NPC's without incident. There are no issues there whatsoever.

The entire second and third menus however appear to do nothing. You cannot change their sprite, you cannot set whether they are visible or invisible and nothing occurs in the third menu if you try to change their events. Also you cannot access the Flag requirements being On or Off in this menu as far as I'm aware.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 31, 2012, 06:32:31 AM
Pinkpuff smash bug!  :banonsmash:

Try it now. (Be sure to download from the timecave link for development updates, not RHDN)

Also you cannot access the Flag requirements being On or Off in this menu as far as I'm aware.

The flag menu should appear when you highlight an event call in their "speech" list. You should be able to tab into it (there should be three components you can tab between when editing speeches: the event list, the bank 2 message list, and the flag settings list).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 31, 2012, 07:39:22 AM
Talk about efficient! Looks like the second menu works now and here's something really strange... I would have no idea what's causing the issue.

I changed the Baron Dancer's second event to be caused by a Flag of 12 and to test that I input Flag 12 in the opening event, yet when I talk to her, regardless of event chosen, it goes to the Fat Chocobo box. Yet, when I moved the Dancer by 1 Y the event I put there (Behemoth Battle Formation, is Mad Ogre's for Overworld) seemed to work?

Other than that oddity everything appears to be working great and will report any other problems I happen to find after work.

 :edit: Oh, how interesting. I was wondering why there appeared to be "incorrect" values and so many mentions of Tellah Joining at the Watery Cave, but now I see that's because it's loading an NPC, not an object that is Unique to that particular map, turns out I was looking at Tellah.

Good work deciphering that PinkPuff. Maybe that's what always confused me about NPC's, I never realized that it was in a different format, so to speak from other event matters.

 :edit: 2 Hmm, there might be more wrong with this than I originally thought. Here's the thing... when I go to replace the Baron Dancer's event in virtually anyway, it's bizarre but another dancer appears inside of that dancer, which causes strange issues like NPC's randomly disappearing, fires being gone, and talking to the dancer will only cause the Fat Chocobo menu to appear.

 :edit: 3 Is this a preview of the Text Editor portion PinkPuff? If so it looks pretty good!
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on December 31, 2012, 04:27:30 PM
That extra dancer is probably caused by the fact that they only changed the sprite assignments to censor the stripper, rather than the NPCs. The dress sprite and alternate dancer sprite are all placed on the same tile as the normal dancer, even in FF2. FF4 makes the dressed dancer invisible, makes the swimsuit dancer visible and makes the tossed dress visible, then reverses the process at the end of the dance. FF2 does the exact same thing, but the dancers share the same sprite and the dress's sprite has been set to none.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 31, 2012, 10:54:20 PM
That extra dancer is probably caused by the fact that they only changed the sprite assignments to censor the stripper, rather than the NPCs. The dress sprite and alternate dancer sprite are all placed on the same tile as the normal dancer, even in FF2. FF4 makes the dressed dancer invisible, makes the swimsuit dancer visible and makes the tossed dress visible, then reverses the process at the end of the dance. FF2 does the exact same thing, but the dancers share the same sprite and the dress's sprite has been set to none.

Ah so that's how they censored it. I thought they actually removed it from the game rather than replaced it. I guess replacing it was easier for them. I guess in reality that's a Placement Spot that can be used for another NPC now?
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 01, 2013, 01:36:58 AM
If that's what you want to do. Alternatively, you could change the one dancer's sprite back to the dressed sprite (forget the value, look up Phoenix's doc).
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 01, 2013, 08:05:45 AM
I changed the Baron Dancer's second event to be caused by a Flag of 12 and to test that I input Flag 12 in the opening event, yet when I talk to her, regardless of event chosen, it goes to the Fat Chocobo box. Yet, when I moved the Dancer by 1 Y the event I put there (Behemoth Battle Formation, is Mad Ogre's for Overworld) seemed to work?

So, did this turn out to be related to the dancer/dress thing? Or does something similar happen with other NPCs as well?

:edit: Oh, how interesting. I was wondering why there appeared to be "incorrect" values and so many mentions of Tellah Joining at the Watery Cave, but now I see that's because it's loading an NPC, not an object that is Unique to that particular map, turns out I was looking at Tellah.

Good work deciphering that PinkPuff. Maybe that's what always confused me about NPC's, I never realized that it was in a different format, so to speak from other event matters.

I have to be perfectly honest... I have no idea what you mean here...

:edit: 3 Is this a preview of the Text Editor portion PinkPuff? If so it looks pretty good!

 :whoa: Ah I forgot to disable it! Oh well that's fine, I guess it'll serve as a little teaser for what's in store in the hopefully near future!
The previews seem to be mostly working (the combat ones aren't displaying things like name references correctly yet), so I need to fix up those a little, and then I'll be working on creating a component for entering multiline text such as the regular game dialogue on the map. It'll probably be similar to the existing "small" text input except with a visible, moveable cursor and a much larger box, and the ability to insert references to things such as character names or song-playing commands.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 01, 2013, 11:28:13 AM
So, did this turn out to be related to the dancer/dress thing? Or does something similar happen with other NPCs as well?

Yes, as it turns out there's something odd going on here, changing NPC's seems to be fairly unstable but now that I think on it... is it possible that maps have "sprite limits"? In that you can only have so many NPC's of differing types before the game chooses what it will and won't load? Maybe that's what's going on here... However for Baron Town, every NPC that wanders around has a different sprite from one another, so that's likely not it.

Another thought is that do different event calls have different hex lengths? For instance if I were to switch the normal guard in front of the Training Room from Message 1 to... for fun, Zeromus Event (doesn't even work on Overworld map and comes up with a completely different formation) does that alter any lengths that may be throwing off the proceeding Placement spot? I'll have to continue to test  to get to the bottom of this.



:edit: Oh, how interesting. I was wondering why there appeared to be "incorrect" values and so many mentions of Tellah Joining at the Watery Cave, but now I see that's because it's loading an NPC, not an object that is Unique to that particular map, turns out I was looking at Tellah.

Good work deciphering that PinkPuff. Maybe that's what always confused me about NPC's, I never realized that it was in a different format, so to speak from other event matters.

Quote
I have to be perfectly honest... I have no idea what you mean here...

I should have been clearer here... I had only meant to say that I did not realize that Placement Spots are just that, placement spots for NPC values. As I thought that the NPC's were tied to that spot in data. Not elsewhere in data and so when you come across a Party Member Placement Spot, they will often if not always have their "You talked directly to them" events. Tied to their NPC themselves rather than anything dealing with their position in the map. That's all I meant by it.



:edit: 3 Is this a preview of the Text Editor portion PinkPuff? If so it looks pretty good!

Quote
:whoa: Ah I forgot to disable it! Oh well that's fine, I guess it'll serve as a little teaser for what's in store in the hopefully near future!
The previews seem to be mostly working (the combat ones aren't displaying things like name references correctly yet), so I need to fix up those a little, and then I'll be working on creating a component for entering multiline text such as the regular game dialogue on the map. It'll probably be similar to the existing "small" text input except with a visible, moveable cursor and a much larger box, and the ability to insert references to things such as character names or song-playing commands.

That's good to see, because one of the obvious issues I saw with it was the inability to move the cursor.

Oh yes, one more suggestion. Could you input the name table for Sprite Numbers? Since the list we have is in Hex and the one you input was numerical it gets a little confusing telling which sprite is which without some calculation on part of the user.


 :edit: Yes, there appears to be something quite wrong here. I changed only the Placement 3 NPC's Message 0 to "Finding Odin before Land of Summon Monsters" and it was clear that things weren't quite right. The old man who talks about the Sword of the Dark Side vanished and the Lock on the Old Waterway was also gone. The Lock on the Waterway is the first Placement while the old man is the 4th placement. Trying to change it back causes another host of problems.

To see the problem for yourself I suggest changing the 3rd Placement's NPC Message 0 event to another event and see what occurs.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 02, 2013, 04:54:33 AM
Oh yes, one more suggestion. Could you input the name table for Sprite Numbers? Since the list we have is in Hex and the one you input was numerical it gets a little confusing telling which sprite is which without some calculation on part of the user.

I'm planning on creating a config file for naming the sprites, NPCs (though probably not the placements), and flags.

:edit: Yes, there appears to be something quite wrong here. I changed only the Placement 3 NPC's Message 0 to "Finding Odin before Land of Summon Monsters" and it was clear that things weren't quite right. The old man who talks about the Sword of the Dark Side vanished and the Lock on the Old Waterway was also gone. The Lock on the Waterway is the first Placement while the old man is the 4th placement. Trying to change it back causes another host of problems.

To see the problem for yourself I suggest changing the 3rd Placement's NPC Message 0 event to another event and see what occurs.

I did exactly what you suggested and it worked perfectly. I talked to the buddy and the screen flashed and Cecil was like "... your majesty?" and the event played out just like it should and no one disappeared.

Are you sure you're using a headered 1.1 rom?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 02, 2013, 10:22:53 AM
Hmm, I'm using the Rom I've been using all of this time... maybe it's just a bit too dirty now? Let me try on a clean 1.1 Headered Rom.

Bah, what a shame. It seemed it was my Rom. Which means all the work I had done is now rendered obsolete, since there's no way I can tell when the corruption started or what had caused it.

I had recalculated everyone's levels and stats as well as altered all equipment, but alas. Looks like I have to start fresh.

 :edit: For a test I restored the original first dancer's dance. Looks like all they did was change the initial sprite to the dancer and made the Dress sprite into a blank sprite, pretty much as Dragonsbrethren suggested.

 :edit: 2 Since it seems that we're getting into the nitty gritty of the game's system. I think I'll list a number of non-essential events that can be safely replaced which are not important to the story as well as sprites that bear little on the game. I will also list their Trigger number and location for touch events.

Behemoth Battle 51 (Trigger 4 in Bahamut's Cave 2F)
Behemoth Battle 52 (Trigger 1 in Bahamut's Cave Bahamut's Floor)
Hummingways
Namingway
OUCH!
Cecil's Maid
Item Selection - Soft
Finding Odin before Feymarch (Trigger 1 in Baron Castle Odin's Room)
Devil's Road is sealed  (Trigger 2 in Baron Devil's Road)
Staying at a 50 GP Inn (You could honestly only have one, all same  have the screen go black, let the music play and reappear in front of Innkeeper the rest of it is just little niceties which aren't really necessary)
Staying at a 800 GP Inn
The current is too strong for us to get in! (Not necessary)
Giott: Open the Door! (I don't believe this is even used in its normal event)
Fallen soldier in Damcyan's basement (sad, but not necessary)
Staying at a 100 GP Inn
WA! (Not sure where this is even used)
Being poisoned by bartender in Mysidia (Mysidia events, while amusing, aren't necessary)
Staying at a 200 GP Inn
Speaking to White Mage in Mysidia
Being turned into a Toad by a Black Mage
Resting for free in Fabul (Trigger 3 in Fabul King's Room) (The Cecil bed can be used for that)
Staying at a 400 GP Inn
HP Restoring Pot
MP Restoring Pot
Being turned Mini in Baron's Classroom
Staying at a 1600 GP Inn
Staying at a 3200 GP Inn
Staying at a 6400 GP Inn
Staying at a 12800 GP Inn
Baron Dancer's Dance
Kaipo Dancer's Dance
Fabul Dancer's Dance
Agart Dancer's Dance
Mysidia Dancer's Dance
Baron Dancer's Dancer after killing Cagnazzo
Mythril 3 Dancer's Dance
Toroia Dance Troupe's Dance
Dwarf Castle Dancer's Dance
Reading the Magazine
Obtaining the Magazine
Obtaining a Grimoire 6C
Obtaining a Grimoire 6D
Trading the Pink Tail for Adamant Armor
Do you have a pass?
Watery Pass - North exiting message (Trigger 7 in Watery Pass 5F)
Behemoth Battle 50 (Trigger 0 in Bahamut's Cave Bahamut's Floor)
Obtaining a Grimoire 91
Viewing the Moon through the telescope


There may be a few more, but that should free up quite an amount of new events for people to use.



 :edit: 3 Oh here's something interesting! It seems as if at one time Tomra NPC's were meant to have more than one line of text, since they have 3 events (like the Baron NPC's) but their unused message banks appear to be blank.

Here's a real oddity, Kainazzo's sprite is apparently in Tomra, but invisible  at X 28/Y 22, how bizarre and if this is to be believed there's an untriggered shop inside of Tomra's main map apparently with the sprite of a Woman shopkeeper.


Wait a second... I think the Underworld is screwed up. Everything seems off slightly. For instance... there is no Baron Dancer in Tomra's Inn or a host other oddities that seem to crop up in the Underworld triggers.

 :edit: 4 It does appear that there are some serious problems with adding and removing Placements. Adding is fine, except it seems it will take some Placements from other maps (I have no idea how that works or why it works like that) however even on a clean rom it will cause the issues I referred to in my previous post.

 :edit: 5 Well this is probably obvious but it is news to me. The "objects" that are activated/deactivated according to events are actually the NPC number. If you go to Mist Events and Pg Dn to the end you'll see a Deactivate Object 200, which is deactivating Rydia's Dead Mother NPC which is NPC 200. That solves that mystery (for me at least).
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 03, 2013, 07:04:10 AM
Bah, what a shame. It seemed it was my Rom. Which means all the work I had done is now rendered obsolete, since there's no way I can tell when the corruption started or what had caused it.

I had recalculated everyone's levels and stats as well as altered all equipment, but alas. Looks like I have to start fresh.

Sorry about that, but with an editor-in-development you gotta expect that kind of thing to happen from time to time. I'd try not to commit too heavily to anything until it's a little more stable. Actually what I've been doing is just sort of jotting down ideas for what I want to do with a hack that will show off all the capabilities of the editor once it's done, and then once it's "done" (a version number starting with 1 instead of 0) I'll start actually committing to making the hack. While the editor is in development I'll just be testing various corner cases here and there.

:edit: 2 Since it seems that we're getting into the nitty gritty of the game's system. I think I'll list a number of non-essential events that can be safely replaced which are not important to the story as well as sprites that bear little on the game. I will also list their Trigger number and location for touch events.

Thanks! This will definitely be useful for people wanting to add to the events.

Wait a second... I think the Underworld is screwed up. Everything seems off slightly. For instance... there is no Baron Dancer in Tomra's Inn or a host other oddities that seem to crop up in the Underworld triggers.

You're right, the underworld does appear to be messed up. What's even stranger is that the messed up data does seem to match what's in Phoenix's doc, and what's in the hex code in the rom!!
I have no idea what to do with this right now...  :sad:

:edit: 4 It does appear that there are some serious problems with adding and removing Placements. Adding is fine, except it seems it will take some Placements from other maps (I have no idea how that works or why it works like that) however even on a clean rom it will cause the issues I referred to in my previous post.

Do you mean guys disappearing, like the old man and the locked door? If so, that isn't happening for me. I deleted someone from Baron Town and it didn't affect anything else in Baron Town; I then loaded a save near Kaipo and it didn't affect anyone there either as far as I could tell. In addition I tried adding an NPC to Baron Town and, while the NPC I added failed to appear ( :edit: I tried adding a different NPC and it appeared correctly; probably the other one needed to be "activated"?), it did not seem to affect any other maps. What exactly did you change and what maps did it affect?

:edit: 5 Well this is probably obvious but it is news to me. The "objects" that are activated/deactivated according to events are actually the NPC number. If you go to Mist Events and Pg Dn to the end you'll see a Deactivate Object 200, which is deactivating Rydia's Dead Mother NPC which is NPC 200. That solves that mystery (for me at least).

Good catch, thanks! I'll update the config file and once I've created a config file for NPC labels I'll add it to the event editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2013, 11:46:01 AM

Sorry about that, but with an editor-in-development you gotta expect that kind of thing to happen from time to time. I'd try not to commit too heavily to anything until it's a little more stable. Actually what I've been doing is just sort of jotting down ideas for what I want to do with a hack that will show off all the capabilities of the editor once it's done, and then once it's "done" (a version number starting with 1 instead of 0) I'll start actually committing to making the hack. While the editor is in development I'll just be testing various corner cases here and there.

That's not a bad idea. Yeah I got over ambitious, it's likely best to just write down what I want to do in a broad aspect before committing to it with an in-progress editor. Ah yes, I was curious to know if Overworld triggers were going to be added eventually? They seem to be the one thing missing from this as of now, in terms of triggers.


Wait a second... I think the Underworld is screwed up. Everything seems off slightly. For instance... there is no Baron Dancer in Tomra's Inn or a host other oddities that seem to crop up in the Underworld triggers.

You're right, the underworld does appear to be messed up. What's even stranger is that the messed up data does seem to match what's in Phoenix's doc, and what's in the hex code in the rom!!
I have no idea what to do with this right now...  :sad:

It honestly seems like everything is off by just a little bit, maybe only a byte or two. I have no idea what bearing that has. Exactly where is this data in ROM? I could hunt it down and see what the values should read.


Do you mean guys disappearing, like the old man and the locked door? If so, that isn't happening for me. I deleted someone from Baron Town and it didn't affect anything else in Baron Town; I then loaded a save near Kaipo and it didn't affect anyone there either as far as I could tell. In addition I tried adding an NPC to Baron Town and, while the NPC I added failed to appear ( :edit: I tried adding a different NPC and it appeared correctly; probably the other one needed to be "activated"?), it did not seem to affect any other maps. What exactly did you change and what maps did it affect?

I added a White Mage to Baron as Placement 12, and then went to Mist and saw that all of the NPC's were gone except for one and the shopkeepers were missing. Since I warped into Mist before Mist events this included Rydia and her mother not being there either. I can't recall the NPC number I set though, but I believe they only had one event attached to them. Then I deleted the Placement and many of the NPC's in Baron disappeared.

:edit: 5 Well this is probably obvious but it is news to me. The "objects" that are activated/deactivated according to events are actually the NPC number. If you go to Mist Events and Pg Dn to the end you'll see a Deactivate Object 200, which is deactivating Rydia's Dead Mother NPC which is NPC 200. That solves that mystery (for me at least).

Good catch, thanks! I'll update the config file and once I've created a config file for NPC labels I'll add it to the event editor.

Ah very nice. That will help keep track of which NPC belongs to which events and all of that.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 03, 2013, 03:23:08 PM
That's not a bad idea. Yeah I got over ambitious, it's likely best to just write down what I want to do in a broad aspect before committing to it with an in-progress editor. Ah yes, I was curious to know if Overworld triggers were going to be added eventually? They seem to be the one thing missing from this as of now, in terms of triggers.

I know some people were talking about that but I don't have a doc on it. If I can figure it out enough from the forum posts to be able to get it working then it's definitely something I'd like to include!

It honestly seems like everything is off by just a little bit, maybe only a byte or two. I have no idea what bearing that has. Exactly where is this data in ROM? I could hunt it down and see what the values should read.

I'm sure this doc is already here somewhere but I'll attach it for convenience anyway. It explains how to read the data, and lists it all.

I added a White Mage to Baron as Placement 12, and then went to Mist and saw that all of the NPC's were gone except for one and the shopkeepers were missing. Since I warped into Mist before Mist events this included Rydia and her mother not being there either. I can't recall the NPC number I set though, but I believe they only had one event attached to them. Then I deleted the Placement and many of the NPC's in Baron disappeared.

Ok, I added a new NPC placement (Placement 12) to Baron Town, it worked just fine. I then walked to Mist (didn't teleport) and the Mist events played out correctly. I then redirected the teleporter in Kaipo that would normally take you to the training room to instead take you to Mist. It worked fine, everyone was there and seemed to behave/speak correctly. I deleted the extra placement and everything still worked correctly. No one disappeared, and Mist was still unaffected.

Unfortunately I can't fix a bug if I can't reproduce it... perhaps someone else can try it and report what happens?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2013, 04:27:05 PM
That's not a bad idea. Yeah I got over ambitious, it's likely best to just write down what I want to do in a broad aspect before committing to it with an in-progress editor. Ah yes, I was curious to know if Overworld triggers were going to be added eventually? They seem to be the one thing missing from this as of now, in terms of triggers.
I know some people were talking about that but I don't have a doc on it. If I can figure it out enough from the forum posts to be able to get it working then it's definitely something I'd like to include!

 Hmm, I might take a look over the course of the next week, but by all means go ahead with the search.

It honestly seems like everything is off by just a little bit, maybe only a byte or two. I have no idea what bearing that has. Exactly where is this data in ROM? I could hunt it down and see what the values should read.

I'm sure this doc is already here somewhere but I'll attach it for convenience anyway. It explains how to read the data, and lists it all.

Thanks. No, looks like there are no miscalculations in that documentsbut there's one thing I noticed while browsing through NPC's... The Underworld events aren't there. As with everything else it seems there's a separate index for Underworld NPCs. That would appear to be the one and only issue in that regard.



I added a White Mage to Baron as Placement 12, and then went to Mist and saw that all of the NPC's were gone except for one and the shopkeepers were missing. Since I warped into Mist before Mist events this included Rydia and her mother not being there either. I can't recall the NPC number I set though, but I believe they only had one event attached to them. Then I deleted the Placement and many of the NPC's in Baron disappeared.

Ok, I added a new NPC placement (Placement 12) to Baron Town, it worked just fine. I then walked to Mist (didn't teleport) and the Mist events played out correctly. I then redirected the teleporter in Kaipo that would normally take you to the training room to instead take you to Mist. It worked fine, everyone was there and seemed to behave/speak correctly. I deleted the extra placement and everything still worked correctly. No one disappeared, and Mist was still unaffected.

Unfortunately I can't fix a bug if I can't reproduce it... perhaps someone else can try it and report what happens?

Yes, I have no clue what could be causing this. Obviously we have the same version since the NPC Placement notes took me to the exact same values, so I'm still unsure what is causing this, or if it's something I'm doing wrong, hmm...
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 03, 2013, 07:50:03 PM
I'm having missing NPC issues as well. No reproduction steps yet; I'll start fresh with a clean ROM and see if I can figure something out.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 04, 2013, 12:20:20 PM
Okay, it seems just opening the ROM in the editor is enough to cause this corruption. Do the following:

1. Open a clean headered FF2 1.1 ROM.
2. Hit the save ROM option without doing anything else in the editor.
3. Start a new game, observe the results. They become most apparent as Baigan walks Cecil through Baron Castle.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 04, 2013, 12:45:21 PM
Wow, you're right. What's even stranger is in the Mysidia flashback, Cecil puts Back the Crystal of Water while an invisible Elder questions him.

The guard that opens the door for Cecil is absent.

Whoa. Um... Stoned Porom statue, Yang In the Doorway leading to the Throne Room. Blue colored officer already in front of the door.

 Yang in the middle of the Throne Room.

Cagnazzo sitting on the throne with the King as well.

Wow, yeah some things are really screwed up here. Now that I think on it though it does seem mainly to involve Active vs. Inactive NPC's. As evidenced by Cecil putting back the Water Crystal.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 05, 2013, 06:32:46 AM
Aha, starting a new game did the trick! I'm also getting the messed up intro. Prior to this I had been loading a save file after the intro in order to save time; it never occurred to me that there might be something in the opening causing it.

This is most interesting... presumably something is likely wrong with the NPC placement saving routine. I have a couple of plausible hypotheses:

Anyway I'll toy with it and let you know if I make any progress...

 :edit:
After comparing the unmodified rom with the load-immediately-save rom side by side in a hex editor, the only difference in the NPC placement area that I can tell is with the dark world placements. Even then, although the data is not in the same order as it was in the original rom, the pointers have been modified to compensate and are correct as far as I can tell (and logically shouldn't be relevant, as the intro takes place entirely in upper-world maps if I'm not mistaken, which come before the underworld maps). I'm going to try a few more experiments to see if I can narrow down the source of the behaviour.

 :edit:
Ok I found the problem; it wasn't with the placements at all. There's a matrix encoding the initial visibility of each individual NPC which was being written incorrectly. It appears to be working now. I made a fresh copy of the rom, loaded it in ff4kster, saved, started a new game, everything appeared as it should; elder, crystal, porom, yang, everything was as it should be. Anyway the fixed version is up on the timecave so feel free to redownload.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 05, 2013, 10:38:42 AM
Wonderful! What ever you did you also fixed my original project rom! So everything seemed to work fine, I even included another NPC to Baron and flew to Mist and all of the proper NPC's showed up there as well (once the Mist events had taken place). Looks like that did the trick.

Now my next question is do you have any leads to the NPC location of the Underworld NPC's? I would imagine they would follow right after the Overworld NPC's. But I'm not entirely sure where that is located itself.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 05, 2013, 12:31:00 PM
Ok I fixed the problem with the underground NPCs being previewed as overworld ones. Re-download and let me know if there are still problems.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 06, 2013, 01:42:23 PM
Just got home from prior business, I am curious to know if all 255 NPC slots for the Underworld are used...

 :edit: Hmm, this is interesting. I know this isn't an issue with the editor, but there are a lot of Placements with NPC's without messages in the Smithy's House (outside) map. They all appear to be House of Wishes NPC's, but I can't figure out why they would have no message attached to them, or why they are considered to be in the Smith's House outside map. Something with the Zeromus battle, maybe?

Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 06, 2013, 03:58:09 PM
Yeah, those look like the NPCs used in the ending. The ones for the other scenes are stored on other underworld maps.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 09, 2013, 06:49:35 AM
Ok, the message editor is now complete.

This update introduces a new input component -- a multi-line text message input box. This one has a visible cursor and the controls work more or less the way you would expect:

Arrows: Move cursor without changing text.
Home: Move cursor to beginning of the current line.
End: Move cursor to end of the current line of text.
Enter: Move cursor to beginning of next line (note that this does not insert an "end of line" character into the text; more on that to follow)
Backspace: Move the cursor one character back and delete that character (moves the rest of the text back).
Delete: Leave the cursor where it is and delete the current character (moves the rest of the text back).
Insert: Insert a special character or code. A separate menu will appear from which you can pick some common codes or a symbol.
Esc: Done editing / commit changes.

There are some special codes that the multiline text input recognizes and converts to the FF4-text equivalent:

In addition, at all times a preview appears of the message you're editing, the way it will (hopefully) look when displayed in the game. This preview is constantly updated as you type.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2013, 10:57:34 AM
Wonderful! I will have to test this as soon as I can and write my impressions.

 :edit: While browsing the FFWikia I noticed some reference to a place called the "Zemus Zone" and that there's unused text regarding it. I scoffed, since I thought I had seen all of the unused text in the game, but it seems that no, the Zemus Zone is a real message and could be an unused area name. I wonder what that was going to be used for. I mean, how dare they actually have the main villain of the game say anything before you reach him!

 :edit: 2, hmm. It seems if the message is longer than the original there are unintended circumstances. I changed the first Baron Town message to something a little bit longer and at the end of it, the fellow broke into different events (Clerics Permission in this instance). What's worse is that every NPC had this message. If you keep it within the original limits though, everything works as you would expect it to.

 :edit: 3 Taking a look at some of the unknown characters...

The majority all appear to be parts of various windows with the pointer cursor thrown in there.

 :edit: 4 After editing "Won!" To see what those Codes do in the battle scenarios, I came to the realization after winning a battle that "Won!" never actually seems to appear. How ironic.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 09, 2013, 01:09:12 PM
There's more unused dialogue than that. Ignore Wikia and check out the Cutting Room Floor FF4 article. I wrote most of that one. (Which reminds me, I need to do the menu text which is accidentally terminated or not given proper coordinates.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2013, 01:16:11 PM
Oh I'm well aware of (most) of the unused dialogue, things like Dark Knight Cecil reference while fighting Yang to get him to say a couple more lines, something that is only said if Tellah can survive the onslaught from the Dark Elf (fat chance of that), things like that. I recall you had a couple videos of it up a while back. They were pretty informative. I should re-read the article again, as I recall it was really good.

 :edit: Looks like the CODE:0-4 are things dealing with after battle. (Or in CODE:3's case the item that Edge steals from an enemy.)

CODE: 0 - GP Obtained/Lost
CODE: 1 - EXP Obtained
CODE: 2 - Character
CODE: 3 - Item Stolen from Enemy
CODE: 4 - Spell Learned

I'm curious now to know if these work automatically.. Like let's say instead of items you steal GP from enemies, hmm... I'll have to try that out.

 :edit: 2 That would be a "No." While the game will display a different amount (in this case I believe it will show the Decimal Number of the item that would be stolen) (206=Cure1) it will still be a Cure 1 you are stealing. That could shed some light on possibly changing Steal (to make it semi-useful) but we'll see down the line I guess.


 :edit: 3 Actually I'd never read this article. I must have been thinking of something else. There is some really interesting stuff in there. Though I do think that Rydia's text about "living here" and "finding something useful" may have actually been her Mist house, because it Definitely has something useful there, unlike her home in the Land of Summoned Monsters. And that text jumps around so much it's kind of difficult at times to tell where things should be placed (that is unless it's an actual Map Message, then there's no doubt)

Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 09, 2013, 01:53:32 PM
There's actually a kind of order to the dialogue's chaos, and it's pretty easy to tell which lines were added later, after the majority had been written, because they're just thrown into otherwise ordered conversations randomly. So I'm almost certain Rydia's text was for the land of summoned monsters, because all of the text there is consistent with that location.

PinkPuff, I'd suggest padding out character names out to six characters with blank spaces. It'll make the text preview a bit ugly, but it'll stop people from writing dialogue that gets cut off when someone renames a character to have a longer name.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2013, 05:01:58 PM
Hmm, I'm still having trouble locating that message, but from the way its written it sounds like it appears in the Land of Summoned Monsters text area, just may have passed it up.

Everything is looking solid. I only have one suggestion and I'm not sure how difficult it would be to implement. Is it possible to have the message be edited from the very NPC option? I noticed you added the Sprite and NPC identifier in which makes identification unnecessary and in the process makes things so much easier to read.

Like say for Mist, there are a lot of Bank 2 message references. Granted all one would need to do is keep a mental record of which line it corresponds to and move on from there, but to cut down on time and accessibility, being able to edit it from there would help things move along at a steadier pace.

But that's merely for later. I think for now you have nearly all text matters done (only thing missing are location names). As for Location Data there is still the Map Data (which JCE3000GT's Map Variables Editor can change) and that should be it as far as maps and events are concerned. I am curious to know what direction you plan from there? You've made a great tool so far and I am looking forward to the future of it!
Title: Re: Developing a comprehensive editor for FF4
Post by: Deathlike2 on January 09, 2013, 10:05:42 PM
Oh I'm well aware of (most) of the unused dialogue, things like Dark Knight Cecil reference while fighting Yang to get him to say a couple more lines, something that is only said if Tellah can survive the onslaught from the Dark Elf (fat chance of that), things like that. I recall you had a couple videos of it up a while back. They were pretty informative. I should re-read the article again, as I recall it was really good.

All you need is a little Reflect... but he's the first one to go when you fail anyways.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2013, 10:23:48 PM
I thought of that, yeah. Would Tellah have enough speed though to cast it though? Though I guess by now there's a Mirror Curtain available (at least one, maybe?)

 :edit: http://slickproductions.org/forum/index.php?topic=1769.0 This might be the thread you were looking for PinkPuff in regards to World Map Triggers.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 10, 2013, 07:53:38 AM
PinkPuff, I'd suggest padding out character names out to six characters with blank spaces. It'll make the text preview a bit ugly, but it'll stop people from writing dialogue that gets cut off when someone renames a character to have a longer name.

Both have their advantages. What about if it were to look normal when you preview it from the main dialogue select menu, but padded while typing?

Everything is looking solid. I only have one suggestion and I'm not sure how difficult it would be to implement. Is it possible to have the message be edited from the very NPC option? I noticed you added the Sprite and NPC identifier in which makes identification unnecessary and in the process makes things so much easier to read.

Like say for Mist, there are a lot of Bank 2 message references. Granted all one would need to do is keep a mental record of which line it corresponds to and move on from there, but to cut down on time and accessibility, being able to edit it from there would help things move along at a steadier pace.

I thought of this during design but while it's technically possible to do I decided against it due to the potential awkwardness.

To illustrate, the Mist example you used, where the NPCs are not actually speaking messages in their parameter list, but just using those "show message x from bank 2" event calls, you may notice I don't even have a preview of the text there for those. The reason is that, with the message parameters, you know they're always messages, and you know what map they're from (since you know what map the NPC is from). With the event calls like the ones in Mist, at first you might be tempted to think, "well we know this block of events are all just a single line of 'show message x from bank 2' and we know what map the NPC is from, so we can just have any NPC with a trigger that calls one of those events to show it" but there are a couple of problems.

First, suppose you have an NPC's speech set up as follows:
* If Flag 1 on, call event "show message 1 from bank 2"
* If Flag 2 on, call event "show message 2 from bank 2"
* -- always --, call event "show message 3 from bank 2"
How would one expect a preview of all of those to look? At first you might say "well just have it preview one when you cursor over it in the event select component of the menu", but then the problem arises that nothing is stopping the user from going into the actual event editor and changing the event that used to simply consist of a single line "show message x from bank 2" into an entire plot scene, or something completely different altogether. Even though the game defaults to having that section of events devoted to simple bank 2 calls, nothing is forcing it to be that way, especially after using this editor.

So maybe we can just have it search each event when you highlight it for bank 2 references? This is possible but would likely be more time consuming at run-time than it's worth. Plus, what if one event has a whole bunch of bank 2 references? Do we preview all of them? If not, which? The first one?

So I think it's probably ok the way it is. I know it may be a bit of a pain to go back and forth between editors, but if you're doing small changes, then it should be easy to put up with, and if you're doing a large project then chances are you probably have your planned NPCs and dialogues and such already written out in another form anyway (or if not then it's a good idea to do, regardless).

But that's merely for later. I think for now you have nearly all text matters done (only thing missing are location names). As for Location Data there is still the Map Data (which JCE3000GT's Map Variables Editor can change) and that should be it as far as maps and events are concerned. I am curious to know what direction you plan from there? You've made a great tool so far and I am looking forward to the future of it!

Thanks! Glad to hear people are enjoying it and finding it useful. Positive feedback always helps motivate me to keep working on it!  :childish:

Yup, map properties are probably next, and actually I had planned to include the map names with that component (rather than with the dialogues and messages/alerts).

As far as maps and events are concerned there actually are a couple more things on the table. One is obviously overworld triggers. I had a look at the info here:

:edit: http://slickproductions.org/forum/index.php?topic=1769.0 This might be the thread you were looking for PinkPuff in regards to World Map Triggers.

... but as far as I can tell it will probably only be able to edit/create teleporters, not actual event calls. Unless the event call data for the overworld/underground is known and I missed it? Yup, I did *facepalm*. Yeah it shouldn't be any trouble.

Anyway, I would like to at some point also include editing the actual maps themselves, such as FF4Tools is capable of. The differences being that it would actually have a rom to edit rather than manually copying and pasting large chunks of hex code and pointers into the (hopefully) correct spots, it would be able to make maps larger than they were in the original (provided that other maps are made smaller or that there is room, but the point is that it would be able to look at the entire space set aside for maps rather than just the one you're editing), and it would (hopefully) be able to read the tile graphics from the rom you're editing in much the same way as it does with the font and window graphics so that if you change a tile or create your own custom tiles (or heck, why not an entire custom tileset) they will look correct in the editor instead of always using the default graphic tiles.

Try not to get too excited about that though, I'm a long way, and a lot of research away from being able to accomplish that; but I do know the basic gist of how to go about it, it's just a question of the details and how much of the relevant info is documented or I am otherwise able to be decipher.

More than likely, the next "group" of editors after the map/event group will be monsters. I know there's a lot of data documented about those and I think I can make editors for those fairly straightforwardly.
Title: Re: Developing a comprehensive editor for FF4
Post by: Deathlike2 on January 10, 2013, 08:37:21 AM
I thought of that, yeah. Would Tellah have enough speed though to cast it though? Though I guess by now there's a Mirror Curtain available (at least one, maybe?)

Sure, but then again I get Tellah at level 30+ and Reflect isn't a very long spell to cast...(I run Active ATB+Battle Speed 1 to compensate for difficulty). I eventually got around to optimizing spell locations... so...  :tongue:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 10, 2013, 10:43:21 AM
Very good points you raise PinkPuff, nevermind that idea then, to cut down on awkwardness would likely be for the best.

Though once you get the Overworld Triggers and Map Properties Editor, there aren't too many further things I can think of regarding events. The only thing I can think of are Event Tied Items (like the magazine, tent, dwarves' bread, etc) which I believe I showed how to change in another thread...? (I don't recall if I actually posted those), battle events (in which we know very little about, last I checked), and the "visual effects" which I'm not even sure it's plausible to edit those.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 10, 2013, 12:40:48 PM
I'm most interested in seeing the monster editors, myself. Those are something nothing does well at the moment. Copying and pasting maps from FF4 Tools can be a bit annoying, but I've got a decent setup for that now. No such luck for monsters, where I'm still doing everything in a hex editor. Overworld stuff would be cool, too.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 10, 2013, 02:03:23 PM
I am going to feel like an absolute idiot, but I could never get FFIV Tools to load my ROM. Is there some trick to it or some button or menu that I've been missing for years now? I could only ever use his On-site one, personally.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 10, 2013, 03:45:11 PM
You...don't. It doesn't edit the ROM. It loads everything from included text files; you need to copy your edited data from its fields into a ROM. Also it only works with certain browsers. I can't use the map editor with Chrome (never tried any of the others) and have to use Firefox instead.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 10, 2013, 04:49:35 PM
Therein lies the problem. Chrome. Heh, looks like I'll have to use a different browser then. Thanks for the heads up.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 12, 2013, 07:24:22 AM
I'm most interested in seeing the monster editors, myself. Those are something nothing does well at the moment. Copying and pasting maps from FF4 Tools can be a bit annoying, but I've got a decent setup for that now. No such luck for monsters, where I'm still doing everything in a hex editor.

Glad to hear it, as the map editor I spoke/speculated about will be a long time coming.

Also I too am looking forward to getting to work on the monster editing, but I still think I'm going to make the map properties editor first just to keep everything thematic and organized. So far, even though it may not be explicitly recognized, you may notice there are a couple of loose "groups" of editors within FF4kster:

"Magic" Group

"Inventory" Group

"Character" Group

"Story" Group

"Battle" Group

Ideally I'd like to complete each group before moving to the next but given the amount of investment the map editor will take I'm certainly willing to jump ahead and insert that later. Map properties should be very straightforward though; at a quick glance they all just seem to be either numbers or references to things that already exist.

Overworld stuff would be cool, too.

If you mean the overworld triggers, that's definitely in the works and I will probably also do that before tackling monsters (in fact I may even do it next, before the map properties). If you mean editing the overworld map, I would love to be able to include that with the map editor when that happens, though there seems to be a lack of sources of information on the overworld map... I haven't seen any docs, and FF4Tools doesn't seem to allow editing it so I can't just reverse engineer it from the output like I hopefully can with regular "inner" maps...
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 12, 2013, 12:24:04 PM
Yousei's old editor supports editing the world maps and its source is included:

http://www.romhacking.net/utilities/191/ (http://www.romhacking.net/utilities/191/)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 12, 2013, 05:14:18 PM
Ah, here's a suggestion of a feature that I thought was implemented along time ago. Can you allow us to edit the names of the characters?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 12, 2013, 05:19:35 PM
Yousei's old editor supports editing the world maps and its source is included:

So it does! Thanks! I'm not too familiar with C++ but I'm sure I'll be able to figure it out by the time I'm ready to work on that.

Ah, here's a suggestion of a feature that I thought was implemented along time ago. Can you allow us to edit the names of the characters?

You know what, I thought it was too! Hmm well that fix should be pretty trivial. I'll upload an update shortly.

 :edit: Ok, now you should be able to rename the actors.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 12, 2013, 06:49:32 PM
Looks like it works, thanks for the fix there.

Also I was curious to know if you planned on allowing us to edit the indexes, like the Status Indexes, Equip indexes, as well as allowing the break-bytes on normal weapons (since they do function appropriately) also do my recent findings have any place in the editor, or would it be best for those to remain separate?

 :edit: Oh very nice subtle update on having Equip Index 0 (which is really just 31) be an "Equip All" byte.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 13, 2013, 05:49:50 AM
Looks like it works, thanks for the fix there.

No sweat; thanks for pointing it out!

Also I was curious to know if you planned on allowing us to edit the indexes, like the Status Indexes, Equip indexes,

You can... at least... you should be able to... I'll verify in a sec (and fix it if it's not working) but you should be able to hit tab while selecting an index to edit that index.
 :edit: Turns out there was a slight problem with the way it was encoding the flags, it should work now.

as well as allowing the break-bytes on normal weapons (since they do function appropriately) also do my recent findings have any place in the editor, or would it be best for those to remain separate?

You mean the properties like "stackable", "multiples in chests", "consumable", etc? Yeah I'd like to include those. Since you seem to be still actively researching it I'll probably remain focused on other things for now but at some point I will definitely go back and put flags for those into the weapon editor. Also, while those are most of the properties required to make something into an "arrow", there are still a couple missing: "can equip either hand" and "deals more damage in one hand than the other" (though that might just be a bow thing? still would be good to know)

I'm really interested in the research on two-handedness though, that would be the real holy grail for weapon properties! If it turns out that we can only change the range in terms of where it starts and can't actually change the total number of two-handed weapons then that would be kinda disappointing, but if we can change the range to include more weapons (or less) then that would be fantastic! And if it turns out to be settable by individual weapon, even better!

:edit: Oh very nice subtle update on having Equip Index 0 (which is really just 31) be an "Equip All" byte.

Yeah I actually thought I fixed that a while ago as well. Major deja-vu. You know what, the more I think about it, the more I think that after I took a bit of a break there for a while and came back to it, I might have mistakenly come back to work on a version of the file that wasn't actually the most up-to-date current one... oh well too late now,  I'll just have to re-squash the old bugs as they show themselves.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 13, 2013, 01:11:53 PM
Ah, it adds so much more variety when the modder is allowed to put their own indexes in (and not to mention allows usage of a whole bunch of blank indexes.)  It is really great to finally have that, now it feels like work can begin in earnest (with frequent backups, of course).

Quote from: PinkPuff
You mean the properties like "stackable", "multiples in chests", "consumable", etc? Yeah I'd like to include those. Since you seem to be still actively researching it I'll probably remain focused on other things for now but at some point I will definitely go back and put flags for those into the weapon editor. Also, while those are most of the properties required to make something into an "arrow", there are still a couple missing: "can equip either hand" and "deals more damage in one hand than the other" (though that might just be a bow thing? still would be good to know)

I'm really interested in the research on two-handedness though, that would be the real holy grail for weapon properties! If it turns out that we can only change the range in terms of where it starts and can't actually change the total number of two-handed weapons then that would be kinda disappointing, but if we can change the range to include more weapons (or less) then that would be fantastic! And if it turns out to be settable by individual weapon, even better!

Yes, that's partially what I meant, but I also meant the Stat Boosting Items to change whatever you wish (Like say you want the Golden Apple to increase Strength by 3 rather than increase HP by 100, or want the Soma Drop to boost Permanent Magic Evasion, or some such) and the slight bit of work I've done with Commands (really the only stable thing in there is the Steal Slot 1-4 on an enemy and Dragonsbrethren figuring out how to make Cecil take no damage from Dark Wave) I would be wary of using any of my Bluff notes at the current time.

Title: Re: Developing a comprehensive editor for FF4
Post by: Deathlike2 on January 13, 2013, 01:22:20 PM
It is not possible to boost magic evasion permanently... because there are formulas at work that recalculate themselves when you show up to the equip screen (think like FF1's Monk Bug).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 13, 2013, 02:02:41 PM
It is not possible to boost magic evasion permanently... because there are formulas at work that recalculate themselves when you show up to the equip screen (think like FF1's Monk Bug).

Bad example on my part, yes. It's possible to increase the five basic stats and change your identity/class, but not evasions and the like.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 14, 2013, 08:07:49 AM
Ah, it adds so much more variety when the modder is allowed to put their own indexes in (and not to mention allows usage of a whole bunch of blank indexes.)  It is really great to finally have that, now it feels like work can begin in earnest (with frequent backups, of course).

Yup, just a few more editors to go and a bunch of cosmetic/convenience tweaks.

Yes, that's partially what I meant, but I also meant the Stat Boosting Items to change whatever you wish (Like say you want the Golden Apple to increase Strength by 3 rather than increase HP by 100, or want the Soma Drop to boost Permanent Magic Evasion, or some such) and the slight bit of work I've done with Commands (really the only stable thing in there is the Steal Slot 1-4 on an enemy and Dragonsbrethren figuring out how to make Cecil take no damage from Dark Wave) I would be wary of using any of my Bluff notes at the current time.

Yup, all that will be coming! Not sure how long it will take but it is on my to-do list.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 21, 2013, 01:30:30 PM
Hello! :) I'm greatly appreciating the dialogue editor, but I have a tale to tell.

So I edited some dialogue in ff4kster and then went around to do finishing touches on the battle dialogue in a hex editor. I had to go back to ff4kster to fix some things, but it now refuses to load the ROM and instead crashes if I try. It can load a clean ROM just fine.

Obviously, this is an awful inconvenience seeing as how I use both programs!

I have two suggestions: add some way to use "special characters" and other things that can only be done in hex editors at the moment, such as the ellipsis tile, item icons, and character name variables, or perhaps you could look into the cause of this? :happy:

Thank you so much, everyone involved with this, and have a wonderful day!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 21, 2013, 02:21:07 PM
Hmm, I'm not sure about the ellipsis tile, but if you press insert after erasing the original item icon in Items you can scroll (by using up and down) through the item icons.

As for name variables, all of the text messages have a /name00 - name13. In addition, if you hit Insert you can reach these menus in an easier fashion, with music cues, pauses and item icons included.

Did you keep a copy of your ROM by chance? When working with a Hex Editor it is nearly prudent to create backups. If you did not, send it to me and I'll see if I can't find the problem.

Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 21, 2013, 05:33:20 PM
Underscore enters an ellipsis. Being able to insert any font character anywhere would be nice, though.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 22, 2013, 01:06:51 AM
Hmm, I'm not sure about the ellipsis tile, but if you press insert after erasing the original item icon in Items you can scroll (by using up and down) through the item icons.

As for name variables, all of the text messages have a /name00 - name13. In addition, if you hit Insert you can reach these menus in an easier fashion, with music cues, pauses and item icons included.

Did you keep a copy of your ROM by chance? When working with a Hex Editor it is nearly prudent to create backups. If you did not, send it to me and I'll see if I can't find the problem.
I had no idea about Insert! That is pretty awesome. I didn't keep a backup, mainly because of how willing I am to start over if need be, but I'll send it over your way.

:edit: I sent it!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 22, 2013, 05:35:43 AM
Underscore enters an ellipsis. Being able to insert any font character anywhere would be nice, though.

You can.

I have two suggestions: add some way to use "special characters" and other things that can only be done in hex editors at the moment, such as the ellipsis tile, item icons, and character name variables

This is where reading the instructions comes in handy...

or perhaps you could look into the cause of this? :happy:

Without knowing exactly what you did in the hex editor this is impossible... Who knows, the wrong typo could mess it up something fierce. But as long as only using FF4kster doesn't cause a problem, then I can't concern myself with protecting the user from any arbitrary changes they may make in a hex editor from crashing the editor.

In the meantime if someone is able to produce this kind of error using FF4kster alone (short of adding large amounts of additional text, as that is already a known issue) then I would be happy to look into it.

Thank you so much, everyone involved with this, and have a wonderful day!

And you as well! Glad to hear it's being useful to people  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 22, 2013, 01:22:12 PM
Underscore enters an ellipsis. Being able to insert any font character anywhere would be nice, though.

You can.

How? Insert only does the default icons and /chr is limited to the start of the font glyphs.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 22, 2013, 01:53:04 PM
This is where reading the instructions comes in handy...
http://i62.photobucket.com/albums/h109/51793Moeman/umm_zps7e5cf1f4.png

It'd be nice if I could, but the readme displays as a jumbled mess when I download the .ZIP file.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 22, 2013, 01:58:35 PM
Do you have Wordpad by chance? Opening it in Wordpad should make it look fine.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 22, 2013, 02:22:42 PM
How?

Using insert in any text box, or the codes in the large text box.

Insert only does the default icons and /chr is limited to the start of the font glyphs.

That's all there is.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 22, 2013, 02:58:40 PM
That's all there is by default. You can add new icons and whatever else in the blank font space. Some of them can't be used in field dialogue because the DTE code makes use of those values, but the menus and battle are fair game for the most part (the old Japanese DTE is still enabled in them, but utilizes the values used by the icons and above, so that's basically a non-issue.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 22, 2013, 03:11:47 PM
That's all there is by default. You can add new icons and whatever else in the blank font space. Some of them can't be used in field dialogue because the DTE code makes use of those values, but the menus and battle are fair game for the most part (the old Japanese DTE is still enabled in them, but utilizes the values used by the icons and above, so that's basically a non-issue.)

Ok now I understand what you mean.

I'm not sure how the program could detect that you've added new characters like that in, and including them in the insert menu be default would confuse/annoy people who aren't doing that (I'd wager most of us) by having all these blanks.

If I can think of a simple and unintrusive way to solve those issues then I'll consider including that feature at some point, but it's not very high priority.

In other news, I have an idea for how to trivially handle unheadered roms! So that may be coming soon but I'll have to do a couple tests first.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 22, 2013, 03:23:23 PM
Unheadered support will be cool. As for inserting new font characters, I'd suggest adding a new key which would just display all 256 possible font characters in a table and let you select the one you want with a cursor. No need to detect new characters. If you don't want to do that, a key that works the same as insert but allows you to go through everything would be an okay solution.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 22, 2013, 06:03:54 PM
I was wondering how the old RPGe translation managed to have a Lot more icons than were in the normal game. I guess it would make sense that it's using much of the Kanji space for that purpose. That would be a pretty neat addition, if it can be easily implemented.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 23, 2013, 06:22:35 AM
I wanted you guys to know that after I restarted and imported my old changes, everything's working now. After editing the battle messages in both ff4kster and Windhex32, everything still loads fine. I must've messed up badly somehow last time.

Thanks for your help anyway and I'm sorry for pointing fingers. :happy:

EDIT: I have another question! :) Do you intend to let the editor modify item descriptions?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 23, 2013, 06:41:07 PM
No problem, glad to hear everything worked out.

Item Descriptions are interesting, but we know that several of them already aren't used. And last I checked we're not sure how to implement them (Things like "Caller's Orb - Teaches Spell" or whatever is in the game's message banks, but isn't used in it's proper place (the Caller's Orbs have no description)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 24, 2013, 07:12:45 AM
To be perfectly honest, I completely overlooked item descriptions somehow! I don't foresee a problem with adding them into the message editor or more likely the appropriate item editors. Maybe the ones that are never displayed in the game normally can be flagged or highlighted in some way as a warning that unless you patched the game you won't actually see the message or something even though you're free to edit it.

Also it turns out my kludgy hack for handling unheadered roms appears to be working perfectly so far! At first I was hesitant to include unheadered roms because I thought it would mess up all the pointers and such but then it occurred to me: I can check the filesize of the file it's being given to determine whether it's headered or unheadered. If unheadered, it sets a flag and adds a dummy header of all 0s to the beginning! That way everything lines up correctly and for all intents and purposes it is a headered rom. When it goes to save, it checks whether the aforementioned flag is set and if so, deletes the header.

I haven't uploaded an update becuase I don't think this is a major enough change to warrant it but next upload will of course include this fix.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 24, 2013, 08:34:52 AM
Fun fact: The Japanese descriptions include strings for spells as well.

 :edit:

And a table of assignments that I completely forgot about, yet knew existed at some point. The magic menu never seems to read the table, so it can be safely overwritten with more item descriptions. (Even if the menu did read it, it's obviously not showing anything, so it'd be safe anyway :tongue: )
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 24, 2013, 09:41:55 AM
I worked out item descriptions this morning:

http://slickproductions.org/forum/index.php?topic=1804 (http://slickproductions.org/forum/index.php?topic=1804)

Allowing the item range to be changed is painless enough, but there's only 44 usable descriptions with the default text offset. Moving the text is probably beyond the scope of the editor, but you can use this data to at least read expanded descriptions in a modified ROM if you want (it would be nice for letting us set them, but again, probably a lot more work for you and beyond the scope of the editor).
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 27, 2013, 08:54:57 PM
Please excuse me if I'm not my usual sunny self.

I have another suggestion. Why not make some sort of shortcut to get to certain dialogue entries in the "messages" menu, at least for banks 1 through 3?

The reason I bring this up is because in my project, I'm currently editing dialogue a lot. Sometimes the editor crashes from me trying to delete too much dialogue at once, and I have to reload and scroll, one increment at a time, to get back to my place at message, say, 330 from message 1. I can just hold down the arrow key, yes, but it lags and it keeps scrolling moments after I've let go.

The kind of shortcut I suggest is typing in the number would take you to the specified message, e.g. pressing 459 would take you to message 459.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 28, 2013, 07:25:50 AM
Please excuse me if I'm not my usual sunny self.

I have another suggestion. Why not make some sort of shortcut to get to certain dialogue entries in the "messages" menu, at least for banks 1 through 3?

The reason I bring this up is because in my project, I'm currently editing dialogue a lot. Sometimes the editor crashes from me trying to delete too much dialogue at once, and I have to reload and scroll, one increment at a time, to get back to my place at message, say, 330 from message 1. I can just hold down the arrow key, yes, but it lags and it keeps scrolling moments after I've let go.

The kind of shortcut I suggest is typing in the number would take you to the specified message, e.g. pressing 459 would take you to message 459.

I feel your pain, believe me... I'm trying to work on a solution to the lag in general, but I also think that in the meantime I will likely add a "page down/up" funcitonality to all the menus. Hitting Page Down or Page Up in the "expanded" menus (the ones where you can see more than one row at a time) will take you down or up to the next entry that isn't already visible (or to the first/last entry if you're already at the top/bottom "page"). It's not an ideal fix I know but I think that those keys should be included regardless and it will certainly be better than what's there now.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on January 28, 2013, 10:53:57 AM
Hi Pinkpuff...
I'm having a bit of a problem. I'm not sure if you'll be able to help, but here goes...
I just DLed the latest version of FF4kster, and it won't load my hack.
It still loads other FF4 ROMs fine.  Not only that, but other FF4 hacking programs still load my hack fine, including the previous version of FF4kster that I had (which was originally DLed on 9/24, if that helps create a frame of reference).  It's very bizarre... Any ideas what might be going on here?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 28, 2013, 12:49:50 PM
I updated the file on the timecave. Menus now feature a Page Up / Page Down funciton, as well as an "index toggle". Pressing the slash key "/" in any menu will add indexes to the front of the options (or remove them). This will help for things with index references, but it may not be as useful in some menus than in others. For example, the item menus in the actor starting equipment will not have the actual index of the item, since it is only a partial list. This functionality has not been fully tested yet so there may be a few strange things but it will not affect the roms in any way, as it only affects the display and not anything in the underlying data.

Hi Pinkpuff...
I'm having a bit of a problem. I'm not sure if you'll be able to help, but here goes...
I just DLed the latest version of FF4kster, and it won't load my hack.
It still loads other FF4 ROMs fine.  Not only that, but other FF4 hacking programs still load my hack fine, including the previous version of FF4kster that I had (which was originally DLed on 9/24, if that helps create a frame of reference).  It's very bizarre... Any ideas what might be going on here?

So... it's loading a clean FF2US v1.1 fine? But not your hack? What happens when you try to load your hack; does it ask for a filename (be sure you're spelling it correctly and giving the correct path, also correctly spelled)? Does it go to a black screen and hang? Does it load the rom but all the data is messed up?

Did you apply any patches, or make any changes to the rom with another tool besides FF4kster?
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 28, 2013, 01:44:22 PM
Hello again everyone! :happy: I have yet one more question.


I noticed that the editor will eventually have the capability to edit monster stats. Does this include the item drops?

Thank you all for your time and have a nice day! :)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 28, 2013, 02:09:48 PM
I updated the file on the timecave. Menus now feature a Page Up / Page Down funciton, as well as an "index toggle". Pressing the slash key "/" in any menu will add indexes to the front of the options (or remove them). This will help for things with index references, but it may not be as useful in some menus than in others. For example, the item menus in the actor starting equipment will not have the actual index of the item, since it is only a partial list. This functionality has not been fully tested yet so there may be a few strange things but it will not affect the roms in any way, as it only affects the display and not anything in the underlying data.


Oh man... you have no idea how nice PgUp/PgDown working is! Everything becomes so much more fluid, no more time holding down, getting lag, missing your target, scrolling back up, etc. A great addition!

Looks like Indexes work great! Very helpful for items/commands and event editing (since you know what each command is numbered)

I got very excited when I clicked on Map Info and saw a list of maps, but alas clicking on it took me back to the menu, too cruel PinkPuff! Haha!

Great work, neat little additions which increase user-friendlyness. Looking forward to the next update.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 28, 2013, 03:04:12 PM
I noticed that the editor will eventually have the capability to edit monster stats. Does this include the item drops?

Yes it does.

Oh man... you have no idea how nice PgUp/PgDown working is! Everything becomes so much more fluid, no more time holding down, getting lag, missing your target, scrolling back up, etc. A great addition!

No sweat! I'm hoping to somehow come up with a clever trick for eliminating the lag in the first place, but this should help things run a little more smoothly in the meantime.

I got very excited when I clicked on Map Info and saw a list of maps, but alas clicking on it took me back to the menu, too cruel PinkPuff! Haha!

Haha I didn't mean to tease people like that. I usually remember to disable whatever component I'm currently working on but occasionally I forget. It's actually more developed than it appears, I was using that as a test sandbox for my page up / page down key and index functions.

Great work, neat little additions which increase user-friendlyness. Looking forward to the next update.

Thanks! Your guys' feedback always helps keep me motivated to keep working on it!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on January 28, 2013, 05:31:39 PM
It does absolutely nothing (hangs) when I enter the (properly spelled) filename and hit enter. Which, I believe, is the same thing that happens with a misspelled filename.
I'm pretty sure I've also edited the file with at least one of jce3000gt's tools, and yousei's map editor, but this wasn't a problem for previous editions of ff4kster (like I said, my older ff4kster version still works for this hack).

Anyway, it doesn'treally matter. I've decided to start fresh with a clean ROM for other reasons anyway. Figuring out why this is happening would really only serve to satisfy my curiosity, and I'm sure you have higher priorities than that.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 28, 2013, 07:37:01 PM
I would assume it has something to do with the loading of some kind of data that wasn't being loaded in the older version. The loading routine for said data could be taking something for granted that's true in an unmodified rom, and true in roms that are saved with FF4kster, but not necessarily true when saved with other editors. There's no realistic way for me to verify how other programs save the data they edit so... I'm afraid you're on your own for this one.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 28, 2013, 08:31:06 PM
I think Yousei's editor expands the ROM and saves world map edits in the expanded space, but it's been forever since I used it.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on January 28, 2013, 10:05:53 PM
I would assume it has something to do with the loading of some kind of data that wasn't being loaded in the older version. The loading routine for said data could be taking something for granted that's true in an unmodified rom, and true in roms that are saved with FF4kster, but not necessarily true when saved with other editors.
That's probably it. There were a lot of aspects of the game I had edited by other means, such as npcs and maps, that the older version of ff4kster was completely ignoring but the newer version is not.
I think Yousei's editor expands the ROM and saves world map edits in the expanded space, but it's been forever since I used it.
If you mean it increases the ROM size, it doesn't. Or at least it doesn't necessarily. I only made minor changes and the file size was unaffected.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on January 28, 2013, 11:48:39 PM
I'm probably just misremembering, then.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on January 30, 2013, 04:19:28 PM
I hate to be "that guy" who knows nothing yet is always suggesting new things, but I have another question!

Will place labels eventually be in ff4kster? I admit that I know nothing about how they're stored in hex, so I don't know if it's an issue or not, but I was just wondering.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 31, 2013, 04:08:41 AM
I hate to be "that guy" who knows nothing yet is always suggesting new things, but I have another question!

Will place labels eventually be in ff4kster? I admit that I know nothing about how they're stored in hex, so I don't know if it's an issue or not, but I was just wondering.

Er... what's a "place label"?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 31, 2013, 10:52:44 AM
I believe he means Location Labels like "Town of Baron", "Baron Castle", etc.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 31, 2013, 02:13:12 PM
If you mean the map names that appear at the top when you enter, then those are coming in the map properties editor. On that note actually I'm finding the overworld map names are working perfectly but the underworld ones are completely messed up... no matter how I realign them it doesn't seem to do the trick. I'm considering uploading a version with the editor accessible (though it will only be displaying the data) so that maybe you guys can help brainstorm?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 31, 2013, 02:49:23 PM
Certainly, It would be interesting to see what could be the issue in that regards. (Not to mention to have that available as well, hehe.)
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on February 01, 2013, 10:37:38 PM
Hello again. I'm here with some info and two minor improvement suggestions.

I noticed some of the shop names were unlisted in the shops menu, so here they are.

Shop 21: Mysidia Items
Shop 25: Eblan Items
Shop 31: Tomra Items
Shop 26: Dwarven Castle Items #2 (Dummied in FFII US)

Furthermore, I've been at it for an hour trying to add back in shop 26 in the NPC editor, and while I've managed to figure out how to put that NPC in its designated spot, there doesn't seem to be a "Bring up shop 19" selection under what speech to assign the NPC, so it's totally impossible to add back in that shop for now.

Secondly, instead of listing the shops in hex under the speech selections, why not just put down "Bring up Baron Shop" and the like? It would make things tons easier and friendlier for newbies.

Thank you for your time, have a nice day.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 02, 2013, 06:14:24 AM
Hello again. I'm here with some info and two minor improvement suggestion.

I noticed some of the shop names were unlisted in the shops menu, so here they are.

Shop 21: Mysidia
Shop 25: Eblan
Shop 31: Tomra
Shop 26: Dwarven Castle #2 (Dummied in FFII US)

Thanks! I added them to the config file. And if you don't want to wait for the next update you can easily add these yourself too! Just go to your ff4kster folder, and in the config folder there should be a file called "shop.dat"; just go in and type in the numbers and names.

Furthermore, I've been at it for an hour trying to add back in shop 26 in the NPC editor, and while I've managed to figure out how to put that NPC in its designated spot, there doesn't seem to be a "Bring up shop 19" selection under what speech to assign the NPC, so it's totally impossible to add back in that shop for now.

Secondly, instead of listing the shops in hex under the speech selections, why not just put down "Bring up Baron Shop" and the like? It would make things tons easier and friendlier for newbies.

Thank you for your time, have a nice day.

That's because you can't reference shops directly with NPC speeches. NPC speeches are actually just triggers for events. If you want to make an NPC open a shop, there has to be an event for opening that shop, then you can make an NPC that triggers that event when you speak to it. So here's what to do, step by step:

* Go to the Event Editor and find an event that you are comfortable erasing/overwriting
* Hit Enter to edit it
* Hit backspace to clear its script completely (say yes you're sure)
* Hit insert to add a new item to the script
* Cycle to the event script item that says "Shop"
* An input should appear where you can select the shop you want
* Exit out of the Event Editor and go to the NPC editor
* Select the map & placement you want to trigger the shop
* Select "NPC", then "speech", then the event (or hit insert to create a new one and select it)
* Cycle to the event you replaced with your new shop and hit enter
* Exit out of the NPC Editor and save

(You can also go into the ./config/events.dat config file and change the name of the changed event to suit your hack if it makes it more convenient to remember.)

The reason I can't just have a shop option in the NPC speech menu is because the instruction to bring up a shop is handled at the event level, not the NPC level. The only ways I can think of to accomplish what you're asking for would all involve something terrible: 1. Assume that there already exists an event for each possible shop and that these events have not been changed or moved around; or, 2. Create a new shop event each time, replacing some existing event.

Thus, as nice as it would be to have something like that, I just don't see it as being very realistic. The user is free to edit the events however he or she wishes and thus it's not safe to make any kind of assumptions about them.

 :edit: The version on the timecave has now been updated to include the new config file, as well as access to the map properties editor, though the data cannot yet be edited, only viewed. If someone has any idea of what in the world might be happening with the underground maps please let me know.

 :edit: Upon second reading I think I may have misinterpreted your original question. Those are in hex mainly because they were just copied and pasted from an existing list of event labels for the original game's events. Changing these is once again simply a matter of changing the config file. So if you don't like "Bring up shop 26" you can go into ./config/events.dat and type in whatever you want to call it. That said, I think I will change the defaults to have something more meaningful there ^_^;
Title: Re: Developing a comprehensive editor for FF4
Post by: kveldolf on February 02, 2013, 02:26:31 PM
Can dialog script events use arguments? I don't know enough about FF4 internals.

If so, some enterprising hacker could make things far easier for you.

In that vein, how are random encounters stored for a map?

If the map structure stores a spot for encounters unused in non-encounter maps, well, that's something we could reuse. You could make events that use the map encounter formations to set the selection. If this works, it could open up event space as well as make shop dialog options portable without changes, as the map would define what SHOP1 means. (You'd need multiple events (I'm thinking four) but you could get rid of most of the 'call specific shop' events.)
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on February 02, 2013, 04:04:33 PM
...Wow, thank you, PinkPuff. I feel so dumb now. I should've realized it was calling on events.

...Though this now makes me kind of peeved that it looks like the FFII US team totally removed the event for the shop, which at once baffles me and makes me think I'm wrong.

 :edit:  I am so, so sorry to spread misinformation like that. Shop 31 is not Dwarven Castle Items. I just found out that Cave Eblana and the Dwarven Castle #2 share the same items. It's just that Cave Eblana's "niche" status healing items were changed to regular shop items, like Cure1, Cure2, Tent, etc. so they removed the second Dwarven Castle vendor, since the other one sold the exact same items.

I am so, so, so sorry. Shop 31 is just some dummied shop.

 :edit: Is there a way to outright remove entries from a shop list? The best I can seem to find is a blank space that costs 0 GP.

 :edit: I feel even dumber, but I meant shop 26 is the dummied shop. Hope you got that.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 03, 2013, 08:06:03 AM
...Wow, thank you, PinkPuff. I feel so dumb now. I should've realized it was calling on events.

Don't feel dumb, that's how we learn!

...Though this now makes me kind of peeved that it looks like the FFII US team totally removed the event for the shop, which at once baffles me and makes me think I'm wrong.

The rom is full of all sorts of strange stuff, ripe for speculation. That's part of the fun!

:edit:  I am so, so sorry to spread misinformation like that. Shop 31 is not Dwarven Castle Items. I just found out that Cave Eblana and the Dwarven Castle #2 share the same items. It's just that Cave Eblana's "niche" status healing items were changed to regular shop items, like Cure1, Cure2, Tent, etc. so they removed the second Dwarven Castle vendor, since the other one sold the exact same items.

I am so, so, so sorry. Shop 31 is just some dummied shop.

Not a problem. I fixed the config file on my local copy, and next time I update it will be fixed in that as well. To fix it on your own local copy you can simply go into ./config/shop.dat and remove the line corresponding to shop 31.

:edit: Is there a way to outright remove entries from a shop list? The best I can seem to find is a blank space that costs 0 GP.

Hm, upon checking it seems I somehow failed to put a "blank" in the menu to make that more convenient. Anyway setting the entry to "Trashcan" will do what you need. Trashcan is always the last item in the list so you can hit Enter on the slot to bring up the item list, hit End to take you to the Trashcan and hit Enter.

I will probably add a blank in there soon for that purpose (although it is hilarious and somewhat fitting that you "trash" the shop item...)
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on February 03, 2013, 12:07:27 PM
I have another question! It's super important!!!

...What people were involved in the creation of ff4kster? I want to credit you all in the readme of my patch!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 03, 2013, 02:40:31 PM
Hmm, there are some oddities. For one the Astro Tower Observatory "Underground?" is marked as YES, when it's clearly not considered underground.

Troia Castle Hospital is the same case.

It is interesting to see that the name of two of the glitch maps are "Fabul' and "Mt. Hobs East" . I wonder if maybe Fabul and Mt Hobs were supposed to originally be larger or if those labels are just placeholders?

Baron Chocobo Forest is randomly noted for having the Underground byte enabled as well.

Tower of Wishes - Final Battle has it marked, but there it makes sense since you cut to it from the Underworld/Moon.

All of the Ending maps are predictably considered underground (but now that I think on it, isn't the Astro-Observatory part of the ending?

Hmm... in the normal game is there a place called "Cave of the Lunarians"? Is that the name of the caves you enter? I don't recall that if such is the case.

Yes, it does appear that the Underground Maps are all kinds of a skewed...

It honestly seems as if it's reading the Overworld map data again. There's nothing in there that is about the Underworld.  Could you give me the offsets? I'll take a look in ROM to see if the issue is with the program or the information given.

 :edit: It's very clear by looking at the actual data that it does seem like the Underworld map indexes should have a special index or some such, since the labels reset back to 00/01/02, etc. Like everything else, it seems there are location labels specially for the Underworld.

 :edit: 2 No, that's not plausible in this case. I am a little bit certain that the editor might be misreading the proper map number? I noticed, with my own experiments that map labels are sequential... For instance... going off of Phoenix's old notes...


Tomra - 23 01 04 01 36 13 10 09 35 71 00 58 00 33

23 - Battle properties
01 - Map Index
04 - Tileset Index
01 - (Underworld) NPC Index
36 - Border Tile
13 - Map Palette Index
10 - NPC Palette Index
09 - Music Index
35 - Background Index
71 - Background Movement
00 - Appears to be load from Moon/Underworld, but that's clearly not the case since this is Tomra, an underworld map. Changing this to 80 in Tomra did absolutely nothing. None of the actual Underworld maps seem to have this byte as 80.

58 - Map Label Index (which as far as I can see the editor currently reads the Map Index for the name to display rather than the Label Index)
00 - Treasure Chest Index

I'll keep on looking to see how the game defines an Underworld Map.

 :edit: 3 Taking a further look into the editor's data of Village Mist and Tomra, is the editor reading the Map Index and just rereading the original data again, looking purely at the map index number to load the data? Since the data for Village Mist and Tomra are exactly the same in the editor but in ROM are...

 20 01 04 01 15 04 90 09 22 71 00 28 07 - Mist
 23 01 04 01 36 13 10 09 35 71 00 58 00 - Tomra

As can be seen the two are Very different in ROM.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 04, 2013, 08:06:13 AM
I have another question! It's super important!!!

...What people were involved in the creation of ff4kster? I want to credit you all in the readme of my patch!

I'm the only one doing any programming, but the information which it is based on is of course founded in a lot of groundwork done by many others. I couldn't even begin to compile a list, but feel free to try! You'll notice in the readme I just acknowledge a general "everyone who did research and posted it" type of thing without naming names.

Anyway I'm not looking for fame or credit here; as far as I'm concerned you can feel free to just say "FF4kster and the people who made it happen" or something.

:edit: 3 Taking a further look into the editor's data of Village Mist and Tomra, is the editor reading the Map Index and just rereading the original data again, looking purely at the map index number to load the data? Since the data for Village Mist and Tomra are exactly the same in the editor but in ROM are...

 20 01 04 01 15 04 90 09 22 71 00 28 07 - Mist
 23 01 04 01 36 13 10 09 35 71 00 58 00 - Tomra

As can be seen the two are Very different in ROM.

Wow, good eyes! I did a major facepalm when I checked this out and found that the loop index for this particular routine was being stored in a Byte variable rather than an Integer... doh...

Anyway it's fixed now and as far as I can tell working correctly, thanks!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 04, 2013, 08:56:21 AM
Aside from some odd background data, it looks to be in form (is that also looking at the old indexes rather than the new ones, maybe?) and as far as I can tell looks like it could be ready for release. Can't wait to try it out!

Also it is interesting to see that "Cave of the Lunarians" is a completely unused map name. Since FFII only ever refers to the race as "Lunars".
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 04, 2013, 09:56:57 AM
Also it is interesting to see that "Cave of the Lunarians" is a completely unused map name. Since FFII only ever refers to the race as "Lunars".
Maybe they originally had planned to give some significance to the Mars Face on the moon... I always wished they had.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 04, 2013, 12:03:47 PM
Also it is interesting to see that "Cave of the Lunarians" is a completely unused map name. Since FFII only ever refers to the race as "Lunars".
Maybe they originally had planned to give some significance to the Mars Face on the moon... I always wished they had.

Well the name label appears in the Overworld Maps. It's a possibility that it may have dealt something with their legacy rather than being info dumped by FuSoYa when you reach the moon.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 04, 2013, 12:50:16 PM
Guess they were in fact just "being cute" with the face. Hmph... maybe you were originally supposed to be able to reenter KluYa's tomb? That also would have been fun.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 04, 2013, 12:59:40 PM
Ah slight glitch I noticed PinkPuff. In the Characters Tab you cannot give a character above 65,536 Exp, but FuSoYa starts with a Lot more than that and you can change that, but if you go down in his 100000-esque Exp, you cannot go back up.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 07, 2013, 01:28:35 PM
For any who might be interested, I think I figured out exactly what it was that I had altered without the use of FF4kster that caused my ROM to be incompatible with FF4kster. As I was re-doing my hack, I tried one piece at a time, to see when the ROM finally started disagreeing with FF4kster. It looks like it was changing the NPC speech pointers (99A00-99DFF) that did it.

Here now is a list of alterations that WILL cause compatibility issues, and those that will NOT (the latter, thankfully, is a much longer list)

WILL cause compatibility issues:
Changing NPC speech pointers (99A00-99DFF)

WILL NOT cause compatibility issues:
Changing character graphics (map, battle, portrait)
Changing character pallettes (map, battle, portrait)
Changing event data pointers (90200-903FF)
Changing event data (90400-96882)
Changing location map data (B8500-CFEF8)
Changing location trigger pointers (A8200-A84FF)
Changing location trigger data (A8500-A981F)
Changing NPC placement pointers (98200-984FF)
Changing NPC placement data (98500-998FF)
Changing NPC sprite pointers (97200-973FF)
Changing NPC default visibility (97400-9745F)
Changing NPC speech data (but not the pointers) (99E00-9A4FF)
Using Yousei's Overworld/Underworld/Moon map editor
Using Zythrofar's Editor
Using JCE3000GT's multi-editor

This is not an exhaustive list, just what I've found will and won't cause conflicts.  If I discover more, I will add to this list, but as FF4kster becomes more and more of a powerful tool, I imagine I'll have less and less reasons to use other tools in the future.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 16, 2013, 08:57:38 AM
Does anybody know... Is it impossible to completely extricate the name of the character in Paladin Cecil's slot from that of the character in DK Cecil's slot?
When I change the name assignment for the Paladin slot, the Dark Knight name still appears in battle, thus making it impossible for these to be two separate characters...

 :edit: I was able to work around this by using Golbez's Slot, but this leads me to a request about FF4kster:
Pinkpuff - would it be possible to add in the ability to manipulate Golbez's actor? As it stands, I have to use a hex editor to do so. This includes adding/removing the actor in the event editor, in addition to editing starting name and battle commands.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 17, 2013, 05:29:14 AM
Does anybody know... Is it impossible to completely extricate the name of the character in Paladin Cecil's slot from that of the character in DK Cecil's slot?
When I change the name assignment for the Paladin slot, the Dark Knight name still appears in battle, thus making it impossible for these to be two separate characters...

I meant to ask about this. I know it's a known thing that the name assignments in battle are stored separately from the name assignments used everywhere else, but I can't seem to find any posts or docs that actually say where that is. If someone knows and is willing to post the data, it should be a trivial fix to update the editor with that functionality.

:edit: I was able to work around this by using Golbez's Slot, but this leads me to a request about FF4kster:
Pinkpuff - would it be possible to add in the ability to manipulate Golbez's actor? As it stands, I have to use a hex editor to do so. This includes adding/removing the actor in the event editor, in addition to editing starting name and battle commands.

Hm, I was under the impression that there are some strange things about Golbez's actor... maybe someone more knowlegable can either back me up or prove me wrong on this? If not, and his actor is no different from any other, then once again it should be a fairly trivial fix.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 17, 2013, 03:24:52 PM
Hm, I was under the impression that there are some strange things about Golbez's actor... maybe someone more knowlegable can either back me up or prove me wrong on this? If not, and his actor is no different from any other, then once again it should be a fairly trivial fix.
Far as I can see, he has limited job and character properties, but his actor is customizable. That is, his name, set of commands, and load/save assignment are unique. The one possible exception might be his starting equipment, which may be set to draw from that of DK Cecil (since in the original programming, Golbez obviously had no need for equipment). This does give him just enough unique characteristics to use him to make DKC and PC different characters.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 21, 2013, 03:46:52 PM
Hey Pinkpuff-
Have you considered putting targeting options into the command editor?
From the bab-il docs:
Code: [Select]
Each menu command also has a byte associated with it in a table that extends from 9FFC3 to 9FFDC indicating what it targets; this only affects the cursor, not the actual effects.
bits 0-2: not used?
bit 3: unknown
bits 4-6:
000 N/A
001 one ally
010 all allies
011 one/all allies/enemies (defaults to allies)
100 one enemy
101 one ally/enemy (defaults to enemy)
110 all enemies
111 one/all allies/enemies (defaults to enemies) bit 7: not used?

# Name Tg Comments -- ---- -- --------
00 Fight 50 one ally/enemy
01 Item 00 opens a sub-menu
02 White 00 opens a sub-menu
03 Black 00 opens a sub-menu
04 Call 00 opens a sub-menu
05 Dummy 60 all enemy (Dark Wave)
06 Jump 58 one ally/enemy
07 Dummy 60 all enemy (Remember)
08 Sing 50 one enemy
09 Hide 00
0A Dummy 20 all allies (Medicine)
0B Dummy 20 all allies (Pray)
0C Aim 50 one ally/enemy
0D Dummy 50 one enemy (Store)
0E Kick 60 all enemy
0F Dummy 00 (Endure)
10 Twin 60 all enemy
11 Dummy 00 (Strengthen)
12 Dummy 60 all enemies (Cry)
13 Cover 18 one ally
14 Peep 58 one ally/enemy
15 Dummy 60 (Unknown and unused command)
16 Dart 50 one ally/enemy
17 Sneak 50 one ally/enemy
18 Ninja 00 opens a sub-menu
19 Dummy 28 all allies (Spirit Wave)
1A Chang -- Yes, this really is "Chang" in the ROM; I don't know where the e gets put in.
1B Parry --
1C Show --
1D Off --

This is REALLY easy to do with a hex editor, but it also seems like the kind of thing you would want to put in there. Split ally and split enemy are possibilities, just no commands use them by default.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 28, 2013, 06:55:20 AM
Hey Pinkpuff-
Have you considered putting targeting options into the command editor?

The main reason I haven't is this line here:

Quote from: Bab-Il Docs
this only affects the cursor, not the actual effects.

Thus meaning any changes to it would be cosmetic only. I didn't really see the point. For example, if Dark Wave targets all enemies even after changing it to single or split then... why fool the players like that?

But if there is demand for it I can certainly throw it in there.

Also sorry it's been so long, I put the homebrew channel on my Wii and got obsessed with playing NES roms and hacks and stuff instead of working on this ^_^;
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on February 28, 2013, 07:56:39 AM
I'm almost certain that cursor data does affect certain commands (or there's more somewhere else which I've forgotten).
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 28, 2013, 09:21:38 AM
I can confirm it works effectively with Sing, so I figured the bab-il docs were mistaken or I was misinterpreting their meaning there. That's the only command I tried it with... perhaps it works with sing because sing calls upon other abilities (spells)... though it can make normally "target all" spells (such as Meteo) target a single ally, or make normally "target one" spells (like weak) target all. I guess more testing is needed to determine which commands can be changed and which cannot. My guess is recall, gird and pray will all work for the same reason sing does. I'll get back to you on that. Might not be til tomorrow.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 02, 2013, 11:11:01 AM
OK, here are my findings.
The summary is that it's really only worth the while to modify targeting of Sing and Recall, but here's the rest:

Code: [Select]
00 Fight - NO
05 Dark Wave - NO
06 Jump - NO
07 Recall - YES
08 Sing - YES
09 Hide - NO
0A Medicine - NO
0B Pray - YES (sorta... you can make it target only the caster instead of the whole party, because it NEVER has a cursor)
0C Aim - NO
0D Store - NO
0E Kick - NO, (but the visual change is complete - only the targeted enemy will flash, but all take damage)
0F Gird - can't tell, but only the caster gets the "armor" animation
11 Strengthen - Honestly, I have no idea what this does. I thought it was supposed to raise the caster's WIS score, but saw no such thing happen when using SNES 9X Debugger, so I don't know...
12 Cry - irrelevant
13 Cover - NO
14 Peep - NO
16 Dart - NO
17 Sneak - NO
19 Spirit Wave - NO

I did not test magic commands, because they open sub-menus, with sub-commands that have their own targeting details. I DID test Dart, because those items do not have their own targeting details, but apparently it is not even possible to affect the targeting options of Dart (even when you change the byte to target multiple, the cursor will still only allow single targeting)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 09, 2013, 11:52:12 AM
I have verified (and I'm sure others have as well that Boast increases Wisdom by 16 (10 in Hex) for each casting of it. I recall it being a simple change to Wisdom, nothing special like some of the other statuses seem to work on. If you run before finishing a battle after using Boast (And Protect and Shell incidentally) you can see that your Wisdom is still 16 up (until you next enter battle and it resets itself)
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 10, 2013, 01:16:25 AM
Yeah, I realized after I wrote that that a seperate portion of RAM is devoted to in battle character stats, which copy the regular record when the battle begins and write to it at the end. I was looking at the wrong RAM location. I guess I should at some point try again to see if the targeting is changeable, but based on all of my other results, I think I already know the answer.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 10, 2013, 10:19:44 AM
Ok I finally got up off my butt and finished the map properties editor. Have at 'er.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 10, 2013, 04:35:19 PM
Looks like everything works! The scrolling, the background, all of that jazz seems to work perfectly. And oddly enough though I was skeptical about the Underground byte, it does seem to allow Dwarves to appear on Overworld maps, but I have no idea what it does in the normal Underground maps, if anything.

Just for further notes (probably marked elsewhere)

 Battle BG 0 - Field
 Battle BG 1 - Forest
 Battle BG 2 - Mountains
 Battle BG 3 - Indoors
 Battle BG 4 - Caves
 Battle BG 5 - Moon
 Battle BG 6 - Aboard Airship (Or Boat)
 Battle BG 7 - Watery Caves
 Battle BG 8 - Cave with chasms in background (Sealed Cave?)
 Battle BG 9 - Desert
Battle BG 10 - Beach
Battle BG 11 - Feymarch/Sylph Cave
Battle BG 12 - Tower of Zot/Babil/Giant
Battle BG 13 - Lunar Subterrane/Bahamut's Cave
Battle BG 14 - Crystal Room
Battle BG 15 - Underworld

That's strange. Are you sure 15 is the last of the available Battle BG's? I didn't see Zeromus' background in there at all.

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 10, 2013, 07:57:06 PM
That's strange. Are you sure 15 is the last of the available Battle BG's? I didn't see Zeromus' background in there at all.

Not sure at all actually... according to the doc there are three mystery bits in that byte:

Quote from: LOCPROP.TXT
00: Battle Properties
   bits 0-3: Battle Background
   bits 4-6: ?
   bit 7: Battles have Magnetic Effect if event flag E1 is set

Right now the editor just ignores those bits and leaves them alone but I could see what happens if I interpret one or all of them to be part of the battle BG...
Title: Re: Developing a comprehensive editor for FF4
Post by: Zozma on March 11, 2013, 05:45:48 AM
i just wanted to take time to say that this program is great! it even properly works with my hack in which i reassigned the level up data so that every character has level 1 data.

i also am interested in being able to change the targetting of skills.

and as for golbez actor? the actor is fine but cannot be given a learnable magic set and cannot be saved to the shadow party (which i really wish could be fixed)
some extra info: the pig sprite can be used to create a full golbez sprite (his palette assignment begins there) instead of overwriting another characters sprite and IF you are ok with dummying mini, and pig it frees up a full overworld sprite slot as well as a portait. there is technically enough sprite space to have a full anna sprite as well however it requires removing the small twin moon gfx from the intro screen when cecil and cain first leave for mist.

ohh btw, I created a special black magic set for my Anna (fusoya's actor) where she actually learns spells that i cant access on the magic learning menu. any way to allow this to select spells further down the list? Fire/Ice/Bolt 4 are a bit overkill but hey its the daughter of the great sage afterall lol..
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 11, 2013, 08:25:17 AM
Glad to hear you're finding it useful!  :childish:

I think my policy on things like the Golbez actor and the learning of monster techs is that, if it can't be made to work properly/elegantly from using FF4kster alone, then FF4kster is not going to let you do it from within it. If you make changes using some kind of other tool, including hex editors, then FF4kster will throw up its hands and absolve itself of any responsibility with regards to what happens.

So with regards to the particulars above, there will be no golbez actor, and no learning monster techs, but there will be targeting options for the commands for which it actually does something (Recall and Sing), since the commands are already handled in a very piece-wise, case-by-case basis.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 11, 2013, 11:36:24 AM
couple of things... well, one long thing...
It doesn't look like ff4kster enables you to alter the second byte of map properties (the "map index").
This, to me, is possibly the most useful property of a map to be able to edit.

Example 1:
Let's say I want to repopulate Eblan Castle.  Well, it's easy enough to put the NPCs in the castle, but Eblan has no Bank 2 (well, only one per map anyway), so the only way to make them speak is to waste events.
BUT, by repopulating Eblan, maybe I wouldn't need Cave Eblana inhabited anymore...
SO, in the second byte of map properties for Cave Eblana B2F ("Cave Eblan Settlement" in ff4kster, map C8), which has 10 Bank 2 messages, I change the C8 to 5E.
NOW, when the game is called upon to put the player in Cave Eblana B2F, the player winds up in Eblan Castle 1F.
VOILA! I have NPCs in Eblan 1F that use the Bank 2 messages from Cave Eblana B2F.

Example 2:
Let's say I want multiple locations that look identical. I only have to program the tile layout of this location once, then I can make multiple maps reference it by way of the second byte.  I think the game does this with the sealed cave, and possibly with a chocobo forest or two (though I could be wrong...).

Come to think of it, this almost definitely has something to do with the use of the "underground" byte as well...
Title: Re: Developing a comprehensive editor for FF4
Post by: Zozma on March 11, 2013, 02:40:16 PM
i was doing a play as i go fix of all my npc bugs and i got to troia castle, and realized i cannot access the npcs in the troia hospital or in several other places for that matter. but because in my hack you dont have the default games party i cant fix this. and one of the characters, my cid takes palette assignment instead of default player character palette because he is in the golbez slot, so he has the wrong palette here too lol...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 12, 2013, 03:16:51 AM
It doesn't look like ff4kster enables you to alter the second byte of map properties (the "map index").

Fixed.

And actually it appears to have been an oversight more than anything else; it was already reading and writing the map index, it just didn't have an entry in the editor menu. It probably just fell through the cracks when I was organizing the different menus.

i was doing a play as i go fix of all my npc bugs and i got to troia castle, and realized i cannot access the npcs in the troia hospital or in several other places for that matter. but because in my hack you dont have the default games party i cant fix this. and one of the characters, my cid takes palette assignment instead of default player character palette because he is in the golbez slot, so he has the wrong palette here too lol...

Hm, you're right, Troia Hospital NPCs don't appear in FF4kster for me either... which is strange as it seems to be reading everything else correctly... I'll do some digging, and in the meantime if anyone has any ideas or speculation I'm all ears...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 12, 2013, 10:58:25 AM
Sweet. Thanks as always.

Regarding the Troia hospital NPCs, I seem to remember having seen some of the bank 2 messages hanging out in the Troia Lobby (in ff4kster). I'm not home, so I can't confirm right now.
Title: Re: Developing a comprehensive editor for FF4
Post by: Zozma on March 12, 2013, 04:24:02 PM
theres another thing. the program will not allow you to add actors golbez or anna to a party, if you use this program on a rom with an event that adds any actor past Kain3, it wont add this character. I used Golbez actor to join where fusoya normally does but now it wont add him.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 12, 2013, 05:25:02 PM
theres another thing. the program will not allow you to add actors golbez or anna to a party, if you use this program on a rom with an event that adds any actor past Kain3, it wont add this character. I used Golbez actor to join where fusoya normally does but now it wont add him.

I take no responsibility nor concern whatsoever about how FF4kster affects roms that have been modified using any other tools. If you do use extenal tools on the same rom, be sure to make a backup.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 12, 2013, 05:35:41 PM
So according to phoenix's NPC placement doc, the Troia hospital (map 58) has no NPCs.
Curious...
Title: Re: Developing a comprehensive editor for FF4
Post by: Zozma on March 12, 2013, 05:39:50 PM
yeah im able to fix that easily, i just figured id mention that that is how it works.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 12, 2013, 10:14:43 PM
Well, yeah, I can think of a couple of different ways to change it.... I'm more curious about how the original programming handles the NPCs.

I'm wrong about the Bank 2 dialogue, btw, that IS linked to the map, which makes it even more mysterious.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 13, 2013, 11:00:02 AM
FOUND IT!!

Map 292 in FF4kster, default name "Tower of Babil 3F"

How in the world they ended up there is beyond me though...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 13, 2013, 07:10:22 PM
Hey, did you notice - apparently the Troia Hospital is underground, too. Add it to the list of bizarre decisions made by Team Square...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 14, 2013, 07:45:08 AM
So, now that the map properties are done, then aside from whatever other random stuff gets discovered in the wishlist thread (on that note, FF4kster now has the ability to edit two-handedness and key-item-ness in a new "Item Ranges" editor that I hope to be able to expand as more info emerges), all that's left is the monster section.

I'm working on the monster editor now, and it doesn't appear too complicated. After that will be monster AIs, and then, once it's been debugged a little of course, FF4kster will be considered v1.0 and I'll be in completely new territory. There are definitely other things I'd like to be able to edit, but I haven't been able to come across any actual documentation for it.

In particular, I'd like to be able to edit the maps (the actual tile layouts themselves, much like FF4Tools). I might be able to reverse-engineer most of the necessary info from playing with FF4Tools, but in either case, another thing I'd like to be able to do, that in a certain sense is kind of required for the map editor, is to be able to preview the graphics. Not necessarily edit the graphics themselves, as there are lots of tools for that, but it'd definitely be nice to, for example, see what a monster will look like if we give it such-and-such graphic with such-and-such palette without having to save and load it up in the emulator for each combination. Likewise, I'd love to be able to preview the animations for weapons, and even spells.

The thing is, while I'm sure it'd be easy to find the location of the graphic tiles themselves with something like Tile Layer, finding the palette information is another thing altogether. For example, I was able to easily find and read the menu graphics which the editor makes use of directly, but it uses a hard-coded palette, not the one in the rom. Is there one set of palettes that's used for all the graphics throughout the game? Or do different kinds of things have different palettes available to them? Is palette 25 for weapons the same set of colors as palette 25 for spells or palette 25 for character portraits?

Also there are things in the monster section that would be very nice to be able to edit but yet I have no documentation for, such as, the actual monster formations themselves (e.g. Imp x3, SwordRat x1), not to mention the monster domain / encounter charts (the list of monster formations you could randomly encounter in a given area).

Anyway thanks again everyone for all your help. We're on the home stretch!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 14, 2013, 01:12:43 PM
Well, first of all, REALLY EXCITED for the monster AI editor. I know where to find the info to do it on my own, but the promise of how long it would take has kept me away thus far.

Regarding the pallettes... I'm sure the information is documented somewhere... maybe in yousei's doc? If it's not, then I can help find them, but it will take some time... they're not all together, and there are quite a few to sort through... and I think some are shared between certain graphics.

Also, I don't know where monster formations are documented exactly, butI know the info is out there somewhere. If it helps to know this, zyrthofar's editor, while obnoxiously buggy, DOES have an effective monster formation editor (including previews).

Any thoughts about a music editor? The doc I wrote up should have enough how-to to make it possible. It's not hard if you know what you're doing, but it would be nice to have a program that bridges the gap between midi program and hex editor.

Thanks as always for everything you're doing!
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on March 14, 2013, 02:04:56 PM
Weapons and spells do share palettes, I'm not sure what else does. Most things have their own palettes, though. They're documented somewhere, probably Yousei's doc like chillyfeez said.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 14, 2013, 04:41:42 PM
Well, first of all, REALLY EXCITED for the monster AI editor. I know where to find the info to do it on my own, but the promise of how long it would take has kept me away thus far.

Me too!  :childish: Not sure at this point whether it'll have its own separate editor component or if it will be integrated with the monster editor. We'll have to see how it evolves.

Regarding the pallettes... I'm sure the information is documented somewhere... maybe in yousei's doc? If it's not, then I can help find them, but it will take some time... they're not all together, and there are quite a few to sort through... and I think some are shared between certain graphics.

Weapons and spells do share palettes, I'm not sure what else does. Most things have their own palettes, though. They're documented somewhere, probably Yousei's doc like chillyfeez said.

None of the docs I've collected seem to have that info... do you have a link to the doc in question?

Also, I don't know where monster formations are documented exactly, butI know the info is out there somewhere. If it helps to know this, zyrthofar's editor, while obnoxiously buggy, DOES have an effective monster formation editor (including previews).

I have seen this. One of the reasons FF4Tools is great for reverse engineering is that it produces the actual hex code and tells you where it goes. Thus I can play with things and see what effect it has on the code. With Zyrthofar's editor it's not obvious what's going on underneath the hood as it were.

Any thoughts about a music editor? The doc I wrote up should have enough how-to to make it possible. It's not hard if you know what you're doing, but it would be nice to have a program that bridges the gap between midi program and hex editor.

Hm, possibly. The main obstacle here would be getting the FreeBASIC sound library to cooperate... I've had trouble with it in the past, but we'll see about it when the time comes.

Thanks as always for everything you're doing!

And to you as well!!
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on March 14, 2013, 05:29:24 PM
ff4.txt that comes with FF4Ed, in the Docs folder. It does't look like weapon/spell palette data is documented there, though. Zyrthofar's docs might've had it, but I seem to have misplaced those (again :blush:). Yousei actually also wrote a palette editor, snespal (http://www.romhacking.net/utilities/32/), if you want to search for them yourself. (GBA utils should work too since they use the same palette format, hence why there are so many color restoration GBA hacks.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 14, 2013, 08:58:56 PM
It seems like things are moving around in a grand fashion! We're almost finished. Just a little bit more and we will have the means to reinvent the game as we see fit! Thank you for all of your hard work and devotion to this project PinkPuff!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 14, 2013, 11:51:13 PM
OK, enemy formations are located in a table beginning at 70200 (ROM with header), and each entry is eight bytes long.
I haven't figured the whole thing out yet, but the most obvious bits:
-Each enemy formation can have up to 3 different kinds of monster.
monster type 1: Byte 01
monster type 2: Byte 02
monster type 3: Byte 03
-there can be 0-3 of each monster type (max 8 altogether, I think). This is all encoded in byte 04:
monster 1 0/1/2/3: 00/40/80/C0
monster 2 0/1/2/3: 00/10/20/30
monster 3 0/1/2/3: 00/04/08/0C
-there are 146 different possible formations (not all allow up to 8 monsters, btw). Which formation used is determined by byte 05 (value 00-91)
-bytes 00 and 06-07 control all other possibilities in a battle, including back attack, inescapable, monsters begin in eggs, monsters die as bosses, which battle music is used, etc. obviously these three bytes each include several of these options. I haven't worked it all out yet, but will have most likely by tomorrow.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 15, 2013, 05:08:50 AM
ff4.txt that comes with FF4Ed, in the Docs folder. It does't look like weapon/spell palette data is documented there, though. Zyrthofar's docs might've had it, but I seem to have misplaced those (again :blush:). Yousei actually also wrote a palette editor, snespal (http://www.romhacking.net/utilities/32/), if you want to search for them yourself. (GBA utils should work too since they use the same palette format, hence why there are so many color restoration GBA hacks.)

Thanks! I'll go digging for it when the time comes.

It seems like things are moving around in a grand fashion! We're almost finished. Just a little bit more and we will have the means to reinvent the game as we see fit! Thank you for all of your hard work and devotion to this project PinkPuff!

No problem, thanks for your feedback! And yeah, the vision of a world where we can (more easily) make FF4 bow to our whims is what keeps me motivated to work on it!

OK, enemy formations are located in a table beginning at 70200 (ROM with header), and each entry is eight bytes long.
I haven't figured the whole thing out yet, but the most obvious bits:
... etc ...
I haven't worked it all out yet, but will have most likely by tomorrow.

Wow, nice work! Thanks to this I might be able to squeeze the formation editor into 1.0 after all.
Title: Re: Developing a comprehensive editor for FF4
Post by: Zozma on March 15, 2013, 06:25:17 AM
snes pal is great for use on ff4, i know exactly where the overworld palettes start as well as battle character sprites palettes and portrait palettes. pretty sure these are specifically used for their one purpose. course ff4 reference book lists where these are too....

my favorite thing to do is play with the sprites but i doubt that helps much here
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 15, 2013, 09:36:32 AM
Here we go:
Code: [Select]
Enemy Formation Table (70200-711FF)
Each formation is represented by 8 bytes:

Byte 0:
 Bit 0: ?
 Bit 1: ?
 Bit 2: ?
 Bit 3: Forced Back Attack
 Bit 4: Enemies Have Boss Death
 Bit 5: Monster(s) 3 Begin In Eggs
 Bit 6: Monster(s) 2 Begin In Eggs
 Bit 7: Monster(s) 1 Begin In Eggs

Byte 1: Monster(s) 1 Type

Byte 2: Monster(s) 2 Type

Byte 3: Monster(s) 3 Type

Byte 4: Qty. of Each Monster Type (max 8 altogether)
 Bit 0-1: ?
 Bit 2-3: Monster(s) 3 Qty.
 Bit 4-5: Monster(s) 2 Qty.
 Bit 6-7: Monster(s) 1 Qty.

Byte 5: Preset Monster Arrangement
 -Values 00-91
 -Total qty. of monsters is limited by arrangement

Byte 6:
 Bit 0: Can't Run
 Bit 1: No Game Over (think impossible Dark Elf battle)
 Bits 2-3: Battle Music (Regular/Boss/Fiend/No Change)
 Bit 4: Character Battle (Edward v. Tellah, etc.)
 Bit 5: Auto Battle (not sure where the AI is for these?)
 Bit 6: Floating
 Bit 7: Transparent (Breath, Mind)

Byte 7: ?
The unknown bits and byte seem to be insignificant, or at least not worth changing.

In case anyone's interested, the so-smart-it's-stupid way I traced this: Took two identical files, changed the monster type of group 1 from imp to basilisk (using zyrthofar's editor), created an .ips patch, read the patch with my hex editor to determine the altered location. Voila!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 15, 2013, 10:37:21 AM
Ha, that is a pretty smart technique actually! Thanks so much for the data! Monster formations are now definitely on the list.

I encountered something odd though... at some point along the line my editor seems to have begun causing arrows to be better in the off hand!! Not sure how this happened, or when it happened, as I only noticed it now...

Maybe someone can confirm that this is also happening for them?

Load up a fresh rom and get a bow and arrows and put it on someone correctly and compare the stats to if you swap hands... then load the rom in FF4kster, change nothing, and save, then load up the emulator again and see the difference!
Never mind, found the problem and fixed it.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 15, 2013, 07:04:19 PM
Hello, me again! Just wondering, was the arrow problem ever in any of the released editors? Like, it isn't in the newest version of ff4kster, is it?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 16, 2013, 07:55:17 AM
I just uploaded the fixed version to the time cave. There are also a couple of new surprises in the "Features" editor (I renamed the "Item Ranges" so that it can include ranges for things other than items).

 :edit:
To answer your question more directly Vivify, that bug has probably been in every version of FF4kster released so far, but saving with the current version will fix it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 16, 2013, 10:00:18 AM
Wow! This is some Really good stuff! I'm glad to see that you managed to figure out many of the ranges! But I curiously do not see Shields (Which I had thought I completely figured out). Nor Black (which I would presume, but I have no idea proceeds right after the White range?)

And it automatically recalculates it when you change it! Great work on this little extra Pinkpuff! It makes editing the ranges such a simple matter!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 16, 2013, 10:52:57 AM
Wow! This is some Really good stuff! I'm glad to see that you managed to figure out many of the ranges! But I curiously do not see Shields (Which I had thought I completely figured out). Nor Black (which I would presume, but I have no idea proceeds right after the White range?)

Thanks! Still working on shields, they're a little more complicated for some reason.  :edit: Fixed and uploaded. Shields now work correctly as far as I can tell.

Black spells are all those spells that are not White or Summons. Changing a spell to White just changes its casting animation (gives it white orbs instead of a green ring), but changing a spell to become a Summon changes more than just the casting animation (the summoner flames), it messes up the actual execution of the spell. Your party disappears and never reappears, and renders them incapable of acting, and it casts a spell from somewhere down in the spell list. Thus, even though I know what to change to modify that range, I'm hesitant to put it into the editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 16, 2013, 02:25:14 PM
Quote
… changing a spell to become a Summon changes more than just the casting animation (the summoner flames), it messes up the actual execution of the spell. Your party disappears and never reappears, and renders them incapable of acting, and it casts a spell from somewhere down in the spell list. Thus, even though I know what to change to modify that range, I'm hesitant to put it into the editor.
Huh... I didn't know that that was known info about summons. I'd like to play around with that. Can someone tell me where the data to adjust that range is? I'm hoping to someday crack the "which monster is summoned" mystery, and this is certainly a key piece of the puzzle I've missed thus far.

(Hey look, I just shapeshifted into a siren!)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 16, 2013, 03:14:31 PM
1CF28: Index of first summon spell
1CF2C: Index of first spell after the summon range (so, last summon's index + 1)
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 16, 2013, 08:51:25 PM
hmm... making spells 40+ into summons seems to invariably summon Asura (completely effectively - party comes back afterwards). Not useful at all, really, but different than the game-ruining effect of setting spells before 31 to be summons.
(sorry, I'll stop talking non-ff4kster now)
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 16, 2013, 10:52:55 PM
OK, I think I just discovered a pretty serious glitch (fortunately, I keep backups of everything, including previous versions of ff4kster)...

It seems that, in all versions of ff4kster since editing map properties became available (that is, the version I downloaded on 3/11), the game freezes when you try to change your overworld map character. In other words, if I have Cecil and anyone else in my party, and I'm walking around, and I hit R, the game freezes.

I tested this with a completely clean FF2 v1.1 ROM.  All I did was open the ROM in ff4kster, save it without making any changes, and play from the beginning. Once I had Kain in the party, I hit R - Game Freezes.

Tried also loading a saved game with several characters.  It's fine until you hit R, then freezes.

As a matter of fact, even when there's nobody else in the party, hit R and the game freezes.

Can anyone else confirm that this is happening?
Seems when I fall back to the version of ff4kster I downloaded on 2/9 (the pre- map properties editing version), this problem no longer exists.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 17, 2013, 02:56:54 AM
Good catch! I think it would have taken me a long time to find that one, I almost never change map characters...

Anyway it's fixed now as far as I can tell.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 17, 2013, 04:53:00 PM
Something similar happened to me with resting after I edited the location labels. If you went to an inn, used a tent or a cabin, the characters would never wake up. The screen would stay black until you reset.

Final Fantasy IV: Eternal Sleep! :laugh:

I fixed it by importing the old code from a clean version of FFII US. But man, pages upon pages were changed.

 :edit: Hello! I encountered another problem: Warp, Exit, and Emergency Exits don't work in dungeons anymore. I think this stems from me using ff4kster's map editor. I'm trying to use an Emergency Exit to leave Magnes Cave, but it doesn't work on my project ROM. However, it does work on a normal FFII US ROM. I'm not quite sure what happened here, but I know Emergency Exits worked earlier in the game, as that's how I escaped the Antlion Cave earlier in my testing.

I thought you'd like to know, Pinkpuff.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on March 17, 2013, 10:12:17 PM
PinkPuff, anything about the map properties or whatnot that you need help with?  Tomorrow I will try to get the monster encounter rates over to you when I get upstairs. :)

Anything else you might need that I may have let me know. :)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 18, 2013, 07:27:11 AM
Warp/Exit bug is now fixed, and in the process of debugging I found the "warpable" flag and added it to the Map Info editor.

I can't duplicate the sleeping bug so I can't really debug it until then... is this happening for anyone else?

PinkPuff, anything about the map properties or whatnot that you need help with?  Tomorrow I will try to get the monster encounter rates over to you when I get upstairs. :)

Anything else you might need that I may have let me know. :)

Thank you so much!! Yes, I would love to have any information you're willing to give me! I'm an FF4 information sponge for the purposes of this project. The more info I have the more robust the editor will be.

If you want me to make some specific requests... I think most of the things in the wishlist thread have actually been found. Did we ever find out what spells and items correspond to what effects outside of battle, and how to change those? If not, that would be a good thing to know. Also any information on the location of graphics and particularly palettes would be nice. I can certainly go digging for it myself but if someone happens to know them already it would speed up the process a great deal.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 18, 2013, 03:57:37 PM
Warp/Exit bug is now fixed, and in the process of debugging I found the "warpable" flag and added it to the Map Info editor.

I can't duplicate the sleeping bug so I can't really debug it until then... is this happening for anyone else?

PinkPuff, anything about the map properties or whatnot that you need help with?  Tomorrow I will try to get the monster encounter rates over to you when I get upstairs. :)

Anything else you might need that I may have let me know. :)

Thank you so much!! Yes, I would love to have any information you're willing to give me! I'm an FF4 information sponge for the purposes of this project. The more info I have the more robust the editor will be.

If you want me to make some specific requests... I think most of the things in the wishlist thread have actually been found. Did we ever find out what spells and items correspond to what effects outside of battle, and how to change those? If not, that would be a good thing to know. Also any information on the location of graphics and particularly palettes would be nice. I can certainly go digging for it myself but if someone happens to know them already it would speed up the process a great deal.

I found a bit about those. But really only Items. When it comes to spells I had modicum success, but in so doing I couldn't get the spell to do anything else. For instance I changed Sight to where it would act like a "normal" spell, but nothing would happen when used.

I'll check to see if I have notes on these...

Here's what I have on Items...

8260 - 03
8264 - 87 (Event Number corresponding to Warp)
8269 - 04
826D - 86 (Event Number corresponding to Exit/Emergency Exit)
8272 - 05
8276 - FB (Event Number corresponding to Sight/Dwarven Bread)
827B - 06
827F - 01 (?? Siren ??)
8286 - DB (Event Number corresponding to Magazine)

Seems I've misplaced (or never wrote down?) the spell correspondence.

hmm... making spells 40+ into summons seems to invariably summon Asura (completely effectively - party comes back afterwards). Not useful at all, really, but different than the game-ruining effect of setting spells before 31 to be summons.
(sorry, I'll stop talking non-ff4kster now)

That is interesting. I am assuming that the game is looking for Specific sections to jump to. If you use This Spell in This Index then Jump 1C further to use the actual spell. I'm assuming that Asura and Bahamut are handled a little differently though. That may be worth a look.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 18, 2013, 10:59:46 PM
That is interesting. I am assuming that the game is looking for Specific sections to jump to. If you use This Spell in This Index then Jump 1C further to use the actual spell. I'm assuming that Asura and Bahamut are handled a little differently though. That may be worth a look.
... you mean because those are the only two where the order of the *cast* spell is not the same as the order of the *effect* spell, right? I've thought of that as well. I've also considered that maybe the different order has something to do with the multiple effect spells associated with Asura.
Don't know how much time you've spent looking at the game's graphics, but it's also worth noting that:
a) the summoned monsters' graphics are all grouped together,
b) they are the last monster graphics that appear (beginning at 68A18 - the earliest monster graphics begin at 48200),
c) they follow the same order of appearance as the effect spell,
and d) there is a large amount of non-graphical data separating the summoned monsters' graphics and all other monsters' graphics
Incidentally, I've also learned how to make an enemy look like a chocobo (change the graphic pointer to C217 and the "size" to 01), or a sylph (C5D4/C5E0/C5EC, 00). Not very useful knowledge about summoning, but a fun side effect of my search. The other non-enemy summons (Shiva, Indra, Jinn) are all irregular sizes, so while I'm sure it is possible, I don't know enough about how the irregular-sized monsters are encoded to make them enemies.
Some pieces of info I'm missing that surely are key:
- the location of the subroutine(s) for the effect spells
-also, I'm sure the effect spells must also have a separate range identified somewhere. If that could be found, then maybe changing the range of the cast spell wouldn't cause the party to permanently disappear (not to mention possibly make other monsters summonable).
(SORRY, this is totally off-topic)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 20, 2013, 12:33:01 PM
Working on the monster editor now, and it's easily the most complex editor so far. I am going to try to incorporate the AI editor in with the monster editor. However, I'm reading the docs and have run up against a slight roadblock...

The AIs are stored as pairs of indexes: one is an index of a set of conditions, the other is the index of a battle scirpt. However, I can't find any information in the docs I have on how to interpret the conditions. Does anyone else know how they are encoded, or know where I can find that information?

This is all I was able to find on the subject:
Quote from: Tower of Babil
Each attack sequence group is made of from one to ten two byte entries. The
first byte determines under what condition(s) the attack sequence specified by
the second byte will take place.

The first byte of the attack sequence group is looked up in yet another list
that extends from 76800 to 773FF. This list is another list of lists; each of these sub-lists consists of
from one to three condition bytes terminated by an FF. Once again, the game
code must walk down the list one byte at a time, looking for those FFs.
Presumably, these bytes represent conditions that must all be met for the
specified attack sequence to be used. The condition bytes are looked up in a
table from 76900 to 76AFF. Each table entry is four bytes. I don't know the
exact meaning of these bytes yet.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on March 20, 2013, 02:37:02 PM
http://rb.thundaga.com/monsters/eci.txt (http://rb.thundaga.com/monsters/eci.txt)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 20, 2013, 03:41:45 PM
Thanks! I thought I had downloaded everything from thundaga but apparently not.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 22, 2013, 09:17:27 PM
Hello! Pinkpuff, I've made a bit of a discovery--the bit labeled "Warpable" in ff4kster is actually only the "Exit OK" bit. "Warp OK" is a different bit. I tested a save in the Lunar Subterrane, where I had Rydia cast Warp in my hack. It didn't work. Then I tried it again with a vanilla FFII US ROM, and lo and behold, it worked just peachy!

I wanted you to know. :happy:
Title: Re: Developing a comprehensive editor for FF4
Post by: Aether Knight on March 23, 2013, 06:00:35 PM
Greetings all. I have found a bug with your (PinkPuff's) editor. Whenever you save the game within the editor whether you changed anything or not, Golbez in the final auto battle with FuSoYa is removed. This causes FuSoYa to endlessly cast spells on Zemus. Tested it versus a clean rom and it is indeed the editor. Just thought you would like to know that.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 24, 2013, 07:22:54 AM
Hello! Pinkpuff, I've made a bit of a discovery--the bit labeled "Warpable" in ff4kster is actually only the "Exit OK" bit. "Warp OK" is a different bit.

Thanks for the tip! There are a couple of other "mystery bits" in that byte so I'm sure it's one of those. I'll get to work on that soon and add it into the map properties editor.

Greetings all. I have found a bug with your (PinkPuff's) editor. Whenever you save the game within the editor whether you changed anything or not, Golbez in the final auto battle with FuSoYa is removed. This causes FuSoYa to endlessly cast spells on Zemus. Tested it versus a clean rom and it is indeed the editor. Just thought you would like to know that.

Wow, nice catch! Thanks Aether Knight. The testing I've done on roms saved with the editor has so far been very cursory and not very rigorous at all. I haven't played one as far as the underworld even, let alone the end of the game. I appreciate the feedback very much and I will try to hunt down this bug. It may take a while though, as I'm going to have to progress a game file that far so that I can make a proper save first.

FF4kster is not a fan of Golbez in general it seems...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 25, 2013, 07:31:43 PM
Ok, "exitable" flag has been separated from the "warpable" flag and added to the editor.

Likewise, I tracked down the problem with Golbez and as far as I can tell it is fixed. If anyone wants to verify, please re-download the current version from the Time Cave link on the first post. Interestingly, in the process of tracking down the Golbez bug, I found that the character level up data looks like it isn't being written to the rom...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 25, 2013, 09:25:23 PM
Interestingly, in the process of tracking down the Golbez bug, I found that the character level up data looks like it isn't being written to the rom...
You mean all characters' level up data? If so, then that's new in the last couple of releases. I did quite a bit of levelup editing in February that worked fine.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 26, 2013, 06:48:17 AM
You mean all characters' level up data? If so, then that's new in the last couple of releases. I did quite a bit of levelup editing in February that worked fine.

False alarm. It looked that way because there was a huge chunk of code in the character saving routine that was commented out, all having to do with the levelups and so I paniced. Anyway after further investigation, you're right, it's working correctly; I just at some point changed how I was saving it, evidently involving moving the code elsewhere, and forgot to delete the redundant part.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 27, 2013, 10:20:35 AM
How do I go about adding Golbez back to that battle? Please tell me that I don't have to start all over--I've invested far, far too much work in this project to restart now...!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 28, 2013, 05:13:00 AM
How do I go about adding Golbez back to that battle? Please tell me that I don't have to start all over--I've invested far, far too much work in this project to restart now...!

I keep warning people... the editor is not reliable yet and not to do anything important with it...

The only way I know of to easily and correctly fix the Golbez issue is to start with a fresh rom. But if you don't mind using a hack-ish workaround, you could go into the event editor, and find the event for the final sequence, and remove the line that tells it to enter that battle. Golbez and FuSoYa would just collapse without any explanation, but at least the game wouldn't freeze.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 28, 2013, 09:47:11 AM
Vivify:
There might not be a quick fix for you, because as far as I know, nobody has discovered yet how to edit the characters that participate in story-driven autobattles (like this one, the tellah-edward battle, tellah-golbez, etc.)

Best thing might be to get a clean ROM and copy/paste all of the information you've changed. Everything  ff4kster does edits a documented set of data in the game.
So, for example, if you've done extensive event editing, copy the event pointers(90200-903FF) and event data (90400-96882) from your edited ROM to the clean file.
It'll still take some time, but will presumably be quicker than rewriting every change you've made.
I'd recommend using Cygnus hex editor for this process. It allows you to open up two ROMs side-by-side, which makes copy/paste from one ROM to another a pretty painless process. Maybe other hex editors will work just as well, but I can vouch for Cygnus.

 :edit:To clarify, I would only use this method to copy events, levelup data, and dialogue banks. Everything else would probably be quicker to redo right on ff4kster.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 28, 2013, 05:46:40 PM
I see. Thank you for your prognosis, doctors. I guess I'll just start fresh, someday.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 29, 2013, 07:12:00 AM
Another hack that might be worth trying out Vivify (not sure if this will work or not so make a backup!):

The offending code had to do with Golbez' character data, so try copying the data from a fresh rom from address 7ACA0 to 7ACBF into your hacked rom into the same address range. If I did my math right that should fix it and you won't have to redo anything.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 30, 2013, 03:19:46 PM
That did it! Golbez is now back in the game. :childish: Thank you very much, Pinkpuff!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on April 09, 2013, 01:08:07 PM
How goes the monster editing portion PinkPuff? It's been a little bit of time since an update and just wanted to know if you needed any help or any such matter.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on April 09, 2013, 02:28:30 PM
Actually, I'm glad you offered...

It has been a while, and I do need some help. I implemented a routine for reading in monster AIs. However, it's clearly doing something wrong, as the output it displays makes no sense. However, the fact that I don't really know what it should look like (though I know this definitely isn't it!), combined with the complexity of the way the monster AIs are stored makes it very difficult for me to pinpoint what is being done wrong. Normally in such a situation I'd look into the hex data and manually trace through the process for a few example monsters. However, I'm not 100% on the description of the way it's stored and I wouldn't know if the results I got were correct, even doing it manually.

If someone does have a thorough understanding of the monster AIs and can maybe give a more clear or more detailed description than are in the Bab-Il docs, (preferably with a couple of examples from the actual hex code if possible), that would be a huge help and I'd be able to get back in business.

In the meantime, I distracted myself by making this (http://www.stencyl.com/game/play/18310)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on April 10, 2013, 10:37:11 AM
Ah, AI is the sticking point... have you tried contacting Deathlike2? He is an expert when it comes to FFIV AI. Also have you tried corresponding your results to other editors that also claim to edit AI? There's a lot of quizzical things in there as well.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on April 10, 2013, 05:50:35 PM
I actually wrote, of all things, a Cartographer command file that can dump sequences. (The actual sequences, not conditionals.) They can be inserted by Altas. :omghax:

Code: [Select]
#GAME NAME: Final Fantasy II

#BLOCK NAME: Normal Attack Sequences
#TYPE: NORMAL
#METHOD: RAW
#SCRIPT START: $76900
#SCRIPT STOP: $771FF
#TABLE: sequence.tbl
#COMMENTS:              No
#END BLOCK

#BLOCK NAME: Lunar Subterrain Attack Sequences
#TYPE: NORMAL
#METHOD: RAW
#SCRIPT START: $736C0
#SCRIPT STOP: $73ACF
#TABLE: sequence.tbl
#COMMENTS:              No
#END BLOCK

Code: (sequence.tbl) [Select]
01=Hold\n\n
02=Mute\n\n
03=Charm\n\n
04=Blink\n\n
05=Armor\n\n
06=Shell\n\n
07=Slow\n\n
08=Fast\n\n
09=Bersk\n\n
0A=Wall\n\n
0B=White\n\n
0C=Dispel\n\n
0D=Peep\n\n
0E=Cure1\n\n
0F=Cure2\n\n
10=Cure3\n\n
11=Cure4\n\n
12=Heal\n\n
13=Life1\n\n
14=Life2\n\n
15=Size\n\n
16=Exit\n\n
17=Sight\n\n
18=Float\n\n
19=Toad\n\n
1A=Piggy\n\n
1B=Warp\n\n
1C=Venom\n\n
1D=Fire1\n\n
1E=Fire2\n\n
1F=Fire3\n\n
20=Ice-1\n\n
21=Ice-2\n\n
22=Ice-3\n\n
23=Lit-1\n\n
24=Lit-2\n\n
25=Lit-3\n\n
26=Virus\n\n
27=Weak\n\n
28=Quake\n\n
29=Sleep\n\n
2A=Stone\n\n
2B=Fatal\n\n
2C=Stop\n\n
2D=Drain\n\n
2E=Psych\n\n
2F=Meteo\n\n
30=Nuke\n\n
5F=$5F-Dummy\n\n
60=$60-Dummy\n\n
61=Gaze\n\n
62=Bluster\n\n
63=Slap\n\n
64=Powder\n\n
65=Glance\n\n
66=$66-Charm\n\n
67=Tongue\n\n
68=Curse\n\n
69=Ray\n\n
6A=Count\n\n
6B=Beak\n\n
6C=Petrify\n\n
6D=Blast\n\n
6E=Hug\n\n
6F=Breath\n\n
70=Whisper\n\n
71=Entangle\n\n
72=$72-Weak\n\n
73=Disrupt\n\n
74=ColdMist\n\n
75=Explode\n\n
76=DullSong\n\n
77=Hold Gas\n\n
78=Gas\n\n
79=Poison\n\n
7A=Maser\n\n
7B=Vanish\n\n
7C=Demolish\n\n
7D=Blk.Hole\n\n
7E=Dancing\n\n
7F=$7F-Disrupt\n\n
80=Storm\n\n
81=Magnet\n\n
82=Reaction\n\n
83=Hatch\n\n
84=Remedy\n\n
85=Absorb\n\n
86=Heal\n\n
87=Big Bang\n\n
88=Vampire\n\n
89=Digest\n\n
8A=Pollen\n\n
8B=Crush\n\n
8C=Alert\n\n
8D=Call\n\n
8E=$8E-Dummy\n\n
8F=$8F-Vanish\n\n
90=Search\n\n
91=Fission\n\n
92=Retreat\n\n
93=$93-Heal\n\n
94=Beam\n\n
95=Globe199\n\n
96=Fire\n\n
97=Blaze\n\n
98=$98-Blitz\n\n
99=Thunder\n\n
9A=D.Breath\n\n
9B=Big Wave\n\n
9C=Blizzard\n\n
9D=Wave\n\n
9E=Tornado\n\n
9F=Laser\n\n
A0=$A0-Explode\n\n
A1=$A1-Quake\n\n
A2=Emission\n\n
A3=Heat Ray\n\n
A4=Glare\n\n
A5=Odin\n\n
A6=MegaNuke\n\n
A7=Needle\n\n
A8=Counter\n\n
A9=(Increment invincibility counter)\n\n
AA=(Decrement invincibility counter)\n\n
AB=Recover\n\n
AC=Remedy\n\n
AD=(Suicide, bring in next monster)\n\n
AE=(End battle)\n\n
AF=$AF-Dummy\n\n
B0=<$B0>\n\n
B1=(Something happens to adult Rydia)\n\n
B2=<$B2>\n\n
B3=(Anna appears)\n\n
B4=(Edward/Tellah appear)\n\n
B5=(Palom/Porom appear)\n\n
B6=(Yang/Cid appear)\n\n
B7=(Golbez/FuSoYa appear)\n\n
B8=(Images disappear)\n\n
B9=<$B9>\n\n
BA=(Revive all enemies)\n\n
BB=(Zeromus shake)\n\n
BC=(Damage all allies 20)\n\n
BD=(Modify speed 248)\n\n
BE=(Restore all HP/MP)\n\n
BF=<$BF>\n\n
C0=Fight\n\n
C1=Item\n\n
C2=White-command\n\n
C3=Black\n\n
C4=Call-command\n\n
C5=Dark\n\n
C6=Jump\n\n
C7=Recall\n\n
C8=Sing\n\n
C9=Hide\n\n
CA=Heal-command\n\n
CB=Pray\n\n
CC=Aim\n\n
CD=Power\n\n
CE=Kick\n\n
CF=Bear\n\n
D0=Twin\n\n
D1=Bluff\n\n
D2=Cry\n\n
D3=Cover\n\n
D4=Peep-command\n\n
D5=Airship\n\n
D6=Dart\n\n
D7=Sneak\n\n
D8=Ninja\n\n
D9=Regen\n\n
E1=Do nothing\n\n
$E8=<Set type>,1
$E9=<Set attack>,1
$EA=<Set defense>,1
$EB=<Set magic defense>,1
$EC=<Modify speed>,1
$ED=<Set elemental defense>,1
$EE=<Set magic power>,1
$EF=<Set elemental weakness>,1
$F0=<Change gfx>,1
$F1=<Battle dialogue>,1
$F2=<Battle dialogue-suppress next attack name>,1
$F3=<Music>,1
$F4=<Set condition>,1
$F5=<Set reflex>,1
F900=Target ID 00\n\n
F901=Target DK Cecil\n\n
F902=Target Kain\n\n
F903=Target young Rydia\n\n
F904=Target Tellah\n\n
F905=Target Edward\n\n
F906=Target Rosa\n\n
F907=Target Yang\n\n
F908=Target Palom\n\n
F909=Target Porom\n\n
F90A=Target Tellah2\n\n
F90B=Target Cecil\n\n
F90C=Target Tellah3\n\n
F90D=Target Yang2\n\n
F90E=Target Cid\n\n
F90F=Target Kain2\n\n
F910=Target Rosa2\n\n
F911=Target Rydia\n\n
F912=Target Edge\n\n
F913=Target FuSoYa\n\n
F914=Target Kain3\n\n
F915=Target Golbez\n\n
F916=Target self\n\n
F917=Target all enemies\n\n
F918=Target all other enemies\n\n
F919=Target all enemies-1st type\n\n
F91A=Target all enemies-2nd type\n\n
F91B=Target all enemies-3rd type\n\n
F91C=Target party front row\n\n
F91D=Target party back row\n\n
F91E=Target one paralyzed enemy\n\n
F91F=Target one sleeping enemy\n\n
F920=Target one charmed enemy\n\n
F921=Target one critically injured enemy\n\n
F922=Target one random enemy or character\n\n
F923=Target one random enemy or character-other than self\n\n
F924=Target random enemy\n\n
F925=Target random enemy-other than self\n\n
F926=Target random front row party member\n\n
F927=Target random back row party member\n\n
F928=Target whole party\n\n
F929=Target all dead enemies\n\n
FB=Attack chain divider\n\n
FC=End attack chain\n\n
FD=Start attack chain\n\n
FE=Wait for next turn\n\n
FF=<END>\n\n\n\n

It's definitely pretty hackish, but it works, I've actually done a little editing this way. Again, it's just the sequences though, I haven't played around with conditionals. Like Grimoire suggests, Zyrthofar's editor can parse them (to some extent) so you might want to compare your output to that. I seem to remember his editor's output being a little off in the case of certain enemy attacks, which my table gets 100% correct AFAIK.

 :edit:

Example output:

Code: (Mist  Dragon sequences output) [Select]
Fight

Wait for next turn

Fight

Wait for next turn

Fight

Wait for next turn

Start attack chain

<Battle dialogue><$00>Do nothing

Attack chain divider

<Change gfx><$01>(Increment invincibility counter)

Attack chain divider

<Set condition><$81>Do nothing

End attack chain

Wait for next turn

Do nothing

Wait for next turn

Do nothing

Wait for next turn

Do nothing

Wait for next turn

Start attack chain

<Battle dialogue><$01>Do nothing

Attack chain divider

<Change gfx><$00>(Decrement invincibility counter)

Attack chain divider

<Set condition><$80>Do nothing

End attack chain

<END>



ColdMist

<Battle dialogue><$02><Battle dialogue><$03><Battle dialogue><$04><END>
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on April 11, 2013, 02:31:58 AM
It's a very long and complicated process to break down a single attack sequence. Phoenix's documents (found readily at http://rb.thundaga.com/) explain it best, but even still you have to switch constantly between three documents:
- attack sequence group data
  http://rb.thundaga.com/monsters/eag.txt
- enemy condition indices
  http://rb.thundaga.com/monsters/eci.txt
- enemy attack sequences
  http://rb.thundaga.com/monsters/eas.txt
This last one has two parts, which are sort of presented backwards in terms of usefulness.

Okay, let's say your monster uses attack sequence group AB.
That's 44 BC 08 40 09 2B 0A 42 FF
This is a string of two byte commands, terminated by an FF. Each two byte command is (first byte) a condition and (second) an attack sequence performed if that condition is met.
So first, we have 44 BC, if condition 44, then attack sequence BC
Condition 44 means "if hp is less than 100 and hp damage"
Sequence BC is F2 7E F3 22 AD FF
This is a string of commands that may or may not have parameters, depending on the command, terminated by an FF.
This particular string translates to:
F2 7E - display battle dialogue 7E while performing next attack
F3 22 - change music to 22
AD - cast enemy spell AD (user dies, next enemy brought in)
So... if the enemy sustains damage and remaining hp is less than 100, display dialogue 7E, play music 22, and die, giving way to the next enemy.

Next in the sequence group is 08 40
If condition 08 (hit by a character fire spell)
Then sequence 40 (96 FF)
Which means cast enemy spell 96 (fire)
So... if the enemy is hit by a character's fire spell, counter with (enemy spell) fire

Next is 09 2B
If condition 09 (hit by a character ice spell)
Then sequence 2B (9D FF)
Which means cast enemy spell 9D (wave)
So... if the enemy is hit by a character's ice spell, counter with (enemy spell) wave

Finally, 0A 42
If condition 0A (hit by a character lightning spell)
Then sequence 42 (99 FF)
Which means cast enemy spell 99 (thunder)
So... if the enemy is hit by a character's lightning spell, counter with (enemy spell) thunder

So this is clearly the reflex group for an enemy that counters magic with its own of the same element, then says something, changes the music to song 22, and gives way to another monster when hp gets critical. Song 22 is Calcobrena, so I'm guessing that this is the big Calbrena's reflex group (I don't remember all of those magic counters, but then again, this battle happens just before getting Rydia back...)
 :edit: Battle Message 7E is "Ran out of power," which is displayed when big Calbrena breaks up into Cal and Brena (and is immediately preceded by "Turned into Calbrena"), so yes, this IS Calbrena's reflex group.

I just picked this one group at random. Attack groups and reflex groups exist in the same table, and a reflex group CAN be assigned as a monster's attack group, but doing so will freeze the game when fighting that monster.

I hope this helps. I was kinda hoping the random sequence I picked would include an attack chain, as that brings an extra element of complication into the mix. I could break more down if you want (not tonight, it's 3:30 am).
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on April 11, 2013, 12:05:32 PM
OK, attached are an IPS and an SRM file. Patch the IPS to a vanilla FF2v1.1 ROM.
You'll load in the Baron area with Edge, Kain, DK Cecil and Rosa in your party. Walk around and you will encounter a (modified) witch.
Do nothing, and she will do nothing.
Physically attack her, and she will say "That tickles!"
Jump attack her, and she will say "Stop hitting me,Kain!"
If she is attacked and her HP falls below 1000 (she starts at 1300), she will cast recover (bringing her HP back to full).

Here's how:
Changed Sequence Group 02 (7623C) to read: 00 00 FF
(by default, do nothing)

Changed Sequence Group 00 (76230) to read: 48 02 06 2F 40 FD FF
If Condition 48 (HP falls below 1000 and physically attacked)
Then Sequence 02 (modified, as explained below)
If Condition 06 (Physically attacked by a character)
Then Sequence 2F (modified, as explained below)
If Condition 40 (Condition flag is 01 and hit by Jump)
Then Sequence FD (modified, as explained below)

Changed Sequence 02 (76B04) to read: F9 16 AB FF
F9 (set target to...)
16 (self)
AB (cast spell AB, Recover)

Changed Sequence 2F (76BB9) to read: FD F1 00 FB F4 81 FC FF
FD (start attack chain)
F1 00 (display battle dialogue 00)
FB (separates battle chain commands)
F4 81 (sets condition flag to 01, assuring condition 40 is met if Jump attacked)
FC (end battle chain)

Changed Sequence FD (772B5) to read: F1 01 FF
F1 01 (display battle dialogue 01)

Of course, I changed the battle dialogue to say what I needed, too.

Then, I set the Witch's Attack Sequence Group to 02, and set her Reflex Group to 00
And there you have it!

 :edit: Couple of notes on this process:
- I chose to edit the particular Sequence Groups and Sequences that I did because they are, by default, the exact same length as what I needed - so for the purpose of this exercise, it was just quicker that way. The one good thing about how the "AI" system is set up, though, is that you can make these strings as long as you need them to be, and don't have to change pointers in order to make them work. the game just counts FFs until it gets to the string it needs (which is in all other respects highly inefficient).
- On a related note, the game reads Sequence Group strings in order from left to right. Once it finds a condition that is met, it uses the paired attack sequence. I spent a good half hour toiling away with my reflex group because I couldn't understand why the monster wasn't casting Recover. I had it set as the last of the three instructions, so the "physical attack" condition was met, and the game carried out THAT reflex action and ignored the rest. So you can always pick out the Attack (non-Reflex) Sequence Groups because they always end with 00 xx FF, thereby giving the monster something to do if no other condition happens to exist.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on April 11, 2013, 08:42:21 PM
This is really neat and indepth Chillyfeez! Hopefully it can be put to great use.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on April 12, 2013, 07:26:29 AM
Thank you SO much, chillyfeez. That is exactly the kind of detailed explanation I was looking for. I think I get it, but the real determiner will be when I go to implement it. I have a lot of work to undo and then do correctly so it'll probably be a while but at least now I have a much clearer concept of what's going on. Thanks!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on April 12, 2013, 10:22:45 AM
Sure thing. Happy I could help.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on April 19, 2013, 10:12:54 PM
Hey PinkPuff -
I just put this together for my own purposes. Seeing as how you are working on the monster editor, thought you might have some use for it.
it's a graphical representation of each of the "special" monster sprite arrangements.
The dashes are empty space, the 1s are sprite space, and the 0s are sprites that are not directly related to the graphical pointer (usually because they are subject to change during the battle)
I also noted which monster they are used for when that info is known, and took my best guess when it is not. for a select few, I have absolutely no idea.
Anyway, here you are:
Code: [Select]
80 (D. Mist)

------111-
-----1111-
--1111111-
--11111-1-
--11111---
--1111111-
-11111111-
1111111111

81 (D. Mist as Mist)

-----11-1111111--
---11111111111---
11111-11111---11-
-----111111111111
--11111111-------
-------11111111--
------1111-------

82 (Titan)

-000-
00000
00000
00000
0000-
0000-
0000-
00000

83 (Titan Quaking)

--00--
00000-
000000
00000-
0000--
0000--
0000--
00000-

84 (Octomamm 1)

--1111-1111--1----
--1111-1111--11---
--1-111--11--11---
-----111-111111---
-----1111--1111111
111--1111----11111
11----111----11---
111---111--1111---
----11-----11-----
--1111-111-11-----
--111--111-11-----
--11---111-11-----

85 (OCtomamm 2)

-----111-----
11-1-11------
1111-11111---
1111-1111111-
-111-1111----
-1111--111111
-1111---11111
--111---11---
11111---11---
11---11111---
11-1111111---
11-111--11---
11-1----11---

86 (Octomamm 3)

1111111------
1111111------
-1111111111--
-111--11111--
-1111-11111--
-1111----1111
--111----1111
--111----1111
--111-1--111-
--1111111111-
--11---11111-
--1-------1--

87 (Octomamm 4)

----111-1---
11--11111---
111-11111111
111111111111
111111--1111
-11111111111
-111-1111-11
-111111-----
-111111-----
---11-------
---11-------

88 (Octomamm 5)

-------1-----
-------11----
11-----11----
111-11-11----
111111-111111
111111--11111
-111--1111---
-111111111---
----1111-----
--111-11-----
--111-11-----
--111--------

89 (Octomamm 6)

11-----------
111---111-1--
1111--11111--
1111--11-----
-111111-11111
---1111-11---
-----11-11---
-----11------

8A (Octomamm 7)

11---1111--
111--1111--
1111---11--
1111---1111
-111-----11
-111---1111
-------1111
-------1-11

8B (Octomamm 8)

11---------
111-------1
1111--111-1
1111--11111
-111--11---
-111--11---

8C (Antlion)

11111111
11111111
11111111
11111111
11111111
---11111

8D (MomBomb after transformation?)

-111111111
1111111111
1111111111
1111111111
1111111111
111111111-
-11111111-
1111111---
11111-----

8E (Milon)

-1111
11111
11110
00111
00111

8F (Milon Z. & Elements as Milon Z.)

-111111-
-1111111
1100000-
1000000-
00000000
00000000
00000000
0000000-

90 (Rubicant)

-1111--
-11111-
-11111-
1111111
111111-
111111-
111111-
111111-
0000000
0000000
0000000
0000000
0000000
000000-

91 (Rubicant on Guard)

--11111
-111111
-11111-
-111111
-111111
-111111
111111-
1111111
0000000
0000000
000000-
0000000
000000-
000000-

92 (Kainazzo)

111111111-
1111111111
1111111111
1111111111
1111111111
-111111111

93 (Kainazzo gathering water)

111111111--
1111111111-
11111111111
11111111111
11111000000
00000000000
---0000000-

94 (Kainazzo in Shell)

-111111-
11111111
11111111
-1111111
-1111111

95 (Valvalis)

-11111--
11111111
00000000
00000000
-000000-
-0000000
00000000
00000000
0000000-

96 (Valvalis on guard)

--1111--
11111110
00000000
00000000
00000000
00000000
00000000
-000000-
----111-
--1100--

97 (Dark Elf before change)

111111
111111
111111
111111
111111
111111

98 (Sandy)

1111
1111
1111
1111
1111
1111
1111
-111
-111
-111
-111

99 (Cindy)

-1111-
-1111-
111111
111111
111111
11111-

9A (Mindy)

1111
1111
1111
-111

9B (Calbrena)

000000
-0000-
-0000-
-0000-
000000
000000
000000
000000
000000
00000-
-0000-
-0000-

9C (EvilWall)

1111111111111111
1111111111111111
1111111111111111
1111111111111111
1111111111111111
1111111111111111
111111111111111-
11111111111111--
1111111111111---
1111111111111---
111111111111----
11111111111-----
1111111111------
1111111111------
111111111-------
11111111--------
1111111---------
1111111---------

9D (K. Eblan)

111--11
-111111
-111111
1111111
1111111
1111111
1111111
1111111
111111-
111111-

9E (Q. Eblan)

---111-
1111111
1111111
1111111
1111111
-111111
---1111
----111

9F (K. Eblan after change)

111--11
-111111
-111111
1111111
1111111
1111111
1111111
1111111
111111-
111111-

A0 (Q. Eblan after change)

---111-
1111111
1111111
1111111
1111111
-111111
---1111
----111

A1 (Baigan)

111111
111111
11111-
--11--
-1111-
11111-
11-11-
11111-

A2 (Right Arm)

-11
111
11-

A3 (Left Arm)

111
111

A4 (MomBomb, before change)

0000
0000
0000
0000

A5 (Dr. Lugae)

111
111
11-
11-

A6 (Balnab)

-111-
11111
11111
11111
11111
11111
11111
11111
11111

A7 (Balnab-Z)

-111-
-1111
11111
11111
11111
11111
1111-
1111-
11111

A8 (???)

1111
1111
1111
1111
1111
1111

A9 (Golbez)

--111----
111111---
111111---
1111111--
111111---
-111111--
-111111--
-1111111-
-11111111
-11111111
-11111111
-11111111
-1111111-

AA (Odin)

--1111--
--1111--
--111111
--111111
--111111
--111111
11111111
11111111
11111111
11111111

AB (Odin, Sword Raised)

111111--
--1111--
--111111
---11111
--111111
--111111
11111111
11111111
11111111
11111111

AC (Odin, Striking?)

---1111-
---11111
---11111
---11111
--111111
--111111
11111111
11111111
11111111
11111111

AD (???)

---111
--1111
111111
111111
111111
111111
111111
111111
111111
111111

AE (Leviatan)

11----
11111-
111111
111111
111111
111111
111111
111111
111111
1111--

AF (Bahamut)

-11111
111111
111111
111111
111111
111111
111111
111111

B0 (Bahamut, casting MegaNuke)

---11111--
-111111111
1111111111
1111111111
1111111111
1111111--1
111111111-
1111111111

B1 (???)

111

B2 (???)

111

B3 (Elements, as Kainazzo?)

000000000--
0000000000-
00000000000
00000000000
00000000000
00000000000
---0000000-

B4 (Elements, as Valvalis?)

--0000--
00000000
00000000
00000000
00000000
00000000
00000000
00000000
-000000-
----000-
--0000--

B5 (Asura?)

-1-11---
-111111-
1111111-
11111111
11111111
-1111111
-1111111
-1111111
-111111-
-11111--
--111---
---1----

B6 (Asura)

-1-11---
-111111-
1111111-
11111111
11111111
-1111111
-1111111
-1111111
-111111-
-11111--
--111---
---1----

B7 (Asura?)

-1-11---
-111111-
1111111-
11111111
11111111
-1111111
-1111111
-1111111
-111111-
-11111--
--111---
---1----

B8 (CPU)

111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111

B9 (Zeromus, Final Form)

--0111-111111--1111
-001111111111111111
--01111111111111111
--01111111111111---
--01111111111111---
--011111111111111--
011111111111111111-
-111111111111111-1-
-110000000000000---
-1100000000000-----
--100000000000-----
--000000000--------
--00000000---------
--10000000000------
-000000000000------
---0000000011------

BA (Defender)

000
000
000

BB (Wyvern)

---11111--
-111111111
1111111111
1111111111
1111111111
1111111--1
111111111-
1111111111

BC (Attacker)

000
000
000

BD (Ogopogo)

---111
--1111
111111
111111
111111
111111
111111
111111
111111
111111

BE (Zemus)

----111--1-
11111111111
1111111111-
-11111111--
--1111111--
--111111---
--111111---
--111111---
--111111---
--11111----
--11111----
---111-----
---111-----
---111-----
---111-----
---1-------

BF (Zeromus, Initial Form)

---11111----
--1111111---
-1111111111-
111111111111
111111111---
-11111111---
11111111----
111111------
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on April 25, 2013, 11:07:21 AM
Hi again, Pinkpuff -
So I know you've already got a full plate with this battle sequence stuff, but I just discovered part of the system that I hadn't previously noticed.
Phoenix's condition indices table (http://rb.thundaga.com/monsters/eci.txt) also explains how to modify condition indices.

The table at 76800-768FF is the breakdown of each condition, variable lengths, each terminated by FF.
The non-FF bytes in that table reference the index of four-byte conditions at 76900-76AFF.

SO...
For example, condition 18 (picked at random) reads:
13 04 4B FF

That's:
13 (02 00 00 03), If condition flag is 03
04 (0A 00 00 00), and HP damage
4B (01 17 00 0B), and Self's HP is less than [index 0B in table at 76200]
FF

Look up condition 18 in Phoenix's list, and that is exactly what it days (apparently, index 0B in table at 76200 is 16,000), but you could theoretically change this to whichever three conditions you want, such as:
15 (02 00 00 05), If condition flag is 05
02 (0B 00 00 00), and only enemy alive
09 (07 19 C2 01), and hit by a character ice-elemental spell (literally, "if any enemy attacks with magic command with element 01, ice")
FF

One could even, if so inclined, change the individual conditions, as well as create new ones (a third of the table is FFs). There are thousands of possibilities here.

Sorry, I know that doesn't make the job of creating an AI editor any easier...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on April 25, 2013, 05:22:17 PM
Yup I knew about that actually, and as far as I can tell the editor is actually reading things correctly now (I think). I'm currently working on getting it to translate the scripts into english. The conditions are already translated and seem to be mostly working.

Sorry I haven't been updating very much but this is a slow process and there hasn't really been much to report...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on April 25, 2013, 09:17:10 PM
Yup I knew about that actually, and as far as I can tell the editor is actually reading things correctly now
Ok, glad that didn't screw you up.
Quote
Sorry I haven't been updating very much but this is a slow process and there hasn't really been much to report...
No worries. I can't even begin to imagine how much tedious work must be involved in actually writing ff4kster.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on April 28, 2013, 04:15:59 PM
Indeed, it's a testament to your constitution that you're willing to put in this extremely laborious-to-implement part of the system. In the end though it will definitely be worth it.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on May 28, 2013, 09:02:53 PM
Hey pinkpuff,
Just checking in. Any progress worth mentioning on the monster editor? Anything else we might be able to help with?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on May 29, 2013, 07:58:25 AM
It's coming along but nothing anyone can really help with right now. I have the script entries translated and I'm about to start working on the editing part. Once I get to the saving I may or may not need help but thanks to those docs and the posts here I think I have a pretty clear idea of how everything is encoded but I certainly won't hesitate to post if something goes wrong.

I'm in the process of getting ready to move so work on this has taken somewhat of a backseat lately but don't worry it's still being worked on! ^_^

Actually now that I think about it I did notice something odd. The Dark Elf seems to have a script that chains together "Dancing", "Remedy", and "Magnet", though I'm certain those should be Fire 2, Ice 2, and Bolt 2... other chains for other monsters seem to be correct so I don't think it's an issue with the fact that they're in a chain. Likewise, other "player spells" for monster AIs seem to be correct as well.

 :edit: Maybe there is something you guys can help with! There seems to be no indication in the monster data itself to tell whether a monster uses "lunar" scripts or "regular" scripts. In the future I will hopefully have a way to get it to automatically detect that from the monster encounter data, but for now it will be stored in a config file. If someone has time to kill and the inclination to do so, I'd love to have a comprehensive list of every monster that uses the "lunar" script set (preferably with monster indexes, doesn't matter what base).
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on May 29, 2013, 01:50:01 PM
Your best bet on the lunar sequences is to have an option to toggle between normal/lunar when displaying/editing a monster's sequence. This is more hacker friendly since any monster can use either set of sequences - which one is determined by the map they appear on, not the monsters themselves.

(The original game doesn't do it, but it's possible to make monsters that switch behavior based on location, for example.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on May 29, 2013, 03:16:06 PM
If I implement something like that it will be in addition to the config file, not a replacement for it.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on May 29, 2013, 05:39:00 PM
Come to think of it, how does the game know if a monster is on the moon? I know map data has an "underworld" bit, but I don't recall a "moon" bit...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on May 30, 2013, 07:10:46 AM
It doesn't know.

Each monster has an AI index (0-255). If that monster appears on the moon, it will use the moon AI script of that index. If it appears anywhere else, it will use the "regular" AI script of that index.


 :edit: I totally misread your question the first time. I don't know actually, but my guess would be that it looks at the map index.

The purpose of the config file is to specify which monsters you want to default to displaying their AI as though they are on the moon, and which you want to display as though they are not. When designing a hack I don't want to have to try to remember myself which monsters in the list are on the moon and which aren't and risk mixing them up and accidentally messing up the AIs. In future, once I can get the editor to read the monster encounter and formation tables, I will simply have it dig into the moon ones and make its own list of monsters that appear on the moon, and those ones will show up as lunar scripts by default, and dynamically update it as you change the encounters and formations. However, until that time I would expect that moving monsters between celestial bodies would be a rare enough occurance to justify having a config file that the user can update as they move them.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on May 31, 2013, 03:43:35 PM
Yeah that plan seems for the best PinkPuff.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 20, 2013, 01:30:57 PM
Hi folks, I know it's taking a long time but I am still working on this. Everything is displaying correctly as far as I can tell, and I'm working on the editing part. I messed up something logistically with the AI editor component so I need to rethink the structure of it, so it still may be a while before the next release.

Anyway, just thought I'd check in and reassure everyone that I'm still alive ^_^
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on June 20, 2013, 02:16:38 PM
Yay!  You're alive!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on June 20, 2013, 02:55:04 PM
We'll be here to test it whenever :)
Title: Re: Developing a comprehensive editor for FF4
Post by: Lenophis on June 20, 2013, 10:38:07 PM
The demon of real life claims us all at some point. Take your time. :cycle:
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on June 20, 2013, 11:29:21 PM
The demon of real life claims us all at some point. Take your time. :cycle:

Truer words were never spoken.  Life's been up and down the past 12-16 months.  Seems to be going up at the moment.  I hope all's well for everyone else!  :D
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 25, 2013, 12:55:44 PM
Things are going swimmingly for me. Glad to hear you have everything working properly now PinkPuff!
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on June 27, 2013, 09:22:58 PM
Hi folks, I know it's taking a long time but I am still working on this. Everything is displaying correctly as far as I can tell, and I'm working on the editing part. I messed up something logistically with the AI editor component so I need to rethink the structure of it, so it still may be a while before the next release.

Anyway, just thought I'd check in and reassure everyone that I'm still alive ^_^
Thanks for the status update. I'm really stoked for the monster editor and once it's ready for release I'll probably start working on this game again.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 28, 2013, 06:19:53 AM
That's exciting!

Right now the condition set editor (allows you to edit what conditions are in each condition set) is giving me a headache. I understand the structure but it's just one of those things that happens sometimes where you're reading the code and going "this should be doing X" and can't see any possible way it couldn't be doing it, yet it isn't. Once I get past that, the rest of the editors should be very straightforward to code, and then it's just a question of the saving routines and how much trouble those give me, but often the problems with saving don't become very pronounced until after I release it and people start reporting issues.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on June 28, 2013, 10:59:32 AM
I've had (probably) similar problems trying to edit conditions:
I wanted to make a monster that reacts in a particular way to being attacked by Edge's Dart command, but it wasn't working.
Likewise, I wanted a particular reaction to a character using the Item command with a particular element (say, a specific reaction to lit-bolt) but it seems the game treats elemental attack items as spells in that respect, so the condition has to be an elemental spell in order for an elemental item to trigger a reaction.
Other custom conditions (that I can't remember at the moment) didn't work either.
I was kind of hoping that once the monster editor was released, you would have figured out whatever it was I was missing.
Maybe the game isn't really capable of observing all of the conditions the human mind can conceive?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on June 28, 2013, 12:41:18 PM
The problem is definitely with my own code. It's currently only dealing with the in-memory abstractions that it creates when reading the rom, it hasn't even been writing anything monster-related to the rom.

Thanks for bringing that to my attention though, I'll be on the lookout for it when I get to the saving part.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 29, 2013, 08:13:44 AM
Hmm, Chillyfeez may have an unfortunately correct thought. FFIV's AI Routines seem very limited compared to FFV and VI, As I recall the only thing special about the Crystal item to start the Zeromus fight is that it is Dark Elemental, not that it is a specific item or anything of the sort, that does not speak very highly of the AI's coding structure to me.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on June 29, 2013, 09:01:51 AM
Does that mean that, in theory, the Zeromus fight could be started by an attack with a Dk Knight sword? Well, from a plot perspective, that contradicts the whole reason Cecil becomes a paladin. How delightfully stupid!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on June 29, 2013, 04:35:03 PM
Plot perspective it is absolute nonsense, yes. From a programming perspective... it is still rather silly. I mean they could have (I believe anyhow) used the Immune elemental byte as something special and unique to give to the Crystal and have a special exception to have Zeromus react to it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on June 29, 2013, 05:02:10 PM
The Zeromus transformation is triggered by a dark elemental spell from Paladin Cecil specifically.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on July 01, 2013, 04:27:40 PM
That makes more sense. That's actually kind of neat in some ways. So a Dark Elemental Weapon wouldn't do it, only a Dark Elemental Spell? That was kind of my worry with letting Paladin Cecil use Dark Swords, glad to see that it wasn't a worry after all.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on July 02, 2013, 06:14:02 AM
Finally smashed that bug after  :banonsmash:

It was a stupid off-by-one error...  :lame:

Anyway, back to plowing ahead!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on July 03, 2013, 07:02:44 PM
Wonderful to hear you got it fixed! I am looking forward to the next update.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on July 31, 2013, 04:22:03 PM
Hello, Pinkpuff. :happy: I had a question for you: will the editor ever support editing of the final scroll of the Mysidian legend? The full one that scrolls past the shot of space.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on July 31, 2013, 04:43:41 PM
... will the editor ever support editing of the final scroll of the Mysidian legend? The full one that scrolls past the shot of space.

I'm thinking that that is a visual effect and not an actual display of text. I'm not home so I can't do the necessary research to back that up, but a) I don't recall ever seeing the full legend in any known dialogue banks, and b) if I remember correctly, it's presented in a different font than everything else that's written in the game (of which I'm less sure because it's been that long since I've watched the ending). If nobody who actually KNOWS replies before I get home this evening, I'll look more into it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on July 31, 2013, 05:28:21 PM
I think you're thinking of FF5; the Japanese version used a separate font for its end text, and RPGe's translation replaces it with a different font than the rest of the text.

FF2us' legend is stored at 0x9EBC5 headered. I think 0x9DA19 is a pointer to it, but haven't tested. I don't think the game supports DTE there.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on July 31, 2013, 07:16:03 PM
Excellent. I will probably add it then. Though it will not likely be in the next update. The monster editor is enough work to merit its own update.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on July 31, 2013, 07:53:56 PM
Also, the credits are just after that at 0x9F56D. They use the same indentation controls: $02xx: Indent xx spaces (just use $FF for one space, since $0201 is obviously a waste of a byte, even though I think it does work). Also, $D8 in the end credits is the Square A logo from the title screen.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on July 31, 2013, 10:24:47 PM
Cool - I'm pretty sure I didn't know the location of the credits. As for the legend, I think what I was remembering in my head was that it was displayed "star wars style," which is why I was so sure it was a visual effect. 
:blits:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 01, 2013, 05:31:44 AM
Kind of. It looks more like it's scrolling up the inside of a box. So like, it starts scrolling up the "bottom" of the box, "star wars style", then starts scrolling up normally (the "back" of the box), then starts scrolling back out the "top" of the box towards the screen, "reverse star wars style"
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 01, 2013, 11:34:56 AM
I just wasn't giving the game's engine enough credit to be able to handle that kind of action with real text. My mistake.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 10, 2013, 06:41:27 AM
MONSTER EDITOR COMPLETE! Or rather, ready for testing...  :childish:

Download the new version from the Time Cave link (I won't be uploading to RHDN until it's received a little more thorough testing).

I haven't written the documentation in the readme yet for how to navigate the monster editor but here's the basics:

Everything works more or less the way you'd expect except for two things: The "monster flags" and the "AIs".

Monster Flags
This is the list of flags indicating which "extra bits" the monster has, such as whether it has a reaction or a weakness or resistances, etc. Pressing enter will activate/deactivate that flag, as you would expect. However, to edit the details (i.e. which element(s) the monster resists or is weak to, or which AI it uses as its reaction) press TAB while the corresponding flag is active.

Monster AIs
This consists of five components. Pressing TAB switches between components. On "index" components, pressing ENTER will also take you to the next component.

And I think that's it. Questions, comments, bug reports, fire away!!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 10, 2013, 08:53:21 AM
Woo-hoo! I've been looking forward to this for months. Can't wait to play around with it (but I will have to until this evening)!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 10, 2013, 09:49:24 PM
Well, I've really only started playing around, but so far, it seems like it's interpreting the custom AIs I created with a hex editor perfectly. The controls will take a bit of getting used to, but I can't think of anything you would have done differently - think it's just a reflection of the complexity of the AI system.

One thing I've noticed: If, when editing the condition set list, you are at "1" and hit (down), FF4kster crashes (like it's trying to go to "0," but then realizes there is no 0 and self-destructs). Not a big deal if you're careful, but could cause loss of a lot of unsaved data for someone who's not careful.

A small suggestion: When selecting the monster's size, would it be possible to have the editor say, for instance, "4x4" instead of "1?"

A question: Wasn't there a plan to have the ability to edit monster formations as well? Please don't interpret that at all as disappointment - monster formations are a blip on the radar compared to what you've created here.

Also, I don't recall the Features (apparently previously Item Ranges) option in previous versions. Did I miss a version somewhere along the lines, was I simply not paying attention to what was there, or is this new?

Still need to do some more testing to see how things work in actual gameplay once changes are made, but so far it looks great!
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 11, 2013, 01:20:20 AM
Very nice to see this available. One thing I've noticed so far: If you hit tab to edit a reaction sequence, going back with esc will increment its index by 1.

 :edit:

Also I don't seem to be able to toggle the boss bit off on monsters it's already set on. Can turn it on and off other monsters fine.

 :edit:

Immune in weaknesses should be "very weak" or something similar.

 :edit:

Attempting to add elements to monster attacks sets statuses in the second column instead.

 :edit:

I think you need to work on memory usage, it increases every time you move the cursor over an option, and this adds up really quick when viewing monsters. Just scrolling down the entire list without doing any editing increases the memory used from about 8 megs to 391. I had it using over a gig at one point through fairly normal viewing and editing. :eek:

 :edit:

Lunar scripts don't seem to be loading for me either.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 11, 2013, 05:25:50 AM
One thing I've noticed: If, when editing the condition set list, you are at "1" and hit (down), FF4kster crashes (like it's trying to go to "0," but then realizes there is no 0 and self-destructs). Not a big deal if you're careful, but could cause loss of a lot of unsaved data for someone who's not careful.

I can fix that Fixed

A small suggestion: When selecting the monster's size, would it be possible to have the editor say, for instance, "4x4" instead of "1?"

It certainly would, but I would need a list of what size indexes correspond to what dimensions

A question: Wasn't there a plan to have the ability to edit monster formations as well? Please don't interpret that at all as disappointment - monster formations are a blip on the radar compared to what you've created here.

There was and still is. It will be separate from the monster editor though. In fact once the monster editor is a little more debugged the formation editor will be next.

Also, I don't recall the Features (apparently previously Item Ranges) option in previous versions. Did I miss a version somewhere along the lines, was I simply not paying attention to what was there, or is this new?

It was in the previous version.

Still need to do some more testing to see how things work in actual gameplay once changes are made, but so far it looks great!

Thanks, and thank you for pointing those out!

Very nice to see this available. One thing I've noticed so far: If you hit tab to edit a reaction sequence, going back with esc will increment its index by 1.

I can fix that Fixed

Also I don't seem to be able to toggle the boss bit off on monsters it's already set on. Can turn it on and off other monsters fine.

I can fix that Fixed

Immune in weaknesses should be "very weak" or something similar.

The thing there is that it's reading the element names from a config file, and also it's using a stock menu component that is used for all element/status menus without regard to what launched it (whether it's relating to weaknesses or resistances or whatever). If you don't like the name you're certainly free to go into the config file and change the word "immune" to something more general-sounding.

Attempting to add elements to monster attacks sets statuses in the second column instead.

I can fix that Fixed

I think you need to work on memory usage, it increases every time you move the cursor over an option, and this adds up really quick when viewing monsters. Just scrolling down the entire list without doing any editing increases the memory used from about 8 megs to 391. I had it using over a gig at one point through fairly normal viewing and editing. :eek:

TBH I never really looked at the memory usage. Is this something specific to the monster editor or does this happen just using the tool regardless? In any case it sounds like there's some kind of memory leak somewhere. I'll see what I can do.

Lunar scripts don't seem to be loading for me either.

Ah yes I forgot to mention, that is a known issue. Until I'm able to determine which monsters appear on the moon and which ones do not, they're all just going to have the regular scripts. Soon I will go through the monster list and create a config file that says which monsters are on the moon, but this will simply be a stop-gap solution until there's an actual encounter list editor, whereupon FF4kster will simply read from the encounter information which monsters appear in lunar areas, and show lunar scripts for those and regular ones for the rest.

Incidentally, behind the scenes it actually is loading the lunar script data, and even saving it, just there's no way to edit it currently.

Again, thanks for pointing those out!
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on August 11, 2013, 08:55:50 AM
I think you need to work on memory usage, it increases every time you move the cursor over an option, and this adds up really quick when viewing monsters. Just scrolling down the entire list without doing any editing increases the memory used from about 8 megs to 391. I had it using over a gig at one point through fairly normal viewing and editing. :eek:
That explains all the crashing errors I had when editing the dialogue...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 11, 2013, 10:07:56 AM
I've been noticing the high memory usage, too, for a while now. I've never monitored it, but if I am working for a while, Windows tells me I need to close some programs or risk losing unsaved data.
Since nobody ever said anything before, I figured it was only a problem for me because the computer I hack on is relatively primitive.
It certainly would, but I would need a list of what size indexes correspond to what dimensions
A few months ago, I posted (to this thread) an interpretation of all of the "special" (non-rectangular, etc) monster sizes. see here:
http://slickproductions.org/forum/index.php?topic=1713.330
As for the standard sizes:
0: 2x2
1: 4x4
2: 4x6
3: 6x4
4: 6x6
5: 6x8
6: 8x6
7: 8x8
8: 6x12
9: 12x6
10: ? (something big)  :edit: it's 20x18. no monster uses this, btw. weird.
11: 10x6
12: 5x3
13: 2x3
14: 3x3
15: 4x3
16: 4x2

Also, in the case of a "character" enemy (Dragoon, Girl, Bard, etc.) the "size" bit corresponds to which character it is.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 11, 2013, 03:59:37 PM
Memory usage increasing is the same across the board, the monster editor is just really good at exposing it. I've never taken notice to it in previous versions, but I'm not one of those people who monitors it constantly, the only reason I took notice to it last night was Chrome became unresponsive and I figured one of my extensions was acting up again. I was surprised to see it was 4kster that was the culprit.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 11, 2013, 09:05:44 PM
This is flabbergasting! No wonder this update took such a long time, haha. It is impressive how exactly they used their tools to make quite an indepth system of AI. Looking at it in these terms makes me better appreciate their work and your own, I can only imagine how much work it was to look at all of these and discern them into a possible pattern to put into a program.

Now maybe I'm just an idiot, but whenever I change an Index of a monster AI and hit Backspace to leave that specific portion the game resets the AI Index to what it was originally. Am I missing something obvious here?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 11, 2013, 10:11:13 PM
... whenever I change an Index of a monster AI and hit Backspace to leave that specific portion the game resets the AI Index to what it was originally. Am I missing something obvious here?
I get that, too, now that you mention it (except I think you mean Escape, not Backspace).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 12, 2013, 12:58:37 AM
Heh, yeah I meant backspace. Good catch.

I am also a little confused on how some of these AI flags work.

For instance the reaction for a SwordRat is "If a character uses 192". I can assume 192 is a physical attack then?
And Valvalis' Jump counter says "If a character uses 222" which I can only assume is Jump.

Are there values for other skills like Dark Wave, Twin, etc? Or is it just Fight and Jump?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 12, 2013, 02:21:46 AM
From what I've learned about the conditions, Grimoire, they can be set to any action, however (as I believe I've mentioned before), I've had mixed success getting them to work. The only other "reactable" action I've had success with is magic (which includes all spells as well as attack tools like lit-bolt, firebomb, crystal, and presumably all of the other ones that are dummied out in the us version; without any testing, I would bet it applies to sing, recall, twin, and any other action that evokes a spell too).  It may be that more research is required here. Example: in the case of valvalis's reaction, she's reacting to the "land," not the jump. Phoenix's document addresses editing these conditions, but seems to graze over reacting to particular character attacks very quickly without much explanation. What pinkpuff has done with ff4kster here is to have allowed for all possible choices for this one particular byte, even though most of the possibilities are undocumented and it seems a lot of them do nothing.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 12, 2013, 06:02:55 AM
Heh, yeah I meant backspace. Good catch.

You meant escape you mean ^_^

I am also a little confused on how some of these AI flags work.

So am I. I guess we're just going to have to experiment.

Anyway I fixed the AI index issue. Next up will be the sizes and then I will see if I can track down the memory leak (I think I know generally where to look for it now though).

 :edit: Size labels done, and also added a "template" feature to the graphics pointers that lets you select from the regular monster graphics by label to assign the pointer and size accordingly.

 :edit: Ok I think I found the (a?) source of the memory leak. Let me know if it is any better now.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 12, 2013, 02:25:18 PM
Haha! Did I really say Backspace, again? Yes, I meant Escape.

Also I have noticed that you added a Lot more Drop Index tables than there were in the normal game. I can only assume that this is actually other data that shouldn't be changed?

Do we know what follows directly after the Drop Index? If the data is inconsequential that means that it might be able to be used, in theory. Though there is a lot of interesting stuff there by default which add quite a bit more variety to drops even if they aren't changed. So while you may want to add a warning about changing the index past a certain value, I do not think that you should limit the number of available Drop Indexes, there's some neat stuff in there that don't necessarily need to be changed to be effective.

This Template system you have set up is Fantastic!

Now what are "units"? I can't quite wrap my head around those. I don't recall there ever being enough monsters to have 26 units, nor do Character's go up to that amount.

I'm having a blast with these AI modifiers.

It seems that the AI in monsters can successfully kick, dealing damage to all characters, only problem is that it moves all of the monster sprites up, rather than one, so it could only really be used when there's one monster remaining.

Monster AI Capabilities - Character Commands -

Fight - Yes
Item - ?Yes? (When an enemy uses the "Item" command, the game seems to assume it is using some sort of Weak effect and it places characters it targets into critical with single-digit HP)

White - No
Black - No
Call - No (Massive Crash)
Dark Wave - Yes (Appears to work. Unsure about HP reduction though.)

Jump - Yes (Enemies can use Jump, but like Kick it will show all of the formation jumping up and coming down. Best to be used on single enemy formations or set the AI to use it when there is a single enemy left.

Recall - No (May perhaps need a team with MP, when an enemy uses Recall the targeted character will do their "special pose" but nothing will happen, but since this was tested with a magicless Kain and Cecil it may do something if the targeted character in question had magic)

Sing - No (When an enemy uses Sing, the target will go into a casting stance, but can no longer act and the game will softlock when that character's turn comes around.)

Hide - No (When an enemy uses Hide, it will cause one character to "run away" (instantly killing him somehow) and the other character to drop dead on the spot causing an instant game over.

Salve - ?Yes? (When an enemy uses Salve it will use up Exactly one of your assigned items for Salve, it doesn't recover as far as I could tell and I don't believe it was healing Cecil or Kain.)

Pray - No (When an enemy uses Pray it will cause the targeted character to raise his hand as if using an item, no HP is recovered on either side it would appear.)

Addendum - If you have the enemy target itself with Prayer it will Appear to work, It will recover HP based on its internal magic Spell Power and will only work half of the time, unfortunately though it's all just graphical representation. They are not actually healed any amount.

Aim - No (As above, with what it shows. Except it will show the character flinching as if hit, no damage is taken)

Focus - No (The enemy will just keep on using Focus, never attacking, oddly enough though when it was used Kain appeared to Cover Cecil as if he was a Paladin.)

Kick - Yes (The enemy formation will move as if kicking and reset back to its normal position. It is best to use this with only a single enemy.)

Gird - Yes (Tell the enemy to target itself with Gird and it works perfectly. It casts Protect without any complications and the damage dealt by characters is significantly lowered over time. This is also the first command that actually appeared with a message for enemies.)

Twin - No (The enemy will continue to rapid cast Twin while the character in the First Position will be stuck in a casting pose, the AI will not move onto its next instructions and will only continue to cast Twin.)

Boast - No (No discernable difference when the enemy used the command other than a character going into a special pose.

Cry - No (As above.)

Cover - No (Doesn't appear to do anything)

Peep - No (Doesn't appear to do anything, surprisingly. Then again there is something special about Cid's Peep which differentiates it from the spell. What that something is, we have never been able to determine.)

Crash - Yes (Crashes the game)

Dart - No
Sneak - No
Ninja - No (Game Crash)
Regen - No (As with Twin the enemies enter into a rapid cast and that's that.)

So enemies can use Dark Wave, Jump, Kick, and Gird, can use Salve to steal the chosen item, and the rest are basically not an applicable option. It was an interesting look at it though.

 :edit: How is Sprite Changing supposed to work? It's an interesting idea but the game uses it quite sparingly to actually say what it is supposed to do. Also it seems as if you change the default Charm into "attack enemy" instead of a specialized one for each type of monster there would be a lot of extra AI sequences to add.





 
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 12, 2013, 04:54:58 PM
Also I have noticed that you added a Lot more Drop Index tables than there were in the normal game. I can only assume that this is actually other data that shouldn't be changed?

No clue, we'll have to experiment!  :laugh:

Do we know what follows directly after the Drop Index? If the data is inconsequential that means that it might be able to be used, in theory. Though there is a lot of interesting stuff there by default which add quite a bit more variety to drops even if they aren't changed. So while you may want to add a warning about changing the index past a certain value, I do not think that you should limit the number of available Drop Indexes, there's some neat stuff in there that don't necessarily need to be changed to be effective.

If it turns out that there is stuff afterwards that it could bleed into then I will eventually put a check in there and limit it. I plan to do that at some point with all the other bleedable data as well but I've been considering it a fairly low priority.

This Template system you have set up is Fantastic!

Thanks! I figured most of the time people would want a graphic setup from the original, but I still wanted to keep the ability to manutally type in something, especially while we're still discovering stuff.

Now what are "units"? I can't quite wrap my head around those. I don't recall there ever being enough monsters to have 26 units, nor do Character's go up to that amount.

Once again, no clue. Experiment time!

:edit: How is Sprite Changing supposed to work? It's an interesting idea but the game uses it quite sparingly to actually say what it is supposed to do. Also it seems as if you change the default Charm into "attack enemy" instead of a specialized one for each type of monster there would be a lot of extra AI sequences to add.

No clue how sprite changing works. I've done very little testing with this so far, I was just so glad to have it done that I just debugged it to a point where it didn't seem to have any fatal errors and posted it right away.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 12, 2013, 05:25:36 PM
It looks like everything works properly and is in order. It seems your dissection of the AI section is a complete success! Now what else did you have in mind? Ah, is it the Formations? I see that as the only thing currently lacking. And if we change monster sprites the original formations may make a little askewed (IE changing Imps to Soldiers doesn't show their full sprite because it overlaps with another Soldier that replaced the Imps)
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 12, 2013, 05:27:06 PM
Memory is still increasing as I scroll through some of the lists: Spells, Weapons, Armor, Medicine, Level Ups, Messages (after I scrolled very far down the bank 1 list, seemed fine at first), Events, Map Info, and Monsters. Notably, the lists that don't have to scroll or don't immediately update a lot of data don't seem to have this problem. Additionally, doing any editing seems fine. I did see memory freed up at one point, which never happened with the previous version, but I can't reproduce that.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 13, 2013, 01:28:32 PM
Ok, attempt #2 at fixing the memory leak! Please redownload and let me know how it goes.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 13, 2013, 02:22:10 PM
Major improvement this time. Memory still increases the first time a monster or dialogue is viewed, but after viewing each monster there are only occasional jumps by about 60KB while scrolling through the list.

However, the Jobs editor now crashes the program. DKnight is the only thing displayed before crashing.

 :edit:

Trying to edit bank 1, 2, or 3 dialogue causes the editor to crash.

I don't know if this is a new problem or not, but Hold can't be added to either starting or learned spells.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 13, 2013, 04:27:40 PM
Ok the jobs editor crashing problem should be fixed there now.

Message editor crash and inability to add Hold confirmed and will be tackled presently...
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 13, 2013, 04:39:14 PM
The Hold problem must be new, in the Monster Editor version adding Hold to learn/start magic lists works fine.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 13, 2013, 05:13:14 PM
It looks like spells are off by one in the command editor: Pray is listed as Cure2, Endure/Bear/Gird/Whatever as Shell.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 13, 2013, 05:46:19 PM
Message editor crash, hold bug, and spells-off-by-one error fixed.  :banonsmash:
Title: Re: Developing a comprehensive editor for FF4
Post by: Jessrond on August 13, 2013, 10:00:03 PM
I edited the game and started to play it... but as soon as I got to the part where Cecil is supposed to have a monologue up in  his room in bed and Rosa comes to visit him, nothing happens instead.

The game gets stuck with the clock ticking and Cecil's monologue never showing. Not sure what I did wrong but it is probably something easily avoided on my end.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 14, 2013, 12:06:08 AM
You will have to be a little clearer on what you edited. It sounds like an event issue, but you can never be too sure.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 14, 2013, 05:23:14 AM
I just took a fresh ROM, changed nothing and saved in FF4kster. The event played out as normal for me.

In order to get any meaningful help you'll have to list out everything you changed, though I'd prefer if you started a new thread for it.

 :edit: Incidentally, I just added a formation editor, so have at 'er.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 14, 2013, 01:42:54 PM
The Reaction AI editor seems to have misleading choices. Choosing any character battle command ("Fight," "Item," etc.) does not actually trigger the monster's reaction. I'm currently experimenting to figure out which entries correspond with which commands, but it will take a long time. There are 255 possibilities, and each one must be tested with each command. I know that "193" (or thereabout) triggers a reaction to "Fight," but since I haven't been able to get reactions to all of the commands, I'm going to try everything. I'm only testing the commands that can target a monster, though, as I don't think a reaction to other commands ("Hide," "Armor," etc.) is possible.

Just thought I'd let you all know that I'm doing this, so as to spare anybody else the time.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 14, 2013, 01:57:44 PM
Wow, that was fast PinkPuff, I'll test that when I get home later. Also glad to hear that you're tackling that Chillyfeez, looking forward to seeing the results!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 14, 2013, 06:26:22 PM
Looks like there's a group of unused Imp battles 131-136. 184 - Unused Imp. 204 - Unused Imp. Same with 208. Same with 216-220. 295-296, the same.

Unmistakably Underworld/Lunar formations begin at 257 or in Hex 0100.

 TrapDoor's are interesting... in their battle formations their transformation is listed as plainly as if they are there. Which means that it may be something special in the formation (maybe the Mystery Byte being set to 20?) or something else perhaps?

Seems that Moon Formations begin at 369.

377-383 are filled with Dummy's.

405-406 are both the Tricker, nothing different between the two formations.

417 is just an Imp.

421-423 just Imps.

430 - Odin fought in the Underworld? Interesting...

425 and 439 are both Golbez/Shadow. One or the other must be an unused copy.

441-443 - Imp/Dummy's.

457-472 - All filled with Imp.

502-506 - All Imp.

512 - Imp.

Well... that's a lot of unused/dummied formation space.


In total...

131-136 - 5
184 - 6
204 - 7
208 - 8
216-220 - 13
295-296 - 15
377-383 - 22
417 - 23
421-423 - 26
441-443 - 29
457-472 - 45
502-506 - 50
512 - 51

Good work Square! 51 of your 512 - 10% of your chosen space is unused (or was taken out since some were no doubt filled with the programmers)

Well I guess that's more space for us to fool around with, haha. Looking forward to seeing the Formation Chooser for Maps!

 :edit: It seems that Mystery Flag 2 must deal something with displaying multiple monsters. When Mystery Flag 2 is set as Off the first monster type will show up fine, but any additional ones will be a glitchy mess.

 :edit: 2 Mystery Flag 3 is used Exclusively by the Zeromus Formation. When activated the normal monster graphics will glitch when you enter battle, even though Mystery Flag 2 is still activated.

 :edit: 3 Mystery Amount is interesting. When it is not set and you have a Monster Spawning enemy, the spawned enemy will be present automatically. When this value is set to 1 the spawned enemy will not be present until summoned and notably nearly every encounter that has a summoned enemy has that value set to 1.

 :edit: 4 Mystery Amount, when set to 2 will hide a group of 2, but from what I could tell, setting it to 3 did not hide a group of 3.

 :edit: 5 What do we know about the Auto-Battle functionality? Outside of its proper environments it seems to just cause the player to use the first spell on the list, which is blank. It doesn't seem to do anything with Arrangement or the Mystery Byte, maybe it's formation number itself? Well I guess we'll find that one out soon enough.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 14, 2013, 09:15:57 PM
Are you really faulting them for reserving space and then not using all of it?

I'm almost sure someone documented autobattles before, although a quick search isn't turning up anything. I hope it wasn't so long ago that it was on JCE's old forum. It's not in the archive of mine, that I can see anyway.

 :edit:

http://slickproductions.org/forum/index.php?topic=961.0 (http://slickproductions.org/forum/index.php?topic=961.0)

Forum search evidently only goes back so far, had to find this with Google. :wtf:
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 14, 2013, 09:41:51 PM
Autobattle notes linked in my previous post. :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 14, 2013, 09:57:47 PM
Hah! Thanks Dragonsbrethren! That seems fairly simple and straightforward, maybe that will be added to the editor in time...

 I'm not really "faulting" them per se, just poking a little bit of fun, those formations could have been used for other things, add a little more variety here and there.

Oh yes, I recall that Deathlike2 in his mod allowed battles against party members that weren't ordinarily battle...able.  Characters like Palom and Porom for instance. But the editor doesn't seem to contain any data for them. Is it just a matter of graphic pointers?
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 14, 2013, 10:13:12 PM
chillyfreez just mentioned that a few pages ago: "Also, in the case of a "character" enemy (Dragoon, Girl, Bard, etc.) the "size" bit corresponds to which character it is."
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 14, 2013, 10:48:24 PM
There's also a bit in the formation that has to be "on" in order to make the character-enemy behave properly. Otherwise they'll face backwards and stand still.
It is possible to make more character battles than exist naturally, but bear in mind that their attacks are limited to what monsters can do; and also, having more than one in a battle will result in some faulty battle graphics.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 14, 2013, 11:07:17 PM
I must not have realized what the size byte referred to at the time. Thanks for that information.

Though when I tested multiple characters in a battle the game didn't display any faulty graphics but the several conflicting AI scripts did prevent Cecil from doing anything, so there was that.

 :edit: Unless you meant the attack animation being where the game assumes a single character would be. Yeah that is a problem.

 :edit: 2 I think I've found an error. The enemy arrangements should go up to 255, granted that is what the Character Battles show, but the editor only lets you go up to 145 and I believe character's only act properly in using Enemy Arrangement 255.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 14, 2013, 11:44:56 PM
Yep, that's what I meant.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 12:26:45 AM
So these "Must be hit with Weapon Elemental" AI patterns Actually work! I'm very surprised at this, all things considered.

This does bring me to another slight error though. The description of the pattern says that is using 192, but when you go to change it, it starts at 193. It appears to be one off is all.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 15, 2013, 12:54:50 AM
This does bring me to another slight error though. The description of the pattern says that is using 192, but when you go to change it, it starts at 193. It appears to be one off is all.
I was going to bring that up when I posted my reaction research results. It's coming along nicely. It's all a bit better than I originally thought. Fight, (Item/Black/White/Ninja), Call, Dark Wave, Remember, Sing all are react-able independently of one another (except item/black/white/ninja of each other). I'm hoping, and now almost expecting, that at least Aim, Kick and Dart will be on the list, but... not tonight.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 01:30:38 AM
Dark Wave worked for you? I looked where I thought it would react and I couldn't get anything to activate. I thought that maybe it's because Dark Wave is a Dark Elemental attack, that it needed to be labelled as Trigger against a Dark Element?

Your findings are very heartening, though. Looks like this system is not so cut and dry after all.

 :edit: I've noticed an error in the Enemy Stats. Though you can change the individual attack and defense formulas, these changes do not actually appear to do anything, despite their displayed amounts.

Though changing the index works just fine, as one may expect.

 :edit: 2 Seems another "off-by-one" issue with the Sing commands. When you go to put it in the value chosen is off by one.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 15, 2013, 05:28:33 AM
I thought that maybe it's because Dark Wave is a Dark Elemental attack[...]
It's actually non-elemental damage with a special check for undead enemies. (And on a less important note, it's Dark/Darkness, the "Wave" part was one of J2e's many "improvements" to their translation.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 15, 2013, 07:29:06 AM
(And on a less important note, it's Dark/Darkness, the "Wave" part was one of J2e's many "improvements" to their translation.)

And a welcome one IMO. Makes it less confusing with the stauts and the element. I'm a fan of different things having different names, which is why I tend to prefer "Dark" for the element name and "Blind" for the status (and "Dark Wave" for the ability).

Anyway, I'll get to tackling those bugs (I seem to be particularly prone to off-by-one errors in general, but this time a lot of them have to do with the fact that I had to change some things about the list structure in the process of attempting to rectify the horrible memory leak), then resume working on the encounter editor, then start on AUTO BATTLE SCRIPTS!!  :childish: With of course a break to update the monster reaction descriptions once that list is ready.

 :edit: Ok bugs fixed.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 10:38:08 AM
Looks like all of the bugs have been fixed! I had thought the Stat one would be a little more complicated but it seems like you quashed it with all of the rest, good work! So Auto-Battle scripts are next, hmm? I did not expect to see those worked on so soon, but I guess they are the natural point of progression, hehe. Looking forward to the results!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 15, 2013, 11:49:11 AM
Done!

OK, the good news is that all menu commands that target one or all enemies can trigger a reaction, the (not so) bad news is that sometimes they act a bit differently than we might want.
Apparently, "Item" counts as magic, but "Call" is separate. Also, any item that can be used on an enemy (including cure potions, etc.) will trigger the reaction, but only white magic that causes damage will trigger the reaction. Also, a few commands trigger the reaction when they are executed, that is, during the "charge" instead of when they hit (as indicated within the table).

After doing this, I thought it might be possible to choose a particular spell to trigger a reaction, but I tested the theory and determined that it's incorrect. As far as I can see, these are the only actions that will trigger reactions.

Also, bear in mind that for these tests, I kept the conditions at "any character" and "any element." I don't know how successful this data would be with particular characters or elements.
Code: [Select]
Monster Reaction Triggers

If FF4kster Says Reacts To
---------------- ---------
193 Fight
195 Black, Item, Ninja, White*
197 Call
198 Dummy (Dark Wave)
200 Dummy (Recall)
201 Sing
205 Aim
206 Dummy (Store)**
207 Kick
209 Twin**
211 Dummy (Cry)
213 Peep
215 Dart
216 Sneak
223 Jump

*Only triggers reaction if the immediate results include a depletion of HP or MP
**Reacts during "charge" time, not after the actual hit
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 15, 2013, 01:18:31 PM
Alright folks, encounter editor is ready for testing!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 01:57:33 PM
Looks like the Encounter Table switching works as does the Formation switching. Great work!


Incidentally is the final formation really a 1% chance? I run into a group of Six Imps many, many times while outside of Baron it seems.

Also Great work, Chillyfeez in figuring all of that AI business out! I can confirm though that elementals work at least for magic (plainly) and the Fight command (as in Elemental Weapons)
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 15, 2013, 02:46:31 PM
The mystery byte in formations is the targeting layout to use. (Zyrthofar's editor can view and modify these, so if you want to add support for them, reverse engineering them from that's probably a good idea. I've never tweaked them much, since I never saw a need to make large-scale changes to battle layouts. I don't think any of our documentation covers them, although I may be wrong.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 15, 2013, 02:59:02 PM
Targeting layout and hopefully arrangements are both ideally coming in the future.

In the meantime, I added chillyfeez's info to the AI editor and also now the program automatically detects which monsters are lunar based on which monsters are in the appropriate maps' encounters.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 03:09:49 PM
An interesting work around with the Lunar-Underground monsters, and while you get all of the normal enemies in that regards you don't get the bosses though, I expect that's forthcoming though.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 15, 2013, 03:19:20 PM
Oh wow, yeah, I never even thought of that... bosses... dang... I guess I'll have to add a toggle key after all.

Anyway I just made it so the event editor will now also preview formation details.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 03:31:38 PM
That is a very neat addition. It's always good to see some of the previous utilities get a bit of an upgrade and the more previews in other parts of the editor to keep the modder on track, the better.

 :edit: If I may make a suggestion, I've been looking into free space in the Encounter section, but at first did not realize that separate play areas had a separate encounter list. Could this be made clearer with something like "Overworld Encounter: X" "Dungeon Encounter: X" that sort of thing? It would keep the mind on track.

Speaking of such, what decides whether one or the other is used?

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 15, 2013, 05:21:28 PM
:edit: If I may make a suggestion, I've been looking into free space in the Encounter section, but at first did not realize that separate play areas had a separate encounter list. Could this be made clearer with something like "Overworld Encounter: X" "Dungeon Encounter: X" that sort of thing? It would keep the mind on track.

That should be doable.

Speaking of such, what decides whether one or the other is used?

Well as far as I understand it, if you're on an overworld map, it uses the overworld domains. If you're on an inner map, it uses the inner map domains. If you're on the "upper world", it uses the upper world versions of the encounters and if you're underground or on the moon it uses the underground/moon versions of the encounters. Is that what you were asking?

Anyway, I added the Cover discoveries into the command editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 05:33:37 PM
Yep, that's what I was asking. It is interesting how they programmed this game with the clear idea to use the Dual-World theme slightly brought up in FF3. Yet in the end the Overworld is so much larger than both the Underworld and Moon.

Oh, the Cover stuff made it in? Good to see. I guess the other command stuff in the thread is just whenever you get around to it as well?



 Hmm, while the Overworld/Underworld differentiation was an interesting system for Encounters, they are not very much used... at all. Both the Underworld Dungeons and the Overworld Dungeons both have 80 Encounter Lists, but the game never uses much before, or after, the lists "branch".

Underworld Dungeons don't have a listing before 28 meaning that 0-27 in the Underworld Dungeon index goes unused and the Overworld Dungeons have large chunks missing out of its Encounters past 27...

Alright, so I took a much closer look and the Only Time these two intersect is a single formation, that being 63.

Code: [Select]
Overworld Dungeon Encounters. Underworld Dungeon Encounter Sharing
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10|
11|
12|
13|
14|
15|
16|
17|
18|
19|
20|
21|
22|
23|
24|
25|
26|
27|
  |28
  |29
  |30
  |31
  |32
  |33
  |34
  |35
36|
37|
38|
39|
40|
41|
42|
  |43
  |44
  |45
  |46
  |47
  |48
  |49
  |50
  |51
  |52
  |53
  |(54 was likely intended for a cut portion of the Cave of Summons)
  |55
  |56
  |57
58|
59|
60|
61|
62|
63|63
  |64
  |65
  |66
  |67
  |68
  |69
  |70
  |71
  |72
  |73
  |74
  |75
  |76
  |
  |
  |
  |
----------------------------------

This means that 43/80 Spots are unused in the Underworld Dungeons and 40/80  Spots are unused in the Overworld Dungeons. The question of course becomes, was there really enough to fill them in the first place?

We know that by looking at the formations directly that these unused Encounters were not just dummied Goblin space, but formations that seemed intelligent for that level (for the most part). I guess it goes to show how much Square had to cut out that over half of their allocated space went unused, despite data clearly being put into them.

 :edit: Chillyfeez, your work has made useless commands such as Peep a very open ended tool. With your discoveries in the AI you can make a quasi-Piercing Sight from FFIVTAY. As observed...

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIV-PiercingSightTest_zps6373cf16.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIV-PiercingSightTest_zps6373cf16.png.html)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIV-PiercingSightTest2_zps02622dc9.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIV-PiercingSightTest2_zps02622dc9.png.html)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIV-PiercingSightTest3_zps6feee0ac.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIV-PiercingSightTest3_zps6feee0ac.png.html)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIV-PiercingSightTest4_zps2dd9de99.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIV-PiercingSightTest4_zps2dd9de99.png.html)

Setting Peep alone is rather dangerous. It might work better as a Reaction, but I haven't tested it in that capacity, so I changed the Imp's Charm (along with many other Charms, I'm sure) into that, a message and a set weakness which worked quite well. Unfortunately (Or fortunately?) there's no way I can see to randomize a weakness like Piercing Sight, and every monster you want to be effected by this would need a specialized AI for it (at least for each elemental weakness.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 15, 2013, 05:59:37 PM
Well, I guess everything at this point is "when I get around to it". I think I'm done for today though, having done almost nothing but slog away at code. I'll probably be a bit more social this weekend.

Anyway what do you guys think? Should I throw it onto RHDN as is, or should I wait a bit longer for more possible bug reports?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 15, 2013, 06:17:36 PM
I have noticed one slightly troubling thing, but I can't say what's causing it. For a test I set my Encounter in Overworld 19 (in front of Baron) saw that it worked, switched it back, but some of the encounters are still as if they are in the Kaipo Desert, but this doesn't seem to be a "one off" error or anything. The first Formation, the Goblin still works fine and appears as frequently as ever and I have seen the six Goblin Formation after I set this, so it's not somehow pushing it down or anything like that. It's difficult to say what Formations have been replaced by the Kaipo Desert one.

You have made Tremendous progress in just today alone, fixed several bugs, added several new features and additions, you deserve a rest, haha.

 :edit: Actually I have found another error. When you go to switch any of the Items in the Drop Charts, though the editor will show them as changed, even as you go through other menus and do other things, the changes are only superficial and don't carry over to the game and when you exit FF4kster and reopen it the data will be initialized.


 :edit: 2 I updated the Cover data, including the method to have the requirements read Class rather than Character giving it more versatility over all.

I've also found another error. If you press "end" while viewing the AI Index, it will show 256, but no descriptions, just a black spot where a box normally would be and pressing down breaks the program.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 16, 2013, 12:39:09 AM
Honestly, Grimoire, I don't own any of the phones or consoles TAY is available on, so I don't really know what Piercing Sight is, but if my research helped you do something you wanted to then I'm glad  :happy:

Now that you mention it, though, I've been wondering about the charm script that almost every monster has... does a charmed monster not behave as charmed without one of these scripts?

Pinkpuff, imho you probably should let us mess around with it for a while longer before uploading to RHDN. I understand you're probably eager to release this to the world, but bugs are still turning up, so you'll probably save yourself some headaches letting us beta test some more first. Probably not a big deal if you take some time off, though. We'll certainly have fun with what we've got, and our findings aren't going anywhere.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 16, 2013, 01:22:25 AM
Ah, Piercing Sight in TAY is an ability that is used by a "scholar" character, she also has Gil Toss which is great early game, tapers off in the final chapter though. She was Supposed to be a Blue Mage, but I guess Square didn't want to devote that much time to it...

In any case Piercing Sight randomly assigns a weakness to an enemy, and the way to tell what the weakness added to is by the flash of color on the screen. It surprisingly (or oversightedly...) even can hit a Dark elemental, but there's nothing in TAY which is Dark Elemental to even use.

The way I made it work is to have the enemy react to a status (in this case, Charm) and then while they are "charmed" the player would use Peep and I made a message to tell the player the new weakness (Fire) and added a chain end flag to move it back to its normal AI script. So it's very close to Piercing Sight without the random factor.

But yes, Charm is individual Monster-by-Monster basis. Charm alone does nothing (As seen when you use it on the Imp enemy in the Underworld in Sylvan Cave) and so many scripts are used by fancy attacks or sequences that only activate when the enemy is charmed (TinyMage comes to mind) that it's a bit of a waste when it could be put to better use, in my opinion.

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 16, 2013, 06:40:04 AM
I have noticed one slightly troubling thing, but I can't say what's causing it. For a test I set my Encounter in Overworld 19 (in front of Baron) saw that it worked, switched it back, but some of the encounters are still as if they are in the Kaipo Desert, but this doesn't seem to be a "one off" error or anything. The first Formation, the Goblin still works fine and appears as frequently as ever and I have seen the six Goblin Formation after I set this, so it's not somehow pushing it down or anything like that. It's difficult to say what Formations have been replaced by the Kaipo Desert one.

I can't reproduce this. I'm not sure what overworld section corresponds to what index in that list but based on the default data 19 does not appear to be in front of Baron. I changed 35 though, which does appear to be near Baron and had no problems, changed it back, still no problems. Granted I didn't grind there for any extensive period so maybe someone else can confirm this?

You have made Tremendous progress in just today alone, fixed several bugs, added several new features and additions, you deserve a rest, haha.

Thanks  :happy: I'm still have this compulsion to fix things as they come up though...

:edit: Actually I have found another error. When you go to switch any of the Items in the Drop Charts, though the editor will show them as changed, even as you go through other menus and do other things, the changes are only superficial and don't carry over to the game and when you exit FF4kster and reopen it the data will be initialized.

Fixed.

:edit: 2 I updated the Cover data, including the method to have the requirements read Class rather than Character giving it more versatility over all.

On the to-do list.

I've also found another error. If you press "end" while viewing the AI Index, it will show 256, but no descriptions, just a black spot where a box normally would be and pressing down breaks the program.

Fixed.

Pinkpuff, imho you probably should let us mess around with it for a while longer before uploading to RHDN. I understand you're probably eager to release this to the world, but bugs are still turning up, so you'll probably save yourself some headaches letting us beta test some more first. Probably not a big deal if you take some time off, though. We'll certainly have fun with what we've got, and our findings aren't going anywhere.

That's true. I'll give it another week or so and see where we are.

The way I made it work is to have the enemy react to a status (in this case, Charm) and then while they are "charmed" the player would use Peep and I made a message to tell the player the new weakness (Fire) and added a chain end flag to move it back to its normal AI script. So it's very close to Piercing Sight without the random factor.

It might make more sense to do this with a reaction to the "Peep" command (can be renamed Peer or Sight or whatever). You'd only need to take up 6 reaction AIs at most, and you could add it as a clause into existing reaction AIs. Just beware that there's currently no check for monster data (including AI data) bleeding into whatever comes after it.

 :edit: Forgot to upload after fixing...  :isuck: Anyway the fixes are up now
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 16, 2013, 07:39:19 AM
Wha-What? You mean to say that Section 19/64 is not Outside of Baron? But I switched that and saw my formations appearing... hmm... Now I am very confused, for whatever reason my 35/64 was Index 1 which should have been the Outside of Baron. I don't recall changing it... but true to form when I changed it to 0 those odd Kaipo Desert encounters stopped. Now I wonder... is 19 at all connected to Baron?

You were 100% right on the Peer issue, I had thought because it bugged out as just a normal AI, it would bug out as a reaction but that is not the case. It works Flawlessly as a reaction, even only going through the motions once rather than repeating. Good thinking there.

Good work on the fixes. I'll keep an eye out for anything else that may pop up.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 16, 2013, 08:00:11 AM
Wha-What? You mean to say that Section 19/64 is not Outside of Baron? But I switched that and saw my formations appearing... hmm... Now I am very confused, for whatever reason my 35/64 was Index 1 which should have been the Outside of Baron. I don't recall changing it... but true to form when I changed it to 0 those odd Kaipo Desert encounters stopped. Now I wonder... is 19 at all connected to Baron?

Like I said, I have no idea which is which, I was just going by what the default encounter sets appeared to be, which for me, 19 was appearing as monster set 1, whereas 35 was the first 0 I encountered in the list. Perhaps it bears further testing, maybe starting with a clean rom just in case you had made any other changes.

You were 100% right on the Peer issue, I had thought because it bugged out as just a normal AI, it would bug out as a reaction but that is not the case. It works Flawlessly as a reaction, even only going through the motions once rather than repeating. Good thinking there.

 :childish: Thanks, glad to hear it worked! Also depending on who you give it to and what period of the game they're in your party for, you may only have to put it on to a small subset of the monsters. Like for example, supposing the plot was otherwise left alone, say you gave it to Edward. Now you only have to change the monsters that Edward can possibly encounter. Now that I think about it that would actually be a neat ability for him. Rydia has the black magic to take advantage of the fire/ice/bolt weaknesses, and Cecil can take advantage of the Dark weakness. Once you pick up Rosa, she (or heck even Edward himself can put on a bow) can take advantage of air weakness... and the holy arrows for holy weakness. I think that covers all of them!

Good work on the fixes. I'll keep an eye out for anything else that may pop up.

Thanks! I think I'll actually write out an itemized list of everything that needs to be done (not on the forum, just locally) and make an updated wish-list for things that I still don't know how to edit but would like to.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 16, 2013, 08:29:05 AM
Like I said, I have no idea which is which, I was just going by what the default encounter sets appeared to be, which for me, 19 was appearing as monster set 1, whereas 35 was the first 0 I encountered in the list. Perhaps it bears further testing, maybe starting with a clean rom just in case you had made any other changes.

That was indeed the problem. A clean rom shows it as you described, 0's don't start until 35. By the way do we have a map of the 64 overworld parts anywhere to see what parts align with where?

:childish: Thanks, glad to hear it worked! Also depending on who you give it to and what period of the game they're in your party for, you may only have to put it on to a small subset of the monsters. Like for example, supposing the plot was otherwise left alone, say you gave it to Edward. Now you only have to change the monsters that Edward can possibly encounter. Now that I think about it that would actually be a neat ability for him. Rydia has the black magic to take advantage of the fire/ice/bolt weaknesses, and Cecil can take advantage of the Dark weakness. Once you pick up Rosa, she (or heck even Edward himself can put on a bow) can take advantage of air weakness... and the holy arrows for holy weakness. I think that covers all of them!

That's a solid idea, that section of the game would need a bit of a difficulty overhaul to make use of that, but I could see a replacement to Salve for Peer, and incorporating Yang's elemental claws in the Fabul Castle Siege could add a bit of strategy.

Thanks! I think I'll actually write out an itemized list of everything that needs to be done (not on the forum, just locally) and make an updated wish-list for things that I still don't know how to edit but would like to.

A lot has been found, but there's still much left to decipher. I'll see if I can't help with that.

Oh! By the way, before I forget, it's not exactly an error per se, but possibly an oversight. If you set another weapon to replace an existing arrow, you will receive a x10 for getting what was those arrows. The fix for this is in this post...

Alright! Well that ends the Arrow business. I found how to make treasure chests give multiples of items, that aren't arrows.

I found it by breakpointing on where the Arrows would appear in my inventory when picked up from a chest, back traced a little from there and found another C9 54 (Compare with 54) and there it was. An unintended consequence of this is that all Weapons are given a multiple of 10 from events. So there would be 10 Excaliburs for instance when you trade the Adamant Ore for the Excalibur (however then you can just have the Smithy's apprentice sell "repairs" to Excalibur, since it's not a quest item.

In addition is the amount that these are given.

In RAM at...

0x009824 - 54 (Change that to whatever value you would like so that when you collect that specific kind of item a multiple would appear in your inventory up until the Armor begins)

0x009828 - 0A (Change that to what you wish for the quantity of item from those sorts of items.)

In ROM at...

0x1A24 - 54

0x1A28 - 0A

Looks like there's no issue now with a Durability based FFIV.

If only finding the information on Two-handedness was this simple...

It was in a separate post from all of the other Arrow stuff so I can see how it was missed.

 :edit: Let me phrase that a little better... If you change the starting point of arrows you will still receive a x10 Multiple, even if the intention was for the weapon to be changed to another weapon type all together (I'm not sure if the breakable bit is removed from moved Arrows)
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 18, 2013, 02:11:18 AM
Certain lunar dungeon attack sequences are making the editor crash. Select the D.Bone and scroll up the sequences to 50 or down to 79. I haven't put together a full list of bad ones yet, but those two are easily reached.

 :edit: More bad sequences:

120
135
232
247

---

Also, it only appears to be cosmetic, but hitting page down without anything selected in the number/condition/sequence windows will place the text at the bottom of the box, creating blank selectable entries (selecting them does nothing but make the window flash). Hitting page up after this will fill the box with these blank, fake entries - the real text can be brought back, at the bottom of the box, by hitting page down again.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 18, 2013, 06:23:52 AM
That's bizzarre that it would only be specific ones like that. This one should be a fun hunting trip...

The Page Up/Down thing sounds like an oversight in menus that are larger than the number of entries in them. Seems like something I could have easily missed when I first implemented that functionality, as most menus have either exactly enough room, or have to scroll. I suspect if you try using those keys in, say, the spell set editor, you'll probably get similar behavior.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 20, 2013, 03:06:32 PM
Attempting to edit Lunar sequences is a bit of a minefield, too. When you hit enter on a part of the sequence to edit it, which command comes up is incorrect. As an example, try editing the Tricker's reaction sequence: the two messages will give different commands when selected, and Cast Fast will crash the editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 27, 2013, 06:02:17 AM
Ok, so I think I now know what's going on with certain lunar AIs messing up.

There are 256 "regular" scripts ("Script Index") and 90 "lunar" ones. However, the conditionset-script pairs ("AI index") are shared among regular monsters and lunar monsters. What I mean is, suppose something has AI index 50. I'm too lazy to look it up right this minute but for the sake of argument let's just suppose AI index 50 says something like "Set 25: Script 32; Set 15: Script 100". Now, if you try to preview this for a normal monster, no problem. Script 32 has meaning and so does Script 100. Now suppose we try to preview AI Index 50 for a lunar monster. Now you have it trying to access Lunar Script 100 (out of 90). KABOOM!

Not sure what a good fix for this would be but I'll think about it and if you have any clever ideas by all means post them.

 :edit: Nevermind, I figured out a way to do it. Now if you select such an index the editor will simply display the message "-- DOES NOT EXIST --" and won't allow you to edit that script. I also fixed the x10 arrows issue. Still on the table though are the "crashing while editing of certain script details in lunar scripts" (I'm pretty sure I know what's causing that) and the Pg Up/Down issue.

 :edit: The bug causing the editor to mess up when editing lunar scripts has now been smashed.  :banonsmash:

 :edit: And Page Up/Down bug fixed. I think that's everything so far? If there are no other major bugs reported by tomorrow I'm uploading this version to RHDN.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 27, 2013, 11:48:32 AM
Seems like everything is working properly as far as I can tell. I'll take a more indepth look a little later to see if anything goes wrong.

 :edit: Hmm all of Zeromus' AI seems to be... wrong? I guess you could say, Ah I see. He's counted as an Overworld enemy for whatever reason in the editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on August 27, 2013, 03:03:04 PM
Yeah everything seems good to me so far too.

 :edit:

Feature request: An option to scan for unused attack sequences and individual scripts. Can lose track of this stuff pretty quickly when you're changing them around.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 28, 2013, 01:55:02 PM
Auto battle editor is mostly done, the only thing I'm having trouble with is figuring out how the multi-character scripts work. Looking at the data in the rom it appeared to be, for example, FuSoYa's script followed by FF followed by Golbez' script (followed by another FF). I figured this would extend to regular scripts as well so I tried adding Kain to the party in the opening events before the airship battles to see if he would use Lit-Bolt (I changed the Fire-Bomb to Hide) but instead, they both executed the first script (so both Cecil and Kain hid).

Anyone have any idea how this works?

Another thing too, is it known how the game determines that only one party member is active for a particular battle? For example, in the Tellah vs Bard fight, only Tellah is active and everyone else, while still in your party, are somehow not present in the battle.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 28, 2013, 02:20:46 PM
Good question. It happens in tellah's battle vs golbez also. Is it possible that tellah's actor in particular has this effect?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 28, 2013, 02:40:08 PM
I don't think there's anything special about Tellah's actor. I tried adding "Tellah 1" to the initial battle instead of Kain and he behaved exactly the same way (he hid along with Cecil).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 28, 2013, 03:04:14 PM
Hmm, looking back at the Ram Locations in the Bab-il Docs, it seems that there's a separate place of Ram being saved for a second character's auto-battle commands.

388C-3899 Autobattle script for first/only character
389A-???? Autobattle script for second character

I wonder if it's somewhat based on formation. After all the only auto-battle that includes two characters is the final one against Zemus and Zeromus if memory serves me correctly.

Now that is another thing with auto-battles you bring up. There are some slight pieces of information missing when it comes to events and battle events. I saw this when I was trying to fix Vivify's patch and setting the Zeromus event on the Training Guard. If you just go for it, switching the formations out, in the second (what would normally been an auto-battle) battle all of your characters will be dead. There is no instruction I saw that kills the party characters. Only after adding a character before the battle begins will that character not be dead.

In addition with Auto-battles Tellah's not the only one that works like this. Something somewhere removes the party members that are called by a specific formation, at least it seems that way. Cecil is required for the auto-battles on the Airship, Tellah is required for the auto-battle in Damcyan, Edward is required for the 1v1 WaterHag, Yang is required for the Mt. Hobbs Ambush, etc. The events leading up to these battles do nothing unusual though to wipe the party to assure this one character is there. Set any other normal formation and you will get just another battle.

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 28, 2013, 03:16:29 PM
To me that seems to imply that it's a feature of the formation whether it's hiding characters. Could it be one of the "mystery" values that we haven't already figured out? Perhaps it's handled somewhere else entirely?

 :hmm: Does the ending event actually add FuSoYa and Golbez to your party? If so what happens to the rest of the party? Like, how does it make room for them? If not, how are we having a battle with characters that aren't in our party?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 28, 2013, 03:27:05 PM
That was my first guess too but when I looked at them I saw nothing too out of the ordinary. Most other auto-battle event battles have the Mystery Byte set to 0 except for the two auto-battles against Zemus/Zeromus they are set to 1, but changing them to 0 doesn't do anything noticeable.

Now here is where things get interesting... it doesn't appear to load FuSoYa per se but loads what is in the 1st Shadow Slot. If you start the game and go straight for the Zemus fight Golbez will be fighting alone in a cycle of Fire 3, Ice 3, Lit 3, W. Meteo. Say if you add and immediately remove Tellah 1 from your party he will be fighting along Golbez in the Zemus fight because he is the actor currently in the 1st Shadow Slot.

This means that your party is still there... somewhere but this formation specifically calls Shadow Slot 1 and Golbez's actors, despite them not being in your active party. This is admittedly the only instance of this as far as I recall.

(http://i112.photobucket.com/albums/n198/LastingDawn/TellahandGolbezfightingZemus_zps8fc90c8c.png) (http://s112.photobucket.com/user/LastingDawn/media/TellahandGolbezfightingZemus_zps8fc90c8c.png.html)

This means that Golbez must similarly be loaded from some sort of 5th Shadow Slot, I would imagine.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 28, 2013, 03:37:56 PM
Found something else interesting, I added a fight at the beginning of the opening sequence with the Bard. If I add Tellah to the party before the fight, it's Tellah alone vs Bard. If I add Kain to the party instead of Tellah (so, no Tellah in the party at all), the game hangs when the battle starts. This implies that something is checking for Tellah specifically.

Now here is where things get wonkee. I changed all the encounters in the section of the overworld around Baron to the Bard fight and loaded a save with just Cecil and Kain (no Tellah). They fought the battle normally, no one hidden, but both were executing Tellah's autobattle script for that fight! That could imply that there's something checking whether the battle was launched by an event...
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 28, 2013, 05:48:10 PM
Alright! I think I found the index! I placed a Read breakpoint on the Encounter index (7E1800)  started up my ready-made Zeromus event and when I did it started to CMP the value of the encounter through listings starting from 00E516 in ROM. starting with F700 which is the Dark Knight vs. Paladin battle, then continued down the list...

In RAM at...

(Note to Self: Always add +1 to hex 1B3 = 435 + 1 = Formation 436

E516 - F700 (248) - Fabul Siege Formation (Oh, I see! Rydia is never removed from the party in this event, but these formations are special so she doesn't appear.) (Edward-Yang-Cecil)
E518 - F800 (249) - Fabul Siege Formation (Edward-Yang-Cecil)
E51A - F900 (250) - Fabul Siege Formation (Edward-Yang-Cecil)
E51C - F100 (242) - Cecil vs. Kain (Cecil)
E51E - EE00 (239) - Tellah vs. Edward (Auto-Battle) (Tellah)
E520 - F600 (247) - Paladin vs. Dark Knight (Paladin Cecil)
E522 - EF00 (240) - Edward vs. WaterHag (Edward)
E524 - F000 (241) - Yang vs. 3 Imp Captains (Auto-Battle) (Yang)
E526 - F300 (244) - Tellah vs. Golbez (Auto-Battle) (Tellah)
E528 - FD00 (254) - Edge vs. Rubicant (Auto-Battle) (Edge)
E52A - A801 (425) - Adult Rydia vs. Golbez (Rydia) (UNUSED!)
E52C - 01B3 (436) - Golbez and FuSoYa vs. Zemus (Auto-Battle) (Golbez-Shadow Slot 1)
E52E - 01B4 (437) - Golbez and FuSoYa vs. Zeromus (Auto-Battle) (Golbez-Shadow Slot 1)

In ROM at...


6716 - F700 (248) - Fabul Siege Formation (Oh, I see! Rydia is never removed from the party in this event, but these formations are special so she doesn't appear.) (Edward-Yang-Cecil)
6718 - F800 (249) - Fabul Siege Formation (Edward-Yang-Cecil)
671A - F900 (250) - Fabul Siege Formation (Edward-Yang-Cecil)
671C - F100 (242) - Cecil vs. Kain (Cecil)
671E - EE00 (239) - Tellah vs. Edward (Auto-Battle) (Tellah)
6720 - F600 (247) - Paladin vs. Dark Knight (Paladin Cecil)
6722 - EF00 (240) - Edward vs. WaterHag (Edward)
6724 - F000 (241) - Yang vs. 3 Imp Captains (Auto-Battle) (Yang)
6726 - F300 (244) - Tellah vs. Golbez (Auto-Battle) (Tellah)
6728 - FD00 (254) - Edge vs. Rubicant (Auto-Battle) (Edge)
672A - A801 (425) - Adult Rydia vs. Golbez (Rydia) (UNUSED!)
672C - 01B3 (436) - Golbez and FuSoYa vs. Zemus (Auto-Battle) (Golbez-Shadow Slot 1)
672E - 01B4 (437) - Golbez and FuSoYa vs. Zeromus (Auto-Battle) (Golbez-Shadow Slot 1)

Hopefully I'll be able to find the party make-up and requirements to play the chosen formation.

 :edit: I can confirm that positioning is a large part of this. I switched 01B3 and 00F1 and only Cecil appeared to fight Zemus (normal auto-battle carried out from there) 00F1 is the Cecil vs. Kain fight, which would make sense that Cecil would be alone. This means that the party is set before the formation number is found, hmm...

 :edit: 2: Hmm, so right above these values are values that Must correspond to "treat actor special".

E509 - 03 - Child Rydia - Hide during Fabul Fight
E50A - 03 - Child Rydia - Hide during Fabul Fight
E50B - 03 - Child Rydia - Hide during Fabul Fight
E50C - 01 - Dark Knight Cecil - Only One Present fighting Kain
E50D - 04 - Tellah 1 - Only One Present fighting Edward
E50E - 0B - Paladin Cecil - Only One Present fight Dark Knight
E50F - 05 - Edward - Only One Present fighting WaterHag
E510 - 07 - Yang 1 - Only One Present fighting Imp Captains
E511 - 0C - Tellah 3 - Only One Present fighting Golbez
E512 - 12 - Edge - Only One Present fighting Rubicante
E513 - 11 - Adult Rydia - Hide during Golbez vs. Party fight
E514 - 13 - FuSoYa - One of Two Present fighting Zemus
E515 - 15 - Golbez - One of Two Present fighting Zemus

But I've already seen first hand that it refers to the first Shadow Slot for FuSoYa's Zemus formation in particular so I have to wonder if these are even used...?


 :edit: 3: Phew, my money was right on the mark. They are thankfully the Only One Present or Hide commands for each special party battle, Except for the final battle's special battles. I have No idea where the game draws those, but nulling them or changing them in anyway does absolutely nothing. However the others work as you would expect change the Tellah ID of 04 to 01 to have Dark Knight Cecil beat up on Edward, for instance.

I think it's fairly clear that the normal matters are ignored for the 13 and 15, since one it's not FuSoYa it is grabbing but Shadow Slot 1 and 2, Golbez is not even in your party therefore the game should lock up when trying to access it. There is something very special going on in that particular scene, but I can't quite reason it out.

But that does solve that, looking forward to seeing Auto-battle and Special Battle's incorporated into the editor!

 :edit: 4: Slight addendum due to new information found below in regards to Rydia vs. Golbez.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 28, 2013, 10:17:52 PM
Double-Post: Humongous update to the previous posts, with the info. required to have the desired PC's take part in special battles. (Except for the final Zemus fights)
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on August 28, 2013, 11:33:21 PM
Good stuff, Grimoire. I hadn't even considered trying to edit special battles, but being able to do so will really help flesh out the story of a hack.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 29, 2013, 05:11:53 AM
Awesome work Grimoire! This is fantastic! Only one question though... how does it indicate whether the actor in question is "hide only me" or "hide everyone except for me"?

There's also the question of how it's handling the multi-actor script issue, since right now my script reading routine assumes each script ends at the first FF so it's not reading Golbez' scripts at all.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 29, 2013, 08:56:45 AM
I haven't yet taken a good look at how the behaviors of the scripts are carried out, only that those ID's mean those in that specific event, I'll take a look later on.

As for the second AI script, here is where things get... weird. I changed the values around from one of the Fabul formations to the Final Battle's formations and though I had Cecil and Edward in my party they kept on doing Only FuSoYa's Auto-Battle Script, never Golbez.

This leads me to believe that there is something special to Golbez's actor which tells him and Only him to use the second scripts of Auto-Battle commands.

If I could only figure out how the game calls a character never in the party, I might be able to make more sense of it....

 :edit: Alright, so I figured out how the game decides "Hide" and "Only One". Child Rydia's ID alone have a CMP that is passed through CMP 03. If this CMP is triggered only that character is hidden.

In RAM this is at...

0xE410 - CMP 03 - Rydia's ID
0xE453 - CMP 03 - Rydia's ID

In ROM at....

0x6610 - CMP 03 - Rydia's ID
0x6653 - CMP 03 - Rydia's ID

You may switch these to whatever you please to hide that specific ID during Special Battles, when they're the "unit specially effected".

 :edit: 2: I expected to find Adult Rydia's ID but there might be something else going on there... There is no CMP for 11, Adult Rydia's ID, as far as I can see.

 :edit: 3: Hmm, if I switched instances of Encounters as in Tellah vs. Bard to the slot which should in theory hide Adult Rydia, Golbez vs. Party she's the only one present, I'm not really sure what's going on there.

 :edit: 4: Even if I Force load the Formation of Golbez/Shadow Dragon Rydia still appears to be the only one. (Incidentally the game softlocks at this point. I wonder if this somehow deals with the Paladin CMP's I saw earlier...)

Nope, not one bit... I can't figure out why this is treated so special or how the game actually hides Adult Rydia since by all accounts Adult Rydia should be the only one appearing according to the byte.

 :edit: 5: Stupid repeated, broken battles, grumble, grumble... I was looking at the wrong Golbez/Shadow Dragon formation. No idea though why only Rydia appeared still despite the wrong formation number.

When set correctly it works fine Rydia is not present. But I think there might be something wrong with the Rom I have been using.

 :edit: 6: No, Rom was fine, a clean one did the same thing, hmm... I start the fight and Cecil raises his hand in the air and Golbez doesn't do anything, despite this being his Underground Formation as well. I might just have to use the actual event.

 :edit: 7: Yeah there is something really special about this formation which makes it not function properly outside of its proper place... for some reason, it's strange. In any case forcing the event call to play the Meeting Giott, having Rydia Join works fine.

Oh. I see. That "wrong formation", I was complaining about? That double Golbez/Shadow Dragon one? That's actually the unused one. 01A8 is unused by the game completely and may have been a remnant of earlier plans somehow. Now it just acts as the normal "Only One" battle. It may hint that Rydia was supposed to fight Golbez on her own (which is why Golbez is so terribly weak "dying" with only 3000 HP loss) originally before they added some sort of advanced script that hides her from likely within the battle itself.

So that means you can have one more kind of Special Battle.


Title: Re: Developing a comprehensive editor for FF4
Post by: 5247846 on August 29, 2013, 09:14:37 PM
I want to modify the FFIVCosmeticChanges2 ROM, but it freezes FF4kster.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on August 29, 2013, 09:18:12 PM
It's likely an invalid version of the game, it's possibly unheadered and may not actually be compatible. Is there not also a patch of the Cosmetic Changes? Why not download that and apply it separately?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on August 30, 2013, 05:18:13 AM
I want to modify the FFIVCosmeticChanges2 ROM, but it freezes FF4kster.

FF4kster is not guaranteed to work on any rom other an FF2US v1.1 that either has not been modified at all, or that has been modified only by FF4kster. Changes made by a graphic editor should also be fine. However, any kind of miscellanous patch or usage of another editor, I can make no guarantees as to the behaviour of my editor. There are certain ones I know to be fine (my protect/shell patch, the "spell learning by first letter instead of index" patch, the long range bugfix, probably others) but it can't be assumed.

 :edit:
it's possibly unheadered and may not actually be compatible

Headered/unheadered is no longer an issue for FF4kster.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 02, 2013, 05:44:04 AM
Hi folks, just a heads-up:

School starts for me tomorrow and thus I'm not sure how much time I'll have for working on this in future. I do still plan to poke at it in whatever spare time I happen to get though. Between all the wishlist topics and such it looks like I'll have a nice clear to-do list to pick and choose from at any given time, and on that note I want to thank everyone who put their time and effort into finding what they could on those topics. It's going to be a huge help and while it may take some time, this editor is going to be awesome (and of course the more info that's found in the meantime, the more awesome it will be ^_^).

I've already started brainstorming some ideas for an FF4 hack I'd like to make whose purpose is to show off all the different capabilities of FF4kster. That will be awesome too and it's helping to keep me motivated to finish this thing and have it be nice and polished in the end.
Title: Re: Developing a comprehensive editor for FF4
Post by: Lenophis on September 02, 2013, 09:10:03 AM
I'm going to sticky this topic, well, because.  :cycle:  If anyone has any objections, let me know and I'll unsticky this thing.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 02, 2013, 09:32:45 AM
Is going to be awesome? It is quite awesome as it stands, haha! Yes, classes start again for me as well. I have been fiddling around with a lot of ideas but I can never settle on an idea to develop enough to preview to the community. From a solo Black Mage mod to an After-After Years mod to trying to make a remake of the first dot hack game in the FFIV system, I think the main thing holding me back is maps for some of these ideas. Good luck in school though!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 02, 2013, 04:56:49 PM
Well, you two just effectively made me feel old...

The editor's grown by leaps and bounds recently, so as I've said recently, I think we've got plenty to keep us busy for the moment.

The hack I'm working on is an after-after-years (kinda funny because I've never played TAY). I've got all of my characters created already, and most of the plot fleshed out (minor story details will work themselves out as needed). It's just a matter of getting to doing it all.

I'm actually having more fun right now messing around with making new discoveries (now that I seem to have a working grasp on the basics of ASM), so I hope to assure you'll be overwhelmed with new stuff to put into FF4kster when you get the opportunity, Pinkpuff.
 :laugh:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 02, 2013, 11:51:38 PM
If you haven't yet tried TAY you should watch an LP of it if you have the time. HCBailly made a fantastic FFIV TAY LP, his favorite game of all time is FFIV and for the most part treats FFIV-TAY with the respect it deserves. Though since you're making such a story I imagine you've likely at least read the plot outline.

I am pretty sure Dragonsbrethren had to have found this some time in the past but I've located the ATB byte for FF2 US in RAM (For real this time!) at...

7E16BE - Enables ATB by changing the value there to 01.

Unfortunately I can't find this in ROM, though it should exist somewhere...


Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on September 03, 2013, 12:41:55 AM
That's a good idea, watching an LP. I read the plot outline on ff wiki, but my story really only borrows bits and pieces (biggest being that Ceodor and Ursula are playable characters). I should watch the whole thing to fix any possible holes.

Are you talking about an ATB guage? Is that actually programmed into the game but not used?!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 03, 2013, 02:16:01 AM
Oh no, it's just the Active Time Battle being set to... well Active instead of Wait as it is by default in FFII US with no way to change it. I recall that Dragonsbrethren ported the menu from FFIV Easytype over to our FFII and the ATB type was there to change... I think.

Also interesting idea you have with your TAAY, mine is set quite a bit further in the future and the complications that would rise from such arrangements as hinted at in the ending of FFIV:TAY.

 :edit: It seems event flags are stored from 1280 to 12DF - Meaning there should be 95 Event Flags, that is of course if they aren't stored in a bit fashion.

One of the CMP 04's must be in regards to when you first enter the Underworld. Whenever you clear that flag you can reboard the Airship but it will continually take you to the crash scene.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 03, 2013, 02:40:00 PM
Alright, so I figured out a work around to get the game to work with Active ATB from the start.

I put a write on the Initial Color of Menu's and after a minute or so of holding "run" saw that it escaped its loop to... end up 3 bytes from it's initial starting point. But this is all that I ended up needing.

In LoRom/HiRom...

0x19B2B - A2 00 30 (LDX 0030)- Default Window Color for new files.
0x19B2E - 8E AA 16 (STX 16AA)- Where to store default colors.

In ROM...

0x9D2B - A2 00 30 (LDX 0030)- Default Window Color for new files.
0x9D2E - 8E AA 16 (STX 16AA)- Where to store default colors.

With this you can... well change the starting file to any color you like But more importantly for my purposes I switched its function.

I change 8EAA16 to 8EBD16 - Making it change the value at 7EBD16 causing Active ATB to activate. The only downside is that the game starts with a black menu instead of a blue one. A small price to pay and can be easily changed. Besides, Black always appealed to me more, haha.

 :edit: I had no idea there was a choosable formula based on physical attack power! I swear I never saw that in any earlier version of the editor. Great find, considering all named abilities don't use it!

 :edit: 2: How interesting. Though it is clearly based on Physical Power, Magical Defense is the stat taken into consideration.

 :edit: 3: Element, whether it be of weapon or set by the ability itself, is not taken into consideration.

 :edit: 4: Spell power does nothing to the power of this formula.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 03, 2013, 07:13:49 PM
I found the window color before, but wanted to do all the config menu settings in one topic since the game initializes most of them in the same code, I just wasn't such which were which. (why are RAM maps of this game so bad?) Feel free to go ahead and do those if you feel like it, I've been busy with GoldenEye again. I'd suggest doing traces in FF4, since it's easier to see which settings are being affected, the RAM addresses are the same between versions, code's likely slightly off in ROM.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 03, 2013, 07:55:36 PM
That's not a bad idea. Also do you happen to know if the Gradual Petrify and Doom Bugs are fixed in any other SNES version of FFIV? If we could figure out how to fix that, it opens up more options for the player to use.
Title: Re: Developing a comprehensive editor for FF4
Post by: Dragonsbrethren on September 03, 2013, 08:06:38 PM
Deathlike's algo guide should have all the bug fixes noted. IIRC, those bugs are in all versions. Easy Type's the least bugged version. (Even the PlayStation version is buggier than Easy Type)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 03, 2013, 11:17:26 PM
Always a joy to re-read that wonderful guide. But oy... so many glitches one has to watch out for. It's a shame that no SNES version fixes the Slow Petrify and Count bugs.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 08, 2013, 11:48:28 PM
Hmm, I've either noticed a bug or an untested component of event editing. Quizzically enough there is an event instruction called "x50 Gil" which is completely redundant since there's a x100 Gil right after it. So I tested it and it doesn't add x50 Gil to the inventory. But I'm starting to wonder if that was ever its function in the first place since it seems like an odd thing to include.

And confirmed! What this actually is a X -100 Gil command. That's actually pretty neat to know and was missing in the initial FFIV's sequence of events. The issue clearly is though there is no check for money when you initiate an event.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 10, 2013, 07:15:52 AM
I don't understand... x-100? So like, it subtracts x100 Gil?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 10, 2013, 10:05:44 AM
I should have just said that, yeah that's what it does.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on September 23, 2013, 10:08:06 AM
Oh, I'm not sure if you ever finalized this, but should the most recent editor have Lunar/Underground enemy AI Scripts? Or is that still in the works?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on September 24, 2013, 06:40:35 AM
Yes it should. However, due to an oversight, certain lunar monsters still show non-lunar scripts. Specifically, the lunar monsters which do not appear in the lunar encounter lists (such as bosses). My plan once I have time to work on this again is to create a key for toggling the script display between lunar and non-lunar for the currently selected monster.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 04, 2013, 09:50:54 AM
OK, here are my findings.
The summary is that it's really only worth the while to modify targeting of Sing and Recall, but here's the rest:

Code: [Select]
00 Fight - NO
05 Dark Wave - NO
06 Jump - NO
07 Recall - YES
08 Sing - YES
09 Hide - NO
0A Medicine - NO
0B Pray - YES (sorta... you can make it target only the caster instead of the whole party, because it NEVER has a cursor)
0C Aim - NO
0D Store - NO
0E Kick - NO, (but the visual change is complete - only the targeted enemy will flash, but all take damage)
0F Gird - can't tell, but only the caster gets the "armor" animation
11 Strengthen - Honestly, I have no idea what this does. I thought it was supposed to raise the caster's WIS score, but saw no such thing happen when using SNES 9X Debugger, so I don't know...
12 Cry - irrelevant
13 Cover - NO
14 Peep - NO
16 Dart - NO
17 Sneak - NO
19 Spirit Wave - NO

I did not test magic commands, because they open sub-menus, with sub-commands that have their own targeting details. I DID test Dart, because those items do not have their own targeting details, but apparently it is not even possible to affect the targeting options of Dart (even when you change the byte to target multiple, the cursor will still only allow single targeting)

Hmm, I'm not sure how you tested these Chillyfeez, as I've come across some counter-findings...

Fight - No
Dark Wave - No
Jump - No
Recall - Yes
Sing - Yes
Hide - No
Salve - Yes
Pray - Yes (It can target either allies or enemies without worry)
Aim - No
Focus - No
Kick - No
Gird - Yes (As above with Pray)
Twin - Yes
Boast - No
Cry - Yes
Cover - No
Peep - No
Crash - Yes
Dart - No
Sneak - No
Regen - No

So you were only slightly off. But I thought it would be best to double check just in case. Being able to retarget Salve, Gird, and Pray may have its uses down the line.



Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on October 04, 2013, 03:08:21 PM
Huh... looks like I didn't even test Twin, so who knows what I was doing. I guess... sorry?
So it works with Salve, how is changing the targeting value in the subroutine itself affected by changing the targeting byte here, I wonder?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 06, 2013, 11:31:34 AM
That is a very good question. I think what the targeting may actually do is tell the game where to choose the targeting base. If it targets enemies all eight slot will be occupied by monsters, if it starts at ?Slot 5? It will tell the game to start the effects from there.

I need to find that in a few more routines to make absolutely sure that is what it is doing. I am almost certain though since both of the routines we located it in bypass multi-targeted death checks it may be some kind of "Target All No Matter What" sort of dealing, it is fairly difficult to say at the current time.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 13, 2013, 02:54:08 PM
In preparing my FFIV to FFI patch I've started to look into graphics again and have come up with something that I can't believe I didn't notice for all of this time.

Pointer 1 specifically is the graphic sequence that appears if the enemy is hit by the spell. (Defined by the Sprite)
Pointer 2 is the graphic that appears regardless.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on October 13, 2013, 09:12:57 PM
Sorry... can you explain that a bit more? Pointer 1 and 2 of what?
Also, an example of a graphic that appears regardless?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 13, 2013, 09:51:51 PM
In the Animation Tabs of Spells in the Editor.

There is Sprite, Pointer 1, and Pointer 2.

Sprite is... clearly a series of sprites.

Pointer 1 is the Graphic Sequence that is used when the target is hit by the Spell. (e.g. Lit spells use 8, 9, and 10. These are all sequences which show a series of sprites falling from the sky and hitting the enemy.)

Pointer 2 appears to be graphics that appear regardless of whether the enemy is hit or not. (e.g. Flash of Light when the enemy uses Glance or Gaze whether it effects the target or not which use 42 and 45.)

Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on October 14, 2013, 01:15:34 AM
Ah, ok. I figured that's what you meant, but I forgot that's how Ff4kster refered to them.
Good find on pointer 2. I was beginning to think it was just unused. I wonder... is that also what makes, say, the screen turn blue for wave attacks, and other non-sprite effects like that?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 14, 2013, 06:54:53 AM
Almost without a doubt. Now this may also be in conjunction with a Pointer 1 at times, but it seems a little bit difficult to say.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 15, 2013, 10:59:15 PM
I've been putting the finishing touches on my FFIV-FFI mod and have come to a very strange realization. As an added bonus I included the Four Elemental Fiends from FFI (namesakes only, sprite transferring seems near impossible for me) into the Hidden Waterfall cave as a non necessary. but not so out of the way place that anyone who thinks they are able to can test their ability. Now I put three of the four fiends in Chest-Only Battles, and this is when I came to this realization...

Monsters in Chests do not refer to the ordinary rules of formation but something else entirely.

What it seems to refer to is a list starting from Formations 449 to 512. This is likely done to assure there is no mix up between the Overworld and the Underworld chests or something to that accord (There's also some normal fights spread throughout). There is a good amount of empty space spread throughout filled with Imps so it wouldn't be a difficult matter to deal with.

Hopefully now knowing that the next update could have that added as a viewing feature when setting monsters to chests.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on October 16, 2013, 06:00:58 AM
I might be able to find some time over the weekend to implement that.

Any ideas what some good names might be to replace "Pointer 1" and "Pointer 2"? What about "Sequence" and "Effects"? Having a config file of descriptions for the different indexes for those fields would be helpful too, now that we know what they represent. If someone has time to put something like that together then I can include it in the update as well.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 16, 2013, 09:42:01 AM
Sequence and Effects sound like proper name choices. I'll see if I can't wrangle up a list for Sequence, Effects is a little bit trickier at times to identify, but I will do what can be done.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 16, 2013, 01:30:15 PM
Here are the Pointer 2 Effects...

Pointer 2 Effects

1 - Nothing
2 - Makes it so the sprite/sequence doesn't look so blocky and square. - Used by Lots of things.
3 - Used by Exit
4 - Used by Meteo
5 - Used by Comet (Looks pretty good using Shell/Protect/Blink graphics.
6 - Absorption-esque effect. - Used by Psych, Drain, Absorb, etc.
7 - Screen Shake
8 - (Seemed to be a multi-Effect, need to test with other Sprites - Targets Allies only)
9 - (Seemed to be another multi-effect, need to test with other sprites)
10 -(Sprite appears first on caster, caster reacts, then vanishes, then sprite appears on targetted enemy.) unsummons - Used by Imp
12 - Possibly keeps the grey palette on enemies when they are petrified and removes the Summon Image. - Used by Roc
13 - Removes Summon Image if applicable - Used by Mage
14 - Looks like a flurry of punches hits Enemy 1, if an ally is targeted, otherwise if an enemy is targeted it will target properl, removes Summon Image. - Used by Chocobo
15 - Shiva's Ice Storm, Moves Shiva's Sprite, Unsummons.
16 - Moves Indra's Sprite, unsummons. - Used by Indra
17 - Jinn flying across the screen, unsummons - Used by Stone, Petrify, Jinn
18 - Another Screen Shaker, unsummons - Used by Titan
19 - Likely used by Mist Dragon, but corresponds to chosen sprites. expels sprite at enemies (looks Really great with Life Sprite chosen) unsummons - Used by Mist Dragon
20 - Seems to be Sylph's healing effect (Figure eighting sprites as they heal) unsummons - Used by Sylph
21 - Odin's Zantetsuken, unsummons - Used by Odin
22 - Leviathan's Wave , unsummons- Used by Leviathan
23 - Unsummons - Used by Asura 1.
24 - Unsummons - Used by Asura 2.
25 - Unsummons - Used by Asura 3.
26 - Megaflare, Unsummons - Used by Bahamut.
27 - Nothing
28 - Nothing
29 - Shows the Sprite/Sequence and Sound Effect Twice. - Used by Explode
30 - Very strange... The effect shows four castings of the spells around the party and the enemies vanish one by one. Only to reappear when the effect concludes, but with a "defeated" sound effect. Oh... - Used by Reaction.
31 - Nothing
32 - Warp's or Dimension 9's revolving aura. - Used by Warp, Demolish
33 - Nuke's (Flare's) Effect. Casted Jinn's effect?
34 - Wave attacking the party. - Used by Big Wave, Wave
35 - Fire 3's Effect.
36 - Nothing
37 - White (Holy's) Effect - Used by Holy.
38 - Odin Rushing Forward - Odin (Enemy Spell)
39 - Sprite/Sequence happens, then screen flashes many different sorts of color - Used by Big Bang
40 - ??? - Used by Fission
41 - Cure 4's Effect.
42 - Screen Flashes Light Blue and then Sprite/Sequence - Used by Glance
43 - Screen Flashes Red, then Sprite/Sequence - Used by Crush
44 - Screen Flashes Yellow, then Sprite/Sequence
45 - Screen Flashes White, no Sprite/Sequence occurs - Used by Gaze, Slap
46 - Sprite/Sequence appears on Caster, then target
47 - Screen Flashes White several times, no Sprite/Sequence occurs - Used by Black Hole
48 - A glitched graphic appears for only less then a second, no Sprite/Sequence occurs
49 - Crashes Game.
50 - The battle screen darkens and does not lighten again, no Sprite/Sequence Occurs.
51 - The Caster Literally jumped across the screen, and then the game crashed.
52 - Screen blacked out.
53 - Crashes Game.
54 - Crashes Game.
55 - No Sprite/Sequence occurs.
56 - Screen blacked out.
57 - Crashes Game
58 - No Sprite/Sequence occurs.
59 - Game goes crazy, then blacks out.
60 - Game Crashes

Here's an ancient post of mine which shows what all Spells Pointer 2 uses.

Weapon Sprites:

Sprite 008 - Thrown Handaxe
Sprite 012 - Thrown Ninjastars
Sprite 014 - Thrown Boomerang
Sprite 016 - Thrown Chakram
Sprite 017 - Thrown Items (Yellow)
Sprite 018 - Thrown Items (Blue)
Sprite 020 - ? (looks to just be glitch graphics)
Sprite 024 - Bow?
Sprite 025 -






I have to wonder if the term "sprite" is a misnomer. Considering that something that couldn't possibly share the same sprite like Peep, Fatal, Float, Quake, etc are listed under the same.

Sprites : 00 Cure1/2/3/4/etc (All to do with Pointer 1 and 2?)
Sprites : 01 Protect/Shell/Blink/Ice1/2/3/Shiva (Summon)/Image
Sprites : 02 Life1/Life2/Asura (RaiseAll)
Sprites : 03 (Looks akin to a Cure graphic)

Sprites : 04 Megaflare/White/Warp/Sleep/Drain/Psych/Nuke/Jinn (Summon)/Flare/Smoke/Sylph (Attack),Bahamut (Attack)/Powder/Disrupt/DullSong/Gas/Demolish/Disrupt(2)/Absorb/Vampire/Digest/Pollen/Fission/MegaNuke/


Sprites : 05 (Same as 03?)
Sprites : 06 Peep/Fatal/Count/Search
Sprites : 07 (Looks to basically be Death Faces from Fatal)
Sprites : 08 Mute/Dispel/Size/Toad/Piggy/Venom/Lit1/2/3/Indra (Summon)/Blitz/Indra (Attack)/Breath/Whisper/Poison/Magnet/Blitz(Enemy)/Thunder

Sprites : 09 (Possibly some explosion graphic?)
Sprites : 10 Stone/Flame/Roc (Attack)/Beak/Petrify/Hug
Sprites : 11 Meteo/W.Meteo/Fire1/2/3/Bomb (Summon)/Chocobo (Summon)/Bomb(Attack)/Jinn(Attack)/Explode/Reaction/Fire/Blaze/Explode(2)/Emission

Sprites : 12 (A breath attack, possibly?)
Sprites : 13 Float/Quake (O...kay?)/Titan (Attack)/Quake(Enemy)
Sprites : 14 Comet
Sprites : 15 Weak/Weak(Enemy)/Storm/Tornado/Glare
Sprites : 16 Hold/Charm/Virus/Mage/Bluster/Entangle/Hold Gas/
Sprites : 17 Fast/Berserk/Wall/Stop (Seems that it's mostly in the pointer 1 for this one)
Sprites : 18 Slow/Heal/Silver Staff/Unicorn Horn/Maser/Heal(Enemy)/Heal (Enemy2)/Beam/Laser/Heat Ray
Sprites : 19 (An explosion of some sort)
Sprites : 20 Hatch
Sprites : 21 Pin/Big Bang/Globe199/Needle/Counter/












Pointer 1: 03 Wall
Pointer 1: 28 Fatal (The rising of the reaper and the energy being taken away animation)
Pointer 1: 37 Quake (To be exact the animation of the chasm)
Pointer 1: 47 Flame
Pointer 1: 48 Flood
Pointer 1: 49 Smoke
Pointer 1: 50 Pin
Pointer 1: 60 Blitz
Pointer 1: 61 Mist (Dragon) (Attack)





Pointer 2: 00 Null
Pointer 2: 01 (The graphic starts from the middle right of the target and descends down slightly before vanishing.)
Pointer 2: 02 Venom/Sleep/Flare/Smoke/Powder/Tongue/DullSong/Gas/Digest/Pollen
Pointer 2: 03 Exit (When you're not actually leaving battle with this, the game gets fairly screwy)
Pointer 2: 04 Meteo/W.Meteo
Pointer 2: 05 Comet
Pointer 2: 06 Drain/Osmose/Absorb/Vampire
Pointer 2: 07 Quake (Shaking of the screen)
Pointer 2: 08 (Looks like a burst of graphic raising upwards coming from the bottom of the screen only ever hitting the party)
Pointer 2: 09 (Graphics assault the enemies and only the enemies)
Pointer 2: 10 Imp (Striking Graphic, over rides defaults Sound choice)
Pointer 2: 11 Bomb
Pointer 2: 12 Roc
Pointer 2: 13 Mage
Pointer 2: 14 Chocobo
Pointer 2: 15 Shiva
Pointer 2: 16 Indra
Pointer 2: 17 Stone/?Jinn?/Ray/Beak/Petrify/Hug/
Pointer 2: 18 Titan
Pointer 2: 19 Mist
Pointer 2: 20 Sylph
Pointer 2: 21 Odin
Pointer 2: 22 Leviatan (Curiously enough there is no sprite or pointer 1 provided for it)
Pointer 2: 23 Asura Cure 3
Pointer 2: 24 Asura Cure 4
Pointer 2: 25 Asura Raise All
Pointer 2: 26 Bahamut
Pointer 2: 27 (Graphic flickers on the target briefly, can be multi targeted)
Pointer 2: 28 (Same as above?)
Pointer 2: 29 Explode
Pointer 2: 30 Reaction
Pointer 2: 31 (Seemed identical to Fission)
Pointer 2: 32 Warp/Demolish/Disrupt
Pointer 2: 33 Nuke/?Jinn?
Pointer 2: 34 Big Wave/Wave (The big difference between this and Leviatan's summon attack is this goes towards the party, though it has pointer 1 as well included in the ability, which doesn't appear to do anything.
Pointer 2: 35 Fire 3
Pointer 2: 36 No graphic even shows, damage just appears.
Pointer 2: 37 White
Pointer 2: 38 Odin (Zantetsuken against party, graphics will glitch if it is not Odin using it)
Pointer 2: 39 Big Bang
Pointer 2: 40 Fission (When used as an ally, the damage effect is shown on the caster and they do the pain animation, does not hurt them though)
Pointer 2: 41 Cure 4
Pointer 2: 42 Glance
Pointer 2: 43 Crush
Pointer 2: 44 (Screen flashes briefly and then it repeats Pointer 2: 27 seemingly)
Pointer 2: 45 Gaze
Pointer 2: 46 Bomb (Summon)
Pointer 2: 47 Blk. Hole
Pointer 2: 48 (No graphic)
Pointer 2: 49 (Crashes emulator)


And now Sequences...

00 - Exit/Drain/Psych/Shiva/Chocobo/Imp/Odin/Leviathan/Blk.Hole/Absorb/Vampire/(Enemy)Odin(Pointer 2 does the work in those cases, or has no graphic, those that have no graphic will be omitted)
01 - Nothing?
02 - Nothing?
03 - Wall
04 - Flare
05 - Fire 1/Emission
06 - Fire 2
07 - Fire 3
08 - Lit 1
09 - Lit 2 /(Enemy)Thunder
10 - Lit 3/(Enemy)Blitz
11 - Ice 1
12 - Ice 2
13 - Ice 3
14 - Armor/Shell/Image
15 - Blink
16 - Fast
17 - Dispel
18 - Mute
19 - Berserk
20 - Stop
21 - Slow
22 - Cure 1/Warp/(Hidden Spell)Disrupt-(Interestingly it seems as if it has a fully functioning Sprite/Sequence, but is never seen because of 255 Effect)/Demolish/Disrupt
23 - Cure 2/Asura1/
24 - Cure 3/Heal Staff/Asura2/Remedy
25 - Bio
26 - Charm
27 - Weak/(Enemy)Weak
28 - Fatal/Count
29 - Heal/Silver Staff/Staff/(Enemy)Heal/(Enemy)Heal(2)
30 - Peep/Search (overrides Pointer 2)
31 - Life1/Asura1
32 - Life2 (There's a difference?)
33 - Size/Breath/Whisper/Poison
34 - Float
35 - Hold/Entangle
36 - White/Nuke/(Spell)Jinn/MegaNuke
37 - Quake/Titan/(Enemy)Quake
38 - Powder/Digest/Pollen/
39 - Stone/(Summon)Roc/Ray/Beak/Petrify/Hug
40 - (Spell) Indra
41 - (Spell)Chocobo
42 - (Spell) Shiva
43 - Meteo/Comet/(Summon)Bahamut/W. Meteo (even though Pointer 2 seems to handle most of it)
 :edit:What this actually seems to do is prevent the graphic from showing on the target and lets Pointer 2 handle the process.
44 - (Spell) Bomb/(Summon)Bomb/Explode/Reaction/Explode(2)
45 - (Summon) Indra
46 - Cure 4
47 - Flame
48 - Flood
49 - Smoke
50 - Pin
51 - (Enemy Spell)Charm
52 - Needle
53 - (Summon)Jinn
54 - Fire/Blaze
56 - Cold Mist/D.Breath/Blizzard
57 - Venom
58 - Hatch
59 - (Summon)Sylph
60 - Blitz
61 - (Summon)Mist (Pointer 2 seems to override this though, 61 on its own seems to be the Sylph Healing graphic)
62 - Maser/Beam/Laser/Heat Ray
63 - Magnet
64 - Fission/Big Wave/Wave(I believe it may be overridden by Pointer 2)
 :edit: It is. The Sequence looks to be completely unused. It seems to be an explosion from the center-left of the screen that first expands and then moves horizontally.
65 - Counter
66 - Nothing?
67 - Big Bang
68 - Alert
69 - Globe199
70 - Tornado
71 - Storm
72 - (Summon)Mage/Bluster/Blast
73 - Hold Gas
74 - Unused Yellow Flashing effect with Sprites around targets.
75 - Glare
76 - Sleep/Tongue/Gas/
77 - Curse/DullSong
78 - Gaze/Slap/Glance/Crush (Though I believe Pointer 2 may disable that.)
 :edit:Doesn't appear to do anything on its own.
79 - A sequence occurs where large rotating sprites hit enemies, and this repeats four times.
80 - Sequence (which was a weird green effect on targets) never ended.
81 - The screen turned blue, enemies began to float but the battle still continued on.
82 - A graphic shows on the targets which seems to change and linger for around 10 seconds before ending.
83 - Nothing
84 - Wave of graphic hits target, repeating five times while target flashes.
85 - Same as 80.
86 - Nothing
87 - Like 84, except hits only once.
88 - Same as 80.
89 - Same as 80
90 - Same as 80.
There are a few gaps, but looking at just the game data it shows what is and isn't used. I'll see if I can figure out what the unused sequences look like then.


 :edit: And that's that. I think that covers Sprite, Sequence, and Effects in an adequate fashion.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on October 16, 2013, 03:32:44 PM
Hang on - when you say, "moves indra's sprite," (for example), do you mean that this contains the instructions for the summoned monster's image change?
I spent hours looking for that and never thought to look into what pointer 2 was doing.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 16, 2013, 03:42:12 PM
Indeed so. Without the Pointer 2 the summon never shifts their pose (and is just there.) Interestingly you can even assign Jinn's "Fly across the screen" to any summon and it should work properly. At least it did when I tested it with Indra.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on October 16, 2013, 03:47:19 PM
Dammit, Grimoire! I thought I was done researching summons    :happy:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 16, 2013, 04:22:37 PM
Haha! You can never be too certain, especially with FFIV. Hopefully this will help you out. Also your tutorial for getting the Shadow Dragon to work properly is very well described.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on October 16, 2013, 07:30:28 PM
You mean Jinn... Haven't done the Shadow Dragon tutorial yet!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 16, 2013, 08:43:22 PM
Yes, but the instructions for actually getting the... yeah you're right I meant Jinn. I think I jumped the gun on that one, hehe.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on October 20, 2013, 05:00:11 AM
Ok the version on the Time Cave has been updated.

Trapped treasures now display "Formation 449" or whatever and will only allow you to select a formation in the correct range.

The "Pointer 1" and "Pointer 2" of spell animations are now labelled "Sequence" and "Effect", respectively, and their values have labels based on the information posted in this thread. The labels are contained in config files ("config/sequences.dat" and "config/effects.dat") so they should be easy to change as new information is presented.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 20, 2013, 11:54:24 AM
Ah! You didn't mention you included the Auto-Battles! Fantastic! How much space is allotted to those? I added some more instructions to the script and saw no issues in being carried out. All that needs is the "Only this character must be present" or "This character should stay out of battle" code I found a while back. (though since that doesn't necessarily deal completely with auto-battles maybe it would go elsewhere?) Oh, and Golbez's auto-battle information. I have a feeling it will be closeby the original code, but not immediately next to it. I already have a proper search point to find them...

"389A-???? Autobattle script for second character." Thanks to the Tower of Bab-il Docs. I'll see if I can''t find those later today.

Spell Animations look to be properly ordered, no errors to be seen in those, good work in implementing them.

Ah right, and a quick question about the "Start of Magic..." in the editor. Is that referring to their formulaic properties as well? I found in the Magic code not too long ago how the game decides what kind of magic it is and how to take it into accordance when casting spells. In addition to that is also the starting point of when the game looks at Wisdom or Will to decide what powers a certain magic. I wasn't certain if the editor includes that information as well or was in some old notes I may have missed.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 20, 2013, 06:15:55 PM
Here's a neat little addition that should be a very simple addition to the editor. How the game decides if the character is Yang and how to process Damage from Fight.

The code surrounding it is in my other thread, quite a bit was revealed within. But for the purposes of the editor this should suffice...

In LoRom/HiRom...

$03/9B0D   C9 00   CMP #$06   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Is it Yang's ID?

This is the check for which character is considered to have special considerations when it comes to weapons.

But you could really link this special behavior to anything...

$03/9B06   A0 01 00   LDY #$0001   A:0001   X:FFFF   Y:0024   P:eNvMxdizc - Load 1 into Y.
$03/9B09   B1 80   LDA ($80),y[$7E:2001]   A:0001   X:FFFF   Y:0001   P:envMxdizc - Load Slot's ID.
$03/9B0B   29 0F   AND #$0F   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Get rid of negatives?
$03/9B0D   C9 00   CMP #$06   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Is it Yang's ID?
$03/9B0F   D0 03   BNE $03    [$9B14]   A:0000   X:FFFF   Y:0001   P:envMxdiZC - If not branch to 039B14.

You could have it look at specific weapons, different armors, etc.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on October 30, 2013, 05:54:28 AM
Ah! You didn't mention you included the Auto-Battles! Fantastic!

Yeah! I was working on those a while back but got stuck on some details like Golbez etc. so I can't recall off hand how robust or stable that component is at the moment.

How much space is allotted to those?

Not sure off hand, I'm at school right this minute so I'll have to check later but my guess is it just bleeds into whatever is after it... I have a tendency to be lazy with that kind of thing  :sad:

I added some more instructions to the script and saw no issues in being carried out. All that needs is the "Only this character must be present" or "This character should stay out of battle" code I found a while back. (though since that doesn't necessarily deal completely with auto-battles maybe it would go elsewhere?) Oh, and Golbez's auto-battle information. I have a feeling it will be closeby the original code, but not immediately next to it. I already have a proper search point to find them...

"389A-???? Autobattle script for second character." Thanks to the Tower of Bab-il Docs. I'll see if I can''t find those later today.

Awesome! I'll look into adding those when I have an opportunity.

Spell Animations look to be properly ordered, no errors to be seen in those, good work in implementing them.

My pleasure! Good work in compiling them for me  :childish:

Ah right, and a quick question about the "Start of Magic..." in the editor. Is that referring to their formulaic properties as well? I found in the Magic code not too long ago how the game decides what kind of magic it is and how to take it into accordance when casting spells. In addition to that is also the starting point of when the game looks at Wisdom or Will to decide what powers a certain magic. I wasn't certain if the editor includes that information as well or was in some old notes I may have missed.

I can't recall off hand what addresses that changes. I'll look into the code sometime in the next couple of days and let you know.

Here's a neat little addition that should be a very simple addition to the editor. How the game decides if the character is Yang and how to process Damage from Fight.

The code surrounding it is in my other thread, quite a bit was revealed within. But for the purposes of the editor this should suffice...

In LoRom/HiRom...

$03/9B0D   C9 00   CMP #$06   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Is it Yang's ID?

This is the check for which character is considered to have special considerations when it comes to weapons.

But you could really link this special behavior to anything...

$03/9B06   A0 01 00   LDY #$0001   A:0001   X:FFFF   Y:0024   P:eNvMxdizc - Load 1 into Y.
$03/9B09   B1 80   LDA ($80),y[$7E:2001]   A:0001   X:FFFF   Y:0001   P:envMxdizc - Load Slot's ID.
$03/9B0B   29 0F   AND #$0F   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Get rid of negatives?
$03/9B0D   C9 00   CMP #$06   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Is it Yang's ID?
$03/9B0F   D0 03   BNE $03    [$9B14]   A:0000   X:FFFF   Y:0001   P:envMxdiZC - If not branch to 039B14.

You could have it look at specific weapons, different armors, etc.

Ok so if I understand correctly, what you're talking about here is "which character has martial arts"? What address do I change in the ROM for that? And how does it relate to specific weapons and armors?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on October 30, 2013, 11:07:19 AM


Yeah! I was working on those a while back but got stuck on some details like Golbez etc. so I can't recall off hand how robust or stable that component is at the moment.

As far as I could tell it seemed fully stable to me, I suspect that only that particular formation calls a second AI component. But I might be wrong.


I can't recall off hand what addresses that changes. I'll look into the code sometime in the next couple of days and let you know.

Thanks. Though I can probably just test it and see how it works...

Yeah, I think the hack that Phoenix made only changes the animation for the spells and doesn't touch upon their formulaic basis.

Here's a neat little addition that should be a very simple addition to the editor. How the game decides if the character is Yang and how to process Damage from Fight.

The code surrounding it is in my other thread, quite a bit was revealed within. But for the purposes of the editor this should suffice...

In LoRom/HiRom...

$03/9B0D   C9 00   CMP #$06   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Is it Yang's ID?

This is the check for which character is considered to have special considerations when it comes to weapons.

But you could really link this special behavior to anything...

$03/9B06   A0 01 00   LDY #$0001   A:0001   X:FFFF   Y:0024   P:eNvMxdizc - Load 1 into Y.
$03/9B09   B1 80   LDA ($80),y[$7E:2001]   A:0001   X:FFFF   Y:0001   P:envMxdizc - Load Slot's ID.
$03/9B0B   29 0F   AND #$0F   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Get rid of negatives?
$03/9B0D   C9 06   CMP #$06   A:0000   X:FFFF   Y:0001   P:envMxdiZc - Is it Yang's ID?
$03/9B0F   D0 03   BNE $03    [$9B14]   A:0000   X:FFFF   Y:0001   P:envMxdiZC - If not branch to 039B14.

You could have it look at specific weapons, different armors, etc.

Ok so if I understand correctly, what you're talking about here is "which character has martial arts"? What address do I change in the ROM for that? And how does it relate to specific weapons and armors?

FFIV is a pretty small game and most sequences of bytes that contain relevant information are normally only held once or twice in the coding.  (Granted I screwed up above and instead used my slightly modified code that was there for testing purpose. the C9 00 should be C9 06)

This is located in a 1.1 Rom at 19B06.

Now I've explained this before, but its worth reiterating... a lot of these dealings have very simple to change attributes in this case case it's this...

Code: [Select]
$03/9B06 A0 01 00 LDY #$0001 A:0001 X:FFFF Y:0024 P:eNvMxdizc - Load 1 into Y.
$03/9B09 B1 80 LDA ($80),y[$7E:2001] A:0001 X:FFFF Y:0001 P:envMxdizc - Load Slot's ID.

The 1 loaded into Y loads the data 7E2001 which is Class ID. By changing the 01 to say 30, 31, or 32 (Armor, Helmet, or Gauntlet) and then look for a specific Equipment Piece, freely chosen by the player.

Code: [Select]
$03/9B0B 29 0F AND #$0F A:0000 X:FFFF Y:0001 P:envMxdiZc - Get rid of negatives?
$03/9B0D C9 06 CMP #$06 A:0000 X:FFFF Y:0001 P:envMxdiZc - Is it Yang's ID?
$03/9B0F D0 03 BNE $03    [$9B14] A:0000 X:FFFF Y:0001 P:envMxdiZC - If not branch to 039B14.

C9 06 is pretty blatant but here is where you use the values changed above, you can even make a range of equipment type you want for this.

D0 03 is fully malleable, and can be used as a Lesser/Higher range. By changing it to 90 (BCC) for Below the CMP and B0 for Above the CMP to branch. For example....

Say I wanted to make it look at the Right Hand...

http://rb.thundaga.com/tob/record.txt

Thanks to Yousei's old notes I would just do this then...

Code: [Select]
$03/9B06 A0 33 00 LDY #$0033 A:0001 X:FFFF Y:0024 P:eNvMxdizc - Load 33 into Y (Corresponding to Right Hand Equipment)
$03/9B09 B1 80 LDA ($80),y[$7E:2033] A:0001 X:FFFF Y:0033 P:envMxdizc - Load Right Hand Equipment into A.
$03/9B0B EA NOP A:0016 X:FFFF Y:0033 P:envMxdizc - Null
$03/9B0C EA NOP A:0016 X:FFFF Y:0033 P:envMxdizc - Null (The original "subtract" is detrimental for this.)
$03/9B0D C9 06 CMP #$06 A:0016 X:FFFF Y:0033 P:envMxdizc - Is it CatClaw or Below?
$03/9B0F B0 03 BCS $03    [$9B14] A:0016 X:FFFF Y:0033 P:envMxdizC - If higher than CatClawsbranch to 039B14.
(This would also have the added effect of Kain, if not wearing a shield, to have Martial Arts)

That kind of modification however may be difficult to incorporate into the editor. Though I do believe that there is room for places where the Stat Record can be changed, which I've written at length in my hacking and notes thread.

Boast for one could really use some easy modification in the editor, as can Cry. With the ability to change other stats with them.

Many of the Commands may be edited Freely now. What should power DarkWave's sacrifice? Improving Steal's Hit Rate, Changing what Item Slot (00-03) would Steal take from, Changing the hit rates (and the spell slots themselves) for Comet and Flare for Twin. Sing's Frog Song and what would activate the conditions for Frog Song, and even more. A lot of that isn't too complicated to put into the editor in time, I would imagine, but if you'd like me to find the ROM offsets for many of these, I could do that as well.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 03, 2013, 05:06:48 AM
Version on the Time Cave has been updated. Now actor names match up correctly in battle and the range of out-of-battle usable spells has been added to the "features" editor.

Boast for one could really use some easy modification in the editor, as can Cry. With the ability to change other stats with them.

Many of the Commands may be edited Freely now. What should power DarkWave's sacrifice? Improving Steal's Hit Rate, Changing what Item Slot (00-03) would Steal take from, Changing the hit rates (and the spell slots themselves) for Comet and Flare for Twin. Sing's Frog Song and what would activate the conditions for Frog Song, and even more. A lot of that isn't too complicated to put into the editor in time, I would imagine, but if you'd like me to find the ROM offsets for many of these, I could do that as well.

That would be most helpful! Ideally what would be easiest for me to work with is some kind of organized, itemized table or list of bullet points that say what addresses to change to what values to get what effects/outcomes on the different commands.

Example:

Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 03, 2013, 01:15:26 PM
Wonderful! I'll pick it up now.

Names look to be in perfect working order...

And spell ranges work optimally as well! Now if only Float were before Sight so we could remove that useless spell for good, eh well...

For things like Boast and Cry you should probably refer to the Tower-of-Babil docs explanation for stats.

For example...

Boast (Click on Boast, edit attributes) two options.

One shows Amount to Increase (default 16) second option would be Character Stat that you could probably use a direct copy of the stats from http://rb.thundaga.com/tob/record.txt
(Things to include though is...

2D-2F  unknown

Which are now known as...

2D - Critical Hit chance
2E - Critical Hit Bonus Damage
2F - ?Steal Prevention?

So for default, Boast would read...

Boast - Modified Wisdom - 16

ROM...
0x1ECD0   BD 17 20   LDA $2017,x[$7E:2017]   A:0010   X:0000   Y:0000   P:envMxdiZc - Load User's Modified Wisdom.
0x1ECD3 69 10   ADC #$10   A:0012   X:0000   Y:0000   P:envMxdizc - Add 10 (in hex) to it.


So if someone wants to change Modified Wisdom to Critical Hit Chance for instance...

They would scroll through Edit Attributes until they hit the Critical Hit Chance spot (2D the 20 portion of the address likely should not be touched.) and they change  the amount from 16 to 5.

Cry is a little more special case, there's a reason for that. Instead of having a default number that the game reads to subtract from the monster's Steal Prevention, it instead uses the user's steal prevention and divides it by 2 and effects all monsters through that. So say the player wants to make Cry (sort of, likely not as broken) like it is in FFIV DS (divides enemies Defense by 2)

You could do this...

Default
(Choices)
Cry - Attribute to use /2 - Attribute to effect
         Steal Prevention   -   Steal Prevention
           (202F)                         (202F)

In ROM...

0x1ECF2 BD 2F 20 LDA $202F,x[$7E:202F]   A:0010   X:0000   Y:0000   P:envMxdiZc - Load User's Steal Prevention

0x1ED0B   BD 2F 20   LDA $202F,x[$7E:22AF]   A:0000   X:0280   Y:0000   P:envMxdizC - Load Monster's Steal Prevention.

The reason these are the exact same is because coding in between targets the monster slots explicitly. You could change Cry into another Boast like command or have it effect the entire party, but that would involve some actions  that could not easily be handled by the editor. For now this should suffice.

So I want to change Cry into a form of FFIV DS's version of Cry...

Cry - Attribute to use /2           -      Attribute to Subtract.
         Physical Attack Multiplier  -  Physical Defense Multiplier
           (201B)                                       (2028)


Steal is a bit... trickier to explain, but I see what you mean there. I'll include all of the usable information that could easily be added to the editor.

First, before I got to the easily changeable attributes of it, it is best to go over how Steal is actually formulated...

50 + Level - Target's Steal Prevention = Amount that will be tested against a Random Number (which seems like it can range from 1-255.) - If the end value is over 100 it is an automatic success.

Now from this description we can change... Base Amount to steal, the stat used to determine bonus success and the stat that decreases the amount from success

Now as how this would look in the editor...

Default
(Choices)
Sneak - Edit Formula - Edit Item Slot

Default Hit Rate + Caster Attribute   -    Target's  Attribute
           50                      Level                  Steal Prevention
                                    (2682)                       (272F)
Item Slot
Normal-00

0x1E3F0 - A9 32   LDA #$32   A:0035   X:0000   Y:0000   P:envMxdizc - Load 32 into A (50)
0x1E3F2 - 6D 82 26   ADC $2682  [$7E:2682]   A:0032   X:0000   Y:0000   P:envMxdizc - + Caster's Level.

0x1E3F6 - ED 2F 27   SBC $272F  [$7E:272F]   A:003C   X:0000   Y:0000   P:envMxdizC - - Target's Steal Prevention.

At this point it is worth explaining the difference between Stat Records and Caster/Target records... When mostly any command in FFIV is used, in most cases the stats are copied into...
7E2680 - The Caster's Stats
7E2700 - The Target's Stats.

All this means is that you would need to make a separate index for the stat records that normally start at 00 and make another that starts at 80.

And finally the Item Slot is at...

0x1E456 - BF00 9F0E - Change the 00 to any digit from 00-03 to receive that rank of item when you use Sneak.

Now... say I wanted to make a more Steal-heavy hack and that actual equipment could be earned by stealing and only from stealing...

Sneak - Edit Formula - Edit Item Slot

Default Hit Rate + Caster Attribute   -    Target's  Attribute
           65              Modified  Agility                 Level
                                  (2695)                         (272F)
Item Slot
Mythic-03

And there you go. That's just for a start though. I'm going to stop here for now to see if I'm on the right track for how you want to go about this. If you have any trouble implementing this or understanding the underlying portions of it, please let me know and I will try to fit it to make it easier to work with.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 04, 2013, 01:53:51 PM
Here's something I posted in another topic, but it bears re-iterating...

This is the Event to Play at New Game, so you won't have to cannibalize the normal event every single time you want to test something in a quick manner.
8081 in LoROM (Thank you Dragonsbrethren for the lead in the default items topic)

$00/8081   A9 10   LDA #$10   A:0081   X:21E0   Y:00F0   P:eNVMxdizC - Add 10 to A (Starting Events)
$00/8083   20 63 DF   JSR $DF63  [$00:DF63]   A:0010   X:21E0   Y:00F0   P:enVMxdizC - Jump to Subroutine (Event Dealings)

In Rom this is at...

281 - A9 10 - Starting Event.

This is Exceptionally useful when testing your hack and you don't want to have to rebuild your event library every single time you want to play a normal game. So you no longer need to destroy the main event and (granted there's a Load Map command within) can start the game from any point.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 04, 2013, 01:56:40 PM
And spell ranges work optimally as well! Now if only Float were before Sight so we could remove that useless spell for good, eh well...

I know right? If only there were a way to shuffle around the pointers for what spells had what out-of-battle effects so we could just clump the ones we wanted to keep together and just crop the rest off by narrowing the range...

I for one would be quite happy to dump all those form changing spells for example (maybe keep Frog or something) in favor of more interesting things. Maybe a Demi spell that uses the HP fraction function or heck Haste 2 or Slow 2 or something. This game doesn't even have something as simple as a "Blind" spell... would much rather Blind than Sight  :wink:

And there you go. That's just for a start though. I'm going to stop here for now to see if I'm on the right track for how you want to go about this. If you have any trouble implementing this or understanding the underlying portions of it, please let me know and I will try to fit it to make it easier to work with.

I understand it so far I think. What I was kinda hoping for though is more of a formatting thing. Think of me as like a "nutty professor"; I'm pretty smart, I can usually understand things, but I'm incredibly forgetful. "What stat did 1C mean again? What address do I go to again for Cry's stat reference? I forgot... D:  ...But wait! There's a convenient list of all those things and what they do posted by my most helpful and wonderful friends over at the slickproductions.org forums!" If you were that nutty professor, what would you love to be able to see when you got there? Here's what I'm picturing based on what you mentioned so far:

Boast

Increases Stat by Amount:

Cry

Sets Write Stat to half the value of Read Stat:

Steal

If a random number from 1 to 255 < Base + Bonus Stat - Penalty Stat then steal target's Slot item.

Command X

Brief explanation of what it does, highlighting editable features:

Make sense?

Also don't worry too much about how it would/should look in the editor. Unless you have specific requests, let me worry about the interface.

In any case thanks so much this is great! Again progress will likely be slow as I'm still in the thick of school and such but I'll be poking around with it here and there no doubt.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 04, 2013, 02:29:33 PM
I'll have to poke around and look for those pointers eventually. So far I've had little luck with it, other than finding what seems to cause the events to occur, it still did not make the Sight effect into anything else.

Ah, I understand what you want now, only one correction though...

Cry

Sets Write Stat to half the value of Read Stat:

Should be...

Subtracts Write Stat from half the value of Read Stat:

On the topic of statuses... the only thing that inflicts Blind for the party in the Entire game are the Blind Arrows and by the time you get them there are better options to use, its sort of ridiculous.

Now I did locate how the Out-of-battle Status Healings Items work, not the spells yet, with that knowledge finding the spells status checks (Toad, Pig, Esuna, Float) should not be too difficult to find.

Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 04, 2013, 04:14:52 PM
Hmm, I think I may have noticed a glitch with the auto-battles in the editor. Only the FuSoYa/Golbez ones mind you. At the end of FuSoYa's Zemus battle script White is shown when it should Twin instead. The Zeromus Battle has FuSoYa's second action being Dispel, but that wouldn't make much sense. These oddities also seem to screw up Golbez as well who doesn't use his proper script to end the battles.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 04, 2013, 06:48:56 PM
Is this something that's being reflected in the actual game? Or is it just the editor displaying the information incorrectly? Like, if I save a ROM with FF4kster will FuSoYa now cast Dispel on Zemus instead of Double Meteor?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 04, 2013, 08:38:14 PM
It is indeed reflected, because he never uses Twin to make Zemus die per script, it goes on forever. This also effects Golbez's AI Script in a strange way, causing him to use blank spells or no spells, but he will never use the Crystal on Zeromus.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 05, 2013, 04:18:32 AM
Well, diving into the ROM, the hex code appears to say exactly what the editor says it's saying according to my information.

A004B: 00 07 00 01 00 0B 00 0B FF

00 07 = Cast spell 7 (Slow)
00 01 = Cast spell 1 (Hold)
00 0B = Cast spell 11 (White)
00 0B = Cast spell 11 (White)
FF = End script

A005D: 00 2F 00 0C FF

00 2F = Cast spell 31 (Meteo)
00 0C = Cast spell 12 (Dummy / Dispel)
FF = End script

Unless there's something special about those indexes, it's being parsed correctly.

 :edit: Wait I see what's happening now. It's writing over Golbez' script code. It doesn't know how to read the Golbez scripts and doesn't even acknowledge their existence and just goes ahead and computes what it thinks is the correct place to put the "next" autobattle, which is right over top of where the Golbez script should be. Ok at least I know what to do now.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 05, 2013, 05:04:45 AM
Ah, so it is Golbez who initiates the Twin sequence, the Twin command routine makes that very unclear and says that either can be used to cast W. Meteo.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 05, 2013, 06:33:34 PM

I'll take it slowly, as I don't want to overwhelm you with information, please tell me if this manner looks proper to work with.

Fight

Basic Attack Option, including Elemental Damage, Weak-Creature Resist/Weapon Damage, Status Infliction



Caster's Stat Subtracted from Target's Stat equals Chance to Inflict Status.

Note in Regards to Command: The Elemental/Creature Hits are translated in this manner.

00: Always 1 Damage
01: x1/2 Damage
02: Normal Damage
03: x1.5 Damage
04: x2 Damage
05: x2.5 Damage
06: x3 Damage
07: x3.5 Damage
08: x4 Damage


Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 06, 2013, 03:46:41 AM
Yes it is! Thank you so much!

The elemental hit damage modifier and creature weak to weapon/resist armor addresses all seem to be off by one though (they all point to A9s).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 06, 2013, 10:29:28 AM
Eh heh, yes. That's because that's the start of the Instruction "A9 XX" Load XX into A, is what I was basing off of for the start of it. Not that changing A9 to anything else would ever work on its own without additional hacking.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on November 17, 2013, 06:44:42 PM
 :edit: Aaand you were just talking about the auto-battle Zemus vs. Fusoya and Golbez problem. I guess I should've read before panicking.

So, I once again ask for help--do you guys have any idea what I should do? Because I am doing the last thing I have to do before I release this, which is the final boss and the ending events.

 :edit: Never mind! I fixed it myself!!! :whoa:

You've taught me well, sensei. *bows humbly*
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 17, 2013, 07:45:08 PM
Oh, it's nearly complete? That's fantastic! I'm looking forward to playing this through when you release it.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on November 17, 2013, 07:48:57 PM
Oh, it's nearly complete? That's fantastic! I'm looking forward to playing this through when you release it.
I have to ask--you've seen a bit of my script so far, right? What do you think of it?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 17, 2013, 08:34:46 PM
Heh, embarassingly I just zipped right through the text, mainly so I wouldn't spoil the experience for myself. I do recall some of the ending script and I think Edge's affection for Rydia comes on a little too strong, mainly because the After Years basically says that the two didn't maintain anything but a friendship for the last 17 years. Other than that everything seemed fine as far as I can recall.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on November 17, 2013, 09:00:32 PM
Heh, embarassingly I just zipped right through the text, mainly so I wouldn't spoil the experience for myself. I do recall some of the ending script and I think Edge's affection for Rydia comes on a little too strong, mainly because the After Years basically says that the two didn't maintain anything but a friendship for the last 17 years. Other than that everything seemed fine as far as I can recall.
That's alright; I thought I'd ask since you're the only person who's really been exposed to it, other than some friends who helped me early on in the script.

Regarding the part of Edge's affection for Rydia, I haven't played The After Years, and so Project II doesn't take it into account. I tote the DS / smartphone versions wholly over Project II as the ultimate Final Fantasy IV experience, anyway! It's official and canon, therefore better by default. Project II's script is mostly for those who do want to play a (mostly) uncut version of FFIV for SNES, but don't want to play J2e's mess of a script / hacking job. (A hack-job hacking job? Ha! OK, OK, no more puns from me.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 17, 2013, 09:40:02 PM
Heh, that is well understood. I'll be able to give a more detailed approach when I play through the game itself.
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on November 21, 2013, 11:42:03 AM
Well, diving into the ROM, the hex code appears to say exactly what the editor says it's saying according to my information.

A004B: 00 07 00 01 00 0B 00 0B FF

00 07 = Cast spell 7 (Slow)
00 01 = Cast spell 1 (Hold)
00 0B = Cast spell 11 (White)
00 0B = Cast spell 11 (White)
FF = End script

A005D: 00 2F 00 0C FF

00 2F = Cast spell 31 (Meteo)
00 0C = Cast spell 12 (Dummy / Dispel)
FF = End script

Unless there's something special about those indexes, it's being parsed correctly.

 :edit: Wait I see what's happening now. It's writing over Golbez' script code. It doesn't know how to read the Golbez scripts and doesn't even acknowledge their existence and just goes ahead and computes what it thinks is the correct place to put the "next" autobattle, which is right over top of where the Golbez script should be. Ok at least I know what to do now.


These are 2 part scripts of some sort. The code accesses the last two auto battle scripts in 2 parts separated by a terminator (FF) and stores the first part starting at address $388C, and the second part starting at address $389A. Here's the relevant code:

Code: [Select]
03/8985: B7 80        LDA [$80],Y   ;Load auto battle script
03/8987: 9D 8C 38     STA $388C,X   ;And save
03/898A: C8           INY
03/898B: E8           INX
03/898C: C9 FF        CMP #$FF      ;End of script?
03/898E: D0 F5        BNE $8985     ;No, branch
03/8990: A5 84        LDA $84       ;Script number
03/8992: C9 0C        CMP #$0C      ;Next to last?
03/8994: F0 04        BEQ $899A     ;Yes, branch
03/8996: C9 0E        CMP #$0E      ;Last?
03/8998: D0 15        BNE $89AF     ;No, branch
03/899A: 7B           TDC
03/899B: AA           TAX
03/899C: B7 80        LDA [$80],Y   ;Continue on past the first FF byte
03/899E: 9D 9A 38     STA $389A,X
03/89A1: C8           INY
03/89A2: E8           INX
03/89A3: C9 FF        CMP #$FF      ;Second terminator reached?
03/89A5: D0 F5        BNE $899C     ;No, branch

I believe the script parser is at 03/8ED6 although I haven't gotten to that yet...

 :edit:

My mistake, I believe the parser is at 03/A4E9
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 21, 2013, 03:46:40 PM
Hey Displacer! It has been a while since I've seen you around, welcome back. It seems you have that AI business well in hand.
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on November 23, 2013, 08:36:49 AM
Yea, had a lot going on with that pesky real life stuff.

Unfortunately the power went out yesterday at my house and I've lost 3 days worth of work on this. I've since added a auto backup plugin to notepad++, that will keep it safe from here on but my changes for the last 3 days (and there were a lot) are lost, and it was a lot of work too.

Let that be a lesson for all of you. Get the backup plugin. There is a auto save plugin but seeing how reverse engineering is all about guesses, then verifying them, making changes, then making them again several times, just the auto save may cause you issues too. The auto backup saves individual copies of your work with timestamps so you can go back to any point. The one you want is Autosave2 in the plugin manager. Set the backup directory to a different one than the default directory then you'll have backups of backups, etc.

At any rate I was going to post a whole bunch of findings, but not now :(

Now if you'll excuse me, I'm going to go lay down in a dark corner and cry
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on November 24, 2013, 10:51:24 AM
Hi. Go easy on me this is my first time...

First off: You are all my heroes. I love FF4 and I've picked at it over the years but this site and the editors and research you've done rivals the work of every scientist I've ever worked with.

That said I hope to keep on with my own projects because it's so much fun breathing life anew into this game. Hopefully this is a new contribution and if not please point my noobness in the right direction. I've been working with Yousei's map editor and PinkPuff's (amazing!) program to mess around with the events surrounding Mist; particularly in regard to how it changes the world map. Going from Yousei's  documentation I found:

AC8FA-      (15C6FA-      ) Routine that alters overworld map depending on events

With that in mind I looked at the events (Phoenix rocks!) and found:

FD 04           Play visual effect 04

This is obviously the earthquake cutscene. I wouldn't have thought that in there was the call that changes the overworld and I was right. You can take that call out (and remove the toggle fade to black because that's a counter to a built in fade to black in play VE 4) and the map still changes. It's tied into the later:

F2 0E           Set event flag 0E

This is the kill event for Mist which makes sense and I verified by trial and error and through checking the triggers in ff4kster (last trigger in Mist). That would say to me that just like the Mist trigger there is something in the overworld code that looks for flag 0E but I can't find it. I took a whole sections from AC8FA to B6D53 replacing every 0E with 0D and checking if killing the Mist Dragon changed the map instead: no good.

I'm going to keep looking, because what I want in the end if for the map to change but not into just mountains: I want a pass to run north to south. I'm sure I'll find it eventually through innovation or more likely through time and sheer force of will; but I'm certainly interested to hear any insights people have. Also of note is there is a similar call associated with Event Flag 30 being toggled on/off to set the hole to the underworld - I'm investigating that as well.  :cybez:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 24, 2013, 11:44:52 AM
Hi, LordGarmonde, and welcome. It was only about a year and a half ago that I started posting here. In addition to being a vast storehouse of knowledge on the subject, this is a great place to level-grind ffiv hacking skills by bouncing ideas off of others.

Anyway, this is something I've wondered out loud about before, but haven't actually ever looked into. I don't believe I've ever seen any documentation on changing world map geography, aside of course from actually editing the map (with yousei's or by hand with a hex editor). I'd be interested in seeing what you come up with.

One caveat about the tools you're using: yousei's uses only version 1.0, and FF4Kster is really only fully compatible with v1.1 (specifically, it won't properly modify battle commands and level up data for v1.0, possibly more). Best workaround for this is to make map edits with yousei's, then patch the changes into a 1.1 ROM for use with pretty much any other editing tool.

You might try, by the way: find where in RAM the game loads the current world map data (might be known, I'm not sure), set a breakpoint to one of the tiles that changes with an event, then set and clear the event flag to observe the changes. Hope that helps!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 26, 2013, 04:02:03 AM
Latest update uploaded! I added the Fight parameters but disabled the autobattle editor until I can get it to write (and edit!) the golbez scripts correctly. I know what I have to do in order to accomplish that, I just have to get around to doing it.

First off: You are all my heroes. I love FF4 and I've picked at it over the years but this site and the editors and research you've done rivals the work of every scientist I've ever worked with.

I would just like to echo this sentiment. It's because of everyone's dedication and research that FF4kster was even possible to begin with. The people here really go above and beyond the call of duty and I'm trying my best to compile it all into one neat package. My vision is that this editor will someday be to FF4 what FF Hackster is to FF1.

That said I hope to keep on with my own projects because it's so much fun breathing life anew into this game. Hopefully this is a new contribution and if not please point my noobness in the right direction. I've been working with Yousei's map editor and PinkPuff's (amazing!) program to mess around with the events surrounding Mist; particularly in regard to how it changes the world map.

I hope to someday soon have a map editor incorporated into FF4kster. In fact I think once the autobattles are working I might just take that on as the next component to tackle. (I'll still be doing misc updates with the info found in the wishlist threads as I go of course.)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 26, 2013, 02:14:29 PM
I'm glad to see the information was well worth it! I'll try to add in the other commands since it seems you properly translated this all to the editor!

Looks like all of the Fight Command parameters work flawlessly, that is good news. I wasn't sure if they would translate directly into the editor but they work great! Let's see... next should be the Magic Routine (White/Black/Call/Ninja along with several other commands which end up using it)

But since White/Black/Call/Ninja all use the same format to access spells, it's understandable that they would all have the same parameters.


The important parts in the Magic Routine that can be easily modified is the starting point of Magic and where White Magic (Will based spells) and All Other Magic begins as well as the Magic Animations starting points. Somehow Phoenix tied that to the character at the start of the Magic, I'm not certain... at all... how he managed it.

Magic Routine

Basic Magic Routine which all spells run through including, Type of Magic Animations and Stats Decided For Magic



Note: Now this requires a bit of explanation... 19 is the first Black Magic  Spell, Toad. Which is what the game checks to see if it is outside of White Magic and same is done with Imp and Bahamut respectively.

Secondly the White Magic Casting also looks at Toad (19 again), to see if it should add the +1 to the Address to read Will instead of Wisdom, if it is above Toad it skips this check and goes with Straight Wisdom.

The second address is the Caster's Modified Wisdom +X (if applicable) the X is only used if it read the spell under 19. In ROM this gets bit-flipped and looks like 9726 but is actually the address 2697, Modified Wisdom.


Sorry if its not as concise as the first Fight one was.

 :edit: I missed your first post, sounds like you're onto something LordGarmonde! It will be interesting to see how that all ends up actually working!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 27, 2013, 04:03:10 AM
Updated yet again! This time Boast parameters, as well as the magic ranges in the above post, but they have been put into the Features Editor section rather than the Command Editor. Also I have not incorporated the "stat to cast magic with". If there is significant demand for this feature then I will put it in, after all it is always fun to be able to toy with things and that's what the editor is about anyway, but I've also established a sort of fuzziness with certain things for the sake of reducing the amount of detail the user needs to know about the inner workings of the ROM in order to use FF4kster to achieve the effects they're expecting.

For example, when you change the "Key Items" range, it affects whether they get highlighted as key items, whether they can be dropped, etc. all at once, even though we know how to manipulate all those features indpendently. This is because I'm running under the assumption that, the vast majority of the time, when you want to change something into (or out of) being a key item, you want all those features to change. The white magic animation and white magic stat ranges have been lumped together for the same reason, and unless there is significant demand otherwise I think I'll leave the magic stats alone, especially since they need to be one apart from each other. It would be unlikely to occur to someone that changing white magic to using VIT would cause black magic to change to using AGI as a side effect, and would probably find such behaviour confusing. So, that coupled with the low probability that someone would want to change the magic stats anyway led me to decide to leave that out for now.

I'm glad to see the information was well worth it! I'll try to add in the other commands since it seems you properly translated this all to the editor!

 :childish: I'll eventually be incorporating everything relevant that's been posted here and in the wishlist threads, but it will be bit by bit and in no particular order, just based on what I feel like working on all the time.

Looks like all of the Fight Command parameters work flawlessly, that is good news. I wasn't sure if they would translate directly into the editor but they work great!

Glad to hear it! Hopefully we'll have as much luck with the rest of them!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 27, 2013, 12:41:47 PM
Updated yet again! This time Boast parameters, as well as the magic ranges in the above post, but they have been put into the Features Editor section rather than the Command Editor. Also I have not incorporated the "stat to cast magic with". If there is significant demand for this feature then I will put it in, after all it is always fun to be able to toy with things and that's what the editor is about anyway, but I've also established a sort of fuzziness with certain things for the sake of reducing the amount of detail the user needs to know about the inner workings of the ROM in order to use FF4kster to achieve the effects they're expecting.

For example, when you change the "Key Items" range, it affects whether they get highlighted as key items, whether they can be dropped, etc. all at once, even though we know how to manipulate all those features indpendently. This is because I'm running under the assumption that, the vast majority of the time, when you want to change something into (or out of) being a key item, you want all those features to change. The white magic animation and white magic stat ranges have been lumped together for the same reason, and unless there is significant demand otherwise I think I'll leave the magic stats alone, especially since they need to be one apart from each other. It would be unlikely to occur to someone that changing white magic to using VIT would cause black magic to change to using AGI as a side effect, and would probably find such behaviour confusing. So, that coupled with the low probability that someone would want to change the magic stats anyway led me to decide to leave that out for now.

A new update already? You are on a roll! I'll try to add some more parameters to this post.

Haha, your reasoning behind not changing the magic stat decider is well thought out. It would be too complicated without additional explanations (and it seems so few people read the readme that it could cause problems. Not to mention it seems pretty rare that someone would want to change Magic from Wisdom/Will to... Equipped Weapon, or something rather nonsensical like that in the first place.

Looks like the Magic moving works (though as always I would be a little cautious about changing the Summon range as their animation does cause the characters to vanish and if the right Effect isn't used they won't reappear.) However if you plan on making the "summon" spell- (Imp to summon Imp, etc...) that does work ideally. In fact now that I think on it... what is the issue with casting the Summon Spells on their own?

As for the Boast parameters... I've noticed a bit of a glitch. What you added Sets it to the chosen value rather than Incrementing the existing value. Did you only change the amount and stat parameters? Or was there another thing that was dealt with there? I just tested it on a Clean Rom and it still seems to happen.

Quote
:childish: I'll eventually be incorporating everything relevant that's been posted here and in the wishlist threads, but it will be bit by bit and in no particular order, just based on what I feel like working on all the time.

That's a good way to handle it. That way you don't become so bogged down by forcing yourself to work on an area you may not want to tackle at that moment.

Quote
Glad to hear it! Hopefully we'll have as much luck with the rest of them!

Heh, well aside from Boast's oddities (everything else works right about it. Just the Setting rather than Incrementing portion is the problem) everything in this update works great! Being able to free up the Summon Spells for one can really expand the amount of usable ability slots.

 :edit:

0x1ECD3 69 10   ADC #$10   A:0012   X:0000   Y:0000   P:envMxdizc - Add 10 (in hex) to it. By chance did that 69 somehow get changed? That's the actual "Add to Value" instruction.

 :edit: 2: No, that's not the problem. I just looked it up in a Hex Editor, its untouched, hmm...

Oh! There's the problem! And it's my fault for not being clear enough.

ROM...
0x1ECD0   BD 17 20   LDA $2017,x[$7E:2017]   A:0010   X:0000   Y:0000   P:envMxdiZc - Load User's Modified Wisdom.
0x1ECD3 69 10   ADC #$10   A:0012   X:0000   Y:0000   P:envMxdizc - Add 10 (in hex) to it.

AND ADD...

0x1ECDB   9D 17 20   STA $2017,x[$7E:2017]   A:0022   X:0000   Y:0000   P:eNvMxdizc - Store A in User's Modified Wisdom

I forgot that Crucial step. I'm sorry about that.

What you could actually do with this is load one value (say... Will) and load that onto another Stat + Value. So if someone wanted to make a Caster's Defense Power - Will+5. They couldn't stack it because it would still continue to read from Will.

Again, very sorry for not clarifying the "Store A in..." portion.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 27, 2013, 02:47:20 PM
Grimoire - do you mean what happens if you cast 4D imp instead of 31 imp? They never disappear, and the palette will be wrong, too. I haveno clue why, considering the fact that the party's reappearance s coded into that part of the spell...
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 27, 2013, 03:23:09 PM
That is true, but what isn't coded is the "Summon Orbs" which vanishes the party. (having already past the point of "All Other Spells" in Animations) It seems without a proper appearance/disappearance animation the game may react this way. I don't currently have time at the moment, but try and add the Actual Summon spell to a Magic List after moving the default Summon Orb Animation up into the 4D Imp. That might help explain some things.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 27, 2013, 04:15:44 PM
Ok so in other words, the save routine should additionally write the "stat to increase" byte to 1ECDC, correct?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 27, 2013, 04:34:49 PM
Indeed, that is correct. I need to be more careful with that sort of thing.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 27, 2013, 09:26:54 PM
If I'm not mistaken, the subroutine that makes the summon orbs appear and makes the party disappear is the same one that subtracts 31 and adds 4D to the current subaction. If I'm right about that, then there would still be significant problems... I think this was all done just so Asura could choose from three different spells. What a waste...
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on November 28, 2013, 12:09:53 AM
Indeed I think that was its purpose as quizzical as it is but those instructions are also easily located in my disassembly of the Magic Routine, specifically the -31 portion which would cause the problems in most ordinary situations.
Code: [Select]
$03/E050 C9 3E CMP #$3E A:0033 X:0000 Y:0000 P:eNvMxdizc - Is it Asura?
$03/E052 90 1A BCC $1A    [$E06E] A:0033 X:0000 Y:0000 P:eNvMxdizc - If it is less than Asura branch to 03E06E
------------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------
$03/E06E 38 SEC A:0033 X:0000 Y:0000 P:eNvMxdizc - Set Carry Flag
$03/E06F E9 31 SBC #$31 A:0033 X:0000 Y:0000 P:eNvMxdizC - Subtract 31 from A.
$03/E071 18 CLC A:0002 X:0000 Y:0000 P:envMxdizC - Clear Carry Flag.
$03/E072 69 4D ADC #$4D A:0002 X:0000 Y:0000 P:envMxdizc - Add 4D to A.
$03/E074 8D D2 26 STA $26D2  [$7E:26D2] A:004F X:0000 Y:0000 P:envMxdizc - Store A in Next Action to Take.
$03/E077 EE 84 35 INC $3584  [$7E:3584] A:004F X:0000 Y:0000 P:envMxdizc - +1 to 7E3584.
$03/E07A 60 RTS A:004F X:0000 Y:0000 P:envMxdizc - Return to 03CD33.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 28, 2013, 01:20:13 AM
It would be possible to make more summon spells if you were willing to have only one (nonrandom) Asura, but man, it'd be so much work for the relatively worthless privilege of keeping Imp.
Actually adding entirely new and extra summons into the mix (by expanding the range in either direction) would be extremely complicated because of all of the new pointers, data, etc. you would have to add into the mix, not to mention how the introduction of new pointers would necessarily push the existing sprite and tile data forward, thus rendering the existing pointers invalid... I'm fed up with the process just thinking about it.

The better use of the range info would probably be to decrease the amount of summons in favor of more black or white magic spells...
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on November 29, 2013, 08:37:19 AM
Here we go:
Code: [Select]
Enemy Formation Table (70200-711FF)
Each formation is represented by 8 bytes:

Byte 0:
 Bit 0: ?
 Bit 1: ?
 Bit 2: ?
 Bit 3: Forced Back Attack
 Bit 4: Enemies Have Boss Death
 Bit 5: Monster(s) 3 Begin In Eggs
 Bit 6: Monster(s) 2 Begin In Eggs
 Bit 7: Monster(s) 1 Begin In Eggs

Byte 1: Monster(s) 1 Type

Byte 2: Monster(s) 2 Type

Byte 3: Monster(s) 3 Type

Byte 4: Qty. of Each Monster Type (max 8 altogether)
 Bit 0-1: ?
 Bit 2-3: Monster(s) 3 Qty.
 Bit 4-5: Monster(s) 2 Qty.
 Bit 6-7: Monster(s) 1 Qty.

Byte 5: Preset Monster Arrangement
 -Values 00-91
 -Total qty. of monsters is limited by arrangement

Byte 6:
 Bit 0: Can't Run
 Bit 1: No Game Over (think impossible Dark Elf battle)
 Bits 2-3: Battle Music (Regular/Boss/Fiend/No Change)
 Bit 4: Character Battle (Edward v. Tellah, etc.)
 Bit 5: Auto Battle (not sure where the AI is for these?)
 Bit 6: Floating
 Bit 7: Transparent (Breath, Mind)

Byte 7: ?
The unknown bits and byte seem to be insignificant, or at least not worth changing.

In case anyone's interested, the so-smart-it's-stupid way I traced this: Took two identical files, changed the monster type of group 1 from imp to basilisk (using zyrthofar's editor), created an .ips patch, read the patch with my hex editor to determine the altered location. Voila!

Bits 0-2 of byte 0 are used to load sets of data, a lot of sets. It is used as an offset to load these sets. There are 2 sets of 8 bytes that are loaded first, located at 16/FBAC and 16/FBDC. It is also used to load 2 sets of 4 bytes each. Located at 16/FC0C and 16/FC24. Here is the loading code ($29A4 holds byte 0):

Code: [Select]
02/8ECA: AD A4 29     LDA $29A4
02/8ECD: 29 07        AND #$07
02/8ECF: 0A           ASL
02/8ED0: 0A           ASL
02/8ED1: 48           PHA
02/8ED2: 0A           ASL
02/8ED3: AA           TAX
02/8ED4: 7B           TDC
02/8ED5: A8           TAY
02/8ED6: BF DC FB 16  LDA $16FBDC,X
02/8EDA: 99 CB 6C     STA $6CCB,Y
02/8EDD: BF AC FB 16  LDA $16FBAC,X
02/8EE1: 99 D3 6C     STA $6CD3,Y
02/8EE4: E8           INX
02/8EE5: C8           INY
02/8EE6: C0 08 00     CPY #$0008
02/8EE9: D0 EB        BNE $8ED6
02/8EEB: 7B           TDC
02/8EEC: A8           TAY
02/8EED: 68           PLA
02/8EEE: AA           TAX
02/8EEF: BF 0C FC 16  LDA $16FC0C,X
02/8EF3: 99 DB 6C     STA $6CDB,Y
02/8EF6: BF 24 FC 16  LDA $16FC24,X
02/8EFA: 99 DF 6C     STA $6CDF,Y
02/8EFD: C8           INY
02/8EFE: E8           INX
02/8EFF: C0 04 00     CPY #$0004
02/8F02: D0 EB        BNE $8EEF
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 29, 2013, 01:29:57 PM
Any insight about how the data loaded by those three bits affects the battle?
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on November 29, 2013, 02:06:15 PM
I set a breakpoint at that routine and oddly enough, I've only had it hit once, the battle in mist when Rydia causes the quake, but that's as far as I have save states into the game so it may be used elsewhere as well. It hasn't hit with normal battles, including the one with the mist dragon.

It seems though that it has opened up a whole can of data being used. For instance, some of those data sets are used to access pointers at 0D/FD6D. These are pointers to data sets at 0D/FD89. These are used in sets of 3, each with a FF terminator. I'm wondering if they are for the 3 monster sets in a battle. The Rydia battle uses the first pointer, and the 3 sets it uses are:

Code: [Select]
01 00 FF
03 02 FF
05 04 FF

I have no clue what these are, just guesses at present. Man, those coders sure did like their pointers...

 :edit:

OK, those appear to be graphic positioning data. I would assume top, middle, and bottom. If you change those numbers, rydia's graphic is broken up and moved around.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 29, 2013, 06:35:27 PM
Hmmm... have you tried changing them to, say:
07 06 FF
09 08 FF
0B 0A FF

Just curious...
I'm wondering if this might be sprite arrangement data for PC enemies, which could be cool - you might be able to force a fight with a "weakened" or "casting" PC enemy...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 30, 2013, 03:37:27 AM
What about enemy PCs that change stance during the fight? Such as Kain for example...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 30, 2013, 04:13:05 AM
Excuse the double post, but I just uploaded another update. The problem with Boast has been fixed, and now Cry and Steal parameters have been added.

Enjoy!!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 30, 2013, 08:04:54 AM
What about enemy PCs that change stance during the fight? Such as Kain for example...

Well, with the exception of Edward, I think they all change stance, but in a way that fits the action performed. What I suspect Displacer may have found is the data that dictates the PC enemy's inactive stance.

Actually, while researching monster and summon sprite arrangement, I did come across a block that controls the party's sprite arrangement. I couldn't think of anything really useful to do with it, so I never bothered to mention it. I've got the offset saved in a notepad file somewhere...
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on November 30, 2013, 08:42:34 AM
Updated yet again! This time autobattles are working again (I think!), including Golbez scripts.
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on November 30, 2013, 01:44:24 PM
I'll give those numbers a try, soon as I fine my way back to where they are loaded. This stuff is so convoluted it's easy to get lost
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on November 30, 2013, 05:15:44 PM
OK chillyfeez, here's what I get with those numbers:

Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on November 30, 2013, 10:01:17 PM
Yep, the parry stance - so that's definitely enemy PC sprite arrangement. Only I bet making that change would make every enemy PC appear in parry stance...
So this arrangement is somehow called by those "mystery bits?" That's weird. That it would potentially be a variable indicates some abandoned plan by the battle programmers, I'd suspect.
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on December 01, 2013, 05:38:09 AM
Yea there's a whole ton of sets of data based off those 3 bits. I'm guessing they're all graphics related but since some of the data are actually pointers to other data then it's going to take awhile to sort them all out. Figures, I hate dealing with graphics code but eh, at least it will clear up some of the "unknowns".

So, for the record the PC enemy sprite arrangement data is stored in 2 parts. A set of pointers starting at 0D/FD6D which points to the actual data starting at 0D/FD89 and it looks like there are 14 in all
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 01, 2013, 07:51:27 AM
Huh... That's certainly more than the standard amount of PC battles, and more than the amont of battle stances. Pretty nifty find there.
Title: Re: Developing a comprehensive editor for FF4
Post by: Displacer on December 01, 2013, 01:21:23 PM
Thing is, it uses an offset to load these so I'm betting one of the other sets of data are used to pick a particular stance for each character, meaning there can be more than one for any particular character. I'll track down which data set it is offsetting into to get the stance data.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 01, 2013, 02:39:28 PM
Good work on cracking the use of the three mystery bits there! That they are used to get a character to use proper animation is very interesting and seems that from the picture you've shown you can also make them use other animations.

Great updates to the editor here! Let me see if I can see if everything is working right...

Hmm, now Boast doesn't appear to do anything.

Ah, that's why. Boast for some reason reads an 80 base which places it outside of the User's Data. At base it reads 97 instead of 17. where it should if it's dealing with the User and not the Target (or in this case because its looking directly at the Character's data the use would instead place it in the Next character's data)

Something rather screwy is going on with Cry.

Oh, that's why. Alright, here's what's wrong with this...

The description of it is a little vague...

"Set Target's X to half its X"

It should read something more akin to...

"Subtract Target's X from half of User's Y"

Also again, I wasn't clear with the Store bytes, so changing those two alone wouldn't change anything but the foe's Steal Evade value. Here is what you need to add to that...

0x1EB16 (without header) 9D 2F 20   STA $202F,x[$7E:22AF]   A:0069   X:0280   Y:0000   P:envMxdizC - Store A in Monster's Steal Prevention.

And that should fix that.

Steal as far as I can tell worked flawlessly, taking the new parameters into consideration.

Now the Autobattles look flawless! It only means that if you used the editor with the improper functions you'd just have to change them to their proper functions, but everything looks A-Okay!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 01, 2013, 09:46:34 PM
Thank you for the warm welcome. I'm sorry it took so long to reply; I was very wrong about my workload this week. Anyway here's what I have so far.

You might try, by the way: find where in RAM the game loads the current world map data (might be known, I'm not sure), set a breakpoint to one of the tiles that changes with an event, then set and clear the event flag to observe the changes. Hope that helps!

Good call! The ram offset is known; I found it in Yousei's text file:

   $7F5C71        Beginning of Map data

With that and comparing a snapshot of the RAM before and after I found where the map data is changed for Mist. Looking at the 1.0 ROM what starts as:

$7F92D2:   23 23 23 23 23
$7F93D2   50 16 16 16 16
$7F93D2   03 04 02 03 13

Becomes:

$7F92D2:   13 13 13 13 13
$7F93D2   12 13 13 13 14
$7F93D2   13 13 13 13 13

(Ram Addresses found using Geiger’s SNES9x debugger with Snes9X1.51.ep10r2)

So tracing that back through Assembly I found:

4A/C52D:   AD8112     LDA $1281
4A/C530:   2940       AND #$40
---------------------------------------------
4A/C53A:   A913       LDA #$13
4A/C53C:   9FD25C7F   STA $7F5CD2,X
4A/C540:   9FD35C7F   STA $7F5CD3,X
4A/C544:   9FD45C7F   STA $7F5CD4,X
4A/C548:   9FD55C7F   STA $7F5CD5,X
4A/C54C:   9FD65C7F   STA $7F5CD6,X
---------------------------------------------
4A/C555:   A912       LDA #$12
4A/C557:   9FD25C7F   STA $7F5CD2,X
4A/C55B:   A913       LDA #$13
4A/C55D:   9FD35C7F   STA $7F5CD3,X
4A/C561:   9FD45C7F   STA $7F5CD4,X
4A/C565:   9FD55C7F   STA $7F5CD5,X
4A/C569:   A914       LDA #$14
4A/C56B:   9FD65C7F   STA $7F5CD6,X
---------------------------------------------
4A/C574:   A913       LDA #$13
4A/C576:   9FD25C7F   STA $7F5CD2,X
4A/C57A:   9FD35C7F   STA $7F5CD3,X
4A/C57E:   9FD45C7F   STA $7F5CD4,X
4A/C582:   9FD55C7F   STA $7F5CD5,X
4A/C586:   9FD65C7F   STA $7F5CD6,X

(Disassembled from 1.0 ROM using DisPel)

I checked in the ram to confirm that setting Flag 14 had an associated change from 00 --> 40 and that is then matched against. It appears that the map routine overall works as it would for the world as first seen exiting Baron and then this modification subroutine is called to change the map when and where appropriate. Not far below this set of code is what appears to change the graphics associated with the hole to the underground. I further tested this by hijacking the function call for the modification sub routine and then adding my own. Basically what I did was to change:

--- Main Code ---
((Some Code))
Set Map
Call Map Modification Subroutine
((More Code))

to:

--- Main Code ---
((Some Code))
Set Map
Call My Subroutine
((More Code))

--- My Subroutine ---
Map Modification Subroutine
My Changes
((Return to Main))

From my tinkering this was the safest way; I had many crashes when I was messing around. I ended up using ASMDev (http://www.romhacking.net/utilities/395/) but I had to change the code line by line. Does anyone have a suggestion as to where I could get a good assembler to go with? Ideally, at least given the way I think & program, I would dump the ROM - edit it (so far Notepad++ is working well) and then reassemble. Any helpful hints in this regard would be welcome. It also seems that you all seem to be using a different program for working with the Assembly code (that itself may be the answer for me). If you let me know what you've been using to generate code such as:

0x1EB16 (without header) 9D 2F 20   STA $202F,x[$7E:22AF]   A:0069   X:0280   Y:0000   P:envMxdizC - Store A in Monster's Steal Prevention.

That's what I have as far as Mist and Assembly. I do also have a follow up on FF4kster. 1st off: awesome! I love the new features. :) One thing I did notice, and this is not new for me at least was that in editing the NPC table for the hospital in Toria it shows up as an empty list. The event script appears correct and references characters 0 - 3, but there are no characters listed on the NPC list. I was very excited when I got my first response which included:

One caveat about the tools you're using: yousei's uses only version 1.0, and FF4Kster is really only fully compatible with v1.1 (specifically, it won't properly modify battle commands and level up data for v1.0, possibly more). Best workaround for this is to make map edits with yousei's, then patch the changes into a 1.1 ROM for use with pretty much any other editing tool.

I thought for sure that was my problem; but a test with a clean copy of the 1.1 ROM killed that hope. It's a very minor thing; but just something I noticed and wanted to bring up. I have a suspicion (complete speculation here) that given the accuracy of the rest of the NPC lists that the hospital at Toria is just some exception to the rule; I don't know but it seems that way to me.

That's it from me for now. The next thing I plan to toy around with is pulling equipment off of someone when they leave your party. I'm thinking of perhaps dumping them in the inventory associated with the Fat Chocobo. We shall see.  :wink:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 01, 2013, 10:44:22 PM
Hi again, LordGarmonde. So if I'm reading this right, then you have successfully modified how the world map changes with certain event flags? Cool, nice work!

As far as ASM tools go, ASMdev is the best I've found, and it's not great, just the best of the very few tools out there. I've really only written battle command code, which appears in fairly short blocks of code and tends to use the same opcodes over and over again, so once I got the hang of doing it with ASMdev, I actually switched to just writing assembly in notepad and using this site (http://wiki.superfamicom.org/snes/show/65816+Reference) to help translate it all into code. It's a very long and tedious process that I oddly find very amusing. Anyway, that's my long way of saying that there doesn't seem to be anything better than what you've already found.

Regarding disassemblers, what I've been doing (and based on the outputs Grimoire LD has posted, I'm pretty sure what he's using too) is Geiger's SNES9x Debugger. What's nice about using Geiger's to disassemble is that - because it's emulating the ROM at the same time - it "understands" the context of the disassembly (for instance, knows which 16-bit flags are set at the time). Also, you can disassemble an op at a time in real time in order to see how the registers and accumulator change as the code is executed.

Quote
One thing I did notice, and this is not new for me at least was that in editing the NPC table for the hospital in Troia it shows up as an empty list. The event script appears correct and references characters 0 - 3, but there are no characters listed on the NPC list.

I puzzled over this one for a while. If I remember correctly, the Troia hospital uses an NPC set from another location (somewhere else in Troia, I think). If you choose to edit map properties with FF4Kster, and view the Troia Hospital, I think you'll find your answer.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 02, 2013, 06:03:57 AM
I do also have a follow up on FF4kster. 1st off: awesome! I love the new features. :) One thing I did notice, and this is not new for me at least was that in editing the NPC table for the hospital in Toria it shows up as an empty list. The event script appears correct and references characters 0 - 3, but there are no characters listed on the NPC list. I was very excited when I got my first response which included:

Thanks! Glad you're enjoying it! And yeah, the NPC sets of some of the maps are messed up; that's not an issue with the editor, that's actually how they're stored in the ROM. There are a lot of things about this game that are coded/stored strangely, some of which are easier to hide from the user than others.

Anyway now that the autobattle editor is finished and seems to be working correctly, I thought I'd give people a heads up as to my plan of attack for the near future:
Of course I still have school stuff left to work on, exams coming up in a couple of weeks, and so that combined with the fact that this is another fairly hefty component means that progress will likely be slow and not all that visible. Hopefully though it will be well worth the wait because having that functionality integrated into FF4kster instead of having to use external programs will greatly improve efficiency of rom hacking.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 02, 2013, 04:36:06 PM
Thanks! Glad you're enjoying it! And yeah, the NPC sets of some of the maps are messed up; that's not an issue with the editor, that's actually how they're stored in the ROM. There are a lot of things about this game that are coded/stored strangely, some of which are easier to hide from the user than others.

Well of course I'm enjoying it. I too come from the old gang of Game Genie dreamers. I remember years ago thinking I'd have to do things just with a hex editor before I found all this information out there. It was then that I took my "first step into a larger world."  This editor, the site and all the other tools I've found are a dream come true for me. :happy:

I'm also glad that I bet right. (With myself at least) I had my money on you and FF4kster; as I said your editor is right way-way too often for it to be an accident so I blamed the ROM - it had to be some kind of exception.  :finger:

I don't have much in the way of overworld triggers to add but I did mess around with the call for the Damcyan bombing. What I found was first the call checking if the flag for the bombing (Flag 20) is set:

4A/C504:   AD8212             LDA $1282
4A/C507:   2910                 AND #$10

& the code that stores the status of that flag (& others):

40/6F42:   A63D                LDX $3D
40/6F44:   1D8012             ORA $1280,X
40/6F47:   9D8012             STA $1280,X

Where the above are from a 1.0 ROM with DisPel's Offsetting - Geiger's Output for the last line being:

$00/F147 9D 80 12    STA $1280,x[$00:1282]   A:0010 X:0002 Y:0000

This is also applicable for storing the flag for Mist (Flag 14 @ $1281). Curiously the Mist flag is set to check against #$40 whereas the Damcyan flag is matched against #$10 - but I'll say (for now at least) that there is a method to their madness. The punch line is that like the Mist flag the Damcyan flag seems to be referenced at every loading - but I still don't know how it knows that at X:119 Y:62 to call the event code for Damcyan if Flag 20 is not set. I'm still investigating this but I didn't think it would hurt to share what I have so far. Good luck!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 02, 2013, 10:59:30 PM
Very good finds LordGarmonde! I believe Chillyfeez actually located that missing piece a while back. The Trigger events for the Overworld are not in the editor yet, but Chillyfeez figured them out quite some time ago.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 02, 2013, 11:57:37 PM
Very good finds LordGarmonde! I believe Chillyfeez actually located that missing piece a while back. The Trigger events for the Overworld are not in the editor yet, but Chillyfeez figured them out quite some time ago.

Good deal; thanks Grimoire! I think I found the post here: http://slickproductions.org/forum/index.php?topic=1769.0 (Nice work Chillyfeez!)

I'll definitely make use of this. I had been thinking about reworking the ship at Fabul; or more specifically hijacking the event call for my own twisted means.  :laugh:

I was thinking instead of of physically boarding the ship instead setting things up so you go talk to Sheila and she gives you the Yes/No about leaving - and then from there having it load the ship/good bye scene - leaving the actual world map trigger free and clear. (Thoughts?) Of course I'll just need to remember to not have it removed by the event flag; I'm writing in the post now so I won't forget later!  :finger:

I was going through some of the older posts (and how I missed that one from Chillyfeez: "the world may never know") and I've come to the conclusion that you & Chillyfeez are both black belts in Assembly. I was wondering if either of you (or anyone of course!) have any suggestions as to blank spots in the code that are good or bad for writing in a subroutine? The one I wrote for Mist (my first Assembly routine ever!) is as follows:

0000:FAD9 22 04 80 1D  jsl 1D8004   (Originally jsl 15C6FA - replaced with my call)

-- My Code --

001D:8004 22 FA C6 15  jsl 15C6FA   (First execute the original modification routine)
001D:8008 AD 81 12      lda 1281      (Check For Mist Flag)
001D:800B 29 40           and #40      ($1281 = 40 => Set)
001D:800D F0 0E           beq 801D    (If Yes - Execute my code, Else Return)
001D:800F A9 01           lda #01      (Load New Tile Value #01 Chosen for Testing)
001D:8011 8F D4 92 7F  sta 7F92D4  (Overwrite address with new value)
001D:8015 8F D4 93 7F  sta 7F93D4  (Overwrite address with new value)
001D:8019 8F D4 94 7F  sta 7F94D4  (Overwrite address with new value)
001D:801D 6B               rtl              (Return Long)

So as you can see it replaces the original subroutine call with one way out in the middle of nowhere - then runs the code as originally written after which my changes are tacked on. As expected there was a slight delay when called - it's quite the trip - but it does its job. I haven't gone into the ROM too much to see where the dead-zones are but I'm happy to hear anything y'all have to tell me. My ambition (bar set high for me) is to strip equipment before character departure; in my mind at least I feel it may be frustrating to play a hack that changes the character line up as well as the joining/leaving times. But that's probably a ways off; there are other things to explore in the meantime. Until then let me say looking back at some of your earlier posts: you guys are good! :cycle:

Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 03, 2013, 05:01:22 PM
That is a good idea with Fabul's ship, but also keep in mind that Chillyfeez found that there's entrances to the Tower of Babil on the Overworld, they could probably also be replaced to use another event.

Chillyfeez is probably more talented than me. My skills are more about recording, observing, and identifying than they are anything else. Granted I can make a good ASM hack or two.

I've never had any luck finding empty space, (granted I've never really looked) but I do know that Chillyfeez has found some areas that are vacant.

I forgot to mention that I love your idea to put the equipment of leaving characters into the Fat Chocobo Storage as it feels much more legitimate than losing that equipment forever and it also doesn't run the risk of filling up your own inventory.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 03, 2013, 07:00:55 PM
Aw, shucks, you guys...
But seriously, that goes back to what I said earlier about this being a great forum to bounce around ideas and grow ROM hacking skill.
When I decided about a year and a half ago that I would try hacking FFIV, my only ROM hacking experience was a graphical mod of the original Zelda I did about fifteen years ago (now lost in time). I had no clue the things we're doing now were even possible, let alone the fact that I would be discovering new ways to do them.
That being said, wait til you see the latest evil genius piece of crazy I've been cooking up. I'm working on a playable preview of my "big project," now that I've got the characters all created and a working idea of the full plot, it seems like the next logical step - who knows when I'll actually finish the whole thing, but there's a bunch of stuff I'm doing that I want to showcase. Primarily, I've sort of made the battle system my bitch, including new commands to replace some of the more useless old ones, and... character-specific limit breaks.
I'm still probably a few weeks away from where it's polished enough to post, so if I seem less active you'll know why... also, this is the busy season for me at work, so that isn't helping to move things along.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 03, 2013, 08:22:49 PM
Now this sounds like a great Mod Chillyfeez! I can't wait to hear more information about this!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 03, 2013, 08:55:16 PM
Now this sounds like a great Mod Chillyfeez! I can't wait to hear more information about this!

Seconded!  :terrydia:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 07, 2013, 05:25:12 AM
Something rather screwy is going on with Cry.

Oh, that's why. Alright, here's what's wrong with this...

The description of it is a little vague...

"Set Target's X to half its X"

It should read something more akin to...

"Subtract Target's X from half of User's Y"

Also again, I wasn't clear with the Store bytes, so changing those two alone wouldn't change anything but the foe's Steal Evade value. Here is what you need to add to that...

0x1EB16 (without header) 9D 2F 20   STA $202F,x[$7E:22AF]   A:0069   X:0280   Y:0000   P:envMxdizC - Store A in Monster's Steal Prevention.

And that should fix that.

I'm afraid I'm more confused now than I was before...

"Subtract target's X from half of user's Y" doesn't make any logical sense to me. It almost sounds like "User.Y = (User.Y / 2) - Target.X" but that can't be right... surely it's the target's stat value that's being changed here right? So it should be Target.X = something. For example, could you mean this:

Target.X = Target.X - (User.Y / 2)

So something like "Subtract half of User's Y from Target's X"?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 07, 2013, 09:40:15 PM
Yes, the way you have put in Target's X = Target's X - (User's Y/2) is a much more readable way to read it.  Eh heh, sorry syntax of this sort isn't really a strength of mine.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 08, 2013, 03:34:02 AM
Yes, the way you have put in Target's X = Target's X - (User's Y/2) is a much more readable way to read it.  Eh heh, sorry syntax of this sort isn't really a strength of mine.

Not a problem. I can usually get what you mean, just English can be a bit ambiguous by its very nature sometimes. With mathematics there's usually only one way to interpret it. ^_^

Anyway, updated again with fixes to Boast and Cry.

Next step is reading/displaying tile graphics. I have to revisit all those graphics tutorials again now, because it's been that long since I did anything graphic related...  :blits:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 08, 2013, 11:32:49 AM
Tiles and Graphics, oy that sounds like a tricky portion to implement. Unfortunately when it comes to graphical representations I can't make much heads or tails of it. Chillyfeez might know a bit more about it though.

Hmm, Boast is still screwed up and still writes to the Slot of the Character that immediately is after the User. Did you change it from a base 80 back to 00?  80 is only meant to be used if its being written to the 2680-2780 portion of RAM (commands generally don't use that unless they're accessing Magic or Fight Routines) and that's only when its hitting a target rather than self in such a case.

Also it seems the options for Cry are completely gone in this version.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 08, 2013, 04:18:02 PM
Tiles and Graphics, oy that sounds like a tricky portion to implement. Unfortunately when it comes to graphical representations I can't make much heads or tails of it. Chillyfeez might know a bit more about it though.
I've done quite a bit of messing around with the game's graphics, so I'm pretty familiar with where graphical data is located and how to manipulate Tile Layer to edit the data, but if you need info on how SNES interprets graphical data, that's a bit outside my scope of knowledge. Still, if there's anything I can help with, as always lemme know.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 08, 2013, 07:07:32 PM
Hmm, Boast is still screwed up and still writes to the Slot of the Character that immediately is after the User. Did you change it from a base 80 back to 00?  80 is only meant to be used if its being written to the 2680-2780 portion of RAM (commands generally don't use that unless they're accessing Magic or Fight Routines) and that's only when its hitting a target rather than self in such a case.

Also it seems the options for Cry are completely gone in this version.

Cry has options on mine. I suspect I may have compiled the executable for the Windows version and forgotten to add it to the zip. Try it again now and let me know if the problems persist.

I've done quite a bit of messing around with the game's graphics, so I'm pretty familiar with where graphical data is located and how to manipulate Tile Layer to edit the data, but if you need info on how SNES interprets graphical data, that's a bit outside my scope of knowledge. Still, if there's anything I can help with, as always lemme know.

Yeah I need to refresh myself on how to interpret palette and graphical data. I know where to go to get that information (after all that's how it's reading the font and menu graphics) but it may take some time and experimenting to get myself reacquainted. I'm not planning on making the tile graphics editable from within FF4kster, but I would definitely like it to display the tiles. That way you can see what tile it is you're editing as opposed to some kind of text description like "upper left corner castle wall tile" or something... also it will be absolutely vital to read and display the tile graphics correctly when it comes time for the actual map editor; the user needs to see what the map looks like in-game as they edit it. Which is another reason I want it to be read directly from the ROM. That way if you change the tile graphics in something like Tile Layer, the changes will be reflected in FF4kster and you won't have to just remember what old tile your new tile corresponds to and try to imagine what it looks like, as you would if you did that with something like FF4Tools.

Additionally, if I can make a generic enough function, I might be able to add graphics to other editor components as well such as previewing NPCs with correct palettes, or more ambitiously, preview weapon attack animations with their proper graphics and palettes, likewise for spells, and even monster graphics.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 08, 2013, 08:13:44 PM
Yep, that appears to have been the problem with Boast, hmm... there's still something wrong with Cry. As in, it doesn't appear to change anything outside the usual. Hmm... oh I see. That is using an "80" for the first argument when it should be using "00" and adding from that. So it was reading (Character after Porom in battle formation) Palom's Atk Power which is 6 and half of that is 3 which subtracted from the Imp's Defense (which is 10) and was placed into their Steal Evade value.

Ah, seems you forgot to change that "save Value to..." to also match (or be a separate entry) the value that is originally being subtracted. This is located at 0x1EB16 9D 2F 20 (Save value to 202F in Monster's Data) in a non-headered ROM.

Very ambitious plans in mind, indeed!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 08, 2013, 09:35:49 PM
I was just thinking the other day that it would be nice to be able to preview NPCs. Can't wait!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 10, 2013, 03:50:23 AM
Ah, seems you forgot to change that "save Value to..." to also match (or be a separate entry) the value that is originally being subtracted. This is located at 0x1EB16 9D 2F 20 (Save value to 202F in Monster's Data) in a non-headered ROM.

I didn't forget, it absolutely was writing to that address. However, it turns out that address was incorrect; it was off by exactly 200. Are you using an unheadered rom by any chance?  :wink:

Anyway I fixed those and uploaded again. Hopefully this time I got it all right. Might be a good idea to refresh any roms that were saved using the previous version (that, or go into a hex editor and fix 1EB17 back to whatever it should be).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 10, 2013, 04:43:55 AM
Indeed, the ROM I use is unheadered (I thought unheadered and non-headered were the same thing. A mistaken assumption?) that should do the trick!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 10, 2013, 12:05:00 PM
...

They do mean the same thing, I just can't read apparently...  :isuck:

Anyway it's finally working correctly now I take it?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 11, 2013, 10:58:42 AM
Indeed! It is finally working. Hard work and perseverance brings reward, as they say. I will post more command mods when I have the time, but I've been feeling ill lately and finals are... well actually they're here so it will be a little bit of time before I can get back to helping implementing those.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 14, 2013, 11:54:34 AM
Well I made it through finals...finally. I hope everyone else is fairing alright. But on to better things. I've been thinking about my intention to strip party members as they depart. I had a few ideas with regard to how to handle it; the easiest of which would be to use the storage capacity of the Fat Chocobo. I had even thought of extending that further to allow for a completely separate storage for gear - maybe even dual functioning Namingway - Storingway does have a bit of a ring to it. That of course led me into where exactly I planned to save this data. I found a post from  the long-long ago with some spaces in the rom to work with, so routines wouldn't be such a problem to work in now:

Per request from Leno...

Unused space (offsets with header):

7F31 = 623 BYTES
E055 = 1195 BYTES
10135 = 203 BYTES
181BE = 66 BYTES
1F3FB = 133 BYTES
200E3 = 285 BYTES
23B4C = 124 BYTES
23DD0 = 1072 BYTES
43AB9 = 1863 BYTES
5FF58 = 680 BYTES

*stopped here, that should be enough for now

The problem, of course, is SRAM: Not going to find much in there - and even if I did I'd never trust it through an entire play-through; even if I watched it the whole time. So given that I started thinking of How much I would need to store in SRAM vs what I could recalculate as needed. My first thought was to go through the event list and see what I could do-away with - hopefully at least freeing up some flags; if it came down to it I could always try playing games where you use a single index to store a bound double index. When my brain takes me on trips like that I usually end up:  :eek: I was actually starting to think about events when I decided to go back a look through some other posts to see if anyone else came up against this. I found a very handy list of events put together by this guy who is really-really modest about his ASM cataloging:  :wink:

...Since it seems that we're getting into the nitty gritty of the game's system. I think I'll list a number of non-essential events that can be safely replaced which are not important to the story as well as sprites that bear little on the game. I will also list their Trigger number and location for touch events.

Behemoth Battle 51 (Trigger 4 in Bahamut's Cave 2F)
Behemoth Battle 52 (Trigger 1 in Bahamut's Cave Bahamut's Floor)
Hummingways
Namingway
OUCH!
Cecil's Maid
Item Selection - Soft
Finding Odin before Feymarch (Trigger 1 in Baron Castle Odin's Room)
Devil's Road is sealed  (Trigger 2 in Baron Devil's Road)
Staying at a 50 GP Inn (You could honestly only have one, all same  have the screen go black, let the music play and reappear in front of Innkeeper the rest of it is just little niceties which aren't really necessary)
Staying at a 800 GP Inn
The current is too strong for us to get in! (Not necessary)
Giott: Open the Door! (I don't believe this is even used in its normal event)
Fallen soldier in Damcyan's basement (sad, but not necessary)
Staying at a 100 GP Inn
WA! (Not sure where this is even used)
Being poisoned by bartender in Mysidia (Mysidia events, while amusing, aren't necessary)
Staying at a 200 GP Inn
Speaking to White Mage in Mysidia
Being turned into a Toad by a Black Mage
Resting for free in Fabul (Trigger 3 in Fabul King's Room) (The Cecil bed can be used for that)
Staying at a 400 GP Inn
HP Restoring Pot
MP Restoring Pot
Being turned Mini in Baron's Classroom
Staying at a 1600 GP Inn
Staying at a 3200 GP Inn
Staying at a 6400 GP Inn
Staying at a 12800 GP Inn
Baron Dancer's Dance
Kaipo Dancer's Dance
Fabul Dancer's Dance
Agart Dancer's Dance
Mysidia Dancer's Dance
Baron Dancer's Dancer after killing Cagnazzo
Mythril 3 Dancer's Dance
Toroia Dance Troupe's Dance
Dwarf Castle Dancer's Dance
Reading the Magazine
Obtaining the Magazine
Obtaining a Grimoire 6C
Obtaining a Grimoire 6D
Trading the Pink Tail for Adamant Armor
Do you have a pass?
Watery Pass - North exiting message (Trigger 7 in Watery Pass 5F)
Behemoth Battle 50 (Trigger 0 in Bahamut's Cave Bahamut's Floor)
Obtaining a Grimoire 91
Viewing the Moon through the telescope

There may be a few more, but that should free up quite an amount of new events for people to use.

Seriously, way to go Grimoire! I mean that list was nothin' compared to all the routines you picked out and deciphered. I was going through those posts all  :childish: about it and then I hit your homemade recipes for FF-I spells and I was like  :omg:

ok: Fanboy-set to off. But yeah color me impressed - and that's not to forget about Chillyfeez, Pinkpuff, or anyone not mentioned: all of you :happy:

Anyway - here's what I've got to contribute for now. I was looking back at the shadow data posts from Phoenix a few years back. I was intrigued by the approach taken there, cutting out unnecessarily stored data; but knowing that he had some trouble and my still being a noob I was thinking about more simplified approach. I've attached a few tables I put together for reference: they show every party formation that I could think of (please correct as necessary) and I was thinking through what shadow slots would be occupied as the game progressed. What occurred to me (and this has been discussed before) was that all five slots really needn't ever be occupied with one exception after leaving Fabul. It's there that all the slots are occupied, the next one that is loaded shortly thereafter is Tellah on Mt. Ordeal: technically Tellah (2) to be swapped out almost immediately for Tellah (3): the fully charged model. My idea (probably simpler than this post) is to load Tellah into the party after Rosa is taken, before the doomed sea-voyage. I had thought that I might be able to hide him, similar to Rydia in the Fabul battles; but thinking that those were specific battle setups that would be impractical.

I did think of one thing. When I first started thinking about hacking years ago the first thing I looked at in FF4 was the data for the party and I found that setting the first bit to 00 would remove the character from the party - but in function only: all the other data stayed where it was as if they never left -  and you could even swap the position of the ghost and it would swap the data as if it were anyone else. Then just changing the bit back made it look as if it never happened. But that's my plan: when Rosa leaves take Tellah(1)'s data out of Shadow Slot 1 (I labeled it S:1 in my table w/ Tellah(1) = 04) and put it in the empty space Rosa left behind. While doing that nullify the first byte and it shouldn't show up.

Looking into it more that's what happens in the Fabul battles - leaving the RAM open reveals that Rydia's first byte is set to 00 as each battle starts and then goes back to her default of 83. Actually looking into it more I found out that the the old data for a character isn't removed even if copied to a shadow slot - instead that byte is zeroed out and the rest of the data remains until overwritten. So in a list what I plan is:

Fabul Battles - Rosa Departs

~~Copy S:1 --> Rosa's Slot Overwriting her Data
~~Set 1st Byte of Copied Data to Zero

Shipwreck

-Copy Rydia --> S:4
~~Copy Yang --> S:1 (instead of S:3)
-Rydia, Yang, and Edward are removed


Mysidia (Speak with Elder to Trigger Events) **

~~Set Tellah Byte to 84
-Palom & Porom Join
~~Set Tellah Byte to 00

** This is just a safety check - it makes sure Tellah doesn't lose overwrite-roulette
      It should be fine if Tellah is either in the 4th or 5th slot

Mt. Ordeal

- Fire/Golbez Cutscene
~~Meet up with Tellah & Set Tellah Byte to 8A in place of "Join Event"


- All Other Events Normal
~~ Must Change Loading for Yang (2) with S:1 instead of S:3


This should leave S:3 blank the entire game - 64 bytes that as far as I can tell should never be touched. I figure this should be pretty easy to pull off, but that might just be my sleep deprived deliria talking...The Tellah copies should work as a straight-forward routine, and remapping Yang 1 & 2 should be just a few keystrokes in FF4kster!  :wink:

That's it for now  :sleep: Let me know what y'all think; sorry if any of this is redundant information. Please feel free to point me towards any relevant posts I may have missed. Thanks everyone!

Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 14, 2013, 02:35:55 PM
Wow - inspired! I don't think I'd ever heard of that before, that not only does zeroing out the first byte make the character invisible, but the game actually uses that trick.
Nice going!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 14, 2013, 06:38:48 PM

I know right - I got a major LOL out of that one  :happy:

I had an idea - extending my last one - part of it thanks to you!

Bear in mind, you're not taking over Mist, Valvalis and Kainazzo's monsters in these examples, you're taking over their image arrangements.

That got me thinking about using that same concept elsewhere to reuse space; character code vs graphics references. For (probably the best) example, I took Edward and swapped out his first two bytes (well...FF4kster did it for me  :cookie: for Pinkpuff!) - to make him Edge - as I had hoped (because otherwise major  :wtf:) everything was fine with him, battle and menu wise but the idea I was testing was how it would effect other appearances of Edward.

I didn't change the NPC calls and since they are not tied to the actual characters (for the most part - which is still kind of weird to me :P) Edward appeared in scenes as he was expected to. He was still a Spoony Bard - no trouble in that battle.

Next I made sure he got yanked out of the party correctly without screwing things up down the road - quick glance ahead supports a yes - so good-good

Specifically - I skipped ahead to the end of the game. As an aside - I often test things by loading a saved game (at various points/parties) with the PAR code to call the Great Whale from the map - that way I can easily get anywhere quickly, more or less - and for Zeromus I actually converted a trigger in Bahamut's cave to send me there. What do you use for testing - I'd think along the same lines but I'm curious. Also, I have been able to load Zemus' lair right from Baron ("Wait - you told me this was Cid's house!") but I've noticed jumping worlds sometimes lead to formation call problems - turns out that they did mean it when they numbered the worlds - but that's the reason why I always fly Whale-Way-Express.

Anyway I wanted to check to make sure the end still played - it did. He was in the Prayer Tower, and he appeared with Tellah so that I would believe in myself - though that wasn't enough the first time because I forgot to bring Paladin Cecil which leads to a dead party against Zeromus  :isuck: But he appeared with Tellah - loading the Edward battle sprite. This was the one I was actually concerned over because I knew it was an enemy spell that corresponded the ghost calls and I wasn't sure where it pulled from.

So the last test to see if I could make something out of this was to replace the battle sprite code for Edward with someone else (I picked Palom) - I thought for sure I'd get to the battle and Palom would be standing behind Tellah - nope still Edward!  :childish:

So now I've got Edward loaded with pointers to Edge and his Battle data is overwritten with the data from Palom without adverse effect. So, in my mind, I could theoretically drop a new set of code over Edward's, and then have this New-ward join the party later after Edward leaves - he should load his initial info, which has now changed, and Edward himself can keep lying in that bed - with no worry of him not showing up on cue at prayer-time.  :terrydia:

It may be a way to shuffle things around to add new characters. My first thought there would be to add the newbie (let's say RacerX) in place of Edge's code while Edge is elsewhere in the ROM and transferred over Edward after he leaves the party - or something along these lines. I haven't gone through it completely - I just skipped around - but in my mind it should work. I'll work that out completely at some point and patch the ROM to make sure that I can get through the game at some point meeting RacerX and not missing Edward cheering for me in the final fight. I'm curious to hear what everyone thinks  - and please point out any visible logic short-circuits; but if this whole thing works I think there'd be some good to come of it.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 14, 2013, 07:28:55 PM
A little more about swapping out character data. I looked at the RAM map over on Datacrystal (http://datacrystal.romhacking.net/wiki/Final_Fantasy_IV:RAM_map)

The following 64-byte memory blocks contain out-of-battle character data:

7E1000: Center Character
7E1040: Upper Character
7E1080: Lower Character
7E10C0: Center-up Character
7E1100: Center-low Character

The following 128-byte memory blocks contain in-battle character data:

7E2000: Center Character
7E2080: Upper Character
7E2100: Lower Character
7E2180: Center-up Character
7E2200: Center-low Character

Use the following offsets to gather information about each character:

+0: Character identifier. Read this modulo 64 - the 2 most significant bits appear to be flags. Known values are:
1: Cecil (Dark Knight)
2: Kain (beginning of game)
3: Young Rydia
4: Tellah (pre-Damycam)
5: Gilbert
6: Rosa (pre-Fabul)
7: Yang (pre-Baron)
8: Palom
9: Porom
10: Tellah (pre-Paladin)
11: Cecil (Paladin)
12: Tellah (post-Paladin)
13: Yang (post-Baron)
14: Cid
15: Kain (pre-Sealed Cave)
16: Rosa (final)
17: Rydia (final)
18: Edge
19: FuSoYa
20: Kain (final)
+2: Level.
+3: Status flags. (4 bytes)
+7: Current HP. (2 bytes)
+9: Max HP. (2 bytes)
+11: Current MP. (2 bytes)
+13: Max MP. (2 bytes)
+16 through +47: Various stats (Strength, Agility, etc.)
+48: Head equipment slot
+49: Body equipment slot
+50: Arms equipment slot
+51: Right hand equipment slot
+52: ???
+53: Left hand equipment slot

That goes along nicely with my other post. That would provide insight into how one could vary battle data. Also, I checked it out and those addresses do work (unheadered 1.1 rom) - but it doesn't update changes until going into a battle. Likewise here zeroing the first byte removes the character from the lineup and they do not return after the battle (just as taking them out of the field will also have them removed from battles). Just a little more food for thought.  :finger:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 15, 2013, 01:41:07 AM
I usually use the White Chocobo to force a location or event (by editing the White Choc event using FF4kster). If you load a map within an event instead of from a "warp point (I.e. a door or stairs)," there tends to be less of a problem for the game figuring out whether you're in the Overworld, Underworld or Moon.

I'm a little unclear about your RacerX - does/will he have his own set of graphics? If so, where will they be stored in ROM, and how will the game know to load them?

+51: Right hand equipment slot
+52: ???
+53: Left hand equipment slot

I think that "???" is right hand equipment quantity, for arrows.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 15, 2013, 02:52:20 AM
White Chocobo - nice!  You've also helped shed light on something I ran into when testing some events a few weeks back: I had changed the Devil's Road in Baron to send me to the moon, which at times had problems - but I was using the soldier in that room as my way to play-test an event in the underground - which had no problems loading the map down there (Giott's crystal room to be exact). So yeah - now I know to watch for that: Thanks Chillyfeez!

As for RacerX:     Yes...

    - Oh, you want me to actually follow up, don't you?   :relom:


What I had in mind was to store the graphics data somewhere in the ROM (that's really as far as I went on that ATM) and then when the time comes call some assembly routine (to be programmed later) to overwrite Edward's data. My thinking is that only changing his actual data but still referencing him in the game as an actually character will (hopefully) avoid unforseen issues in calculations down-the-road. This seems to be a much safer (and easier) alternative to my attempting to try and mimic a character's functionality by writing subroutines to reference new areas of data - which was my Plan A but I had to bag that on account of being insane for me to try - Though I'm learning I'd say I've only recently graduated to no longer needing training wheels on my bike - however, that sort of ASM attack, like trying to go from bike to jetliner, is probably beyond me. That's me, though...were attempts to be made others might fare better.  :wink:

I did think of one problem: RacerX may be limited to Edward's battle commands - or similarly he may not be able to cast magic from the menu: I don't know how that's controlled - does just having spells in the spell list allow you get past "Cannnot Use" - or it could be as (I'm thinking about it) both in and out of battle magic use is tied into what commands are available - hence Edge having Ninja listed under magic in the menu. But on the other-other hand there's is a separate location for the spell lists themselves and the the game expects Edge to have magic, so he does.  :hmm:   - Thoughts?

I'll have to look into that one. But my first line of defense there would be to start off working with alternative versions of known characters: Tellah (2) is barely used - it wouldn't take too much tweaking to change all the events that key off of Tellah (2) and make them look instead for Tellah (1) - In fact, I think it's just in the Mirror room - and even there it should only be one event action: dropping Tellah (2) as a party member. Using my proposed trick of bringing Tellah(1) back early, hiding him and then going from him to Tellah(3) I could potentially squeeze a new character out of Tellah(2). But I know they don't have the multiple copies of his graphics - so all three would be trying to access the same code - but that's along the same line as Edward - once Tellah is gone from the PC line-up I should be free to drop new code in his place.

That brings me to an Assembly question: If I were to write a simple loop to move a character's data from some dead-zone in the ROM to replace an old character - how noticeable do you think that would be? If I go low-brow and just straight up loop through 64 bytes of non-battle data + 128 bytes of battle data + incidentals I haven't thought of - I feel like I can't just sneak that call in just anywhere - it'd be PlayStation battle loading in Chronicles all over again...What do you think?

...and if you were thinking: "Man this guy just keeps on going..." - you'd be correct; so full credit for that answer   :tongue:
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 15, 2013, 03:03:09 AM
...and in all that I forgot to reply to the last bit:

  I think you're absolutely right about it being quantity - And though not listed I'm sure left-hand quantity is after left-hand in the battle code just as it is in field code. That was going to be something I was thinking about changing if I ever tried full shadowing.

Since there aren't any unused locations of RAM (that I know of), I knew I had to fit as many characters' stat data within this 64 x 5 = 320 bytes of data that I could. Ideally, this would be 14, because there are 14 character classes and sets of sprites (not including Golbez and Anna, who don't have complete sets). In order to do this, I needed to store only the absolutely essential stats of a character, removing non-essential stats like modified strength/agility/vitality, hit percentage, attack statuses, etc. I call these "non-essential" because they can be calculated from a character's base stats and equipment data.

Looking at the data, I pared the stat list down to: character id (1 byte), class id (1), level (1), max HP (2), max MP (2), base str/agil/vit/wis/will (5), helmet (1), armor (1), gauntlet (1), right-hand weapon (2), left-hand weapon (2), and experience (3). This adds up to 22 essential bytes per character. Finally, I divided the 320-byte block by 22, and lo and behold there's room for 320/22 = 14.54 characters. It's like it was fated to be.

I like that approach - and since I would hope that you can't have arrows in both hands (does the game allow that??) that you really only need one quantity byte for the two hands to share (and a little extra code to assign it properly when read). Of course, that's the kind of shortcut that works on paper but then gets me in the end. I feel like doing stuff like that I'll be looking at a crashed game someday thinking "What were the odds the boy was going to look in the vegetable crisper?"
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 15, 2013, 06:12:09 AM
I did think of one problem: RacerX may be limited to Edward's battle commands - or similarly he may not be able to cast magic from the menu: I don't know how that's controlled - does just having spells in the spell list allow you get past "Cannnot Use" - or it could be as (I'm thinking about it) both in and out of battle magic use is tied into what commands are available - hence Edge having Ninja listed under magic in the menu. But on the other-other hand there's is a separate location for the spell lists themselves and the the game expects Edge to have magic, so he does.  :hmm:   - Thoughts?

You can use FF4kster to edit this (that is if I'm understanding your question correctly):

Edit Jobs -> Select the person's job (e.g. Bard) -> "Edit spell list links" -> Set white, black, and/or call to whatever spell lists you want.

They will be the same list in battle and in the menu. I may at some point add functionality to have them be separate but for now I'm assuming most people would want and expect them to be the same. The magic will be accessible from the menu and such (so you won't need to worry about "cannot use"). It does not currently allow you to change the text that overwrites "Black" with "Ninja" for Edge, but that will probably come in time as well.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 15, 2013, 07:32:38 AM
Do you see how easy that instruction to change spell links is? – 100% Amazing – I mean it when I say had I not come upon your editor I’d probably not even be into this at all other than dreaming and maybe some hex futzing. I remember first looking into this long ago and being frustrated that I couldn’t mix and match battle commands - Not a problem anymore!  :happy:

As for my extended character roster scheme I was thinking as follows:


Playthrough as usual up through losing Edward

With Edward not coming back call ASM routine to overwrite Edward’s data (graphical at least)

Meet RacerX which would correspond to “Add Edward” – but he would look like a new character


That’s the plan in a nutshell – but in this scheme I’d have to then make sure either the Job pointer is also changed or I also change what “Bard” corresponds to in terms of available commands – otherwise RacerX will have “Sing” & “Hide”

Really, though, I think that whole plan with overwriting data of no-longer needed characters may be too involved – in fact I’m pretty sure that I’m overthinking it – I do that. :P

What I’m thinking I'll do is what I was saying with Tellah and repurpose multiple copies. As I understand it now you get Kain (1) (for 5 seconds) and then he’s gone for a while – but because you met him and he’s still a shadow he is going up in level to match. What happens if I meet Kain (2) in Baron and then meet Kain (2) again as normal in the Tower of Zot – I’m going to find out as soon as I post this but I still want to get your perspective on that. The two Kains would still be pointing to a lot of the same things but I still want to see what's going on behind that curtain.

Oh yeah – 10" of snow outside today - I think it’s time to do some more experimenting.  :cybez:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 15, 2013, 09:19:15 AM
The biggest hangup I foresee for the RacerX plan would be that I'm not sure if it's known how the game determines where to look for a character's graphics. There's probably a set of pointers somewhere. Assuming you find those (should be possible given enough time), is there enough empty space in ROM that can actually be pointed to? The nice thing about pointers is that you can be all over the map with them, so to speak. The not-so-nice thing about pointers is that the "map" is only 8000 (hex) or FFFF bytes long, depending on where in ROM they point to, which is not a whole lot in terms of graphical data.
This is all theorhetical, but assuming pointers are used, and you can find them, then it's only a short trip to finding how they're used (it's usually a simple calculation like x + pointer = data location). It might then be possible to change x in order to point to a latger empty bank. Of course, you'd have to rewrite all of the other characters' graphics into that bank, too.
I don't have a lot of time to do stuff these days - I've even had to put my own stuff on hold - but I'll be interested to see what you come up with.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 15, 2013, 06:11:57 PM
Finally! The flu is gone (or mostly so) and finals are now over. All that is on my plate is work, I am fine with that.

Now this is an Incredibly ambitious plan you have set up here LordGarmonde. I am still a little hazy on the RacerX proof of concept. Is it supposed to show that you can have a character be replaced in function but not in story role in order to free up that data? Because you can. The Sprite designations for NPC's and Party (Leader) is a very different thing. One that I've looked at, but came up blank. There is one thing that troubled me with this and its exceptionally troubling when you may plan on using a character outside of Dark Knight/Paladin Cecil as the main character.

That problem is in some cases when a cutscene ends (or in some cases, during) the game will default to either 00 Dark Knight or the 0B Paladin (I have no idea what makes this differentiation) for the displayed graphic. Everything else is completely fine in changing.

Also great find with how the "single character", "exclude character" battles work! I never realized that their ID Byte was written to 00 for those fights.


Though if you want to test something event-wise Immediately at a new game, you would change...

In Unheadered Rom this is at...

281 - A9 10 - Starting Event.

With this also you won't have to erase the second Longest event in the game which is the Starting Events.

Also about my ASM work... I was really glad that I managed to include all (most) of FFI's formulas and was building a patch, but FFIV's system doesn't really allow a lot of it to be too useful without a Heavy overwrite of the basic battle system, which might be worth it. Though one thing that did upset me was my inability to pinpoint the Level Up Random Bonuses that I had planned to utilize from the earliest levels to the end.


For PinkPuff -

Now that we have everything worked out with the current commands, I can post some information for other command implementations... (As before, they are in a non-headered ROM)

Dark Wave

Dark Knight's Hit-All Attack Option, includes Value Loss 1/8 (Yes/No), What Value to decrease by 1/8 (See Kick for more info.)



Note: The Value Loss looks at two values. The first is Max HP, 2009 (or 0920 as it will appear)  the second address looks at Current HP 2007, and the last one is Save to Current HP 2007. The "Yes/No? option would NOP the instructions at 1E9FF with EAEAEA to make sure nothing is subtracted. It is also important to note that Dark Wave's formula flows right into Kick.

------------------------------------------------------------

Kick

Yang's Hit-All Attack Option, includes Damage /2 for Kick (Yes/No?), What values will be used by Kick (and Dark Wave), Value Resisting Dark Wave (On/Off) and Creature Type which Nullifies Kick & Dark Wave

I tried to do something a little nicer, but I kept the old "Note" format above and this version which includes the descriptions underneath the main line. Please let me know which method you prefer.

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 16, 2013, 05:25:36 AM
I tried to do something a little nicer, but I kept the old "Note" format above and this version which includes the descriptions underneath the main line. Please let me know which method you prefer.

Actually neither TBH ^_^; I prefer the note being in the preamble. Right now it's just listing the variables, then the list directly below lists them again. The point of the preamble was to establish the meaning of all the variables (what they do, how they interact with each other, etc. to create the effect of the command), then you can just have the list below that specify the addresses. If those variables take values that aren't obvious, they should be listed indented under that variable's description. So what I would prefer would be something more like:

Dark Wave

Deal an attack to all enemies. Then, if Stat Loss Enabled, subtract 1/8 of Read Stat from Write Stat.

Also you may notice I converted the addresses to those of a headered rom; this to help prevent the likely scenario where I forget to convert these (or forget that I have to convert them) such as what happened recently.

Do you see how easy that instruction to change spell links is? – 100% Amazing – I mean it when I say had I not come upon your editor I’d probably not even be into this at all other than dreaming and maybe some hex futzing. I remember first looking into this long ago and being frustrated that I couldn’t mix and match battle commands - Not a problem anymore!  :happy:

 :childish: Thanks! Glad to hear it's useful.

That’s the plan in a nutshell – but in this scheme I’d have to then make sure either the Job pointer is also changed or I also change what “Bard” corresponds to in terms of available commands – otherwise RacerX will have “Sing” & “Hide”

Actually commands go by actor, not job. You can have two different Edwards with two different sets of commands; this is how, for example, Tellah loses Recall.

Just go into the actor editor and mess with the commands and you should be able to get what you're trying to achieve.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 16, 2013, 02:35:10 PM
Ahem... I somehow completely forgot about that. Hehe, my apologies. Then I will rewrite these using what you have listed here.

Dark Wave

Deal an attack to all enemies. Then, if Stat Loss Enabled, subtract 1/8 of Read Stat from Write Stat.

Kick

Deal an attack to all enemies using Read Stat and Read Stat and Variable including Read Stat which resists Dark Wave and the Read Stat which nullifies Kick and Dark Wave.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 16, 2013, 06:01:16 PM
Is that better, or is there still room for improvement?

Well, yes to both ^_^;

There isn't anything special about the word "read stat" or "write stat"; I was just using those as variable names. When naming variables, it is important that each variable have a unique name. So, if you use Read Stat for the name of a variable then you shouldn't call any other variables Read Stat, even if they're also being read (that's beside the point). The name can be anything you like (Foo, Bar, etc) but generally it's better to have names that relate to the function/purpose of the variable. In the case of Dark Wave, you have one stat that's being used as part of a division calculation but not actually modified so that's why I chose the name "Read Stat" for it. The other value is being modified so I called it "Write Stat" for that reason. They could just as easily have been called "Stat 1" and "Stat 2", though those wouldn't have been very helpful names.

The list of two addresses after Write Stat in the Dark Wave example meant that when that value changes, it changes two different addresses in memory (to the same value). In other words, if Write Stat (Current HP by default) were to get the value 2F (Steal Evade), then 2F would be written to both 1EBFB and 1EC00. For the kick example, it looks like several addresses are listed together that all take different values. So I would have imagined something more like this:

Kick

Deal a group physical attack with damage equal to Multiplier Stat * Base Stat. If Half Damage Enabled, divide the damage by 2. Resist Race monsters resist it and Immune Race monsters are immune to it.

Basically, you should be able to read it as a regular sentence when you replace the variable names with their values. If they all have their default values, the sentence would read in such a way that it describes the default behaviour of the command.

Am I making any sense?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 16, 2013, 06:30:46 PM
Ah yes, I think I have it now. That makes a lot more sense than what I posted, heh.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 17, 2013, 08:50:03 PM
Hey everyone,

Actually Chillyfeez it's double-theoretical because I'm pretty sure I'd never actually use this anyway. It is my opinion that this game, while amazing, has too many playable characters. I always feel like Edward and Cid were just NPCs that you got to control for a while - I never felt like they were part of the core. It's also possible that I'm writing this as a 28-year old cynic who has played this game so often that I wore out the battery in my FF2 cart. I might just feel that way now because of how quickly I can move the game along. Anyway it's still an interesting puzzle to work on and since puzzles hook me every time I'm sure I'll be back around this way again. Should I add another character, I imagine it will be at someone's expense - but I think that I'd endeavor to try and keep everyone + 1.

But in fairness I do think I will write a patch to free up one shadow slot - it will be nice to have a bit of room to play with if I want to save any data. (more inventory space, for example - goes with equipment stripping) It's nice that isn't too complicated, just a few code changes and a bit of my own. My plan with adding in new characters was way more involved - basically (in my mind) patching the game while you are playing so the whole patch would need to already be in the ROM and then called when needed. It'd certainly be a challenge.

Also, Grimoire - what you were saying about Cecil: when it is looking for the Dark Knight vs when it needs the Paladin  :wtf:

I looked into that before too - total fail. My answer to that is "Perhaps another day, but not today." Hopefully it won't come up (for me at least) anyway - I don't plan on ever having Cecil not be my main man; one of the things I love most about this game is the solid story, well established. Having freedom in games is nice, but it's harder to write around that.

Though if you want to test something event-wise Immediately at a new game, you would change...

In Unheadered Rom this is at...

281 - A9 10 - Starting Event.

- Very nice! That does speed things up in a much more consistent way - usually I'd load a save state outside a town (or whatever) and then walk in knowing the game won't load the map until I enter - so if I load a given from a savestate that actually came from a different version of the ROM then usually the game is none-the-wiser...usually - so yeah changing the starting event call: Good deal  :childish:

One thing though - 281 is the Headered Address - I found it at 81 in my Unheadered 1.1 ROM  :tongue:

That's it for now, I guess. Pinkpuff pointed out the Job/Actor discrepancy - my mistake, failed use of nomenclature on my part - sorry if anyone got confused by that.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 17, 2013, 08:58:09 PM
Oh Grimoire I did think of something else - regarding your FFI spell routines, I could see Temper working - in my head it's got the advantage of Berserk without losing control - probably not granting the speed benefit would balance it out and make the two spells less overlapping.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 18, 2013, 04:09:54 PM
I just came across this old post:

When you fight Golbez, you "start" losing control of your own characters because of Hold Gas. I hadn't really thought it through before, but if you want the Hold Gas to not be effective.. you want to cast Mute/Silence on yourself. Since Mute status has a priority over Hold, it has no power over you. How's this useful? Well, it allows Cecil get ready his ATB bar while he does his scripted speech stuff... allowing you to revive other party members or get an early shot at Golbez.

I just went though that battle (with LV 99 characters so no speed trouble) - and yep absolutely right. I knew about that sort of priority selection/exclusion - always fun to wear a confusion-preventative head-band to negate Bad-Breath. My question (apologies if this was already answered) is I feel like I read that resistance bits are factored in when damage (etc.) routines are called; but is that universal, or is there a way to change that? Since I started thinking of the game from a programming stand point I've been thinking of things like: "Should I mix and match Fire/Ice Shields/Armor?" Looking at Deathlike's killer FAQ I found:

FF4A (GBA)
Immunity > Weakness > Absorb/Resistance
FF2/4/4ET (SNES)
Weakness > Immunity > Absorb/Resistance

But I was just wondering how much this has been investigated. It's just something that popped into mind.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on December 19, 2013, 09:38:18 AM
I discovered a problem. The first magic called upon for Sing gets its byte, A9, changed to 2F somehow if you open a ROM and save it in FF4kster.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 19, 2013, 12:55:51 PM
Eh heh, yes I was mistaken on that I should have said headered Rom. I'm not sure how I keep on confusing those two.

Advantage of Berserk without losing control? Hmm...

That's a difficult idea to set up. Here is the relevant data from the normal battle code...

Code: [Select]
$03/C6C4 8E 02 39 STX $3902  [$7E:3902] A:0028 X:0028 Y:0000 P:envMxdizC - Place the Attack Base 7E3902.
$03/C6C7 AD 84 26 LDA $2684  [$7E:2684] A:0028 X:0028 Y:0000 P:envMxdizC - Load Status Anomalies (Byte 2) from Caster's Data Copy into A.
$03/C6CA 29 04 AND #$04 A:0000 X:0028 Y:0000 P:envMxdiZC - Is the Status Berserk?
$03/C6CC F0 19 BEQ $19    [$C6E7] A:0000 X:0028 Y:0000 P:envMxdiZC - If not Jump to 03C6E7.
---------------------------------------------------------------------------------------------------------------------
03/C6CE 86 A9 STX $A9    [$00:00A9] A:0004 X:0028 Y:0000 P:envMxdizC - Store the X 0028 for later.
$03/C6D0 46 AA LSR $AA    [$00:00AA] A:0004 X:0028 Y:0000 P:envMxdizC - divide the value in AA by 2.
$03/C6D2 66 A9 ROR $A9    [$00:00A9] A:0004 X:0028 Y:0000 P:envMxdiZc - divide the value in A9 by 2
$03/C6D4 18 CLC A:0004 X:0028 Y:0000 P:envMxdizc - Clear Z Flag
$03/C6D5 AD 02 39 LDA $3902  [$7E:3902] A:0004 X:0028 Y:0000 P:envMxdizc - Load A from 7E3902
$03/C6D8 65 A9 ADC $A9    [$00:00A9] A:0028 X:0028 Y:0000 P:envMxdizc - Add the value from 00A9
$03/C6DA 8D 02 39 STA $3902  [$7E:3902] A:003C X:0028 Y:0000 P:envMxdizc - Store the new value in 7E3902
$03/C6DD AD 03 39 LDA $3903  [$7E:3903] A:003C X:0028 Y:0000 P:envMxdizc - Load A from 7E3903
$03/C6E0 65 AA ADC $AA    [$00:00AA] A:0000 X:0028 Y:0000 P:envMxdiZc - Add the value from 00AA
$03/C6E2 8D 03 39 STA $3903  [$7E:3903] A:0000 X:0028 Y:0000 P:envMxdiZc - Store the new value in 7E3903 (Berserk therefore gains 1 1/2 xdamage as DeathLike theorized)
$03/C6E5 80 0D BRA $0D    [$C6F4] A:0000 X:0028 Y:0000 P:envMxdiZc - Branch Always to 03C6F4...

Now the game looks at a Status to make this occur. That alone is easy enough to change, but that would make the Berserk status not do anything but lose control (which I guess could be interesting on its own). If this is placed into a custom formula there might be a way to make it work...

It seems *pretty sure* that Steal Prevention doesn't do anything for characters, so you could tie a value that this formula writes to "Steal Prevention" and have the game look at that for its 1 1/2x Power rather than the Berserk status. That would be the easy way to deal with it.

If I were to modify Temper to make it more inline with FFIV, I think what I would do is take Target's Wisdom*2 + X = new Attack Power. That way it couldn't be continually increased and it would remain useful the entire game through. I do agree though that the best way to balance all stat+ skills in this game are to use % increments. As the way the game is currently set up it seems like it can be too easily askewed out of balance.

Now resistance/drain/immune/ have been covered at some length in my ASM logs in the normal sense it looks at status immune bytes, see what is inflicted, and decides from there. I cannot explain why Silence protects from Golbez's Hold Gas... let me check that formula... No, nothing that I can see why it works that way in the formula.

The Elemental dealings are covered pretty well in their respective areas. Even formulas that you wouldn't expect to have Elemental Ability have things in place.

Code: [Select]
$03/C658 AD 99 26 LDA $2699  [$7E:2699] A:0002 X:0300 Y:0000 P:envMxdizC - Load A from Caster's Attack Elemental Copy Data.
$03/C65B 8D 00 36 STA $3600  [$7E:3600] A:0008 X:0300 Y:0000 P:envMxdizC - Store A in 7E3600.
$03/C65E 2D 21 27 AND $2721  [$7E:2721] A:0008 X:0300 Y:0000 P:envMxdizC - Check the value of A against the Target's Very Weak Elemental.
$03/C661 F0 07 BEQ $07    [$C66A] A:0000 X:0300 Y:0000 P:envMxdiZC - Branch if there is no match to 03C66A.
--------------------------------------------------------------------------------------------------------------------------------
$03/C663 A9 08 LDA #$08 A:0008 X:0400 Y:0000 P:envMxdizC - Load a 08 into A.
$03/C665 8D FE 38 STA $38FE  [$7E:38FE] A:0008 X:0400 Y:0000 P:envMxdizC - Store A in 7E38FE (Presumably a data altering field - x4 Power)
$03/C668 80 2B BRA $2B    [$C695] A:0008 X:0400 Y:0000 P:envMxdizC - Always Branch to 7EC695.
--------------------------------------------------------------------------------------------------------------------------------
$03/C66A AD 99 26 LDA $2699  [$7E:2699] A:0000 X:0300 Y:0000 P:envMxdiZC - Load Caster's Attack Elemental from Data Copy into A.
$03/C66D 2D 20 27 AND $2720  [$7E:2720] A:0008 X:0400 Y:0000 P:envMxdizC - Check the value of A against the Target's Elemental Weakness.
$03/C670 F0 07 BEQ $07    [$C679] A:0008 X:0400 Y:0000 P:envMxdizC - Branch if there is no match to 03C66A.
-------------------------------------------------------------------------------------------------------------------------------
$03/C672 A9 04 LDA #$04 A:0008 X:0400 Y:0000 P:envMxdizC - Load 04 into A.
$03/C674 8D FE 38 STA $38FE  [$7E:38FE] A:0004 X:0400 Y:0000 P:envMxdizC Store it at 38FE (x2 Power)
$03/C677 80 1C BRA $1C    [$C695] A:0004 X:0400 Y:0000 P:envMxdizC - Always Branch to 03C695.
---------------------------------------------------------------------------------------------------------------------------------
$03/C679 AD 99 26 LDA $2699  [$7E:2699] A:0000 X:0000 Y:0000 P:envMxdiZC - Load Caster's Elemental Attack from Data Copy into A.
$03/C67C 2D 26 27 AND $2726  [$7E:2726] A:0000 X:0000 Y:0000 P:envMxdiZC - Check it against Target's Elemental Immunity.
$03/C67F F0 07 BEQ $07    [$C688] A:0000 X:0000 Y:0000 P:envMxdiZC - Branch if there is no match to 03C688.
----------------------------------------------------------------------------------------------------------------------------------
$03/C681 A9 00 LDA #$00 A:0008 X:0400 Y:0000 P:envMxdizC - Load 00 into A.
$03/C683 8D FE 38 STA $38FE  [$7E:38FE] A:0000 X:0400 Y:0000 P:envMxdiZC - Store A in 38FE (x0 Power=1 Damage no matter what)
$03/C686 80 0D BRA $0D    [$C695] A:0000 X:0400 Y:0000 P:envMxdiZC - Branch to 03C695.
------------------------------------------------------------------------------------------------------------------------------------
$03/C688 AD 99 26 LDA $2699  [$7E:2699] A:0000 X:0400 Y:0000 P:envMxdiZC - Load A from Caster's Elemental Attack Data in Data Copy.
$03/C68B 2D 25 27 AND $2725  [$7E:2725] A:0008 X:0400 Y:0000 P:envMxdizC - Check it against the Target's Resistance Byte in Data Copy.
$03/C68E F0 05 BEQ $05    [$C695] A:0008 X:0400 Y:0000 P:envMxdizC - Branch to 03C695 if there is no match.
-------------------------------------------------------------------------------------------------------------------------------------
$03/C690 A9 01 LDA #$01 A:0008 X:0400 Y:0000 P:envMxdizC - Load 01 into A.
$03/C692 8D FE 38 STA $38FE  [$7E:38FE] A:0001 X:0400 Y:0000 P:envMxdizC Store it in a damage altering field (x1 (1/2) Power

So it goes as DeathLike2 said...

Very Weak/Weakness/Immune/Resistance/Creature Type Weakness/Resisting Creature Type/Absorb (handled at the very end of those dealings)

Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on December 19, 2013, 01:59:56 PM
Actually, you could also mess with the ASM to take away the control loss that comes with berserk status. That's part of the same coding that initiates auto-hide, I believe. I've never tried it , but I am pretty sure it can be done.
Fun little tidbit - if you add Hide status, but keep the character on-screen, you get controllable invincible characters! That's part of one of my upcoming limit skills.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 19, 2013, 05:20:06 PM
It seems *pretty sure* that Steal Prevention doesn't do anything for characters, so you could tie a value that this formula writes to "Steal Prevention" and have the game look at that for its 1 1/2x Power rather than the Berserk status. That would be the easy way to deal with it.

That's the way I was thinking about it too; set up some dummy flag to be able to check against for easier code altering. Another spell I was thinking about was Hastaga - I changed Haste to be forced to target everyone (and technically the spell was originally Sight) just to see if the game had any trouble. Everything was fine - as suspected: some enemies can split Haste - but they have a special algorithm to do so right: "Perform Special Monster Technique" - Anyway, what I was kicking around there was to make it cost 99, and take a good time to cast rather than go one by one - because I find often that's what Rosa's spending her time doing when not healing - which is not unreasonable for a White Mage. I was wondering if that made sense to anyone else or is it just me being lazy?  :tongue:

That's pretty nifty about Hiding + Not Hiding = Invincible - Do they have all the same targeting rules as if they were anyone else; what happens if they are hit: "Miss" I'd think as if trying to attack 1st form Zeromus. But yeah, very intersting; I'm excited to see what you are cooking up. I just came due for a new mod to play as it happens since I just finished Project II.  :yabin:

" Rosa: Lunarians
  Fusoya: Yes...
  Edge: This is insane!"

I feel like I'd have the exact same reaction if I was in that situation.  :tongue: Nice mod vivify93! It was very enjoyable. I'm also in agreement about the use of Theodor - a "nice touch" as HCBailly might say.  :wink:

Also something over on you Project II thread gave me an idea related to what I had been sketching out about repurposing characters to add new people to the game:

Any reason Tellah and FuSoYa can't both be Sages?

Any reason why they can't share a Level-Up table? I wonder if it would make any sense to cap Tellah @ 45 (I could imagine writing the ASM hook to deal with that) and then from 50 onwards for FuSoYa - just a thought  :hmm:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 19, 2013, 05:32:47 PM
Any chance we can keep the discussion here about FF4kster? Not that it isn't interesting stuff, just, if it's not related, maybe it could use its own thread...

I discovered a problem. The first magic called upon for Sing gets its byte, A9, changed to 2F somehow if you open a ROM and save it in FF4kster.

Interesting, I'll look into this soon.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 19, 2013, 07:45:30 PM
I would say good chance Pinkpuff; it's already done  :tongue:

Nothing critical just something I noticed earlier today: in editing messages there are the six sub-headings Bank 1-3, Battle, Alerts, & Statuses (as you know) - but when they display they show different list lengths:

Bank 1: Shows 10 entries on screen

Bank 2: Shows 8 (But they are drawing from location so that might be it)

Bank 3: Shows 55 which bottoms out my list with the edge of the window
   Then Battle & Alerts are the same as Bank 3: All the way to the bottom

Like I said, nothing vital just a bit of inconsistency that I just noticed after my last post
Title: Re: Developing a comprehensive editor for FF4
Post by: Deathlike2 on December 20, 2013, 01:52:59 AM
I just came across this old post:

When you fight Golbez, you "start" losing control of your own characters because of Hold Gas. I hadn't really thought it through before, but if you want the Hold Gas to not be effective.. you want to cast Mute/Silence on yourself. Since Mute status has a priority over Hold, it has no power over you. How's this useful? Well, it allows Cecil get ready his ATB bar while he does his scripted speech stuff... allowing you to revive other party members or get an early shot at Golbez.

I personally have forgotten a lot of stuff that I've said.  :tongue:

Quote
I just went though that battle (with LV 99 characters so no speed trouble) - and yep absolutely right. I knew about that sort of priority selection/exclusion - always fun to wear a confusion-preventative head-band to negate Bad-Breath. My question (apologies if this was already answered) is I feel like I read that resistance bits are factored in when damage (etc.) routines are called; but is that universal, or is there a way to change that? Since I started thinking of the game from a programming stand point I've been thinking of things like: "Should I mix and match Fire/Ice Shields/Armor?" Looking at Deathlike's killer FAQ I found:

FF4A (GBA)
Immunity > Weakness > Absorb/Resistance
FF2/4/4ET (SNES)
Weakness > Immunity > Absorb/Resistance

But I was just wondering how much this has been investigated. It's just something that popped into mind.

I think in LD's code dump of the attack algos (both physical+magical) has explained it. It's in one of the bigger code dump threads.

Although, my GBA analysis could be wrong in the sense that they "fixed" physical elemental weaknesses in the armor this making immunity kinda irrelevant.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 20, 2013, 03:38:04 AM
Nothing critical just something I noticed earlier today: in editing messages there are the six sub-headings Bank 1-3, Battle, Alerts, & Statuses (as you know) - but when they display they show different list lengths:

Bank 1: Shows 10 entries on screen

Bank 2: Shows 8 (But they are drawing from location so that might be it)

Bank 3: Shows 55 which bottoms out my list with the edge of the window
   Then Battle & Alerts are the same as Bank 3: All the way to the bottom

Like I said, nothing vital just a bit of inconsistency that I just noticed after my last post

Oh yeah I forgot about that. I just tried changing Bank 1's menu to go to the bottom of the screen and it seems to run just fine.

My general rule for menu lengths (at least for those side menus) is the full length of the list, or as many will fit on the screen, whichever is lesser. For Bank 2, it will only list as many as there are for the selected map since there are so few, but for Bank 3 it will show as many as will fit on the screen since there are so many. The list of maps in the Bank 2 editor would fill up the entire screen if it followed this rule so I made it sort of a top menu and limited its size to something reasonable for the given screen space.

What was going on with Bank 1 was that at one point in history the menus were being coded in an inefficient and wasteful way and I didn't notice it until I think the monster editor when someone pointed out the huge memory leak that was happening (which happened to be mostly due to something else but the menus were partly responsible as well). Anyway, due to the inefficiencies, the Bank 1 menu was being super slow when it filled the screen, but for some reason, limiting it to a few entries (10 was picked arbitrarily) seemed to alleviate the problem enough that it was usable. Anyway now it seems as though having it go all the way to the bottom no longer causes slowdown. I have yet to test it on Windows (I use Ubuntu as my main platform) but if there aren't any issues there either this will be fixed in the next upload.

 :edit:
I discovered a problem. The first magic called upon for Sing gets its byte, A9, changed to 2F somehow if you open a ROM and save it in FF4kster.

Interesting, I'll look into this soon.

This isn't happening for me. Anyone else?

Incidentally the only bytes read or written by FF4kster for Sing are the spell indexes, none of which are A9 by default.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 20, 2013, 11:21:31 AM
Hmm, I just tested this and saw no issue. The first default Song was still "Nothing Happened" the second default one was Song of Silence, then Song of Charm, and Lullaby. There was no issue that I saw with an A9 becoming 2F.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on December 20, 2013, 10:40:10 PM
It had happened for me every time I changed the Nothing Happened song to do something, I think.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 20, 2013, 11:10:44 PM
I just tested that and changed it to Hold and saw no issues. Hmm, I don't know what could be causing that.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 21, 2013, 04:57:04 AM
Did you make any changes to the commands via anything else besides FF4kster (patches, hex editor, etc)?
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on December 21, 2013, 10:04:50 AM
Did you make any changes to the commands via anything else besides FF4kster (patches, hex editor, etc)?
I had the following command changes done.

Pray: Casts Cure2 upon success, success rate: 70%
Heal: Consumes Cure1 Potions but has a Cure2 Potion effect
Regen: Heals 250 HP every round
Sing: Hold is cast instead of nothing; its message is changed to Message 47. Stop is cast instead of Mute

Sorry. I should've been more concise. I believe it was the description byte that was changed. From the information Grimoire LD gave me for the headered ROM...

"In ROM at...

01EB17 - A9 00 (LDA 00) - Stores message 00 for the first instance of Sing's effects. | I found that this was the description byte. A9 was altered to 2F in this instance.
01EB1C - A9 00 (LDA 00) - Seems to be necessary to change both, otherwise both are considered 00 regardless of what they actually are. | And if memory serves, this is the actual 'spell cast' byte. There was nothing changed here."

 :edit: In an otherwise unmodified headered FFII US V1.1 ROM, I just edited Sing's "Nothing happened." song to cast Hold and the Mute song to cast Stop, and A9 at 01EB17, or the "Call on this description for song #1" byte, was changed to 2F. So this change when I edited Project II was definitely not an issue of my own doing, though I must stress it's very easy to fix.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 21, 2013, 10:42:29 AM
Hmm, it doesn't seem to be effected by FF4kster, considering that FF4kster wouldn't touch this location as of yet. Are you sure a separate patch didn't effect it in some way?
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on December 21, 2013, 03:34:44 PM
If it happened with an unmodified ROM, I'm fairly certain that it isn't anything I did. I could download a fresh v1.1 if you'd like, and test that?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 21, 2013, 04:09:37 PM
That could possibly be for the best, since FF4kster shouldn't have a way to change this completely unrelated value that the programmer wasn't aware of at the time.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on December 21, 2013, 05:22:49 PM
I tried it on my 1.1 ROM clean - then after just opening & saving it with FF4kster - and then after actually changing the first Sing call (to Exit). No trouble - used Sing many times random distribution of the 4 choices. I'm sorry to say that it must be your copy of the ROM. Sorry I can't be of more help on that vivify93 - I hope you get it sorted all sorted out.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on December 21, 2013, 11:48:24 PM
It must've been in a previous build of FF4kster, then; I redownloaded FF4kster and made the changes and it's still A9. My problem was fixed easily, actually, I was just worried that this potentially game-ruining problem could've been in a build of the editor.

 :edit: Yeah, it was the previous build, apparently. I don't know what caused it, but it doesn't matter since it was fixed. I tested the fresh ROM in the old build, made the Nothing > Hold and Mute > Stop changes, A9 became 2F or whatever erroneous byte it was, I'm too drunk to look it up.

Sorry for raising a ferret-hunt for no reason, but I just wanted to be sure. :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 22, 2013, 04:03:56 AM
I have a pet theory... 2F is steal evade right? And for a brief period it was being written to the wrong address due to my mistake with the headered/unheadered issue with the Cry offsets. It could be that it just happens that the mistaken address turned out to be Sing's message...

 :edit:
It occurs to me though that which messages are displayed by which commands is something that probably should be incorporated into the command editor isn't it ^_^; Is that information already documented?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 22, 2013, 12:42:57 PM
That is an interesting theory and one that makes a good deal of sense.

While it is not formally documented it is mentioned in all of my ASM notes. I can grab a quick collection of those (that have them) and post their offsets here.

(In order internally...)

Headered ROM

Peep   - 01E3A3   1E - Load Message 1E into A. (Peep's Message)
Sneak - 01E433   1C - Load 1C into A. (Sneak Fail - Damaged Message)
Sneak - 01E43A   1B - Load 1B into A. (Sneak Fail Message)
Sneak - 01E4CA   1D - Load Message 1D (Sneak Successful Message)
Salve  - 01E4F9    0F - Load 0F into A. (Not Enough Medicine - Salve Message)
Regen - 01E633   36 - Load 36 into A. (Regen Message)
Twin   -  01E6DC  11 - Load 11 into A. (Twin Fail Message - In Regards to Status)
Twin   -  01E787  11    - Load 11 into A. (Twin Fail Message - 1/255 Failure Message)
Gird    -  01E8A5  3A    - Load 3A into A. (Gird Message)
Focus -  01EA1E  39    - Load 39 into A (Focus/Boost Message)
Pray   -  01EA5D  10 - Load 10 into A (Pray Fail Message)
Sing   -  01EB08  0B - Load 0B into A (Song of Toad Message)
Sing   -  01EB19  00 - Load 00 into A (Nothing Happened Message)
Sing   -  01EB25  0E   - Load 0E into A (Song of Mute Message)
Sing   -  01EB32  0D - Load 0D (Song of Charm Message)
Sing   -  01EB3B  0C   - Load 0C into A. (Lullaby Message)
Recall -  01EC62  09 - Load 09 into A. (Recall Fail Message)
Boast -  01ECDF  12 - Load 12 into A (Boast Message)
Cry     -  01ED22 13   - Load 13 into A. (Cry Message)

And that should do it!

Also would you like me to rewrite the Kick Options again? I wasn't sure if the last iteration of that was enough to go off of for implementation.[/list]
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 23, 2013, 05:05:11 AM
Thanks so much!!

Also would you like me to rewrite the Kick Options again? I wasn't sure if the last iteration of that was enough to go off of for implementation.

If my rephrasing of it was accurate then there's no need, but if something needs to be corrected, then by all means.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 23, 2013, 07:01:10 AM
Indeed your rephrasing of it was spot on. By the way, since we have the other four songs here's the means to change the Frog Song into what you like and how it is activated.

Headered Rom

Sing - Song of Toad
- When Inflicted with Certain Status always use Specific Spell rather than a randomized spell.


Caster's Status Byte 1 - 1EB01
Status Determination - 1EB04
Specific Spell - 1EB0D

(Reference for the above -
Status Byte 1 - 8326 (2683)
Status Determination - 20 (Frog)
Specific Spell (19) (Toad)[/list]
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 23, 2013, 02:17:43 PM
Awesome!

I take it "Inflicted With Certain Status" translates to "if Caster's Status Byte 1 is equal to Status Determination"? (Ideally each variable in the list should appear in the description)
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 23, 2013, 03:23:46 PM
Ahem... yes, yes, that is what that meant. Not very clear at all, but you got the gist of it, hehe. It should probably read...

When Caster's Status Byte 1 is the same as Status Determination always use Specific Spell rather than a randomized spell.

Pretty much what you have there, yeah.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 30, 2013, 05:21:26 AM
Progress Update

I put the tile editor on the back burner and began coding the map editor using hard-coded tiles (ripped directly from FF4Tools). What this means is that for now, the tiles will always look the same no matter what has been changed about them (i.e. even if you hack something that was formerly a warp tile into not warping, it will still appear as a warp tile in the editor), and they will have a fixed palette no matter what the map's palette is.

Currently, it gives you a menu of maps at the top and highlighting a map will display the correct tileset on the left side and will give you a preview of the top left 16-tile x 16-tile corner of the map in the center. While this map looks correct for almost all maps, overworld and underground/lunar alike, there are certain maps that look messed up and I'm not sure why. The "Glitch World" maps are all messed up of course but I was expecting that. I'm talking about things like, the ice shield treasure room in the Tower of Babel looks messed up while the icebrand room looks just fine.

I've uploaded the current working version so if you guys want to take a look at it and see if you can find a pattern, by all means please do so. Also let me know if it's slow updating; it seems to run fine under linux but when I compiled it for windows it seemed to take forever to update the tileset and the map. However it could simply be an emulator issue (it's been known to be sluggish with certain things anyway).
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 30, 2013, 06:39:37 AM
That was a pretty fast implementation! I'll take a look at the newest version to see what's working and what might be a bit askewed then.

 :edit: Now this is interesting! I love actually being able to look at the Glitch Worlds, are they being displayed properly from the data, or are they being read in some different manner? (As in could we potentially alter them to make them fully functioning maps?)


Troia Castle Crystal Room also seems to be rather screwed up as well, it looks to be reading the next map (Troia Hospital).

Baron Castle White Magic School looks to be reading the next map data (Desert Background), while the Desert Background likely has the wrong tileset all together, the Training Room (Is that even a map in FFII SNES?) looks to be having the same problem. The same applies to the Cave Magnes Crystal Room, it looks to be reading the data of the next map, possibly. There is always the distinct possibility that the Crystal Chambers have one set that is called upon by the map data itself (since they all look the same)

Cave Magnes Save Point Room looks to be using the wrong tile arrangement all around.

All of the "Airships" are screwed up, I expect this to be because there is one general map called for those sorts of events.

Cid's Falling mountain background isn't using the correct tile arrangement.

Hmm, the Cave Eblan Savepoint room also looks to be askewed. Is it maybe copying its map data from the Sewer Savepoint?

Baron Empty Throne Room is probably another map which is copying data from elsewhere.

Both docks show a white background.

All inns and shops are askewed starting from Mist Inn. I suspect that to be because they are likely reading from earlier arrangements. Inns however are mostly unique so that is a little troubling...

The other Babil Treasure Rooms are likely reading off of the main one, which is the Icebrand room.

The floors w/ Lugae/Ice Mail/Airship are likely copies again.

I need to head to work, but that seems to be the case here. A lot of these are copies so they don't have default map data.




Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 30, 2013, 09:09:51 PM
Yes, looking in the editor The "Troia Crystal Chamber" uses Index 74. That means that it is actually reading its Map Data from Fabul's Crystal Chamber, and this likely follows suit with the other Crystal Chambers.

Baron Castle's Magic Schools both use the same index of 102, meaning that there is no individual graphics for the White Magic School

Cave Magnes Crystal Room uses Index 74 as expected.

Cave Magnes' Second Save Point Room uses the index of its earlier Save Point Index 146.

Most Airships use Index 195 as their base.

Interestingly enough the Tower of Zot and Tower of Babel use the same Index as well, 166.

Cave Eblan Save Point Room uses Index 61.

Second Empty Airship uses 195.

All normal Chocobo Forests use 207 as their Index.

Baron's Empty Throne Room uses Index 44 as a base.

Tower of Wishes - Final Battle uses Index 23 from the normal Tower of Wishes.

I cannot say what is wrong with the "Small Dock" map, it has no repeat index.

Mist Inn uses Index 7 (I guess there is a generic Inn and its apparently Troia's)

Mist Weapons uses Index 8 (Troia's Weapon Shop)
Mist Armor uses Index 9 (Troia's Armor Shop)

Kaipo, Mysidia, Mythril, and Baron Items follows suit with using Troia's shops as a base.

Ending - Tower of Wishes uses Index 23 as expected.

The ending stuff is clearly taken from their respective copies (Except for Palom and Leonora's Area, that Index is correct though from Underground Index 49)

The Tower of Babil Treasure Rooms all take their Index from 21.

The Babil Copies from the other side are 38, 39. and 40 Index. (The First instance, the second copy is the real one)

The second instance of the Lunar Whale uses Index 44.

Sealed Cave Crystal Room uses Index 13.


And that is that! There's nothing wrong with the way you have parsed the maps. They are just using copied indexes for data that isn't actually there.


Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on December 31, 2013, 05:54:14 AM
I see, thank you! So it has to do with the "map index" of the given map... I should actually be able to code that in pretty easily so that it displays correctly. I'll just have to put something in the readme that reminds people that changing a map that shares an index with another map will change both maps. And if they don't read the readme well... that's not my fault  :happy:

Is the "town water background" coming up as a bunch of cargo boxes for you? For me it seems to be using the airship tileset instead of the town one. This matches what's in its map info data; it says it "should" be using tileset 0 but we know from playing the game that it somehow "knows" that it should be using town tileset...
 :hmm:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on December 31, 2013, 09:19:38 AM
Yeah, the Town Water Background does come up as a bunch of boxes. There is nothing in Tileset 0 that would correspond to water indeed, let's see then...

Also, now that you added the map section, when you go to change certain things like Events, the entire background becomes a bright pink, I can't think that's intentional.

Alright, it seems my theory was right on the dot. The background of any given area will use the tileset that is native to the area. For instance if you change the water background from Town Water Background to the Castle Background you'll see its not proper. It would appear the designers knew this and didn't bother to give the Town Water Background its own proper tileset for some reason, relying on the tileset of Towns to do it for them.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 01, 2014, 11:07:45 PM
Happy new year! I unfortunately have to start the new year with a glitch in the editor...

When you switch Level Ups from one character to another some other level ups get Really screwed up in the process. Just try switching say Rydia and Cecil's Level Ups and then change Tellah's to Rosa's and watch the points needed to level up and the level up bonuses themselves, Sky Rocket!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 02, 2014, 06:08:28 AM
Happy new year! I unfortunately have to start the new year with a glitch in the editor...

Happy new year to you as well! And that's not unfortunate! If there are bugs in my program I want to know about them right away so that I can smash them!  :banonsmash:

And on that note, I uploaded the latest version again which now has fixed:
One thing to note about the levelups if you go messing with the levelup links for the actors, is that I think it's possible to just outright lose levelup data now, at least as far as the editor is concerned. For example, let's say you changed Cecil's levelup link to point to Rydia's levelups but then didn't change Rydia's (or anyone else's) to Cecil's. Now when you open the editor, Cecil's former levelups will just be gone, with no way to access them from within the editor, and both Rydia's and Cecil's levelups will now be called Cecil's. I can't think of a good way to fix that right now but I'll keep it in the back of my mind as something to brainstorm at some point.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 02, 2014, 10:32:07 AM
Hmm, that makes sense that such a thing would occur. So Level Up Index is not a single byte then, but something that is copied into the character's data itself? I was under the impression it was a byte in an initial character's data somewhere. A very nice addition if it is not.

Went looking for more pink boxes, I found another when you go to add a spell to a skillset, the box that holds the level when the spell is to be learned turns Pink when you exit out of it.

Ouch, the Message editing section has it as bad as the Event Editor section did, an entire bright pink screen when you go to edit a field message (Battle Messages work fine)

Ah right, this reminds me of a thing that has bothered me for a while. Do we not have an Underground NPC Index available? Since every mention in the editor refers to the Overworld NPC Index, even in the Underground it uses those names.

But that seems to be it as far as I could make out.

Hmm... I just tested out the Level Up switching and took your words to heart so I changed Dark Knight Cecil's to Tellah's Level Ups and immediately gave Tellah Dark Knight Cecil's Level Ups now this had the effect of erasing Tellah's level-ups all together...

My suggestion is when a Level Up is switched, that immediately the person who is losing their level-up set should be given the other person's level-ups.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 02, 2014, 12:33:59 PM
Hmm, that makes sense that such a thing would occur. So Level Up Index is not a single byte then, but something that is copied into the character's data itself? I was under the impression it was a byte in an initial character's data somewhere. A very nice addition if it is not.
...
Hmm... I just tested out the Level Up switching and took your words to heart so I changed Dark Knight Cecil's to Tellah's Level Ups and immediately gave Tellah Dark Knight Cecil's Level Ups now this had the effect of erasing Tellah's level-ups all together...

What's happening there is that there's a list of pointers, each corresponding to an actor, that point to a set of levelup data. Some point to the same set of data (e.g. Child Rydia and Adult Rydia). So when you change one of the pointers and don't change anything else to what it used to be, so that nothing points to that set of levelup data anymore, then when you load the rom again, it just reads the pointers and doesn't see that there's a set of data with nothing pointing to it.

Went looking for more pink boxes, I found another when you go to add a spell to a skillset, the box that holds the level when the spell is to be learned turns Pink when you exit out of it.

Ouch, the Message editing section has it as bad as the Event Editor section did, an entire bright pink screen when you go to edit a field message (Battle Messages work fine)

Thanks, I'll get on it.

Ah right, this reminds me of a thing that has bothered me for a while. Do we not have an Underground NPC Index available? Since every mention in the editor refers to the Overworld NPC Index, even in the Underground it uses those names.

I had forgotten completely about that... I'll see what I can do. Thanks for the reminder.

My suggestion is when a Level Up is switched, that immediately the person who is losing their level-up set should be given the other person's level-ups.

I'm not sure I understand... Suppose I want to change the plot a little at the end of the game and instead of Kain 3 I need a Yang 3. So I change Kain 3's levelups to Yang's levelups. Would Yang and Yang 2's levelups then become Kain's?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 02, 2014, 01:36:25 PM
Hmm, well that does appear to be what is happening. Though Cecil's level-ups were changed to Tellah's, Tellah's entire Level up Data was erased, despite Tellah 1 still having the normal Tellah Level-up Data (because I switched his data to Dark Knight Cecil's beforehand) which is nothing. By changing this, Tellah 2 and 3 still have Dark Knight Cecil's Level-up Data,. So I think that might be what is going on regardless of the case and  Cecil's data reads it as Cecil's Level Up Data.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on January 02, 2014, 11:16:44 PM
Also I have an observation about the level up editor.  On the later levels (50+ or so) the MP increased byte is also used by the experience needed for level up.  It starts with $20 and moves on to $40--what this means if you put in a value that exceeds $BF for example the exp needed for level up increases as well.  As an example put $FA on Rydia or Rosa's level 40 MP level up data and you'll see the required exp for level up goes into well above 300,000. 

My recommendation is to have the max MP increased per level up not exceed 191 ($BF) or make it an even 190 ($BE).  Or you can be safe and cap it at 160 (A0)--I haven't tested it any further.  :)

Let me know if you need a further explanation. 
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 03, 2014, 06:12:41 AM
Hmm, well that does appear to be what is happening. Though Cecil's level-ups were changed to Tellah's, Tellah's entire Level up Data was erased, despite Tellah 1 still having the normal Tellah Level-up Data (because I switched his data to Dark Knight Cecil's beforehand) which is nothing. By changing this, Tellah 2 and 3 still have Dark Knight Cecil's Level-up Data,. So I think that might be what is going on regardless of the case and  Cecil's data reads it as Cecil's Level Up Data.

So if I understand correctly... you changed Cecil's levelups to Tellah's, right? So now the situation is the actors DK Cecil, Tellah 1, Tellah 2, and Tellah 3 all have Tellah's levelups. Next, you changed Tellah 1's levelups to Cecil's. So now the situation is Tellah 1 has Cecil's (old) levelups and now actors DK Cecil, Tellah 2, and Tellah 3 all have what were Tellah's levelups, correct? Now you save rom and exit, then when you load up the editor you should see this:
ActorLevelups
DK CecilDK Cecil
Tellah 1Tellah
Tellah 2DK Cecil
Tellah 3DK Cecil

But when you look in the character editor you'll find that the levelups that are being called "DK Cecil" are actually what Tellah's were originally, and the levelups that are being called "Tellah" are what DK Cecil's were originally. This behaviour is "correct" and I'll explain why:

Levelup data is stored by character, but the pointers to the levelup data are stored by actor (thanks, FF4 programmers). What this means is I can't just read levelup data along with the rest of the character data. I have to read it with the actor data and assign it to the corresponding character as I go. So let's just do a quick trace of this process with the data changes made above:

Now let's suppose instead that you hadn't assigned Cecil's levelups to anyone. You left all Tellah's actors alone and just changed Cecil to have Tellah's levelups. Now when you save and re-load, the following happens:

Notice that now there is nothing pointing to DK Cecil's former levelups. What this means is that the data is still there, it's hasn't been deleted or overwritten or anything, there's just no way to access it from within the editor. If you were to manually go in with a hex editor and update the pointer for one of the characters to point to DK Cecil's old levelups, they'd all be there and completely accessible.

Actually now that I think about it they might get overwritten in the saving process since nothing is pointing to it; the levelups that are actually being used might all just get written sequentially and the pointers computed based on that, in which case what I said above wouldn't hold true for DK Cecil but depending on what else you changed you might be able to salvage, say, FuSoYa's had you done that with his levelups rather than Cecil's.

Ideally, I'd like to be able to read all the levelup data regardless of whether anything points to it or not; that way you can assign pointers to whatever levelup sets you like without having to worry about it since the entire data set would always be read and written. But it's tricky to do that because of the way those particular pointers work. They care about the character's starting level. If you start at level 10, it will result in a different pointer from if you start at 15, even if the data begins at the same memory address. This means that in order to read the levelup data correctly I need to know the corresponding character's starting level, meaning it has to have a corresponding character.

Also I have an observation about the level up editor.  On the later levels (50+ or so) the MP increased byte is also used by the experience needed for level up.  It starts with $20 and moves on to $40--what this means if you put in a value that exceeds $BF for example the exp needed for level up increases as well.  As an example put $FA on Rydia or Rosa's level 40 MP level up data and you'll see the required exp for level up goes into well above 300,000. 

My recommendation is to have the max MP increased per level up not exceed 191 ($BF) or make it an even 190 ($BE).  Or you can be safe and cap it at 160 (A0)--I haven't tested it any further.  :)

Let me know if you need a further explanation. 

When you do this in FF4kster the result is that the MP ends up getting capped to 31 and the TNL goes bonkers. So I'm just going to do the lazy thing for now and cap it at 31.  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2014, 09:18:09 AM
I see... I had no idea level was so absolutely important to the starting point of the level-up system. What a mess Square... I'm afraid I can't think of any remedy to make that work better.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 03, 2014, 09:43:39 AM
I'll probably think of some way around it eventually, but for now I'm going to keep focusing on the map editor.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 10:02:05 AM
Hey everyone - Nice detective work!

I'm sorry I haven't been able to contribute much lately - life got in the way - and I'm just too slow: by the time I sit down and work through the editor it's already been hit back and forth like a tennis ball and figured it out. :eek:

I'm hoping to have some time today - there's over a foot of snow outside with a temp of about 8 degrees - so computer bound it is.  :tongue:

One thing I was going to mention Wed. night was Agart's weapon and armor shops being tile-swapped versions of Fabul's lobby - but when I went to write it you had the new version out which worked fine - that being another case of wayward FF4 programming, I'm sure. Speaking of I'm totally with Grimoire following up on increase byte:

What a mess Square...

I'll give it some thought but running into this sort of thing before I'm inclined to think there's no easy way to correct for that; Off the top of my head it makes me think of the kind of problems you run into trying to separate two arrays that have been added together: it's fine if you know how the individual data should behave but the way it would seem I don't think there's a pattern to exploit - and even if so hardly the easiest fix

- I'll probably take a look anyway but I wouldn't complain with a cap of 31 though - in fact had I not read it here I wouldn't even know about it :wink:

Hopefully I'll be back to post later with something more tangible to contribute but I couldn't not tip my hat at the great efforts as of late :)

...also, I had to relay to Pinkpuff that yesterday I ran into a situation where I had an unrefreshed copy of the forum up on one monitor next to a current one and saw the two different versions of your avatar...I was just going to relay that as a funny double take moment but then I looked this morning and you changed it again! I'm starting to think that I might be shorting out...Princess Momo overload...lol  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 03, 2014, 10:22:29 AM
...also, I had to relay to Pinkpuff that yesterday I ran into a situation where I had an unrefreshed copy of the forum up on one monitor next to a current one and saw the two different versions of your avatar...I was just going to relay that as a funny double take moment but then I looked this morning and you changed it again! I'm starting to think that I might be shorting out...Princess Momo overload...lol  :childish:

 :scared: You recognize Minky Momo?? That's awesome, I usually have to explain to people who she is. Years ago I couldn't find any subtitled episodes so some friends and I got together and started translating it. We didn't get very far though. We all ended up becoming busy with other things and such. I might come back to it some day but we'll see...

Anyway, back to the map editor! I've got a cursor working now. It even scrolls and everything. My plan is to have it so that the controls are:
And if I'm particularly ambitious I'd like to also put a visible clipboard there on the right side and add the following controls:
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 10:32:30 AM
In looking around for a table with the experience data (knowing I had seen it before) I came across this:

http://rb.thundaga.com/chars/lvup_data.txt - That had a note:

"Byte 3: Magic Point Gain; also, around the 50th level gained or
so (varies for each character), the ROM begins adding $20, $40,
or ($20 + $40) for each subsequent entry for this byte.  This
may have something to do with how your HP/MP/Exp needed data is
updated after you pass level 70."

- that's what JCE3000GT pointed out a few posts back - and as Pinkpuff was saying there may be some kind of overwrite issue: I would say absolutely - you get just enough room for each character for the levels they need - no wiggle room. That and the well caught character/actor pointer discrepancy (OMG Square...) definitely throws a wrench into keeping it easy to edit.

- Also here's a link to the level up data for convenience/reference:  http://rb.thundaga.com/chars/ff4chrlvup.txt
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 10:52:57 AM
:scared: You recognize Minky Momo?? That's awesome, I usually have to explain to people who she is. Years ago I couldn't find any subtitled episodes so some friends and I got together and started translating it. We didn't get very far though. We all ended up becoming busy with other things and such. I might come back to it some day but we'll see...

Yeah, that is a little scary...I'd also have accepted  :wtf: - I had a friend many years ago named Morgan and who had a nickname of Momo - I went looking for what it could be to see if it was a good nickname or a bad one - because one person had told me about it but no one I knew used it. Anyway, Minky Momo came up as what I thought would be the answer...didn't know what to make of it and I was wrong anyway: it was from her little sister not saying "Morgan" as a baby just "Mo-Mo" - However, having read up on it and having seen so many pictures I recognized the picture right away when I first saw it here. It sounded very interesting, so I kept reading about it - and it stuck; that was back from 2006...but there it is. Also translation, damn that's hardcore - I just wouldn't have that in me - but that's some passion you're talking about - the best I'd ever done on that is guessing at the text between equations in German books & papers. lol :P

- But to get back, controls sound good - I mentally ran through them and it seems like a good scheme. Backspace threw me for a second but it made sense when I was imagining "Enter" and "Space" - so I'm happy with it

- The fact that you even thought to attack the map editor and are doing so now with such vigor is quite the feat: to quote April O'Neal: "You have my support!"
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2014, 11:04:54 AM
Hey LordGarmonde! Yeah, I'm facing basically the same issue you are as well, so I am also in front of the computer all day. I'm going to try and revisit some of my earlier incomplete work (before I understood ASM by any stretch) and see what I missed and what can be changed.

That sounds like an ideal way to handle the map editor PinkPuff!

There is one thing in there I don't fully grasp though...

"Shifted Arrows: Expand cursor, increasing highlighted rectangular area" what are "shifted arrows"? Also is this saying that you will be able to copy/paste larger than single tiles? If so that sounds fantastic!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2014, 11:50:45 AM
Oh yes, I was looking through the information I had located in the past and I found... well a lot. With this information you could turn the "Tools" section into a slightly editable section rather than just change the price of items.

I know how to decide which stat to raise with the Apples and Soma Drop for instance, which some modders might find useful. And while I know the information for how to change the events on Magazine/Exit/Sight items, I think that can be dealt with much easier by just disallowing people to use those spells outside of battle (as you've added to the editor.)

Now the Stat-Boosting Items are very simple affairs.

These are very simple instructions and their use can be easily altered.

Unheadered Rom

Golden Apple
Raise Max HP by 100 if more than 9999then make it 9999


Max HP - (Read Byte/Write Byte) - ROM 0xA734
100 (2 Byte Value) - ROM 0xA73A

Silver Apple
Raise Max HP by 50 if more than 9999 then Make it 9999

Max HP - (Read Byte/Write Byte) - ROM 0xA74E
50 (2 Byte Value) - ROM 0xA754

(Shared by both Golden and Silver Apple)
9999 (2 Byte Value) - ROM 0xA73D
Make it 9999 (2 Byte Value) - ROM 0xA742

Soma Drop
Raise Max MP by 10 if more than 999 then Make it 999

Max MP (Read Byte/Write Byte) - ROM 0xA75A
10 (2 Byte Value) - ROM 0xA761
999 (2 Byte Value) - ROM 0xA764
Make it 999 - ROM 0xA769

And there you go! That's all you would need to say... raise any of the primary stats. and with the enforced limits you can easily make them cap at 99. You could even raise your critical Hit Rate with these.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 12:06:06 PM
Nice finds Grimoire - not a bad way to spend time while stuck at the computer.  :happy:

It is funny to go back and look at stuff like that - you can get a lot of classic "Oh, man what was I thinking?"  moments to be had.  :happy:

One I just looked into a bit is a (extremely minor) problem with Jinn vs Choco as they are called visually. In the Medicine List the visual for Fire-Bomb is listed as Choco and that works correctly and looking at the editor from a few versions back, same story. I switched it to Jinn and it had the same visual effect of the Crystal when used on Zeromus - and indeed looking at the list the Crystal has a visual listed of Jinn. I can see this issue has come up before:

Here are the Pointer 2 Effects...
...
Pointer 2: 16 Indra
Pointer 2: 17 Stone/?Jinn?/Ray/Beak/Petrify/Hug/
Pointer 2: 18 Titan
...

And now Sequences...

00 - Exit/Drain/Psych/Shiva/Chocobo/Imp/Odin/Leviathan/Blk.Hole/Absorb/Vampire/(Enemy)Odin(Pointer 2 does the work in those cases, or has no graphic, those that have no graphic will be omitted)
...
35 - Hold/Entangle
36 - White/Nuke/(Spell)Jinn/MegaNuke
37 - Quake/Titan/(Enemy)Quake
...
52 - Needle
53 - (Summon)Jinn
54 - Fire/Blaze
...

I guess I just wanted to point out how that carries over for calling the visuals from items - and then to ask is there then no specific Choco call - i.e. can I not have a battle item that just calls a chocobo - weird, but not overly important so this can get moved to the other thread if that seems appropriate - thoughts?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2014, 12:39:09 PM
Unfortunately FFIV is Far too exact with Summons and trying to use Items to call Summon animations does not work from the first. There is an item to call Summons randomly (which I have labelled in my notes thread) if you Really wanted to you could change every instance there to Summon Chocobo. The reason Items can't summon actual Summons is because the important "make the party disappear" is not innately in the item data, but is only used in the separate routine for the Grimoire.

Great find though with the True purpose of those bizarre animations that I was stumped on when I compiled the effect list, but you pretty much cracked it!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 02:22:48 PM
I'm glad that was able to help. It's good that's tied up; but with FFIV there's no shortage of these kinds of anomalies.  :wink:

Also I missed earlier that you updated the algorithm thread as well - NICE!  :yabin:
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on January 03, 2014, 02:42:03 PM
The reason why I bring up the MP increase byte issue is I'm about to release a patch (and utility) for FF2us/FF4 that alters the max levels of stats, HP, MP and physical damage.  Using this a modder can enable MP to go beyond the 999 cap.  Thus 31 may not be enough if they've increased the max beyond 999. 

YouTube from last year:
http://www.youtube.com/watch?v=YCkZuQUV0ME&sns=em
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2014, 02:45:27 PM
Oh? Did you get those graphical issues figured out then JCE3000GT? I recall that being the main sticking point on why it couldn't really look right before.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on January 03, 2014, 04:15:08 PM
Oh? Did you get those graphical issues figured out then JCE3000GT? I recall that being the main sticking point on why it couldn't really look right before.

Not for damage over 9999 no, but I'm not an assembly guru.  I didn't attempt to do the other limits because of the menu limitations.  :(
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 03, 2014, 04:20:48 PM
Ah, yeah those are all reasonable thoughts. Ah well, looking forward to the release anyhow!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 04:55:43 PM
Agreed!  :happy:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 03, 2014, 05:12:22 PM
- The fact that you even thought to attack the map editor and are doing so now with such vigor is quite the feat: to quote April O'Neal: "You have my support!"

Oh wow I actually love that game, haha! You're IN MY MIND!!

"Shifted Arrows: Expand cursor, increasing highlighted rectangular area" what are "shifted arrows"? Also is this saying that you will be able to copy/paste larger than single tiles? If so that sounds fantastic!

Shifted arrows are the arrow keys while holding shift... ^_^;
And yes you will be able to copy/paste/select/etc a rectangular area of tiles, not necessarily just one.

That is unless something unforeseen happens that causes things to go horribly horribly wrong... which... you never know with this game.

The reason why I bring up the MP increase byte issue is I'm about to release a patch (and utility) for FF2us/FF4 that alters the max levels of stats, HP, MP and physical damage.  Using this a modder can enable MP to go beyond the 999 cap.  Thus 31 may not be enough if they've increased the max beyond 999. 

Oh yeah don't get me wrong I'll probably go back and fix it properly "at some point", the 31 thing is just a quick patchwork kludge I can do in 0 seconds.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 03, 2014, 06:00:44 PM
Oh wow I actually love that game, haha! You're IN MY MIND!!

Well obviously - I mean come on, given the choices of 'in your mind' and 'under that dam' I have no choice but to go with A - lol  :tongue:

Perhaps not an editor issue, but anyone know what enables Status messages in battle?  I tried a few of the 'dummied' ones (HP Leak, Hiding, & Critical) - no good, still blank next to the name. I changed the names for Wall and KO - the changes carried through perfectly, so there's something in between getting in the way. Any ideas?
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on January 03, 2014, 11:16:34 PM
Ah, yeah those are all reasonable thoughts. Ah well, looking forward to the release anyhow!

PM me your email address so I can send you a beta of it so you can test it out if you have time?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 05, 2014, 05:17:14 AM
The good news:

The most rudimentary level of map editing has been implemented. You can now tab between the tileset and the map itself and hit enter to assign tiles. You can also "save" your changes...

The bad news:

Something is messed up with the saving. Specifically, I'm having trouble figuring out a way for the program to detect which maps need to write data and which ones don't. For example, maps that refer to other map indexes don't need to write map data or pointers. However, what's happening now is that, for example, the first glitch world (the one immediately after the Troia dancers' stage) is writing data and a pointer, when it shouldn't be. The rule I had been using was if the "map index" property for a given map was different from its actual map index, then don't write anything. However, that doesn't seem to do it. That glitch world apparently has its own map index and thus FF4kster thinks it needs to write something there when it actually needs to write nothing.

With things like this I normally don't care that much if the underlying representation isn't identical to the original, as long as the output/functionality is the same. However, when I ran it in an emulator, it was a complete disaster. Loading up a fresh rom in FF4kster, changing nothing, and then saving, resulted in DK Cecil's battle graphic being messed up (???) and stepping into Baron Town caused you to appear in the top left hand corner instead of the correct entrance.

I uploaded the current version, but since it will horribly mess up your rom, I simply added it to the zip under a different name, "bugged.exe", but the previous version is still there as "ff4kster.exe". That way you can still use the previous more stable version, but if you want to help me debug you can also look into the output of the bugged one.


 :edit: Never mind, I'm a genius; I figured out the solution. I just made it so that when it's reading the maps to begin with, it checks whether the next map has the same pointer as the current one and if so, flags it as having "no data". If a map is flagged as having no data, it will only display in the map editor if it has a map index different from its own, and will not be written to the rom when it is saved.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 05, 2014, 08:43:26 AM
Nice job Pinkpuff!  :cookie:

That was quick too - I swear it seemed like yesterday that you surged with conviction and released the first half of the map editor. But here you are now, blazing away.  :cycle:

I'm excited to try your map editor out - I remember a while back someone "requesting" mouse support...

 :bah: - If I want to do that I use FF4Tools - in Safari, if I try it in Chrome it's like it's not even there and Firefox seems to have some mood swings about it.

But never give up the quest! Keyboard forever!  :yabin:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 05, 2014, 10:07:15 AM
Looks like everything is working perfectly! Added a few new tiles to Baron Town and noticed no peculiarities through doing so. It seems you implemented this quite quickly! And I tested that item locations and triggers could be changed as long as the other data in doing so is changed and it worked! Its like having the other half of a puzzle, I wouldn't have to go into FF4tools to make those fit any longer!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 05, 2014, 09:53:55 PM
Agreed - so far so good: Nice work Pinkpuff

I changed a few things in Baron, on the Lunar Whale, and in the Subterrane - no problems    :yabin:

Also, I love using it - very natural:  :cookie: --> you  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 06, 2014, 06:53:43 AM
Yay!  :childish: *Eated da cookie*

Next I'll see what I can do in terms of getting some of those more convenient keys working. Oh also, I don't think I documented it earlier but in the version you guys have you can also do these:

HOME: Scroll to top left corner
END: Scroll to bottom left corner
PAGE UP: Scroll to top right corner
PAGE DOWN: Scroll to bottom right corner

Try using it with the numpad, it's awesome (you'll have to turn off numlock though). On that note I'm thinking I might assign some of those other functions (flood fill, etc) to numpad keys as well (in addition to their regular keys) and then it'll be super numpaderific.

Soon no one will miss the mouse  :laugh:

 :edit: Everything implemented now except for copy/paste, and the current version has been uploaded. Enjoy!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 06, 2014, 02:24:13 PM
Wow! You implemented these really quickly! I do have a bug report though... when you go to fill in a space of tiles that is currently filled in with Enter, the program crashes (I guess because there's no exception made for it?)

And soon with visual confirmation of NPCs and the like true event editing can take place without the need of constant memorization.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 06, 2014, 03:42:10 PM
Wow! You implemented these really quickly! I do have a bug report though... when you go to fill in a space of tiles that is currently filled in with Enter, the program crashes (I guess because there's no exception made for it?)

Fixed.  :banonsmash:

And soon with visual confirmation of NPCs and the like true event editing can take place without the need of constant memorization.

Er... yes... well... for that I will have to dig back into the graphics. Hopefully the NPC graphics are not as much of a pain in the butt as the map tiles.

But in any case, yes that is something I would like the editor to be able to do for sure. I was thinking of maybe having a toggle switch, like maybe the "/" key, to turn on/off NPC placements.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 06, 2014, 03:56:15 PM
The more you can use the numpad buttons the better I say, it creates a compressed and solid dynamic.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 07, 2014, 05:23:23 AM
Well, school starts again for me tomorrow. Once again this means work on FF4kster will likely be slow and updates will happen at highly irregular intervals, depending on how much homework I have, etc.

The map editor has all its basic functionality; I'll probably leave the copy/paste thing for the time being and come back to it later. However, what I would like to come back to next is the tile editor. I would really like to be able to read the graphic tiles directly from the rom. In addition to the already mentioned advantages, it will greatly shrink the filesize of the program due to no longer having to package all those bmp files with it, and also I can have it dynamically add those box and arrow symbols to the tiles that have those features (warp, treasure, etc) and have them change as you change those features on different tiles. I almost had the graphics being read correctly, but if I recall correctly there were a couple of major roadblocks:

1. I couldn't get the palettes correct for some reason. The castle tileset seemed to display fine but the magnetic/sealed cave tileset had the correct graphics with the wrong colors. I even tried cycling through all the palettes and none of them looked correct. Either I'm reading the palettes wrong or from the wrong location or something is otherwise messed up.

2. I don't know where all the tileset graphics begin and end. If there are any kind-hearted souls who don't mind finding this information for me I would be most appreciative and it will certainly speed things along. Don't get me wrong, I am certainly quite able and willing to dig around for this myself in Tile Layer or something, but it will take time; time that I would much rather spend coding and implementing things in the editor.

I also have an ever-growing to-do list that I can implement odds and ends from as the mood strikes me.

In any case, in the absence of any game-wrecking or program-crashing behaviour, I think today I'm going to finish updating the readme and upload the current version to RHDN.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 07, 2014, 07:15:33 AM
That time is creeping up on me as well and I have a pretty heavy schedule this time around so my activity might *actually* decrease, instead of me doing the equivalent of deciphering all commands and spells this time around. But I suppose by job is just about over until... oh boy, next October?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 07, 2014, 02:50:42 PM
So as a bit of experimentation I decided to copy the first town of FFIII into FFIV as a test of the tools, it went smoothly (except for my artistic failure to even copy). Here are a couple of pictures.

(http://shrines.rpgclassics.com/nes/ff3/maps/ur1.gif)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIVUr_zps6d817946.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIVUr_zps6d817946.png.html)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIVUr2_zps3595c8c6.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIVUr2_zps3595c8c6.png.html)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIVUr3_zps45b619dc.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIVUr3_zps45b619dc.png.html)

(http://i112.photobucket.com/albums/n198/LastingDawn/FFIVUr4_zpsa1fa6c0b.png) (http://s112.photobucket.com/user/LastingDawn/media/FFIVUr4_zpsa1fa6c0b.png.html)

Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2014, 03:50:44 PM
One thing I Must address is that the Message Editor for large bits of text is now unusable, basically. There is a bright pink glaring at you the entire time when you go to click on a message to edit and the cursor which showed you where you were in the message is Completely gone and despite not even touching it (but merely viewing it) I can no longer save because of a Bank2 Overflow. This is rather harrowing and should be fixed as soon as possible.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 09, 2014, 04:17:14 PM
I can't duplicate this. Anyone else?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2014, 04:58:43 PM
Ah? Hmm... do I have a slightly outdated version? I'll redownload what is there and see if maybe I was using a slightly outdated one. Apparently it was slightly outdated... I got the one from RhDN and that one works perfectly fine. Sorry for the false alarm Pinkpuff.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 09, 2014, 05:06:38 PM
No sweat  :wink:

Before uploading to RHDN I had a more thorough run-through of the different components, looking for any pink areas that I may have missed. I still may have missed some though.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 09, 2014, 05:17:24 PM
So far so good over here - made some changes to Baron Town and changed some of the dialogue: no problem. It looks you have it figured out though so that's good.  :yabin:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2014, 05:25:07 PM
Also, this version seems to include the two names that have been missing since the start, Golbez and Anna. All in all the touch-ups seems to be working and the editor runs as smooth as ever.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 09, 2014, 05:26:55 PM
Incidentally I managed to figure out a more efficient way to search for the tilesets so I think I can handle that part after all. Also got the palette problem fixed.

Soon we will have tile graphics being read from ROM!  :childish: ...and I won't have to package all those image files with the program! ...and then I can get started on the Map Tile Editor!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 09, 2014, 05:43:51 PM
That sounds fantastic! Looks like you already have the future all lined up!
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on January 09, 2014, 07:51:51 PM
I'm relieved that the map editor is coming along!  :)
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 10, 2014, 03:37:59 AM
I'm relieved that the map editor is coming along!  :)

Actually the map editor proper is basically done already as of the version currently on RHDN. The only planned features it's missing are copy/paste, and toggle display of NPCs and background map.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on January 10, 2014, 05:14:46 PM
I'm relieved that the map editor is coming along!  :)

Actually the map editor proper is basically done already as of the version currently on RHDN. The only planned features it's missing are copy/paste, and toggle display of NPCs and background map.

Sweet!  Love the copy/paste!  Do you think you could add a clone map feature?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 10, 2014, 06:01:46 PM
I'm relieved that the map editor is coming along!  :)

Actually the map editor proper is basically done already as of the version currently on RHDN. The only planned features it's missing are copy/paste, and toggle display of NPCs and background map.

Sweet!  Love the copy/paste!  Do you think you could add a clone map feature?

Maybe? Not sure what the point would be though... especially when you could either highlight the entire map, copy it, and paste it to another map, or just set the other map's map index to the map you want it to be a copy of...

In any case, right now my focus is on getting the map tile editor working.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 13, 2014, 12:55:03 PM
That is almost certainly what is happening. FF4kster saves absolutely everything even if you've changed nothing. For most things, this results in no change, but for some things (definitely messages, and probably events as well), even though there is no functional difference in the gameplay, the underlying representation may not be identical to what was there originally.

To that my brain tries to make the analogy of the theoretical aspects of teleportation: Can't actually teleport someone - but they can be scanned, destroyed, and rebuilt to be exactly the same (or are they...)

However - that analogy doesn't help me understand what is actually happening. I look at your program like someone looking at a book (again with the analogies - it's how I understand - how I teach as well, actually) I take the FF4 book off the shelf (not the Japanese one - I can't actually read it = sad) and if I look at it and put it back - no edits: how did it change.

As I write this I kinda feel like I may be edging "stupid question" teritory - but something just doesn't connect with me on why things would change.

My only thought is that what Chillyfeez had hinted at was correct:

FF4kster, bless it's little automiton heart...

Which would mean that maybe my problem is just that my feable skills are no match for the power of the Pink-side  - and only at the end will I understand  :laugh:

But even if that's true I'm still interested in learning anyway  :wink:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on January 13, 2014, 01:19:27 PM
LordGarmonde, lemme try to explain...

Every bit of information in the game, obviously, has its own starting point within the ROM.
The way the game knows how to find that starting point is by referencing pointers, often grouped together right before the part of the ROM designated to house the data in question.

Now, if you change those pointers, you can change where the beginning of that information is, and the game will handle the change seamlessly. One could, in theory, switch the data for the opening events with the data of the closing events and (as long as they fit I each other's spots) the game would play exactly as normal, as long as the pointers were changed to accommodate the changes.

NOW THEN... presumably, when first programming the game, the developers did not know exactly howlong the data for the opening events would be, BUT, they had a ballpark, so they set aside a block that was a bit more than long enough, set the pointers, and moved on until such time that the opening events were programmed.
Later, when the opening events were programmed, it turned out thatthere was extra space at the endthat was not needed. At that point, instead of moving a shitton of data around and changing a bunch of pointers, they just left the empty space, filled presumably with FFs.

Flash forward to now. In FF4kster, Pinkpuff has programmed the instructions to recognize unused space between events and, well, squeeze it out, so to speak. The pointersareautomatically adjusted bythe program, and any empty space is gathered together after the end of the last event. This, if nothing else, helps the hacker knowhowmuch extra space is still available for more events, or longer events.
When one loads and saves a clean FFIIUS ROM with FF4kster, the program does not just read the book then put it back on the shelf. It looks at the book, finds the empty pages, tears them out, gathers them together, and replaces the at the end of the chapter. Now an aspiring reader could pick up the book, look at the end of a chapter, and kmmediately know how many pages are available for edits and rewrites.

Hope that helps.
Please excuse multiple typos. I'm kind of in a hurry right now.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 13, 2014, 01:28:50 PM
That's a hell of a lesson for being in a hurry - I think I get it!

You even extended my book analogy  :cookie: for you sir!

I'll probably have another question later upon reread but ATM I follow. Thanks, Chillyfeez!!  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 18, 2014, 06:46:34 PM
I was thinking about something earlier today and then remembered a conversation from a few days back:

Pretty much, yeah. With XML you define a more or less standard way to represent data, which can be manually edited and expanded at will. Here's and example of what I have in my enemy database:

Yup that's pretty much what I was picturing. FF4kster will still need a ROM file regardless because it gets all sorts of other information from there, including things like the font and menu graphics (so it's literally unusable without a loaded rom). But I can certainly picture something like "export project file" which will create an xml file based on the loaded rom or "import project file" which will read the xml file the user provides and alter the loaded rom according to the specifications.

That said, it probably won't be happening any time soon. It's still evolving at a fairly rapid pace (relatively speaking), and we're still discovering things about the game data that would cause us to have to revisit the structure for some objects fairly frequently. But it does sound like an ideal solution to the problem down the road.

Would there be a way, perhaps, to start on a smaller scale. I was playing around in the Event Editor and remembered trouble I was running into (completely of my own making) keeping track of versions of the ROM at editing stages. What it got me thinking was on any given screen (Events lets say) could it be set up to export whatever I'm looking at: So when I have selected "4: Behemoth battle 51" with a list of the steps could it dump to a text file that would read:

4: Behemoth battle 51
-------------------------
1: Fight battle: Formation 153
2: Set flag 81
3: Play song: Feymarch
4: --END--

So exactly what I'm looking at which in my mind at least must already have instructions to output to anyway so I can see it. Just a thought - but I could see that or something similar as useful in its own right (especially for me) - but maybe as a base for a grander total export down the road.

Also (if it sounds stupid <- ignore) what about some kind of recorded action scheme? Just keep a list going of every action submitted. This would work great if starting from a fresh ROM, but then building something off a previously edited ROM would cause problems - but for me I have a layout in my head of:

Start with ROM A (Fresh Copy) ---> Make Changes & Save as ROM B ---> Make More Changes & Save as ROM C ... and so on

But if the Change Map is preserved from each Step then if I wanted to recreate ROM C all it should take (I think) would be the two Maps <- I'm sure this an obvious connection but I might miss it later so :P - but the thought process was same as applying multiple patches sequentially.

Anyways, just some thoughts - some good, some bad, some ugly - :hmm: 
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 19, 2014, 04:18:26 AM
Both of those are good ideas but would be a bit of an undertaking. An "undo" feature would also be awesome but again, it's gonna be a fair bit of work.

Right now I just want to get the tile editor working, which can't happen until I get those Airship/Ship tileset offsets figured out and also figure out why the Giant tileset doesn't look quite like it should.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 19, 2014, 08:59:19 PM
Both of those are good ideas but would be a bit of an undertaking. An "undo" feature would also be awesome but again, it's gonna be a fair bit of work.

I guess that would work as a basis for: "undo" - good thinkin'! - But first thing's first:

Right now I just want to get the tile editor working, which can't happen until I get those Airship/Ship tileset offsets figured out and also figure out why the Giant tileset doesn't look quite like it should.

I in no way guarentee this to be the answer - but I think it might at least shed a little light on the Giant problem. I pulled out the individual tiles for three sets: Giant, Whale, & Tower - I put each tile side by side (rows of 3) so one row per hex assignment so I could do the only thing I know how to do: patterning!

What I generated was a table that indicates when the tile for either the Giant or the Whale (or both) matched the tile used in the Tower. My hope is that you'll be able to surmise from there how the game's curve-ball is tracking. Not surprisingly there's a good deal of overlap but out of the 127 tiles in the Tower set 65 of them are a direct match to a tile in the Whale set and 42 tiles match a tile found in the Giant set. There are several cases (27) where all three match up (jackpot??)

So that's all well and good, you look at the table to see which ones matched or didn't...based on their Hex ID. I noticed a few instances where two tiles were clearly copies of one another but they didn't share the same ID - and the offset doesn't seem predictable either. For example (all in hex):

For (G)iant, (T)ower & (Whale):   G<70> = T<6F> while...                         

G<4E> = (T<57> = W<57>)   &   G<4F> = (T<5F> = W<5F>)

Seems like another "Gee thanks, Square" kind of arrangement but if it helps then I'm happy to have done it. The whole thing with The Giant feels almost like there's a half tile set for the background and the set the game ends up using is a mix of that and the set used in the Towers

:edit:  Two quick things I forgot:
1) I got the tiles from Phoenix's FF4Tools and I wanted that to make sure that was credited properly
2) I went off of exact matches for this go-round - but there were several instances where there would have been a match but for one - that's where a good number of differences between the Tower and the Whale arise - Within those tiles you can see that 3/4 of the subtiles that make the up the tile match - it's just changing out one:

So      S1 S2   vs  S1 S2       <-- Common for the lower Whale Entries
          S3 S4        __ S4
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 20, 2014, 12:29:25 PM
Hmm, after working on a map for a good half-an hour or so things were going well, but while I was working on it though a strange "mini-map" like box opened up and I couldn't do anything anymore. I tried to hit escape to save my progress but the system crashed and I lost my work.

Any idea what might have caused this?
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 20, 2014, 12:52:18 PM
Sorry to hear that, Grimoire; that sucks  :sad:

I haven't spent enough time with the map editor to have run into that; but I'll be on the lookout - and saving frequently.

I wonder if there would be a way to map a key to save instead of backing out to the menu. It may not be possible the way things are set up - it might be the case that you have to back out of the sub-menus to update the parameters needed to be able to save them to the ROM.

Typing that out it seems to go along with what was discussed about about mapping, exports and undo - so I just wanted to throw that out since you got me thinking about it.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 21, 2014, 03:44:04 AM
Hmm, after working on a map for a good half-an hour or so things were going well, but while I was working on it though a strange "mini-map" like box opened up and I couldn't do anything anymore. I tried to hit escape to save my progress but the system crashed and I lost my work.

Any idea what might have caused this?

I'm afraid I don't! That is pretty alarming though! Can you (or anyone else) duplicate this? If we can figure out how to trigger it I'll be able to start hunting for the cause.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 21, 2014, 05:34:33 AM
I wrote a script (in AutoIt) to randomly move around the tileset, select a tile, and then move to the map and perform a random set of actions (between single paste and flood fill) - I ran it twice and saw the same error as referenced above. It seems to be a memory problem - when the program crashed it was using about 2GB of memory (out of 8 for my machine, so computer was still doing fine)

I've attached 3 pictures: the mini-map pop-up, the crash screen, and the debug window/memory usage showing visual studio complaining about RAM which is shown to the right. I can easily run that script again for retesting whenever you need it. Good luck!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 21, 2014, 05:35:22 AM
Last picture showing the RAM issue:

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 21, 2014, 06:18:27 AM
Ok thanks, now I know where to look.

 :edit: Try it now
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 21, 2014, 07:11:19 AM
Ok thanks, now I know where to look.

 :edit: Try it now

 :banonsmash:   you got it! RAM use stayed constant @10,092k - ran a few cycles - no prob!  :cycle:
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on January 21, 2014, 09:19:07 AM
Haha, that makes this the 50th version of FF4kster I've downloaded on this computer alone. I am glad to see that this problem appears to be fixed now.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 22, 2014, 12:59:03 AM
Haha, that makes this the 50th version of FF4kster I've downloaded on this computer alone. I am glad to see that this problem appears to be fixed now.

I'm glad it turn out to be quickly fixed (<15 mins!!) - happy editing!

I in no way guarantee this to be the answer - but I think it might at least shed a little light on the Giant problem. I pulled out the individual tiles for three sets: Giant, Whale, & Tower - I put each tile side by side (rows of 3) so one row per hex assignment so I could do the only thing I know how to do: patterning!

I hit the Ship/Airship tilesets the same way - the result is more straightforward only comparing 2 rather than 3. Comparing the two tilesets they can be (mathematically) be split into subsets:

Airship = (A) + (C)   &    Ship = (S) + (C)

Where: (A) are tiles unique to the Airship set, (S) are tiles unique to the Airship set, & (C) are common to both

Specifically the common subset is comprised of the tiles  of the indices:

{01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21, 22, 23, 24, 25, 26, 27,  28, 2A, 2B, 2C, 2D, 2E, 30, 32, 33, 35, 36, 37, 38, 39, 3A, 3B, 3C, 3D, 3E, 3F, 53, 54, 55, 56, 57, 58, 59, 5A, 5B, 5C, 5D, 5E, 5F, 6F, 7C, 7D, 7E}

& The individual sets are indexed:

{29, 2F, 31, 34, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 4A, 4B, 4C, 4D, 4E, 4F, 50, 51, 52, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 6A, 6B, 6C, 6D, 6E, 70,  71, 72, 73, 74, 75, 76, 77, 78, 79, 7A, 7B, 7F}

Of the 127 indices 76 are shared, and 51 unique. At the very least there must be some way the game differentiates referencing the unique subsets vs the common ones; but I don't yet know how.

Could you give me an idea of how for the tilesets already mapped out you build those complete tilesets from the metatile pool: that's something I don't know the specifics of (but I think I finally grasped the concept)

If I were to continue my analysis further the next step would be to split each tile in the sets in question into their 4 individual metatiles and then construct each minimum set, taking into account for each right-rotation:  :hmm:

...stupid combinatorics  :tongue:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 22, 2014, 03:28:54 AM
No sweat,

Quote from: FF4.txt
A2000-A5FFF   (149E00-14DDFF)   Town Map Tile Formation Data (*4)
...

*4 -- Town Map Tile Formation Data, 2 bytes

0x0000         8x8 tile (0x00-0xFF)
0x0001:0...1   ?
0x0001:2-4      Palette Index
0x0001:5      Tile Priority (0 = behind character, 1 = in front of character)
0x0001:6      Flip tile horizontally
0x0001:7      Flip tile vertically

The priority is ignored for the sake of the editor (currently), and there are two mystery bits that may or may not have anying to do with it.

Judging by my code, bits 6 and 7 seem to be the opposite of what you'd expect; 0 = flip, 1 = leave alone (though it is entirely possible that the program is just reading in the graphics reversed to begin with or something)

Also worthy of note is that judging by the way my code is layed out it looks like it's all the top left corners of all the tiles, followed by all the top right corners of all the tiles followed by all the bottom left corners of all the tiles followed by all the bottom right corners of all the tiles so you can't just read along 16 bytes to get one tile.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 23, 2014, 10:29:32 PM
The priority is ignored for the sake of the editor (currently), and there are two mystery bits that may or may not have anying to do with it.

I'm just sitting down to try and have another look and found some references (most likely already known)

http://wiki.superfamicom.org/snes/show/Backgrounds  &
http://wiki.superfamicom.org/snes/show/Working+with+VRAM+-+Initializing+Tiles+and+Tile+Maps

Th most promising explaination appears to be here:

http://www.ff6hacking.com/ASM/SNES%20Graphics%20Information.html

But my brain is way too fried at the moment to try and comprehend so me =  :sleep:

Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 29, 2014, 03:02:33 AM
 :blits:

- The more I get into this the more confused I become...

Looking at two sets, mountain and cave and just visually scanning them I can see several tiles (and I do mean full 2x2 metatile matrices) that are the same, some using the same ID some not (see FF4Tools):

Mountain:     (Rock=7B)     (Bridge L/R=6A/6B)     (Chest Open/Closed=77/78)     (Save=7F)
                            |                        |                                   |                                  |
Cave:     (Rock=58/7E)*     (Bridge L/R=39/3A)     (Chest Open/Closed=77/78)     (Save=7F)

(http://i34.photobucket.com/albums/d120/lordgarmonde/cavs_vs_mountain_zps60f39a53.jpg) (http://s34.photobucket.com/user/lordgarmonde/media/cavs_vs_mountain_zps60f39a53.jpg.html)

* Two different rock sets??? <--- I got nothin' for that one...  :sad:

I went looking into it and found the chest and save tiles at the end of cave set and another set at the beginning of the mountain set. (See pictures) I wouldn't think that these two sets aren't also sharing. I think that the chest/save group I found at FD208 is from the end of the lunar subterrane set - but even that seems illogical because the only difference between the chests in the subterrane and the chests in caves/mountains is the color.

(http://i34.photobucket.com/albums/d120/lordgarmonde/mountain-sm_zpse9dc896c.jpg) (http://s34.photobucket.com/user/lordgarmonde/media/mountain-sm_zpse9dc896c.jpg.html)

(http://i34.photobucket.com/albums/d120/lordgarmonde/cave-sm_zps025c830e.jpg) (http://s34.photobucket.com/user/lordgarmonde/media/cave-sm_zps025c830e.jpg.html)

The giant/tower has a different chest setup to accommodate the glowing effect that us Westerners can't live without apparently...

http://tcrf.net/Final_Fantasy_IV_(SNES)/Version_Differences#Graphics

(http://i34.photobucket.com/albums/d120/lordgarmonde/FADA8-GiantChest-Glowing-sm_zps2b3a8d75.jpg) (http://s34.photobucket.com/user/lordgarmonde/media/FADA8-GiantChest-Glowing-sm_zps2b3a8d75.jpg.html)

Bottom line is I really can't figure out how they could get all the tilesets assembled without a bunch of explicit instructions - not that I put this past Square but I don't know what to do from here. It may just be easier to keep the map editor as it is. If you have an idea as to something to look for let me know because this is the sort of crap that really bugs me...  :angry:

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 29, 2014, 05:46:02 AM
It sucks being so close and yet so far...  :sad:

I guess for now I will leave the map editor as is and come back to the tile editor later, hopefully armed with more info by then. Particularly for the tile editor itself I want to be able to dynamically overlap those red box/arrow indicators on the tiles that actually have them. Currently they're part of the bmp images themselves, but I would like the editor to visually reflect tiles that have had their warp/event/treasure/etc properties changed. I can go through and manually separate them using the bmp images but I don't want to have to do that if it's at all possible to read the tile graphics from the ROM, especially since that's something that in principle should be happening regardless.

In the meantime I have a bunch of stuff on my ff4kster to-do list that I can work on as time permits.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 29, 2014, 06:18:20 AM
Yeah...maybe someday... :sad:

In the meantime, there is good news - the source for FF4Tools has every tile separated and sorted - they are each .png files ~ 4-5kb each - That's what I used when I went through and did the first few tile-by-tile comparisons
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 29, 2014, 10:02:12 AM
That's what I used to make the bmp files as well, I just ripped them from FF4Tools and mass-converted the file format. But that's not what I mean.

I'm talking about, you know how there are some tiles with red arrows or boxes on them? Well those red arrows and boxes are part of the bmps themselves, not separate bmps with transparent backgrounds that are layered on top, which is what I would want. That means you can't just make arbitrary tiles appear as f.ex. warp tiles. I would need to manually go through and separate the red arrows from the tiles themselves and make separate transparent bmps with those arrows and boxes and such so that in the tile editor when you make a regular tile into a warp tile, it will appear as such with a red arrow indicating so.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 29, 2014, 11:25:03 AM
Oh, OK - gotcha -- me iz smrt  :blush:

red dots and arrows - those are the only two overlays, right? I'll extract them; I have photoshop (CS6) - shouldn't be too involved to separate them - my bigger problem (I imagine) will be keeping the sizes consistent - but since I'm planning to start with a real tile with the arrow the picture size itself shouldn't change - but I've seen it happen anyway.

I'll go through and look, but if you have a semblance of a list of the tiles I'll need to make non-warp versions of let me know - either way, most of them (I'd think) would have a dot and an arrow version - so removing the dot should be no big deal.

Let me know if I'm following right - and please correct me as necessary  :tongue:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 29, 2014, 03:18:29 PM
There are also tiles with a red border, like the items hidden in grass and such. Anyway yeah I would certainly welcome the help if that's something you feel like doing... though I don't off hand have anything resembling such a list I'm afraid.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 29, 2014, 11:41:00 PM
Happy to help.  :happy:

I've attached 4 images:

Box Around Items
Dot Pattern for Passing Into Walls, etc.
Return Arrow
Warp Dot

That seems like it covers everything - but if not just let me know. It really was not much trouble; and as I say I'm happy to contribute.

On a related note I've been watching a series of interviews of Richard Garriott (of Ultima fame) that The Spoony One conducted. My favorite is definitely Garriott talking about working out graphics from the Apple II days:   graph paper --> binary --> hex, and all the ways he could mess up along the way - also his advocation for even programmers of today to adhere to the minimum tileset approach:

http://spoonyexperiment.com/game-reviews/make-apple-ii-artwork/

- It also has the very appropriate tagline: "You kids and your Photoshop…"    - Well, pretty much  :tongue:

Here's the full series if you are interested:

http://spoonyexperiment.com/game-reviews/ultima-retrospective/richard-garriott-interview/
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on January 30, 2014, 01:26:10 AM
Hey Pinkpuff - did it ever end up being possible to change whether FF4kster recognizes a monster as Lunar? I see that there is a "lunarmonsters.cfg" file, but it's blank.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on January 30, 2014, 05:09:56 AM
Thanks very much LordGarmonde. That's part 1 done. Next I will have to remove those arrows and other symbols from the tiles that had them to begin with. Some of them are easy (the ones with "normal" counterparts) but as I recall there were some that only existed in symbolized form. For example, I'm pretty sure there are no closed town doors that didn't have any red marks on them.

Hey Pinkpuff - did it ever end up being possible to change whether FF4kster recognizes a monster as Lunar? I see that there is a "lunarmonsters.cfg" file, but it's blank.

Didn't realize that was still being packaged with the program! I doubt it will have any effect even if you change its contents.

Right now what it's doing is searching the lunar encounters list to see if that monster appears anywhere there. If it does, it will display as Lunar. If it doesn't, it won't. Unfortunately this has the side effect of lunar monsters that only appear via plot-triggered battles appear as non-lunar... But fear not! On my to-do list is to create a "toggle button" in the monster editor that will switch the display between lunar and non-lunar. I will stlil use the existing method to determine what its default display will be, but this way you will be able to view what any monster would look like if you were to drop it onto the moon as-is.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 30, 2014, 06:55:26 AM
Thanks very much LordGarmonde. That's part 1 done. Next I will have to remove those arrows and other symbols from the tiles that had them to begin with. Some of them are easy (the ones with "normal" counterparts) but as I recall there were some that only existed in symbolized form. For example, I'm pretty sure there are no closed town doors that didn't have any red marks on them.

Quest accepted!  :laugh:

There shouldn't be all that many overall. If you can think of any others off the top of your head let me know. I should be able to knock it out later today.

and...I'm off!  :cycle:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on January 30, 2014, 08:18:40 AM
It might not be packaged with current versions, now that you mention it. I don't typically elect to erase any of the config files when I unzip a new FF4kster. I just copy out the ones I want to keep, "yes to all" the overwrite prompt, then copy them back - the process would leave any defunct files untouched. Thanks for the info.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on January 31, 2014, 05:22:21 AM
Here are the first few replacement tiles. They are labeled according to their appropriate set and then which tile(s) they are to replace - both numbers following the FF4Tools convention.

More are on the way, but if you spot a flaw in these let me know.  :yabin:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 01, 2014, 09:40:54 AM
Looks great so far! Thank you so much!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 01, 2014, 12:43:50 PM
You're welcome!  :cycle:

It makes for a welcome distraction between bouts of "real work"  :tongue:
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 02, 2014, 03:29:16 AM
 :yabin:   Two more sets ready to go  :happy:
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 02, 2014, 05:21:51 AM
Two more sets to go:  (08+0A+0B)  &  (0C+0D+0E)
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 02, 2014, 09:38:32 AM
"Almost there..."

"...stay on target..."
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 02, 2014, 04:12:48 PM
That should do it. Don't hesitate to request anything I may have missed.  :finger:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 03, 2014, 11:24:01 PM
Hey, Pinkpuff,
I'm having some trouble with the NPC editor...
Specifically, I'm editing NPCs in "Smithy's house main floor," but I don't think the issue is isolated to this particular map. What's happening is, when I try to change an NPC's Sprite, it just doesn't respond. The sprite seems to be static. It lets you scroll through the possible sprites, but when you select one, it just jumps back to whatever the default was. It happens for pretty much every NPC (I've tried early ones as well as some in the 500s).
I've also experienced trouble with setting the NPCs' default visibility status. This hasn't really been a problem, since I can generally fix visibility within events, but it might become a problem eventually.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 04, 2014, 03:32:54 PM
Confirmed. Investigating...

 :edit: Fixed. Uploaded.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 04, 2014, 05:17:48 PM
Hmm... did you change something for how the program reads the maps? They all load so quickly and change tileset with barely a hiccup now.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 04, 2014, 06:39:49 PM
Someone noticed a memory leak that was happening, I tracked it down and solved it. Could that be it?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 04, 2014, 06:41:28 PM
Possibly, I thought I downloaded that version as well though? Well no matter, it's a welcome change.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 04, 2014, 08:35:24 PM
Hey, Pinkpuff,
I'm having some trouble with the NPC editor...
Specifically, I'm editing NPCs in "Smithy's house main floor," but I don't think the issue is isolated to this particular map...

I see the same problem as well, but in looking at it I believe I've found another. For later maps (I tried 1st floor Smithy and Lunar Palace Lobby) scrolling through towards the high end of NPCs caused a crash. If I start low and work up it crashes at an entry for Dark Knight Cecil (see pic) but if I use 'end' to go to NPC 511 it works going down until I hit Namingway.

Someone noticed a memory leak that was happening, I tracked it down and solved it. Could that be it?

I think it may be a similar problem, but I don't know. I followed it into Visual Studio's debugger/disassembler, the results are attached. Good luck!
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 04, 2014, 08:38:48 PM
Here's the last one - I don't know if what the windows executable will tell you if anything, but it might help
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 04, 2014, 09:15:39 PM
I'm not getting the crash LordGarmonde is getting, but the default visibilities still don't seem to be kicking in reliably. It's weird, FF4kster says "yes" for the NPCs visbility, but in game the NPC is not visible (unless activated via event).
On the bright side, the NPC sprite seems to work fine now.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 04, 2014, 09:42:10 PM
OK me neither, whatever was changed also cleared up my problem. I assume it was some kind of pointer/index issue? I say that because in looking at the offending editor the defaults for Smithy's place are:

Cave Eblana Soldier, Cave Eblana Soldier, Cave Eblana Soldier, Cave Eblana Soldier, Porom Statue, Mythril Frog

vs. what is in the now working editor (Each using a separate fresh copy of the 1.1 ROM):

Invisible, Invisible, Sylph, Invisible, Invisible, Crystal Sword

- Weird; but mute - everything seems to work now!  :childish:

Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 05, 2014, 06:30:45 PM
It was adding 100 for underground NPCs instead of adding 100 hex.  :lame:
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 05, 2014, 07:35:29 PM
It was adding 100 for underground NPCs instead of adding 100 hex.  :lame:

Gotcha - well it's not an issue any more so I say it's more like:    :finger: -> :lame: <- :banonsmash: =>  :childish:
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 05, 2014, 07:40:08 PM
I don't know if this is significant enough for immediate attention, but... When you are in the NPC editor, the location's NPCs are numbered 1, 2, 3... 12. In the event editor, NPCs are numbered 0, 1, 2... 11. It's not an error, but it can lend itself to hacking errors.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 15, 2014, 08:36:56 PM
Hello Pinkpuff, I think I have an idea for an interesting addition to the editor, but I don't know how difficult it would be to implement...

You know the 19 unused "glitch worlds" right? It turns out that starting at CFCF9(non-headered) there is a decent amount of unused space continuing until CFE5F. That leaves room for maybe... two decent sized maps. 166 (358) bytes left to use.

My idea was to allow the modder to click on a glitch world map and a separate menu would open up "358 bytes left to spare. Would you like to use the index of this map as a new map?" If yes is chosen, the index's pointer is changed to CFCF9 and a fresh map can be created. The program will keep track of the space used and if the player decides to click on another glitch world map the same prompt will open, except with the mention of the new amount of bytes remaining a Stark Warning that they Must be finished with the first map because this will write to directly after it. Should they go back and make changes to the other map it cannot have more bytes than it started with.

This will give the player a couple more maps to fool around with. Granted, you might already be aware of this free space and that is why there is no defined limit to map creation in FF4kster.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 20, 2014, 03:51:24 AM
Sounds like it would be pretty compicated, but I'll add it to the feature request list anyway.

Incidentally, FF4kster figures out which maps have no data by the pointer information. So if you're feeling brave, you might be able to achieve the effect you're looking for by messing around with the pointers in a hex editor; you might be able to "fool" FF4kster into thinking a particular glitch map is real.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 20, 2014, 08:09:11 AM
Ah, well then that might actually do the trick in all reality.

Also a syntax update... In the AI there's a command called "Cast Black or White Magic Spell" and "Cast a Special Spell". Now the first one tells the enemy to randomly single target an ally or enemy. The second one tells the game to Multi-Target. There doesn't seem to be much special about it. I can change that easily enough with the indexes, but its just something to keep in mind.

May I ask as well why Golbez and Anna's character data isn't shown in the Actor's tab? Golbez, I can understand in a normal game sense. He's used in a pivotal battle scene, has no actual level up system. But he does have default stats and even has several Commands set as well as equipment (even though that equipment consists of a Flame Spear and Trashcans) and Anna is a completely blank slate. But the game does reserve five commands for her, so that actor slot can be used and is virtually unused by the game itself.

Is it because the information of these locations is unknown? If so I can do a quick search and bring them to light.
Title: Re: Developing a comprehensive editor for FF4
Post by: LordGarmonde on February 20, 2014, 10:52:26 AM
Also a syntax update... In the AI there's a command called "Cast Black or White Magic Spell" and "Cast a Special Spell". Now the first one tells the enemy to randomly single target an ally or enemy. The second one tells the game to Multi-Target. There doesn't seem to be much special about it. I can change that easily enough with the indexes, but its just something to keep in mind.

I also had that same question. I think I figured out that the special part was being able to multi-target with magic usually not multi-targetable - like Baigan casting Haste on both of his arms.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on February 20, 2014, 02:18:26 PM
Ah, well then that might actually do the trick in all reality.

If you do decide to try it, let me know how it goes!

Also a syntax update... In the AI there's a command called "Cast Black or White Magic Spell" and "Cast a Special Spell". Now the first one tells the enemy to randomly single target an ally or enemy. The second one tells the game to Multi-Target. There doesn't seem to be much special about it. I can change that easily enough with the indexes, but its just something to keep in mind.

Ok cool, I just got those descriptions either from some file or from some post here. Is the wording the only issue there, or does any of the actual functionality need changing?

May I ask as well why Golbez and Anna's character data isn't shown in the Actor's tab? Golbez, I can understand in a normal game sense. He's used in a pivotal battle scene, has no actual level up system. But he does have default stats and even has several Commands set as well as equipment (even though that equipment consists of a Flame Spear and Trashcans) and Anna is a completely blank slate. But the game does reserve five commands for her, so that actor slot can be used and is virtually unused by the game itself.

Is it because the information of these locations is unknown? If so I can do a quick search and bring them to light.

It's less about that and more about the character object that's being held in memory in FF4kster. When it loops through and writes all the characters, it does exactly that; writes all the characters. I think there was even a point where something was being messed up because it was reading and writing stuff for Golbez when it shouldn't have been and made it so you couldn't finish the game. As a result, the editor only reads in the "regular" characters. Since the actors are dependent on characters, it will mess up if it tries to reference a "nonexistent" (as far as it can tell) character such as Golbez or Anna. The easiest (laziest ^_^) solution was to just exclude their actors.

I can probably jury rig something if there's significant demand for such functionality, but otherwise I'd rather focus on more pressing things like the tile editor. I'll certainly add it to the feature request list though ^_^;
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 20, 2014, 04:09:04 PM
I'll try to check that out eventually.

Nope, the descriptions are all that is off, the functionality is perfectly fine. Though if I may make another request... there's several UNKNOWN's in the AI functions, but they're all under UNKNOWN rather than UNKNOWN 1, 2, etc. and because they are all the same label, it makes it difficult to test what each one is doing. I think some of them at least may have some function. One is used in the King Eblan fight, one in a Dummy battle with a Programmer and Two are used by Zeromus(Crystal Use one) .

Ah, so that's the reason. I understand then why Golbez and Anna aren't included yet. Yes your current goal is a more pressing matter admittedly.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 23, 2014, 01:00:41 PM
I was thinking of adding the Serpent Road into my Combat Boost patch so I thought it might be best to test out this method. Then I came to the realization that I Don't know where the map pointers are. Do you happen to have any information on that PinkPuff?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on February 23, 2014, 03:03:00 PM
From yousei's doc:
Quote
B8200-B84FF   (178000-1782FF)   Town Map Pointers

is that what you're looking for?
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on February 23, 2014, 03:26:48 PM
Ah, since it said "Town Map" I thought it was referring purely to Towns... but there's not That many towns to take up that much space. Yes thank you very much Chillyfeez.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 04, 2014, 05:08:21 AM
  • At this point, everything I know how to do has already been incorporated into the editor. However, I will still be adding things as they are found and documented well enough to do a proper job of it.
Hi all, I was just checking back in about this.

So, the item descriptions are out of the question for now? Or were they merely forgotten in the midst of all these more exciting revelations?

Thanks for your time. :happy:
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 04, 2014, 09:27:53 AM
They were forgotten; they're on the to-do-list
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 04, 2014, 10:23:43 AM
Hmm, PinkPuff there might be something wrong with the Level Up Editor...

For my patch I changed Kain3 into Edge2 and Tellah3 into Cid2, now everything works fine for Tellah, but Kain3 when changed had something strange happen to it... when I changed Kain3 to Edge2 Kain's default level changed to 25 and he Lost all of his previous level up data up to Level 25. As in 00's were written into his Actual level up data before Level 25. I can go into the Hex editor and change that back, but it seems like a mistake that such a thing should have happened in the first place.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 05, 2014, 05:27:21 AM
Ok I think that fixed it. Give 'er a whirl and let me know.
Title: Re: Developing a comprehensive editor for FF4
Post by: vivify93 on March 05, 2014, 05:27:54 AM
They were forgotten; they're on the to-do-list
Alright, that's fair enough! The only reason I'm so leechy about this, is because the lack of item descriptions is the one thing stopping Project II from being at 100% completion. I mean, I could learn to do it myself, but I'm too lazy, so, yeah. Thanks again! You rock!!
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 05, 2014, 08:44:12 AM
Hmm, looks like it worked. I took the steps I originally did to see if it would act the same way and it appeared not to do so. Good work! Also is that an initial attempt to include Golbez with Character 14 references? Very nice!
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 14, 2014, 11:08:40 AM
Hi Pinkpuff - I discovered something that's not working right with FF4kster.
It seems the program isn't properly referencing (or editing) locations' treasure contents indices (byte 0C of location properties). It seems to work fine when changing/moving/adding treasure in rooms that already have treasure, but adding treasure to rooms that normally have no treasure is where the problem crops up.

For example: I'm adding a treasure chest in the Agart Inn, which normally has none. The Agart Inn's map index is 20 (hex), but its treasure contents index is 1F (for no discernible reason). When I edit the triggers in FF4kster, the treasure chest stays inaccessible unless I manually change the treasure contents index to 20 with a hex editor.

 :edit: looks like I'm wrong about how this byte works (I guess it's a running total of how many chests have been counted so far... ?), but the fact remains that it needs to be changed in order to add treasure chests where there previously were none.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 15, 2014, 06:10:49 AM
Huh, I thought I handled that one a long time ago; apparently not? I'll look into it. Thanks.

 :edit: Definitely hasn't been handled yet. I'm gonna need some details though, in terms of what it should be doing. The Treasure Index (byte 0C of map properties) should be computed by the number of "treasure" type triggers encountered so far when enumerating the maps in index order, correct? And it's only one byte, correct? But there are more than 255 treasures in the game aren't there? Does the index reset after the upper world maps?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 15, 2014, 02:37:52 PM
... Yeah, damn. I was hoping that was info known but not by me. I'll have to fiddle around a bit. I'll let you know when I figure it all out.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 16, 2014, 06:41:23 AM
Updated again!

I'm tackling some of the stuff on my to-do-list. I added the targeting to the command editor, and you can now tell Cover to index by job rather than actor. As well I went ahead and made the assumption that the treasure index works the way I think it does. Let me know if anything goes wonkee.
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 16, 2014, 05:48:57 PM
Looks like the Targeting works perfectly! That is so nice to have in the editor and cuts down on the need to jump to and fro with the Hex Editor and FF4kster. There's also another easy piece (at least I would imagine its easy) to implement that Chillyfeez discovered long ago, but it seems like the info fell through the cracks and that is the Charge Time for the various commands.

Quote from: Chillyfeez
there is a table in ROM at A0189 that contains one-byte-per-command references to the duration set to perform each command. Most of them are 00, which is immediate. 01 is not one second, though. These are pointers. I haven't tested all 256 options (and probably won't) but the following are used:
00: (most commands) immediate
01: (Charge) 5 seconds
02: (Dark Wave, a few others) 2 seconds
04: (Salve, Aim) 1 second
FE: (not used, but I tested it to see if it would crash the game - it doesn't) several hundred seconds

I'm unsure if its with a header or not, but it would make a nice addition.


However I did add another item to Rosa's House and the game... sort of well got a bit strange. The graphics glitched and not just the map graphics, even NPC's had black lines running through them.

For what its worth the item spot properly responded, but some item spots wouldn't yield their item any longer.
To try this for yourself go to Rosa's House, add a new Treasure Trigger and then load Baron up.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 17, 2014, 06:37:59 AM
Glad to hear something's working correctly on the first try ^_^;

Charge time: Awesome, thanks! And yeah that does sound familiar so I think it did fall through the cracks; there are probably several other things that met that fate, so I'm trying to be a bit more organized about things now. Anyway it looks like it will take some tinkering which I don't have time for right this minute but it's on the to-do-list.

As for the treasure thing, does a rom that has been loaded and saved (but not modified) using FF4kster show any signs of glitching, or is it just when you mess with the treasures?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 17, 2014, 10:57:18 AM
I got the same results as Grimoire LD. It looks like only a modified treasure list causes the glitching issue. Saving without making changes seems to be fine.

 :edit: OK, I've had a chance to investigate, and I think what should be happening is this: When adding a treasure to any given location, the way to make that treasure active is to increase byte 0C of the properties of each subsequent location by 01 (or by an amount equal to the amount of chests you're adding). Keep byte 0C of the map you're editing the same.
For instance, the treasure index byte of Baron Town is 00, meaning when searching for treasure contents in Baron, the game starts by looking at the first treasure. But it also references the treasure index of the next map, Village Mist. Mist's treasure index is 07, meaning once the game has accounted for 7 treasures in Baron, it will stop counting. By changing Mist's treasure index to 08, you activate all of Baron's chests, but negate one Mist chest, because you haven't yet adjusted the treasure index of the next map, Kaipo. Therefore, in order to add a chest seamlessly, you have to increase all subsequent locations' treasure indices by 01 (or remove a chest somewhere).

You are right, though, that the counting resets with map 0x100 (Kokkol's smithy). I think it's safe to presume that those indices can be left alone

 :edit: heh - I just re-read what I wrote... I mean they can be independent of the first set of maps, not entirely left alone.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 17, 2014, 03:30:14 PM
Ok so I implemented something that I think should fix it. See if it works correctly now...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 17, 2014, 07:30:38 PM
Cool. I'll try again in a bit. Will let you know.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 17, 2014, 11:26:09 PM
Hmmm... It looks like the same problems are still happening - the graphics glitches as well as the treasures not redistributing right. Which is odd because as far as I can tell, the indices did change appropriately. It must be changing something else, too...?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 18, 2014, 04:47:29 AM
Does the issue appear if you:

Open rom in FF4kster -> Enter Trigger Editor -> (change nothing) -> Leave Trigger Editor -> Save ROM -> Exit FF4kster
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 18, 2014, 09:47:30 AM
Yup
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 18, 2014, 04:43:19 PM
It looks like it's generating the correct numbers for a while, but then it starts to diverge at whatever map contains AA70B (headered)... I think it's Tower of Babil B1?

Then it's fine again for the underworld until AAD20...
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on March 18, 2014, 06:35:08 PM
It looks like it's generating the correct numbers for a while, but then it starts to diverge at whatever map contains AA70B (headered)... I think it's Tower of Babil B1?

Then it's fine again for the underworld until AAD20...

That is the correct map for that offset. 

What can I do to help?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 18, 2014, 06:51:26 PM
What can I do to help?

Hm, good question!

I think it's just a question of finding a pattern. Why is it messing up there and not earlier or later? What is it about that map that distinguishes it from the others before it?

Right now my code basically starts at 0, assigns that to the first map, then counts the treasures in the current map, adds that to the running total, then moves to the next map. Writes the running total so far to that map's treasure index, then adds on the treasure in that map and so on. It resets to 0 at map 256 (start of the underworld).

Here's the exact code (in FreeBASIC) if it helps:
Code: [Select]
for i as Integer = 1 to total_maps
 if i = 256 then treasures = 0
 maps(i).treasure_index = treasures
 for j as Integer = 1 to maps(i).triggers.Length()
  t = maps(i).triggers.PointerAt(j)
  if t->treasure then treasures += 1
 next
next
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on March 18, 2014, 10:39:49 PM
Here's the RAW bytes for the map before Tower of Babil B1F (which is a Save room) and the Tower of Babil B1F (entrance) map itself.  So, B1F has 2 treasure chests; one at 12 04 and the other at 1A 0C.  Obviously the Save room has none.  I've also included the RAW trigger data with the treasure bolded for the Tower of Babil B1F. 

Map Index A6 Data:  08 A6 2F 0A 10 17 7C 86 00 80 C9 1C A7
Map Index A7 Data:  0A A7 AF 0A 10 17 9B 86 00 4A CB 1C A8

Map A7 Trigger Data:  2800 1204FE80D0 1A0CFE80D0 1513A895141C12CA96031906

Do you have a way to debug what your app is doing right at that point?  I usually do a msgbox on routines in my apps in Visual Basic when I need to run a debug if there is a problem.  I don't see a reason why it should bug out? 
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 19, 2014, 03:28:33 PM
It writes the treasures so far before adding on the ones for the current map. So it's writing C9 for map A6 correctly, then seeing that map A6 has no chests, writes C9 again for map A7 (the original has CB instead). Then it adds the 2 chests from map A7 to get CB for map A8 (the original has CD instead). This seems to me to be the original breaking the pattern at this point. The question is, why?
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 19, 2014, 04:24:34 PM
Now... is this at all related to the graphical glitch that seems to accompany any trigger changes?
Sems like that would be a weird association.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on March 19, 2014, 06:09:11 PM
It writes the treasures so far before adding on the ones for the current map. So it's writing C9 for map A6 correctly, then seeing that map A6 has no chests, writes C9 again for map A7 (the original has CB instead). Then it adds the 2 chests from map A7 to get CB for map A8 (the original has CD instead). This seems to me to be the original breaking the pattern at this point. The question is, why?

So to make sure I completely understand, it loads A6 then writes $C9 (no chests) then loads A7 and writes $C9 again?  I think your editor may be off by one.  Indeed, Map A7 has a chest index of $CB A8 has a chest index of $CD.  Can you verify this?

*edit*
BTW, Map chest indexes 9E through A6 all should show $C9.  Maybe somewhere around there it gets off by one?
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 19, 2014, 06:28:07 PM
It's off in relation to the original treasure indexes, but I think it's correct in terms of counting the treasures, meaning the original is off for some reason.

Now... is this at all related to the graphical glitch that seems to accompany any trigger changes?
Sems like that would be a weird association.

Yup this whole treasure index thing seems to be the culprit. The code for updating the map treasure indexes is executed when you leave the trigger editor. So even if you change no triggers, entering and exiting the editor will cause the resulting game to glitch if you saved the rom.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on March 19, 2014, 06:42:53 PM
It's off in relation to the original treasure indexes, but I think it's correct in terms of counting the treasures, meaning the original is off for some reason.

Oh hell, that makes things complicated then...

I need to wrap my brain around that. 
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 21, 2014, 04:02:33 AM
Ok here's what I did. I got it to output to a text file as it was going. I'm dumping the results here; this is how you read it:

Map XXX: YY -> ZZ (N treasures)

XXX is the index of the map, 1-based, hex (i can easily make it decimal or have the name come up or whatever people find more useful)
YY is what the treasure index byte is for that map in the original.
ZZ is what the treasure index byte is as calculated by FF4kster.
N is how many treasures that map has. In theory this should be added to the current total to arrive at the next map's index.

Code: [Select]
Map 001: 0 -> 0 ( 7 treasures)
Map 002: 7 -> 7 ( 3 treasures)
Map 003: 10 -> 10 ( 1 treasures)
Map 004: 11 -> 11 ( 0 treasures)
Map 005: 11 -> 11 ( 3 treasures)
Map 006: 14 -> 14 ( 4 treasures)
Map 007: 18 -> 18 ( 1 treasures)
Map 008: 19 -> 19 ( 0 treasures)
Map 009: 19 -> 19 ( 0 treasures)
Map 00A: 19 -> 19 ( 0 treasures)
Map 00B: 19 -> 19 ( 0 treasures)
Map 00C: 19 -> 19 ( 4 treasures)
Map 00D: 23 -> 23 ( 2 treasures)
Map 00E: 25 -> 25 ( 0 treasures)
Map 00F: 25 -> 25 ( 2 treasures)
Map 010: 27 -> 27 ( 4 treasures)
Map 011: 31 -> 31 ( 0 treasures)
Map 012: 31 -> 31 ( 0 treasures)
Map 013: 31 -> 31 ( 0 treasures)
Map 014: 31 -> 31 ( 0 treasures)
Map 015: 31 -> 31 ( 0 treasures)
Map 016: 31 -> 31 ( 0 treasures)
Map 017: 31 -> 31 ( 0 treasures)
Map 018: 31 -> 31 ( 0 treasures)
Map 019: 31 -> 31 ( 0 treasures)
Map 01A: 31 -> 31 ( 0 treasures)
Map 01B: 31 -> 31 ( 0 treasures)
Map 01C: 31 -> 31 ( 0 treasures)
Map 01D: 31 -> 31 ( 0 treasures)
Map 01E: 31 -> 31 ( 0 treasures)
Map 01F: 31 -> 31 ( 0 treasures)
Map 020: 31 -> 31 ( 0 treasures)
Map 021: 31 -> 31 ( 0 treasures)
Map 022: 31 -> 31 ( 3 treasures)
Map 023: 34 -> 34 ( 0 treasures)
Map 024: 34 -> 34 ( 0 treasures)
Map 025: 34 -> 34 ( 0 treasures)
Map 026: 34 -> 34 ( 0 treasures)
Map 027: 34 -> 34 ( 0 treasures)
Map 028: 34 -> 34 ( 0 treasures)
Map 029: 34 -> 34 ( 0 treasures)
Map 02A: 34 -> 34 ( 0 treasures)
Map 02B: 34 -> 34 ( 3 treasures)
Map 02C: 37 -> 37 ( 0 treasures)
Map 02D: 37 -> 37 ( 0 treasures)
Map 02E: 37 -> 37 ( 0 treasures)
Map 02F: 37 -> 37 ( 6 treasures)
Map 030: 43 -> 43 ( 0 treasures)
Map 031: 43 -> 43 ( 0 treasures)
Map 032: 43 -> 43 ( 0 treasures)
Map 033: 43 -> 43 ( 0 treasures)
Map 034: 43 -> 43 ( 0 treasures)
Map 035: 43 -> 43 ( 0 treasures)
Map 036: 43 -> 43 ( 4 treasures)
Map 037: 47 -> 47 ( 2 treasures)
Map 038: 49 -> 49 ( 5 treasures)
Map 039: 54 -> 54 ( 1 treasures)
Map 03A: 55 -> 55 ( 0 treasures)
Map 03B: 55 -> 55 ( 3 treasures)
Map 03C: 58 -> 58 ( 3 treasures)
Map 03D: 61 -> 61 ( 0 treasures)
Map 03E: 61 -> 61 ( 1 treasures)
Map 03F: 62 -> 62 ( 1 treasures)
Map 040: 63 -> 63 ( 0 treasures)
Map 041: 63 -> 63 ( 1 treasures)
Map 042: 64 -> 64 ( 0 treasures)
Map 043: 64 -> 64 ( 3 treasures)
Map 044: 67 -> 67 ( 9 treasures)
Map 045: 76 -> 76 ( 1 treasures)
Map 046: 77 -> 77 ( 0 treasures)
Map 047: 77 -> 77 ( 0 treasures)
Map 048: 77 -> 77 ( 0 treasures)
Map 049: 77 -> 77 ( 0 treasures)
Map 04A: 77 -> 77 ( 4 treasures)
Map 04B: 81 -> 81 ( 0 treasures)
Map 04C: 81 -> 81 ( 0 treasures)
Map 04D: 81 -> 81 ( 0 treasures)
Map 04E: 81 -> 81 ( 0 treasures)
Map 04F: 81 -> 81 ( 1 treasures)
Map 050: 82 -> 82 ( 1 treasures)
Map 051: 83 -> 83 ( 4 treasures)
Map 052: 87 -> 87 ( 0 treasures)
Map 053: 87 -> 87 ( 0 treasures)
Map 054: 87 -> 87 ( 0 treasures)
Map 055: 87 -> 87 ( 0 treasures)
Map 056: 87 -> 87 ( 0 treasures)
Map 057: 87 -> 87 ( 0 treasures)
Map 058: 87 -> 87 ( 0 treasures)
Map 059: 87 -> 87 ( 0 treasures)
Map 05A: 87 -> 87 ( 0 treasures)
Map 05B: 87 -> 87 ( 0 treasures)
Map 05C: 87 -> 87 ( 1 treasures)
Map 05D: 88 -> 88 ( 8 treasures)
Map 05E: 96 -> 96 ( 18 treasures)
Map 05F: 114 -> 114 ( 1 treasures)
Map 060: 115 -> 115 ( 5 treasures)
Map 061: 120 -> 120 ( 0 treasures)
Map 062: 120 -> 120 ( 2 treasures)
Map 063: 122 -> 122 ( 4 treasures)
Map 064: 126 -> 126 ( 2 treasures)
Map 065: 128 -> 128 ( 5 treasures)
Map 066: 133 -> 133 ( 3 treasures)
Map 067: 136 -> 136 ( 0 treasures)
Map 068: 136 -> 136 ( 0 treasures)
Map 069: 136 -> 136 ( 0 treasures)
Map 06A: 136 -> 136 ( 0 treasures)
Map 06B: 136 -> 136 ( 0 treasures)
Map 06C: 136 -> 136 ( 0 treasures)
Map 06D: 136 -> 136 ( 4 treasures)
Map 06E: 140 -> 140 ( 0 treasures)
Map 06F: 140 -> 140 ( 0 treasures)
Map 070: 140 -> 140 ( 5 treasures)
Map 071: 145 -> 145 ( 3 treasures)
Map 072: 148 -> 148 ( 2 treasures)
Map 073: 150 -> 150 ( 2 treasures)
Map 074: 152 -> 152 ( 4 treasures)
Map 075: 156 -> 156 ( 0 treasures)
Map 076: 156 -> 156 ( 2 treasures)
Map 077: 158 -> 158 ( 2 treasures)
Map 078: 160 -> 160 ( 6 treasures)
Map 079: 166 -> 166 ( 3 treasures)
Map 07A: 169 -> 169 ( 0 treasures)
Map 07B: 169 -> 169 ( 3 treasures)
Map 07C: 172 -> 172 ( 1 treasures)
Map 07D: 173 -> 173 ( 0 treasures)
Map 07E: 173 -> 173 ( 0 treasures)
Map 07F: 173 -> 173 ( 0 treasures)
Map 080: 173 -> 173 ( 1 treasures)
Map 081: 174 -> 174 ( 0 treasures)
Map 082: 174 -> 174 ( 4 treasures)
Map 083: 178 -> 178 ( 0 treasures)
Map 084: 178 -> 178 ( 3 treasures)
Map 085: 181 -> 181 ( 2 treasures)
Map 086: 183 -> 183 ( 0 treasures)
Map 087: 183 -> 183 ( 2 treasures)
Map 088: 185 -> 185 ( 0 treasures)
Map 089: 185 -> 185 ( 0 treasures)
Map 08A: 185 -> 185 ( 0 treasures)
Map 08B: 185 -> 185 ( 0 treasures)
Map 08C: 185 -> 185 ( 0 treasures)
Map 08D: 185 -> 185 ( 2 treasures)
Map 08E: 187 -> 187 ( 1 treasures)
Map 08F: 188 -> 188 ( 2 treasures)
Map 090: 190 -> 190 ( 0 treasures)
Map 091: 190 -> 190 ( 3 treasures)
Map 092: 193 -> 193 ( 1 treasures)
Map 093: 194 -> 194 ( 0 treasures)
Map 094: 194 -> 194 ( 1 treasures)
Map 095: 195 -> 195 ( 0 treasures)
Map 096: 195 -> 195 ( 0 treasures)
Map 097: 195 -> 195 ( 0 treasures)
Map 098: 195 -> 195 ( 0 treasures)
Map 099: 195 -> 195 ( 1 treasures)
Map 09A: 196 -> 196 ( 1 treasures)
Map 09B: 197 -> 197 ( 0 treasures)
Map 09C: 197 -> 197 ( 0 treasures)
Map 09D: 197 -> 197 ( 0 treasures)
Map 09E: 197 -> 197 ( 4 treasures)
Map 09F: 201 -> 201 ( 0 treasures)
Map 0A0: 201 -> 201 ( 0 treasures)
Map 0A1: 201 -> 201 ( 0 treasures)
Map 0A2: 201 -> 201 ( 0 treasures)
Map 0A3: 201 -> 201 ( 0 treasures)
Map 0A4: 201 -> 201 ( 0 treasures)
Map 0A5: 201 -> 201 ( 0 treasures)
Map 0A6: 201 -> 201 ( 0 treasures)
Map 0A7: 201 -> 201 ( 0 treasures)
Map 0A8: 203 -> 201 ( 2 treasures)
Map 0A9: 205 -> 203 ( 1 treasures)
Map 0AA: 206 -> 204 ( 1 treasures)
Map 0AB: 207 -> 205 ( 1 treasures)
Map 0AC: 208 -> 206 ( 0 treasures)
Map 0AD: 208 -> 206 ( 1 treasures)
Map 0AE: 209 -> 207 ( 0 treasures)
Map 0AF: 212 -> 207 ( 0 treasures)
Map 0B0: 214 -> 207 ( 0 treasures)
Map 0B1: 214 -> 207 ( 0 treasures)
Map 0B2: 214 -> 207 ( 0 treasures)
Map 0B3: 214 -> 207 ( 0 treasures)
Map 0B4: 214 -> 207 ( 0 treasures)
Map 0B5: 214 -> 207 ( 0 treasures)
Map 0B6: 214 -> 207 ( 0 treasures)
Map 0B7: 214 -> 207 ( 0 treasures)
Map 0B8: 214 -> 207 ( 5 treasures)
Map 0B9: 219 -> 212 ( 0 treasures)
Map 0BA: 219 -> 212 ( 2 treasures)
Map 0BB: 221 -> 214 ( 1 treasures)
Map 0BC: 222 -> 215 ( 0 treasures)
Map 0BD: 222 -> 215 ( 0 treasures)
Map 0BE: 222 -> 215 ( 0 treasures)
Map 0BF: 222 -> 215 ( 0 treasures)
Map 0C0: 222 -> 215 ( 0 treasures)
Map 0C1: 222 -> 215 ( 0 treasures)
Map 0C2: 222 -> 215 ( 0 treasures)
Map 0C3: 222 -> 215 ( 0 treasures)
Map 0C4: 222 -> 215 ( 0 treasures)
Map 0C5: 222 -> 215 ( 0 treasures)
Map 0C6: 222 -> 215 ( 0 treasures)
Map 0C7: 222 -> 215 ( 0 treasures)
Map 0C8: 222 -> 215 ( 3 treasures)
Map 0C9: 225 -> 218 ( 0 treasures)
Map 0CA: 225 -> 218 ( 12 treasures)
Map 0CB: 237 -> 230 ( 4 treasures)
Map 0CC: 241 -> 234 ( 0 treasures)
Map 0CD: 241 -> 234 ( 0 treasures)
Map 0CE: 241 -> 234 ( 1 treasures)
Map 0CF: 242 -> 235 ( 2 treasures)
Map 0D0: 244 -> 237 ( 1 treasures)
Map 0D1: 245 -> 238 ( 0 treasures)
Map 0D2: 245 -> 238 ( 1 treasures)
Map 0D3: 246 -> 239 ( 1 treasures)
Map 0D4: 247 -> 240 ( 1 treasures)
Map 0D5: 248 -> 241 ( 1 treasures)
Map 0D6: 249 -> 242 ( 0 treasures)
Map 0D7: 249 -> 242 ( 0 treasures)
Map 0D8: 249 -> 242 ( 0 treasures)
Map 0D9: 249 -> 242 ( 0 treasures)
Map 0DA: 249 -> 242 ( 0 treasures)
Map 0DB: 249 -> 242 ( 0 treasures)
Map 0DC: 249 -> 242 ( 0 treasures)
Map 0DD: 249 -> 242 ( 0 treasures)
Map 0DE: 249 -> 242 ( 0 treasures)
Map 0DF: 249 -> 242 ( 0 treasures)
Map 0E0: 249 -> 242 ( 0 treasures)
Map 0E1: 249 -> 242 ( 0 treasures)
Map 0E2: 249 -> 242 ( 0 treasures)
Map 0E3: 249 -> 242 ( 0 treasures)
Map 0E4: 249 -> 242 ( 0 treasures)
Map 0E5: 249 -> 242 ( 0 treasures)
Map 0E6: 249 -> 242 ( 0 treasures)
Map 0E7: 249 -> 242 ( 0 treasures)
Map 0E8: 249 -> 242 ( 0 treasures)
Map 0E9: 249 -> 242 ( 0 treasures)
Map 0EA: 249 -> 242 ( 0 treasures)
Map 0EB: 249 -> 242 ( 0 treasures)
Map 0EC: 249 -> 242 ( 0 treasures)
Map 0ED: 249 -> 242 ( 0 treasures)
Map 0EE: 249 -> 242 ( 0 treasures)
Map 0EF: 249 -> 242 ( 0 treasures)
Map 0F0: 249 -> 242 ( 0 treasures)
Map 0F1: 249 -> 242 ( 0 treasures)
Map 0F2: 249 -> 242 ( 0 treasures)
Map 0F3: 249 -> 242 ( 0 treasures)
Map 0F4: 249 -> 242 ( 0 treasures)
Map 0F5: 249 -> 242 ( 0 treasures)
Map 0F6: 249 -> 242 ( 0 treasures)
Map 0F7: 249 -> 242 ( 0 treasures)
Map 0F8: 249 -> 242 ( 0 treasures)
Map 0F9: 249 -> 242 ( 0 treasures)
Map 0FA: 249 -> 242 ( 0 treasures)
Map 0FB: 249 -> 242 ( 0 treasures)
Map 0FC: 249 -> 242 ( 0 treasures)
Map 0FD: 249 -> 242 ( 0 treasures)
Map 0FE: 249 -> 242 ( 0 treasures)
Map 0FF: 249 -> 242 ( 0 treasures)
Map 100: 249 -> 242 ( 0 treasures)
Map 101: 0 -> 0 ( 0 treasures)
Map 102: 0 -> 0 ( 0 treasures)
Map 103: 0 -> 0 ( 3 treasures)
Map 104: 3 -> 3 ( 1 treasures)
Map 105: 4 -> 4 ( 0 treasures)
Map 106: 4 -> 4 ( 0 treasures)
Map 107: 4 -> 4 ( 6 treasures)
Map 108: 10 -> 10 ( 0 treasures)
Map 109: 10 -> 10 ( 0 treasures)
Map 10A: 10 -> 10 ( 0 treasures)
Map 10B: 10 -> 10 ( 3 treasures)
Map 10C: 13 -> 13 ( 3 treasures)
Map 10D: 16 -> 16 ( 0 treasures)
Map 10E: 16 -> 16 ( 0 treasures)
Map 10F: 16 -> 16 ( 0 treasures)
Map 110: 16 -> 16 ( 0 treasures)
Map 111: 16 -> 16 ( 1 treasures)
Map 112: 17 -> 17 ( 1 treasures)
Map 113: 18 -> 18 ( 0 treasures)
Map 114: 18 -> 18 ( 0 treasures)
Map 115: 18 -> 18 ( 0 treasures)
Map 116: 18 -> 18 ( 1 treasures)
Map 117: 19 -> 19 ( 1 treasures)
Map 118: 20 -> 20 ( 1 treasures)
Map 119: 21 -> 21 ( 1 treasures)
Map 11A: 22 -> 22 ( 4 treasures)
Map 11B: 26 -> 26 ( 4 treasures)
Map 11C: 30 -> 30 ( 2 treasures)
Map 11D: 32 -> 32 ( 0 treasures)
Map 11E: 32 -> 32 ( 1 treasures)
Map 11F: 33 -> 33 ( 0 treasures)
Map 120: 34 -> 33 ( 1 treasures)
Map 121: 35 -> 34 ( 0 treasures)
Map 122: 35 -> 34 ( 3 treasures)
Map 123: 38 -> 37 ( 1 treasures)
Map 124: 39 -> 38 ( 3 treasures)
Map 125: 42 -> 41 ( 2 treasures)
Map 126: 44 -> 43 ( 2 treasures)
Map 127: 46 -> 45 ( 1 treasures)
Map 128: 47 -> 46 ( 1 treasures)
Map 129: 48 -> 47 ( 1 treasures)
Map 12A: 49 -> 48 ( 0 treasures)
Map 12B: 49 -> 48 ( 0 treasures)
Map 12C: 49 -> 48 ( 0 treasures)
Map 12D: 49 -> 48 ( 0 treasures)
Map 12E: 49 -> 48 ( 0 treasures)
Map 12F: 49 -> 48 ( 0 treasures)
Map 130: 49 -> 48 ( 0 treasures)
Map 131: 49 -> 48 ( 0 treasures)
Map 132: 49 -> 48 ( 0 treasures)
Map 133: 49 -> 48 ( 0 treasures)
Map 134: 49 -> 48 ( 0 treasures)
Map 135: 49 -> 48 ( 0 treasures)
Map 136: 49 -> 48 ( 0 treasures)
Map 137: 49 -> 48 ( 3 treasures)
Map 138: 52 -> 51 ( 2 treasures)
Map 139: 54 -> 53 ( 6 treasures)
Map 13A: 60 -> 59 ( 0 treasures)
Map 13B: 61 -> 59 ( 5 treasures)
Map 13C: 66 -> 64 ( 4 treasures)
Map 13D: 70 -> 68 ( 0 treasures)
Map 13E: 70 -> 68 ( 2 treasures)
Map 13F: 72 -> 70 ( 0 treasures)
Map 140: 72 -> 70 ( 0 treasures)
Map 141: 72 -> 70 ( 0 treasures)
Map 142: 72 -> 70 ( 0 treasures)
Map 143: 72 -> 70 ( 0 treasures)
Map 144: 72 -> 70 ( 0 treasures)
Map 145: 72 -> 70 ( 0 treasures)
Map 146: 72 -> 70 ( 10 treasures)
Map 147: 82 -> 80 ( 10 treasures)
Map 148: 92 -> 90 ( 4 treasures)
Map 149: 96 -> 94 ( 6 treasures)
Map 14A: 102 -> 100 ( 2 treasures)
Map 14B: 104 -> 102 ( 1 treasures)
Map 14C: 105 -> 103 ( 2 treasures)
Map 14D: 107 -> 105 ( 2 treasures)
Map 14E: 109 -> 107 ( 2 treasures)
Map 14F: 111 -> 109 ( 2 treasures)
Map 150: 113 -> 111 ( 3 treasures)
Map 151: 116 -> 114 ( 1 treasures)
Map 152: 117 -> 115 ( 1 treasures)
Map 153: 118 -> 116 ( 1 treasures)
Map 154: 119 -> 117 ( 2 treasures)
Map 155: 121 -> 119 ( 2 treasures)
Map 156: 123 -> 121 ( 0 treasures)
Map 157: 125 -> 121 ( 0 treasures)
Map 158: 125 -> 121 ( 0 treasures)
Map 159: 125 -> 121 ( 0 treasures)
Map 15A: 125 -> 121 ( 0 treasures)
Map 15B: 125 -> 121 ( 2 treasures)
Map 15C: 127 -> 123 ( 2 treasures)
Map 15D: 129 -> 125 ( 0 treasures)
Map 15E: 129 -> 125 ( 0 treasures)
Map 15F: 129 -> 125 ( 0 treasures)
Map 160: 129 -> 125 ( 0 treasures)
Map 161: 129 -> 125 ( 0 treasures)
Map 162: 131 -> 125 ( 0 treasures)
Map 163: 131 -> 125 ( 0 treasures)
Map 164: 131 -> 125 ( 3 treasures)
Map 165: 134 -> 128 ( 0 treasures)
Map 166: 134 -> 128 ( 0 treasures)
Map 167: 134 -> 128 ( 0 treasures)
Map 168: 134 -> 128 ( 1 treasures)
Map 169: 135 -> 129 ( 3 treasures)
Map 16A: 138 -> 132 ( 3 treasures)
Map 16B: 142 -> 135 ( 2 treasures)
Map 16C: 144 -> 137 ( 5 treasures)
Map 16D: 150 -> 142 ( 4 treasures)
Map 16E: 154 -> 146 ( 0 treasures)
Map 16F: 154 -> 146 ( 2 treasures)
Map 170: 156 -> 148 ( 2 treasures)
Map 171: 158 -> 150 ( 2 treasures)
Map 172: 160 -> 152 ( 0 treasures)
Map 173: 160 -> 152 ( 0 treasures)
Map 174: 160 -> 152 ( 1 treasures)
Map 175: 161 -> 153 ( 2 treasures)
Map 176: 163 -> 155 ( 1 treasures)
Map 177: 164 -> 156 ( 1 treasures)
Map 178: 165 -> 157 ( 1 treasures)
Map 179: 166 -> 158 ( 0 treasures)
Map 17A: 166 -> 158 ( 1 treasures)
Map 17B: 167 -> 159 ( 0 treasures)
Map 17C: 168 -> 159 ( 0 treasures)
Map 17D: 168 -> 159 ( 2 treasures)
Map 17E: 170 -> 161 ( 0 treasures)
Map 17F: 170 -> 161 ( 0 treasures)
Map 180: 169 -> 161 ( 0 treasures)
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 21, 2014, 09:36:07 AM
So if I'm reading this right then the original game, at a few particular spots, increases the "treasure index" byte by an amount not equal to the amount of treasures in the previous map.
This occurs at:
Code: [Select]
0A8 by +002
0AF by +003
0B0 by +002
120 by +001
13B by +001
157 by +002
162 by +002
16B by +001
16D by +001
17C by +001
180 by -001

I see no discernible pattern.
Seems this would indicate that this byte has some second, as-yet-undiscovered, significance.

For the sake of a working FF4kster, might it help to change the way it calculates this byte?
Say, instead of counting total treasures per location and assigning potentially brand new values to each location's treasure index... maybe logging the changes made in the current session and increasing the existing value for every relevant (subsequent, within the same 0x100) map?

Granted, I'm not a programmer, so I have no idea how feasible this idea would be.

Alternatively, you could take these particular discrepancies into account and try simply implementing them after the initial calculations are done.
Title: Re: Developing a comprehensive editor for FF4
Post by: avaquizzer on March 21, 2014, 10:08:00 AM
I had a thought, though it might very well be completely unrelated.  If so, please forgive my ignorance.  Also, since this is my first post, "Hello everyone!"

I recall reading (on the website http://arcanelore.net/articles/ff4wrong/  at the very bottom) that there are several "treasures" in the game that aren't really treasures at all.  And the first one of these occurs in the Tower of Bab-il (although, on floor 7F, not B1F).  The second one occurs in the Sealed Cave, which is in the underground (and PinkPuff mentions that this screwy treasure index problem seems to occur in the Tower of Bab-il, and again in the underworld).  Could this be the source of the error?

I just want to say, I've been following this website for quite some time and am really impressed with the progress being made on hashing out all of the behind-the-scenes stuff of my favorite game.  I'm also impressed with the statistical regressions of LordGaramonde.  Just to give some background, I'm a math and computer science teacher (though I only know the very basics of CS, not nearly as much as PinkPuff or the hex-editing community here; I basically teach an AP CS course using Java so we stay away from memory management).  I just find this project absolutely fascinating.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 21, 2014, 10:37:46 AM
I see no discernible pattern.
Seems this would indicate that this byte has some second, as-yet-undiscovered, significance.

Either that or, something happened at some point during development (maps were moved around or rearranged entirely, treasures removed, etc) and the treasure index was not updated and it still expects those "ghost chests" to be accounted for.

However I kinda suspect that you're right, it could be affecting something else that we don't know about. Like, why would the graphics glitch from a simple treasure pointer misalignment... ??? You would think it would just cause screwy treasure contents or maybe some of the other triggers to mess up, like teleporters or event triggers.

For the sake of a working FF4kster, might it help to change the way it calculates this byte?
Say, instead of counting total treasures per location and assigning potentially brand new values to each location's treasure index... maybe logging the changes made in the current session and increasing the existing value for every relevant (subsequent, within the same 0x100) map?

Granted, I'm not a programmer, so I have no idea how feasible this idea would be.

Alternatively, you could take these particular discrepancies into account and try simply implementing them after the initial calculations are done.

I think I'll try the second one; sounds like the same result but easier. Hopefully it won't mess anything else up.
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 21, 2014, 10:43:17 AM
hmm... that's pretty curious, avaquizzer (and, welcome!).

Yep, it looks like each of those maps are on the list of those that precede index oddities.
In order to determine from the index above which map has the "wrong" amount of treasures accounted for, you would subtract 2 from its map index - one because the treasure index references the amount of treasures from the previous map, and one because Pinkpuff started counting at 001 instead of 000.
The others are inaccessible maps (backgrounds, foregrounds, etc.), with the exception of I believe one save point room (perhaps there are a few undiscovered hidden treasures?).

Each is also located "within" a trigger point, it seems (so approaching the trigger point like a chest yields the treasure, instead of standing on it). I'd be willing to bet the parameters of the treasures collected match those of the teleport or event call.

Most likely though, these hidden treasures are an unintentional byproduct of the index oddities.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 21, 2014, 11:53:00 AM
This is interesting... if I don't change the treasure index of the final map... no graphical glitches!

Current version posted, let me know if it messes up for you guys now. And if it doesn't, let me know if adding/removing treasures works correctly.
Title: Re: Developing a comprehensive editor for FF4
Post by: JCE3000GT on March 21, 2014, 01:49:51 PM
I came in here about to post some stuff but seems my input wouldn't be as helpful as chilyfeez's.  I'll test the app this evening when I have time to sit down in front of the computer.  :)
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 22, 2014, 11:22:36 AM
Well, granted that my ability to test is limited by knowledge of which RAM bits to change in order to unlock certain locations or my patience to change things in FF4kster in order to circumvent said limitations, but it seems like things are working perfectly from what I can tell.
 :cookie: for you!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 25, 2014, 06:58:19 AM
Updated again! This time... ...

... ... wait for it ... ...

ITEM DESCRIPTIONS!!

Here's how it works: In the Features editor you can change the range of items that have descriptions. In the Messages editor, you can edit what the descriptions themselves say (their text). In the editors for the various kinds of items, you can edit which item has which description index, if that item is within the range of items that have descriptions. It will be in the same box with the name and other misc info.

As usual, have at 'er and let me know what kinds of horrible game-destroying bugs I've introduced this time ^_^;
Title: Re: Developing a comprehensive editor for FF4
Post by: Grimoire LD on March 25, 2014, 04:22:47 PM
Wonderful! Sorry I haven't been around lately. My free time has been Absorbed by Bravely Default (A more apt love-letter to FF and FF4 in particular I've never seen, with similar themes in some respects I would urge any fans of classic FF to pick this gem up) but just beat it yesterday. Just in time for Dynasty Warriors 8 Xtreme Legends. I will test the editor and see if all the new portions work correctly.

 :edit: Whoa ho! 60 Descriptions available?! I was not counting on that by any means! Unfortunately, though you can give description assignments to weapons and armor, they don't actually show up because it seems the extra message box isn't called for those items, I think Lenophis posted a fix for this at one point... I'd have to take a look.

Looks like switching around labels and descriptions works fine. Fantastic update Pinkpuff! And there's room to spare because the vast majority of the text is "Dummy" rather than "D".

 :edit: 2: http://slickproductions.org/forum/index.php?topic=1804.msg20683#new Ahem... right. Seems I should learn to read. I'll try that out now then as well.

Yes indeed! They work great! You could give specific descriptions to anything you like now! Excellent job PinkPuff!
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 26, 2014, 05:47:33 AM
 :childish: Yay for things working correctly!

I should warn though that there is currently no safeguard for data bleeding with the item descriptions, so be careful not to be too verbose...
Title: Re: Developing a comprehensive editor for FF4
Post by: chillyfeez on March 26, 2014, 08:42:24 AM
I was wondering about that. Good to know.
Title: Re: Developing a comprehensive editor for FF4
Post by: Pinkpuff on March 26, 2014, 03:59:47 PM
Also a syntax update... In the AI there's a command called "Cast Black or White Magic Spell" and "Cast a Special Spell". Now the first one tells the enemy to randomly single target an ally or enemy. The second one tells the game to Multi-Target. There doesn't