News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Secret of Mana, Turbo - Beta 191115  (Read 99947 times)

kethinov

  • Full Member
  • ***
  • Posts: 109
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #680 on: October 13, 2019, 01:59:07 am »
New hack: "Suicide Burst"

This is a different take on "Burst - Health Cost" that I personally prefer a bit more.

This hack changes the Burst spell so that it kills you to use it, inflicting the same damage to the enemy as it does to you. The more HP you have, the more damage you will do to your target. This appears to be the original intention of the Burst spell, given its animation and what happens to Pumpkin Bombs when they use it on you. This hack could thus be said to perhaps be implementing the Burst spell's original vision.

To improve the appeal of the spell, the MP cost has also been reduced to zero, the spell ignores defenses, and it will penetrate Wall, making it possible to use against such notable Wall-casting bosses as as Aegagropilon, Mech Rider III, and the Mana Beast. Now you can have a more interesting Mana Beast fight with both Randi and Popoi doing damage, Primm resurrecting Popoi, and Primm and Popoi buffing Randi. Even better when combined with "Harder Final Boss," "Balance Spell MP Cost," and/or "Herbal Boost" to lengthen the Mana Beast fight and reduce the cost of Revivifier.

Download: http://www.romhacking.net/hacks/4731/




I also updated Hellfire to make the Mana Beast immune to fire. (Immune to everything actually similar to the changes to him in "More Useful Evil Gate.")

Download: https://www.romhacking.net/hacks/4681/

For the Dark Stalker in the Emperor's room, was there any reason you put only 1 Dark Stalker, instead of 3?  If I remember correctly, there were 3 Dark Ninjas in that room.

Had 3 at first, but it was a rather vicious fight. Also there's limited space for monsters, so keeping 3 in there for the second visit would've required a few more annoying tradeoffs.

Hey, I still haven't heard back from you about my request for you to take over the Grave Flare project.  Please get back to me.  I'd really appreciate it.
@kethinov
Also, would you be willing to take over my Grave Flare spell exchange, and make that into reality? (Speed Up <--> Fire Bouquet)  The effects can remain the same (Grave Flare is <damage + Atk down>), for the non-Turbo people in Romhacking (they have no access to Inferno Barrier, so Primm's other Salamando spell would still be an attack spell).  I'm having a rather tough time trying to change enemies to target the spells correctly, and I'm failing.  I'm feeling rather frustrated with all my failures.  I also completely failed to edit the spell graphic (I changed the animation pretty easily, but I can't change the colors without screwing up the animation).  You can have all the credit, of course.

      Vanilla            My intent
      --------         --------
Chess Knight   Speed Up (Gnome, self)      Grave Flare (Gnome, one-enemy)
Ghoul      Speed Up (Gnome, self)      Grave Flare (Gnome, all-enemies)
Imp      Fire Bouquet (Salam, one-enemy)   Speed Up (Salam, all-ally)
Spikey Tiger   Fire Bouquet (Salam, enemy)   Speed Up (Salam, self)
Mech Rider 1   Speed Up (Gnome, self)      Speed Up (Salam, self)
Mech Rider 2   Speed Up (Gnome, self)      Speed Up (Salam, self)
Mech Rider 3   Speed Up (Gnome, self)      Grave Flare (Gnome, all-enemy) <-- He would attack OFTEN with this spell (due to AI trying to cast Speed Up on himself), making him quite challenging, in a good way.

I can give you my progress (name change, spell menu change (plus color), spell animation (minus color) change, and effect change), but I have a feeling that's really easy for you.  The stuff I failed to do (spell color, enemies use the correct target) is probably the hard part... maybe.  I also made Salamando's remaining attack spell, Fire Wall's PWR from 33 to 43 (don't want Salamando's attack spell to be weaker than Gnome's).

I could probably help out with the color changes if you email me an IPS of the work you've done on it so far. I may not be any help on the enemy AI scripts. While I have poked around a few of the enemy AI scripts (e.g. Shape Shifter to find the transform list), for the most part it's not an area of the ROM I've studied much yet, so it would take me some time to get up to speed on it to figure out how to change what they do.

I was looking at this today but am not 100% sure what you're suggesting needs fixing. There's an odd collision issue between the doorway opening and the bit of wall to the right you can walk behind, which I may by able to resolve (but maybe not, it depends on what collision options are available with that tileset); is that what you're referring to or was there something else?

Edit: Scrutinizing the tileset that map uses, yeesh it has quite a few issues. Resolving them will probably solve quite a few things for the three maps (technically 5, but 2 pairs are duplicates) that use it.

Standing at the bottom of the map reveals some weird out of bounds stuff. I can possibly screenshot it later.
« Last Edit: October 18, 2019, 01:46:47 am by kethinov »

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #681 on: October 13, 2019, 04:04:00 am »
@kethinov

Doesn't Aegagropilon have Burst?  So does that mean that it'll kill itself?

Also, for Harder Final Boss patch, can you make Mana Beast into resisting all elements?  Same as the one used for Useful Evil Gate and Hellfire.

And if possible, have it cast Lucid Barrier instead of Wall?  Mana Beast doesn't need Wall if it resists all elements with 99 M.Def.  But Lucid Barrier would make the fight so much more interesting, since Popoi will have to constantly cast Dispel to get rid of the barrier.

I don't have an .ips file.  I simply modified the Turbo patch, and added my own code (using Notepad).  I can send you the things I did in Notepad (pure code, so none of the convenient macros that Turbo made).  Or if you teach me how to make .ips files, then I can work that too.
« Last Edit: October 13, 2019, 04:09:48 am by hmsong »

Mr X

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #682 on: October 13, 2019, 04:43:15 am »
I still wouldn't really use that spell when there are better alternatives than killing yourself, imo.

Also while Barrier is more useful for the mana beast, in turbo you can still get rid of it rather comfortably after some physical hits without the need of casting dispel over and over.

The Girl and the Sprite can still damage the mana beast just that they need to charge their attacks high enough. Use Herbal Boost/Lunar Energy and they will still pack quite the damage by charging up (the problem being if you don't control them or run after their initial attack they will stop charging/attacking altogether).

They aren't completely useless when it comes to damage output.

zoolgremlin

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 130
  • Steam Profile Name: keeperofcastlegreydusk
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #683 on: October 13, 2019, 07:00:45 am »
There are actually quite a few monsters/bosses that can use Burst, but I wouldn't necessarily be worried that they're all suddenly gonna die, when casting it.  With a mod like this, I would daresay that it's been programmed to only work this way with the Sprite.

Suicide Burst... Interesting concept, which I wouldn't really have thought of.  Reminds me of certain attacks from the FF series.  With a spell that can breach 999 Magic Defence + 99 MagicBlock%, not to mention Wall, 0MP cost, and doing the same damage as you have currHP, the cost of self-inflicting Dead seems quite reasonable.  Combine that with Revivifier having a lower cost (4 instead of 10), and keeping up the damage-over-time seems a lot more interesting this way than, and as viable as, Weapon-Charging.  Which, by the way, the Boy doesn't have to do, if he levels up all of his weapons to get a high Mana Magic Bonus to TempAttPwr, and gets the Moon Energy effect on him.  More on that when I start writing up the Weapon Damage algorithm document...   :laugh:

The only thing I personally wouldn't speculate about, is whether this or something like it was intended by Square.  It is eminently possible, I just don't fancy driving myself up the wall trying to figure out what those
Spoiler:
crazy little Japanese neeeeeerrds
guys ever intend.  Whatever it is, it's a coin-toss whether it'll be good, at best.   :crazy:

Just wondering where you put the code, that checks for whether your new Burst spell is Wall-bouncable or not... that part of the Vanilla ROM is pretty crowded, from what I've seen.  You did well, whatever it was... thanks very much for the new mod.   :)

Did I mention I'm supposed to put this sort of thing in a review?!  Yes.  Time to go do that now... while I'm thinking about it.   :-[
« Last Edit: October 31, 2019, 07:02:37 am by zoolgremlin »
If you try to fail, and succeed, what've you done?!

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #684 on: October 13, 2019, 09:01:08 am »
@kethinov

Okay, here's what I have so far, but it turns out that I don't know how to modify some of the things without the Turbo macros...

But if you can help me with the spell animation color change, that would be wonderful, since I can implement that somewhat.  I'll have to experiment some more with the enemy's spell target modifying.

Please make the Grave Flare into yellow/brown/grey color (or something close), while the target's spell effect color turns Black.  As for the Salamando Speed Up, please make it red, with the target's color to red too.  If the spell color and menu color match, that would be wonderful:

Code: [Select]
' Icon Change
@OFF $D8FD86
RAW A0
@OFF $D8FD9E
RAW 08

' {04: Grave Flare (vanilla Speed Up -> Fire Bouquet modified)}
@OFF $D02BA0
RAW E0 85 53 05 53 05 53 05
@OFF $D02BA8
RAW 89 00 BE 6A 00 00 2D 8F
@OFF $D02BB0
RAW 89 00 BE 6A 00 00 2D 8F
@OFF $D02BB8
RAW 89 00 D4 6A 00 00 2D 8F
@OFF $D02BC0
RAW 89 00 D4 6A 00 00 2D 8F
@OFF $D02BC8
RAW 89 0E D4 6A 00 00 55 8F
@OFF $D02BD0
RAW 89 0E D4 6A 00 00 55 8F

' {10: Speed Up (vanilla Fire Bouquet --> Speed Up)}
@OFF $D02EA0
RAW 32 86 D5 0B D5 0B D5 0B
@OFF $D02EA8
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EB0
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EB8
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EC0
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EC8
RAW C9 00 1E 68 00 00 13 8B
@OFF $D02ED0
RAW C9 00 1E 68 00 00 13 8B

It's only the animation and menu icon, but modifying those to something good will be a great help.
« Last Edit: October 13, 2019, 07:28:47 pm by hmsong »

kethinov

  • Full Member
  • ***
  • Posts: 109
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #685 on: October 13, 2019, 08:50:28 pm »
Doesn't Aegagropilon have Burst?  So does that mean that it'll kill itself?

Dunno. Will have to test this. Depending on how it behaves I might need to write some code to restrict the changes to Popoi or fork the spell into a human version and an enemy version if the game doesn't do that already. Anyone have a complete list of enemies and bosses that cast Burst?

Also, for Harder Final Boss patch, can you make Mana Beast into resisting all elements?  Same as the one used for Useful Evil Gate and Hellfire.

Done: https://www.romhacking.net/hacks/4412/

And if possible, have it cast Lucid Barrier instead of Wall?  Mana Beast doesn't need Wall if it resists all elements with 99 M.Def.  But Lucid Barrier would make the fight so much more interesting, since Popoi will have to constantly cast Dispel to get rid of the barrier.

It's an interesting idea. I played around with it today and it doesn't work as well as I thought it would. Here is a partial implementation if you want to try it yourself:

Code: [Select]
Alter Wall test to check for Lucid Barrier instead:
C293D3: 894000
to:
C293D3: 890001

Cast Lucid Barrier instead of Wall:
C29413: 7C1694
to:
C29413: 7C1E94

The problem is the first thing the Mana Beast does during each loop of his AI script is test for Wall (or now Lucid Barrier) and reapply it if it isn't set, which results in a very unsatisfying fight. Given this mechanic, it's possible to prevent the Mana Beast from ever casting Lucent Beam on you by simply spamming it sword swings or Dispel Magic until it is removed, which doesn't take long. Basically if you do damage to the Mana Beast with your sword, the Mana Beast will be too busy trying to reapply Lucid Barrier to bother with trying to fight you.

(Actually there's a bug in my code: Something about the code change I made to test to see if he already has Lucid Barrier status isn't functioning, so he just casts it on himself endlessly, so it's not a perfect test, but close enough to illustrate the problem.)

This bug exists in the vanilla logic too, sort of. If you just have Popoi cast Dispel Magic on the Mana Beast over and over, it will force the Mana Beast to restore his Wall over and over. If you do that, he will never cast Lucent Beam on you. Though it's less noticeable because people usually don't bother to keep removing the Mana Beast's Wall if his response to it is to simply restore it over and over.

I think a better change to the Mana Beast's AI would be to prevent the Mana Beast from casting either Wall or Lucid Barrier. This would allow him to get to his Lucent Beam casting loop faster, resulting in him being more aggressive.

Code: [Select]
Prevent Mana Beast from casting either Wall or Lucid Barrier:
C293D0: BDB101
to:
C293D0: 4CEE93

@kethinov

Okay, here's what I have so far, but it turns out that I don't know how to modify some of the things without the Turbo macros...

But if you can help me with the spell animation color change, that would be wonderful, since I can implement that somewhat.  I'll have to experiment some more with the enemy's spell target modifying.

Please make the Grave Flare into yellow/brown/grey color (or something close), while the target's spell effect color turns Black.  As for the Salamando Speed Up, please make it red, with the target's color to red too:

Code: [Select]
' Icon Change
@OFF $D8FD86
RAW A0
@OFF $D8FD9E
RAW 08

' {04: Grave Flare (vanilla Speed Up -> Fire Bouquet modified)}
@OFF $D02BA0
RAW E0 85 53 05 53 05 53 05
@OFF $D02BA8
RAW 89 00 BE 6A 00 00 2D 8F
@OFF $D02BB0
RAW 89 00 BE 6A 00 00 2D 8F
@OFF $D02BB8
RAW 89 00 D4 6A 00 00 2D 8F
@OFF $D02BC0
RAW 89 00 D4 6A 00 00 2D 8F
@OFF $D02BC8
RAW 89 0E D4 6A 00 00 55 8F
@OFF $D02BD0
RAW 89 0E D4 6A 00 00 55 8F

' {10: Speed Up (vanilla Fire Bouquet --> Speed Up)}
@OFF $D02EA0
RAW 32 86 D5 0B D5 0B D5 0B
@OFF $D02EA8
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EB0
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EB8
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EC0
RAW C9 00 06 68 00 00 02 8B
@OFF $D02EC8
RAW C9 00 1E 68 00 00 13 8B
@OFF $D02ED0
RAW C9 00 1E 68 00 00 13 8B

It's only the animation and menu icon, but modifying those to something good will be a great help.

You can set the animation target palettes here:

Code: [Select]
D18F2E: 84 (Fire Bouquet)
D18B07: 85 (Speed Up low/mid)
D18B18: 85 (Speed Up high)

Key:

84: red
85: blue
86: green
87: yellow
88: purple
8E: white
8F: charcoal

Spell targeting (just swap these):

Code: [Select]
D02ED8:  81 (Fire Bouquet)
D02BD8:  01 (Speed Up)

You should also change D02EA0 back to E085 and D02BA0 back to 3286 to fix a bug you created with the Gnome/Salamando elemental animation timings. (An early version of my Herbal Boost had the same bug. Queue pointed it out to me.)

I looked briefly at the spell animation palette but couldn't find what byte is setting it. It doesn't appear to be controlled the same way Moon Energy's was, so it would take a bit of digging to find it that I don't have time for right now.

zoolgremlin

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 130
  • Steam Profile Name: keeperofcastlegreydusk
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #686 on: October 13, 2019, 10:56:44 pm »
I just checked the documentation for Bank $C2, and searching for the word "Burst" only showed up the AI for Aegagropilon.  Not even a single glance at Boreal Face, which can also cast it.  So I suspect that the document for that Bank at least, hasn't got quite enough Comments for a full list.  Ah well...

I don't fancy the chances for monster AI, but I'm gonna check shortly, once I check the thread for where Queue said it was.

But not only that... I'm pretty sure that NO website has ever had a full list of which enemies can cast which spells.  Not even SoM's shrine at RPGclassics has a complete and 100% accurate Spell List for enemies, and it's one of the better sites.  It comes pretty close, but it's not dead-on.

So it looks like I would have to read all the actual code to get a complete List.  But this might give a good start, hopefully.   8)

MONSTERS:
  • Dark Ninja (when low on HP, dies afterwards in Vanilla)
  • Pumpkin Bomb (dies afterwards in Vanilla, seems to be its only attack)
  • Nitro Pumpkin (doesn't die afterwards in Vanilla)

BOSSES:  (Note:  No Boss dies immediately after casting Burst, in Vanilla.)
  • Aegagropilon
  • Boreal Face (the second Mr. Toothy Fruit guy, in the Crystal Forest.  Tropicallo is the one in Dwarf Village.)

Wow, that bbCode for Lists is easier to use than I imagined!  Must use it more, silly waffler that I can be...  :laugh:

UPDATE:  That appears to be it for all monsters and bosses, surprisingly enough.  The extra spaces are going... going... gone.   :D

NOTE TO MYSELF:  Bank $D0 for monster AI.
« Last Edit: October 14, 2019, 06:41:30 am by zoolgremlin »
If you try to fail, and succeed, what've you done?!

Queue

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #687 on: October 14, 2019, 12:20:41 am »
Quote from: kethinov
Standing at the bottom of the map reveals some weird out of bounds stuff. I can possibly screenshot it later.
Screenshot(s) would be helpful; I tried quite a few things (including actually doing the Hydra fight, not just visiting the room after the fact) and haven't seen anything graphically out of place in that room.

In the meantime, I've gotten through tidy map treatment for almost everything for all 3 (sorta 5) sandy underground city maps; just need to clean up the waterfalls in the large puzzle room. Bonus objectives which I may or may not complete are two new tiles to differentiate above and below water angled walls (changing tiles is incredibly annoying), and adding flowing water down the steps in the entrance room to match the water flowing into the staircase you see externally.

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #688 on: October 14, 2019, 01:15:05 am »
@zoolgremlin

Hey, can you find the enemy spells (spells, targetting, etc) for Chess Knight, Ghoul, Imp, Spikey Tiger, Mech Rider 1/2/3, and Axe Beak?  I know I'm asking a lot, but I'm having very little success in modifying their spells...

zoolgremlin

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 130
  • Steam Profile Name: keeperofcastlegreydusk
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #689 on: October 14, 2019, 01:44:29 am »
hmsong:  No, no, I don't mind unless I say otherwise.  I have the Documents open, just had to find a way to identify individual spell options.  For monsters, it can only be done via Spell ID number, not by name.  That's how the Comments are formatted.  But now that I know that, the process will be quicker than I thought.  <whew>

I have prepared the way for all this by updating the Magic Data Tables document in my folder, to contain the ID numbers for every spell.  The only missing data for that Document is the buffer space underneath (containing null values).  That last bit can wait... let's see what the AI code blocks can tell us.  Back soon, when I have the requested info.   :)

LINK:  Secret of Mana Information (Vanilla)
If you try to fail, and succeed, what've you done?!

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #690 on: October 14, 2019, 01:59:58 am »
@zoolgremlin

Yeah, I found the spell IDs too.  The problem is, I can't find which code controls Chess Knight's Speed Up spell or its targets (and various other enemies, such as Ghoul, Imp, Spikey Tiger, Mech Riders, and Axe Beak).  As you know, I'm trying to switch Speed Up <--> Fire Bouquet.  And while I can have enemies cast the right spells (Chess Knight will now cast Fire Bouquet), they aim that at themselves (so Chess Knight will damage himself).  At the same time, the enemies that used to cast Fire Bouquet (ex: Imp) will now cast Speed Up on Randi's party instead of himself.

I'm trying to find where to edit those, but after finding some things and I edit them, they don't work.  Or maybe I'm just editing the wrong thing.  In any case, I keep failing, because I only look at the pattern and try to find "04" (for trying to change Speed Up) or "10" (for Fire Bouquet).  And honestly, they're rather... common numbers, so I end up changing the wrong things.  Honestly, it's tiring.



@kethinov

Quote
I think a better change to the Mana Beast's AI would be to prevent the Mana Beast from casting either Wall or Lucid Barrier. This would allow him to get to his Lucent Beam casting loop faster, resulting in him being more aggressive.

That's a good idea.  The problem is that Mana Beast will be a REALLY boring fight, since it'll only cast Lucent Beam and nothing else (we'll not count on its melee attacks).  Practical, sure... but boring.

I also want Mana Beast to cast some of the annoying spells, such as Fire Bouquet to make Randi's attacks weaker (no defense against that), or Acid Rain to get everyone's Defense down (again, no defense, and if Acid Rain = M.Def Down patch is on, Lucent Beam will hurt PCs a lot).  I'm not entirely sure if Mana Beast will cast Dispel if PCs have stat downs.  I saw Mana Beast casting Dispel when I had Wall on.
« Last Edit: October 14, 2019, 02:12:19 am by hmsong »

kethinov

  • Full Member
  • ***
  • Posts: 109
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #691 on: October 14, 2019, 02:04:29 am »
"Suicide Burst" now with an alternative version of the hack that will make it so the spell divides the damage amount by 2 so that it won't kill you, but it will do less damage. Again, unlike "Burst - Health Cost" this hack bases the damage calculation off your current HP, not your max HP. So if you cast the "Half Damage" variant of "Suicide Burst" repeatedly (without healing), your HP will be halved repeatedly until it is near zero.

Download: https://www.romhacking.net/hacks/4731/

Also updated "Harder Final Boss" to include the changes to make the Mana Beast more aggressive (will no longer waste time casting Wall): https://www.romhacking.net/hacks/4412/
« Last Edit: October 15, 2019, 01:02:36 pm by kethinov »

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #692 on: October 14, 2019, 02:15:10 am »
"Suicide Burst" now with an alternative version of the hack that will make it so the spell divides the damage amount by 2 so that it won't kill you, but it will do less damage. Again, unlike "Burst - Health Cost" this hack bases the damage calculation off your current HP, not your max HP. So if you cast the "Half Damage" variant of "Suicide Burst" repeatedly (without healing), your HP will be halved repeatedly until it is near zero.

I hope enemies with high HP (bosses) won't insta-kill PCs.  That would be ridiculous.


October 14, 2019, 03:44:42 am - (Auto Merged - Double Posts are not allowed before 7 days.)

@Queue, @kethinov, @zoolgremlin

Okay, no wonder I wasn't getting any result of editing the right target for enemy spells (I can't even find which codes are the enemies I'm looking for).  Apparently, I'm editing the wrong thing (I don't know what the right thing is).  I'm not seeing a pattern.

I started by looking at the things that you posted (thank you).  This is the vanilla codes for Dark Funk, Heck Hound, Doom Sword, Master Ninja, and Dark Lich (for Blaze Wall, Stone Sword, and Evil Gate):

Code: [Select]
$D05C9E
E9 04 11 C0 01 85 C1 'one enemy (Dark Funk, Blaze Wall)
$D0968C
E9 05 11 C0 E3 00 B4 'one enemy (Heck Hound, Blaze Wall)
$D09FBE
E9 04 03 C0 E2 0B 01 'self (Doom Sword, Stone Saber)
$D0A369
E9 06 03 C0 E3 00 3C 'self (Master Ninja, Stone Saber)
$C2E974
00 0E 24 00 FF 00 EC 'one enemy (Dark Lich, Evil Gate)

Obviously, the 11, 03, and 24 are the spell ID codes.  That's easy enough.  But the rest?  They're all different.  There's no pattern.  How do I adjust the target? (from enemy to self, or self to enemy, self to ally, etc)  Or am I missing something?

Please help.
« Last Edit: October 14, 2019, 05:31:28 am by hmsong »

Queue

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #693 on: October 14, 2019, 05:34:03 am »
Quick reply before sleep. The target is specified before the spell cast command (E9). So for many AI scripts, where the monster targets a player, the byte before E9 is C1, which means "spell_target = melee_target" (and earlier in the AI script the monster had picked a melee target). For AI scripts where the monster targets itself, the byte before E9 will be C4, which means "spell_target = self" instead. The spell cast command itself is 3 bytes, so in the stuff you quoted for the Dark Funk "E9 04 11" is the only part that's the actual spell cast command. The C0 after that means "spell_target = none" (the AI scripts clear the spell_target after issuing the cast spell command). The "01 85" is a relative jump, and the following C1 is related to a different spell cast command (for the Dark Funk casting spell number 0x0C).

Oh, and the Dark Lich is a boss, so its AI scripting is totally different than for normal enemies, so the various command codes are different.

kethinov

  • Full Member
  • ***
  • Posts: 109
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #694 on: October 14, 2019, 06:14:28 am »
I updated "Suicide Burst" to prevent enemies from immolating themselves with the new spell behavior. When an enemy casts Burst on you, it will behave as before. The new behavior is restricted to when Popoi casts the spell.

Download: https://www.romhacking.net/hacks/4731/ (I didn't increment the version number because 1.0 hadn't been posted to RHDN yet. So if you downloaded 1.1 before, download it again...)

Adding code to revert to the original behavior if the spell is being cast by an enemy required writing a Turbo-specific patch as well, which you can download here: http://kethinov.com/images/linked/som/burst/SecretofManaSuicideBurst1.1Turbo.zip
« Last Edit: October 15, 2019, 01:03:31 pm by kethinov »

zoolgremlin

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 130
  • Steam Profile Name: keeperofcastlegreydusk
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #695 on: October 14, 2019, 06:36:55 am »
hmsong:  Er, perhaps I can take up the mantle from here, strap yourselves in boys and girls... please keep hands and feet inside the vehicle at all times! :D

I'll use Doom Sword as an example, since that was just quoted very recently:

Okay, so Doom Sword's entire spell selection is handled with a sub-script between $D09FAD and $D0A019.  The script is that long because, fun fact, the Doom Sword has the capacity to cast four of the six Saber spells in Vanilla.  Quoting the whole script might be a bit beyond the Posting guidelines, though.  So I'll just say this.
  • If Target is NOT Immune to Petrify, cast Stone Saber (what the majority of players are probably used to), if the Sword doesn't already have it.
  • If Target IS Immune to Petrify, check for Immunity to Engulf.  If Target doesn't have it, cast Flame Saber, if the Sword doesn't already have it.
  • If Target IS Immune to Engulf, check for Immunity to Frosty.  If Target doesn't have it, cast Ice Saber, if the Sword doesn't already have it.
  • If Target IS Immune to Frosty, cast Thunder Saber, if the Sword doesn't already have it.  End Script.

So basically, a character has to be Immune to at least 1 out of the 4 Defects being checked for, to see Doom Sword cast anything other than Stone Saber.  I guess that explains why this thing is called "Element Sword" in the Japanese ROM.  But that doesn't mean that this AI-script is necessarily a well-executed idea, it isn't.  I probably shouldn't go ranting about that, though.

I've seen these things cast Flame Saber before, never the other two.  Now I finally know why... it was so worth it, huh!?  Errrr... uhhhh...

So where it says, E9 04 03, that's the spell command for DS's Stone Saber.  That starts at address $D09FBE.  The targeting bit is just before that, at address $D09FBD.  That's the bit that needs changing, depending on which target the programmer intends to be the spell's recipient.  Whether it wants to be or not, hehe...  :laugh:

It might be that the code for altering spell commands, that's in the ZPS now, doesn't always include a change to spell-targeting.  If it does need that, the altered ZPS code will probably start with an @OFF command, that specifies the address for the targeting byte, instead of the "E9" bit that starts the actual casting.

Not sure if that hits the wordcount for this forum, or not.  Probably not, but I may be posting the info that you requested in a file on Google Drive, just to avoid the issue.  Almost there, I've just gotta check my work before uploading it.  Not much good if it's incorrect...  :)
« Last Edit: October 31, 2019, 06:57:27 am by zoolgremlin »
If you try to fail, and succeed, what've you done?!

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #696 on: October 14, 2019, 07:41:51 am »
@Queue @zoolgremlin

Thank you so much!!  Finally, something I can understand.  You probably explained everything before, but those flew right over my head.  Yeesh.

Some more experiments are necessary.  I shall report back after some more trials.

Also, zoolgremlin.  How the HECK did you figure out Doom Sword's AI script?  Amazing.  Btw, this also means that you'll never see Doom Sword cast Ice Saber in vanilla, since the only way to defend Engulf also defends against Frosty.  My recent Equipment Tweak allows that though (totally coincident).

zoolgremlin

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 130
  • Steam Profile Name: keeperofcastlegreydusk
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #697 on: October 14, 2019, 08:24:02 am »
@kethinov:  Just very quickly, thanks very much for the latest updates to Suicide Burst.  Really great stuff...  8)



Gotta revise the requested material for hmsong.  It'll be a bit longer than I thought, apologies in advance for the delay.   :(
If you try to fail, and succeed, what've you done?!

hmsong

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #698 on: October 14, 2019, 09:06:34 am »
@Queue @zoolgremlin @kethinov

WOOOOT!!  Progress!!!

I have successfully made the spells target correctly, at least for the normal monsters (Chess Knight, Ghoul, Imp).  After few weeks of struggles in vain, I have finally seen a success.  I was ready to throw in the towel too.  Not quite complete, but definitely a huge leap.  So thank you.

Few questions.  I now know that C1 targets the nearest enemy, and C4 targets self, but are there any other values?  Such as allies, or multi-target?  I'd love to know.

Now, for the bosses.  I only have Dark Lich's script from Shadow Saber, so I'm rather limited in what I can do.  Can you guys help me, in HOW to search for them with the spell?

For the normal monsters, I used the 2 bytes before and 1 byte after the spell ID to search.  For example, I knew that Chess Knight had Speed Up (ID: 04), so:
Quote
C4 E9 03 04 C0 26 08

I just switched C4 to C1.  And boom.  Success.

The problem is, I don't know how to search for the bosses.  Taking Dark Lich, I'm guessing the important ones to search for are (using the previous pattern:
Quote
EB 00 0E 24 00 FF 00

I'm guessing EB is the boss equivalent of C1 (targets the nearest enemy).

But is my approach in finding spells correct?  And what is the value of boss equivalent of C4? (or any other values?)

Thanks in advance.



@Queue

I heard kethinov updated his Northtown wood treasure (still same v1.1).  Apparently, the previous 1.1 caused glitch in the Southtown vendor.  Does the patch in your package do that too?  I don't see it, but maybe I'm looking at the wrong place.



@zoolgremlin

I'm very grateful to you creating so many documents.  And while I eagerly wait for my requested document, you don't have to particularly hurry up so much.  What I requested (monster behavior codes) is absurdly a lot, I'm sure.



@kethinov

I gotta say, your Suicidal Burst sounds awesome.  I haven't really experimented with it (due to doing my Grave Flare), but from what it sounds like, it's great.  Esp the Wall-pierce and Def-ignore thing.  You said that the Current HP gets cut in half (very interesting idea), but does the spell power decrease the less Current HP you have?  For example, when your current HP is 800, and you use it, and it's powerful (does it do 800 damage?).  But if you use it again while having only 400 HP, the spell power gets weaker? (400 damage?)  Also, does that mean that spell element (Dryad) doesn't matter, and therefore doesn't exploit Luna weakness? (and Dryad enemies resist)
« Last Edit: October 14, 2019, 08:48:30 pm by hmsong »

kethinov

  • Full Member
  • ***
  • Posts: 109
    • View Profile
Re: Secret of Mana, Turbo - Beta 191010
« Reply #699 on: October 14, 2019, 01:32:08 pm »
The logic for Suicide Burst ignores all defenses whatsoever and applies spell damage exactly as reflected by your HP. There is also no multi-targeting penalty.

So if Popoi has 500 HP, Suicide Burst will do 500 HP of damage every time to all targeted enemies, killing Popoi in the process.

If you use the "Half Damage" variant, it will do 250 HP damage to all enemies and cut Popoi's HP in half. If you cast it again without healing, it'll do 125 HP damage, etc.