• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 02:09:24 pm

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


Total Request ASM: All armor replaced by shoes

Started by pokeytax, January 02, 2011, 10:16:01 am

Choto

Thanks for those tips Glain, I definitely wasn't aware of that word loading/storing issue :P

Glain

Pokeytax, my best guess on that ALMA issue is memory corruption. I've had really bizarre things happen when one of my hacks writes to the wrong place in memory; for example, the AI slowing down the game, acting strangely and running into corners, ending their turns without acting for no reason, and nearly grinding the game to a halt before crashing the emulator. (Might be the best error I've ever caused -- has a bit more style than the up-front emulator crashes! :D)

All that from one wrong store instruction. There's nothing wrong in the syntax and no pipeline hazards but chaos is running wild nonetheless. I'd check the store instructions in a debugger to make sure they're storing the right values in the right places.

And no, I don't think you can cram too many instructions into a CPU pipeline. They're built to be able to handle all that fun stuff!
  • Modding version: Other/Unknown

Kurosabes

After some testing, I found out the potion slots used in the Auto Potion hack only affect allies, not enemies. I found a way around this by simply altering Potion in FFTpatcher to heal as much as desired (as enemies use that auto potion slot by default no matter what, they have infinite Potions) and removing "Potion" from the game and giving Eye Drops the same effect as a Potion. It was just convenient that my patch had Eye drops disabled however. Not sure if that was a known issue or not but I'm pointing it out for those that don't know.
  • Modding version: PSX
  • Discord username: Kurosabes#0312

Choto

While we're on the topic, maybe i'm having a dumb moment.. But is there a way to fix that word-aligned loading and storing problem without moving the thing you're loading? I'm guessing you could just put two lbu's... but that seems crumby. How does vanilla code do so?

Pride

im not too sure what your asking choto... you mean you have a half word stored at 0x0001 and you want to load it as a half word without moving the table?
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Choto

pretty much Pride.. I was just looking at fixing the ARH code. I guess you'd have to do a lw at the even location and then OR or shift the stuff you don't want away, or move the table..

Glain

There's a routine somewhere in the code that loads halfwords regardless of alignment by issuing two load byte instructions as Choto described.

IIRC, the result is basically lhu r2, 0(r4) except r4 can contain an odd address.  I always thought it was the most pointless routine ever until I thought about the halfword alignment.

EDIT - It's at RAM 0x146078 (comes from battle.bin).  I added it to the wiki.
EDIT 2 - It mimics lh, not lhu.  It sign extends the first 16 bits via sll/sra.

EDIT for below - I can tell you the random equip algorithm is pretty dumb (hardcodes item IDs to search for valid equipment), so it probably will indeed try to give units the same type of item in different slots.
  • Modding version: Other/Unknown

pokeytax

This is an upgraded version of the equipment sorting hacks/spreadsheet earlier in this thread.  It lets you change shields to hats to armors to accessories, and change which items go in which slots.  For example, vanilla has 16 shields / 28 hats / 36 armors / 32 accessories.  You could change that to 16/32/32/32; or to 24 shields / 40 hats / 48 accessories and allow a second accessory in place of armor; or 96 accessories and three accessory equip slots.  You will need to change the item's type in FFTPatcher to match its new classification, and you should probably not change weapons into other equipment into items.

This should be pretty robust, covering the formation screen, the unit random equip algorithm, Equip Change (ugh), previews, and shops.  However, I'm sure I still missed some things, so let me know if you find them (and backup your patch before you try it).  Units with preset equipment will still have what you gave them, even if they absurdly have a helmet and armor instead of three hats, and the random equip algorithm might well give people two of the same thing, but it's a start.

Still need to figure out how to make the six throwables fully usable weapons and sort out some of the grousing it is doing about HP/MP <=> PEv/MEv.  [EDIT: hm, I just stabbed somebody with a Yagyu Darkness after changing item data.  I'll have to test more but this is looking better than it did last time I tried.]  And I would like to have this interact with RSM so that RSM could change your equip scheme... but wow, talk about a headache.
  • Modding version: PSX

Celdia

I almost wish I weren't done with my equipment reshuffling so that I could use this.

One thought comes to mind about details: When changing a non-shield into a shield, will the new item display the proper graphics in battle when the equipped unit blocks with a shield?
  • Modding version: PSX
  • Discord username: Celdia#0

pokeytax

February 20, 2013, 11:28:10 pm #349 Last Edit: February 20, 2013, 11:35:12 pm by pokeytax
I'm going to do some tinkering and find out.  I would guess so (should just pull the palette and graphic) but I'm still concentrating on getting basic gear shipshape rather than weapons/throwables/shields.  I certainly wouldn't be shocked if there is more dumb hardcoding there.  In fact, my Yagyu Darkness looked like a dagger, which is suspiciously normal... hm.  Definitely still a lot of work to do.

Glain, I adjusted those hardchecks - but if I read your thread right, the random equip routine isn't all that random, so I'll probably get randoms with three Leather Mantles rather than an interesting and diverse mix of stuff, right?

I think I'm going to have to code a multiplicative evasion routine for multiple accessories.  I need to do something to repair base functionality in any case and additive evasion gets too silly too fast.
  • Modding version: PSX

Glain

The randomness in the random equipment routine has to do with item level, I believe...

It basically finds the "peaks" in the item level for a given equipment slot... let's say it was searching through the list of items and saw this for the item levels:
3, 7, 10, 12, 2, 5, 8, 9, 7, 8, 3, 10

It would pick item #4 (item level 12), #8 (item level 9), #10 (item level 8), and #12 (item level 10), then randomly choose between one of those.  Basically the more peaks you have in the
item levels, the more options you'll get.  I believe the idea is that if the item level ever goes down, it must be a new type of item that it should consider.

Or, rather... that's the way it's supposed to work, and it will work that way if you use my hack to make random unit gear more selective.  What it actually does in vanilla is, IIRC... if the item level ever goes down, every subsequent item it encounters, no matter how low level, will be added to the list for random selection (and get an equal chance of being selected). 
Hooray, Chapter 4 Linen Robes! (In this example, it would be items 4, 5, 6, 7, 8, 9, 10, 11, 12)
  • Modding version: Other/Unknown

hierophant

February 23, 2013, 09:23:55 am #351 Last Edit: February 23, 2013, 11:45:01 am by hierophant
Edit:  trying to make more plausible requests:

--Skip title screen, go directly to an event.
--Have an equipped item allow access to a command set. (For example, an equipped masamune allows access to the "masamune" skillset, populated by the "masamune" ability)
--Any ability that would check for range checks the jump stat for horiz/vert range.  Never mind if this would affect Attack.  Also with this:  Move stat = Move & Jump.

Edit2:  So I forgot monster skill triggers on adjacent monsters.  Could this be rigged to give a unit haste when an enemy is adjacent?

pokeytax

Quote from: hierophant on February 23, 2013, 09:23:55 am
--Skip title screen, go directly to an event.


Skipping the introduction and booting immediately to an event in New Game is something I have tried a few times and found very difficult.  But it's also something many patches would like, so I haven't given up.  Skipping the title screen entirely might be doable once that's figured out.

Quote from: hierophant on February 23, 2013, 09:23:55 am
--Have an equipped item allow access to a command set. (For example, an equipped masamune allows access to the "masamune" skillset, populated by the "masamune" ability)


You can do this using the Skillsets tab of the ALMA spreadsheet: http://ffhacktics.com/smf/index.php?topic=6664.0.

I definitely recommend you check the Important Links thread in this forum, particularly "Programs, Spreadsheets, Other Utilities".  Stuff like Raven's Spreadsheets and ALMA, if you aren't already familiar, will give you a lot of functionality to play with.

Quote from: hierophant on February 23, 2013, 09:23:55 am
--Any ability that would check for range checks the jump stat for horiz/vert range.  Never mind if this would affect Attack.  Also with this:  Move stat = Move & Jump.


This is a little involved, because you would have to change every Jump check in the code.  It's also probably not very generally applicable, and would only help your patch.  It never hurts to ask!  But realistically, with so much else to do, I don't think I will ever get to this one.

Quote
Edit2:  So I forgot monster skill triggers on adjacent monsters.  Could this be rigged to give a unit haste when an enemy is adjacent?


Unfortunately, the game only checks this (I would guess) when you open a monster's skillset.  I have been thinking about how to route some more context-sensitive stuff like this through ALMA, but it would take some work.
  • Modding version: PSX

Celdia

Quote from: pokeytax on February 23, 2013, 07:21:47 pm

Quote from: hierophant on February 23, 2013, 09:23:55 am
--Have an equipped item allow access to a command set. (For example, an equipped masamune allows access to the "masamune" skillset, populated by the "masamune" ability)


You can do this using the Skillsets tab of the ALMA spreadsheet: http://ffhacktics.com/smf/index.php?topic=6664.0.


I just want to point out - since I saw the original request and almost posted about it - the idea for Items specifically in this won't work with the ALMA Skillsets sheet [though I like your idea for Item bags] but I believe the error is tied to something else. I have successfully bound a Normal skillset to a piece of equipment as well as a limited-and-fully-mastered Jump skillset. You can NOT use Item, Throw [Weapon Inventory] or Draw Out [Katana Inventory] action sets with this. I don't know where it's documented exactly, but there is some issue with the other strange skillset types when using them outside of their original places. From my own testing I know for certain that Item, Throw and Draw Out skillsets [even with the Action Menus set correctly and both applying the Generic Skillset Fix and not applying it] will display the equipment-accessed skillset on your action menu in battle but it will be greyed out and will tell you no abilities have been learned even when using a skillset slot that should be automatically Mastered. I haven't tested Elemental, but that may work for this.


If you want to see Jump working with this, grab my CCP 2nd Beta patch and get ahold of the Dragoon Boots item. It replaces Attack with a Jump command that gives Range 3 and Vertical 5. The Dragoon job gives a Range 5/Vert 8 Jump command in addition to the normal Attack command even when their skillset is added as a Secondary skillset [which also has more Normal skills in it] and there is another item that let's you access a special command set when equipped but I don't think that's normally accessible in the Beta version...
  • Modding version: PSX
  • Discord username: Celdia#0

pokeytax

February 24, 2013, 11:23:58 am #354 Last Edit: February 24, 2013, 11:31:17 am by pokeytax
Glain, that should work great then (with your fix applied).  Also that's really good knowledge to have.  By manipulating what order you have items in, you can tell the game which accessories to consider.

Hm, thanks for that note, Celdia.  I really need to code up something that allows you to determine, for every skillset, what skills are considered learned, so you can have stuff like Red Magic.  Probably when I redo RAD I will try to allow a lot of that functionality separately, for people who don't necessarily need a bunch of jobs but do need better controls over skillsets, learned abilities, etc.

I updated the equipment sorting hack to properly load accessory evasion multiplicatively (e.g. 3 x Small Mantle gives 28% evasion, not 30%).  I don't know of any other bugs yet, but it's too wide-ranging of a hack for there not to be any.
  • Modding version: PSX

Choto

Quote from: pokeytax on February 24, 2013, 11:23:58 am
I really need to code up something that allows you to determine, for every skillset, what skills are considered learned, so you can have stuff like Red Magic.


If you do so, these routines may be helpful. They span from 00181584 to 001822c8. I posted them up on the wiki in case they may help. Sorry in advance for my shotty notation :P.

They are the routines that find known abilities for a skillset and load them to a list to be put into the skillset.

Astos

I have a question about the "R/S/M designates learn on hit". It says byte 91 value 10 is equivalent to Monster Talk. But if I want to use that to other support abilities, how do I find out which values I should use? Is there a list out there or another way to find out?

Choto

Indeed, and it can be found here: http://ffhacktics.com/wiki/Battle_Stats

here's the relevant information:

Reaction abilities
0x008B:
0x80 = A Save
0x40 = MA Save
0x20 = Speed Save
0x10 = Sunken State
0x08 = Caution
0x04 = Dragon Spirit
0x02 = Regenerator
0x01 = Brave Up

0x008C:
0x80 = Face Up
0x40 = HP Restore
0x20 = MP Restore
0x10 = Critical Quick
0x08 = Meatbone Slash
0x04 = Counter Magic
0x02 = Counter Tackle
0x01 = Counter Flood

0x008D:
0x80 = Absorb Used MP
0x40 = Gilgame Heart
0x20 = Reflect
0x10 = Auto Potion
0x08 = Counter
0x04 =
0x02 = Distribute
0x01 = MP Switch

0x008E:
0x80 = Damage Split
0x40 = Weapon Guard
0x20 = Finger Guard
0x10 = Abandon
0x08 = Catch
0x04 = Blade Grasp
0x02 = Arrow Guard
0x01 = Hamedo

Support abilities
0x008F:
0x80 = Equip Armor
0x40 = Equip Shield
0x20 = Equip Sword
0x10 = Equip Katana
0x08 = Equip Crossbow
0x04 = Equip Spear
0x02 = Equip Axe
0x01 = Equip Gun

0x0090:
0x80 = Half of MP
0x40 = Gained JP-UP
0x20 = Gained EXP-UP
0x10 = Attack Up
0x08 = Defense Up
0x04 = Magic Attack Up
0x02 = Magic Defense Up
0x01 = Concentrate

0x0091:
0x80 = Train
0x40 = Secret Hunt
0x20 = Martial Arts
0x10 = Monster Talk
0x08 = Throw Item
0x04 = Maintenance
0x02 = Two Hands
0x01 = Two Swords

0x0092:
0x80 = Monster Skill
0x40 = Defend
0x20 = Equip Change
0x10 =
0x08 = Short Charge
0x04 = Non-charge
0x02 =
0x01 =

Movement abilities
0x0093:
0x80 = Move +1
0x40 = Move +2
0x20 = Move +3
0x10 = Jump +1
0x08 = Jump +2
0x04 = Jump +3
0x02 = Ignore Height
0x01 = Move-HP Up

0x0094:
0x80 = Move-MP Up
0x40 = Move-Get Exp
0x20 = Move-Get Jp
0x10 = Cannot enter water
0x08 = Teleport
0x04 = Teleport 2
0x02 = Any Weather
0x01 = Any Ground

0x0095:
0x80 = Move in Water (yes, this should be named Walk on Water)
0x40 = Walk on Water (yes, this should be named Move in Water)
0x20 = Move on Lava
0x10 = Move Underwater
0x08 = Float
0x04 = Fly
0x02 = Silent Walk
0x01 = Move-Find Item

Kurosabes

Just a minor display issue with 'Units rot or reanimate without skipped turns'. When a Death Sentence'd unit count is 0, the 'Death Sentence' doesn't show, the unit just drops to the ground without any indication, kind of like when it's the last unit standing in vanilla.
  • Modding version: PSX
  • Discord username: Kurosabes#0312

DuxorW

Quote from: pokeytax on January 31, 2013, 06:25:27 pm
Can anyone confirm these?  I ask only because I think I investigated a couple reports like this and they turned out to be other hacks.  (I'm not saying it didn't happen - lord knows RAD, especially, needs a lot of work.  But a clear reported case would help a lot.)

Celdia, if you send me your current ALMA 4 spreadsheet I'll make sure it's transferred.

Thanks for the notes.  I'm also looking at knocking out some of the hardcoding FFT does (e.g. having whether an item is a shield, hat, armor, or accessory be determined by FFTPatcher, not its item number; having the "Action Menus" tab in FFTPatcher actually do what you would expect it to without the Generic Skillset Hack).


I know that I encountered some problems with ALMA on consoles and I applied ALMA to a clean ISO to make sure it wasn't my other hacks. I just figured it was not designed with consoles in mind but since that is not the case I am willing to do some bug testing for you. I had a few specific problems and once I double check them I'll post in detail.