Author Topic: AI Frustrations  (Read 1132 times)

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
AI Frustrations
« on: July 26, 2016, 05:10:35 PM »
So, here's my issue for today. ;)

Trying to create a custom boss. Everything is working except his primary AI.  I wanted to create a longer script so I thought, hey, just use AI 255, it's got all that unused space after it.  Wrote up the script, start up the battle... and a few seconds in, Cecil starts his victory dance and the game crashes.  Strange.

Then I thought, if that won't work, I'll just use another monster's AI, like Behemoth or something.  Game doesn't crash now, but the boss just casts Break over and over (it always fails BTW).  Even though this totes isn't what's in his script.

So, what am I missing?  This boss will be on the moon.  I only used indexes and scripts from lunar monsters.  There must be some arcane tidbit here that I'm overlooking.

Thanks as always.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: AI Frustrations
« Reply #1 on: July 26, 2016, 10:17:05 PM »
Cecil striking a victory pose and the game crashing is symptomatic of the AI not being programmed right.

Regarding the second part... Was the monster that you took over to make this boss a moon monster? If not, then FF4kster may be assuming it's a non-moon monster and thus displaying the wrong AI.

I might be better able to help if I saw some screenshots of what you're doing in FF4kster.

AI is by far the most bass-ackwards system in FFIV, so frustration is totally normal. You'll probably have to learn a lot through trial and error before it all starts really making sense.

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: AI Frustrations
« Reply #2 on: July 27, 2016, 06:51:16 PM »
Well, at least it's something that's been seen before! :)

The monster I used is MoonCell.

I changed the reaction to index 186 (Behemoth's reaction script) and it works great.

For the main index, if I put in an unedited script from a Lunar monster, like Kary or Behemoth, it executes as expected, although it does NOT display properly in ff4kster (shows Blue Planet index instead of Moon index).  However, it seems if I make any change (like deleting an action), I get Cecil's happy dance of death immediately.

I was able to make a custom boss for the Underground in about three minutes with no issue at all.  Is it a Moon monster thing?

Are there any particular pitfalls I should watch out for?  Because I don't see where the problem is AT ALL.

If I had my druthers, I would use MoonCell's index (58), and use script 254 or 255 (with "If no condition") for the actions.  But if I put script 254 or 255 on my monster, regardless of the content of those indices, the game will crash every time.  I don't understand it.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: AI Frustrations
« Reply #3 on: July 27, 2016, 07:41:51 PM »
Ah! Got it!

The moon only has 90 valid scripts, so anything above 90 will cause a crash.

Have I directed you yet to this thread? Grimoire found some entirely unused scripts, so instead of stealing from another monster, you can actually use one of those if you want to.

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: AI Frustrations
« Reply #4 on: July 28, 2016, 07:07:05 PM »
Ah! Oh my gosh! You saved my ass yet again, my friend.

Such a relief, because this is literally the last "tricky" task left for my current project.  (This guy again > :cybez: )

Thank you so much for your help... again!

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: AI Frustrations
« Reply #5 on: July 29, 2016, 06:56:53 PM »
You know what? I give up.

It seems like there should be a Moon/non-Moon flag for monsters.  But since there isn't one, I can't get the appropriate AI to show up when I try to setup my monster.  It seems utterly random what shows up.  Like if I tweak MoonCell long enough, eventually I go in to edit the AI and the Moon stuff is all gone, replaced by Blue Planet indicies that suddenly won't work anymore.

So, I went and tried to do it the hard way with my trusty hex editor, but it seems like ff4kster must move data around or something, because when I look at my base and hacked roms next to each other, even the pointers for monsters I never touched (like Egg) are all different.  I don't know where to even begin sorting that out.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: AI Frustrations
« Reply #6 on: July 29, 2016, 10:04:08 PM »
Yeah, in order to conserve space, if you make one change in one AI routine, FF4kster will automatically change the location and pointers for everything that might be affected by the loss or gain of space in that one routine. Believe it or not, FF4kster is being helpful in that respect. But the AI system is overly complicated, so for what you're trying to do, it's unfortunately making things more difficult to un-complicate...

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: AI Frustrations
« Reply #7 on: July 30, 2016, 12:10:09 PM »
FF4kster will display moon AIs for monsters that appear in random encounters in moon maps. If the monster is only fought as an event or chest battle, it will probably show non-moon AI. If you put the monster in question in one of the random encounter sets for one of the moon maps (you may have to save and close FF4kster and re-open), then it should show moon AI for that monster.

I kept meaning to make a toggle button for switching between AIs but it's been so long and that code was a nightmare even when I was actively working with it that it's unlikely to happen at this point.
Let's dance!

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: AI Frustrations
« Reply #8 on: August 03, 2016, 07:39:06 PM »
Hey, thank you both for the additional advice.  I've been tied up for the last few nights and keep thinking, I've got to get back to my hack!  I'm literally at 95% done so this last bit is such a pain.

PinkPuff:  I hope I didn't come off as critical of your work.  ff4kster is AMAZING, as I hope you know.  I've been able to do countless things with it that I was never able to do before, like, too many things to even list here.  It's been a pleasure working with your program over the past few weeks.

EDITED TO ADD: Putting my custom monster into an existing Lunar formation was all it took! From then on, ff4kster understood that it was a Lunar monster and I could edit accordingly. If only I hadn't taken the monster out of a formation to begin with, I would have saved myself a lot of hassle. Thanks again for your help!!!
« Last Edit: August 03, 2016, 09:52:05 PM by fedorajoe »