1
Archive / Re: scene.bin ai size reduction project
« on: 2009-06-08 02:22:33 »
I just checked and Eligor's AI is definately a mess.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Not that confusing now that you explained. Seems like, as secondadvent said, I should use mainly opcodes while editing AI, not that hard after a bit of learning.QuoteHave I understood "ElseIf ( (BitCount(AllActiveOpponentMask) == 1) )" part correctly? Is this what actually happens?QuoteSince everything is init'ed to 0 then Attack will be 0 if AttackType is Command.Attack (1h). Otherwise it'll be Command.Magic (0h). So the odds of Sephiroth casting Quake3 are 1:3 IF there's not a monster that nullifies or absorbs Earth Elemental. Even though he has a Restore Materia, he will never use it in battle. You could get him to use it out of battle, I suppose. I never tried it. He'll also never use Fire3 on all enemies like this.I always found it weird all other Sephiroths elemental spells had all materia linked to them except fire. Instead there was an empty slot. I always thought that this was a mistake on developers part but now I see AI tells different story.
Fire3 intentionally casted only on single enemies when normal attack would do ½ damage because of back row modifier. And because of that I think that casting Fire3 at all is impossible with this AI since if I understood "ElseIf ( (BitCount(AllActiveOpponentMask) == 1) )" correctly Sephiroth will only use normal attack and Fire3 against single targets. In vanilla scene.bin all enemies in flashback come in groups and Sephiroths kills them all in once either with Ice3 or Bolt3 and if for some reason 1 enemy was left alive it would always be in front row -> so no Fire3
Not really. Like I have said, the disassemble is just an approximation and isn't always 100% accurate. This is one of those times. That particular piece isn't an ElseIf block, but an If block nested inside an Else block. Confusing, I know. Conditions are one of the harder things to decompile because jumps can go all over the place and there are frequently jumps that never get called that are throwing off the disassembly.
Have I understood "ElseIf ( (BitCount(AllActiveOpponentMask) == 1) )" part correctly? Is this what actually happens?QuoteSince everything is init'ed to 0 then Attack will be 0 if AttackType is Command.Attack (1h). Otherwise it'll be Command.Magic (0h). So the odds of Sephiroth casting Quake3 are 1:3 IF there's not a monster that nullifies or absorbs Earth Elemental. Even though he has a Restore Materia, he will never use it in battle. You could get him to use it out of battle, I suppose. I never tried it. He'll also never use Fire3 on all enemies like this.I always found it weird all other Sephiroths elemental spells had all materia linked to them except fire. Instead there was an empty slot. I always thought that this was a mistake on developers part but now I see AI tells different story.
Fire3 intentionally casted only on single enemies when normal attack would do ½ damage because of back row modifier. And because of that I think that casting Fire3 at all is impossible with this AI since if I understood "ElseIf ( (BitCount(AllActiveOpponentMask) == 1) )" correctly Sephiroth will only use normal attack and Fire3 against single targets. In vanilla scene.bin all enemies in flashback come in groups and Sephiroths kills them all in once either with Ice3 or Bolt3 and if for some reason 1 enemy was left alive it would always be in front row -> so no Fire3
@warbaque: that is essentially right, but a way to make your second statement right (since putting just one nonzero value, say 23 for instance, could be wrong, even though it is still non-zero) would be to make if (something >= 1), because it will always be a (positive) non-zero value, though just if (something is much easier to write, and saves space .
If (something) is equivalent of If (something==1)what would if statement return when using following value for example
If (something) is equivalent of If (something=/=0)something=0 If (something) returns 0
Have I understood "ElseIf ( (BitCount(AllActiveOpponentMask) == 1) )" part correctly? Is this what actually happens?QuoteSince everything is init'ed to 0 then Attack will be 0 if AttackType is Command.Attack (1h). Otherwise it'll be Command.Magic (0h). So the odds of Sephiroth casting Quake3 are 1:3 IF there's not a monster that nullifies or absorbs Earth Elemental. Even though he has a Restore Materia, he will never use it in battle. You could get him to use it out of battle, I suppose. I never tried it. He'll also never use Fire3 on all enemies like this.I always found it weird all other Sephiroths elemental spells had all materia linked to them except fire. Instead there was an empty slot. I always thought that this was a mistake on developers part but now I see AI tells different story.
Fire3 intentionally casted only on single enemies when normal attack would do ½ damage because of back row modifier. And because of that I think that casting Fire3 at all is impossible with this AI since if I understood "ElseIf ( (BitCount(AllActiveOpponentMask) == 1) )" correctly Sephiroth will only use normal attack and Fire3 against single targets. In vanilla scene.bin all enemies in flashback come in groups and Sephiroths kills them all in once either with Ice3 or Bolt3 and if for some reason 1 enemy was left alive it would always be in front row -> so no Fire3
LocalVar:0000 <- 2
TargetMask <- (TargetMask.GreatestElementalDamage >= 5) <- what does this do for example
If (TargetMask)
{
Debug.Print: "RESIST EARTH MONSTER" ; 0
LocalVar:0040 <- 1
}
TargetMask <- (ActiveMask.FormationNumber == 25) <- same question
If ( ( (TargetMask And (TargetMask.Status:Death == 1) ) And (Random MOD 3 == 0) ) )
{
LocalVar:0020 <- 8
}
ElseIf ( (BitCount(AllActiveOpponentMask) == 1) ) <- BitCount and AllActiveOpponentMask?
{
TargetMask <- RandomBit(AllActiveOpponentMask)
If ( (TargetMask.BattleRow >= 16) )
{
LocalVar:0020 <- 29
}
Else
{
LocalVar:0000 <- 1
}
}
Else
{
TargetMask <- AllActiveOpponentMask
If (Random MOD 3 + LocalVar:0040 == 0)
{
LocalVar:0020 <- 38
LocalVar:0040 <- 1
}
ElseIf (Random MOD 3 + LocalVar:0040 == 1)
{
LocalVar:0020 <- 32
}
Else
{
LocalVar:0020 <- 35
}
Else
{
POP(Random MOD 3 + LocalVar:0040)
}
Perform(LocalVar:0020, LocalVar:0000)
SCRIPT END
So the solution could be to make enemies give way less exp so levelling up is slower and the time you meet bosses you are much lower level but this would then mean getting to the magical level 99 and level 60 points much harder and less likely in a normal game, I do agree enemy AI's need to be improved especially on bosses and of course stronger attacks ones that hurt enough so that you do actually have to heal in battles and even consider fighting on the back row/use sadness, but doing this alone is useless if the enemy gets no attacks in, and the best way to ensure they get attacks in is to boost their hp/dexterity and defenses.
I started my balance/hard mod from completely different perspective. Average EXP/AP is multiplied by 2 and boss EXP/AP by 5. This way player is about lvl 90 when they reach The Northern Crater and difficulty isn't completely ruined for those who wish to max their levels.
Damage multipliers removed from UWs. I haven't yet decided should I replace it with some other effect or leave them as "normal" weapons.
If Shield protected against non-elemental magical damage I would make KotR hit everyone on the screen (your own party included). So if you wanted to cast it and survive you would need some preparations or final attack+restore/phoenix. In any case the effect can't be made a lot weaker since the animation takes forever so it has to dish some damage. It's the MP cost that is the problem. If it killed you everytime you summoned it requiring you to use final attack+restore for example that would make miming it a lot harder. Or alternatively (1-3)xShield 180-540MP for preparations but if I remember correctly Shield protected only against physical and elemental magic damage. Items excluded.
If you wanted harder battles enemies need to have a lot stronger attacks than they do in vanilla/unmodified game. AI needs to be smart and it needs to react players actions, for example use spells like dispel and debarrier.
What I personally find annoying are the enemies that have 1 basic attack and 1 stronger attack and they choose their attacks completely by change. After that difficulty of the battle becomes dependant on players luck. Does it use it's stronger attack or do I get lucky and it uses it's weaker attack multiple times in a row without using the stronger one. Of course if the attacks had a different Att% with stronger attack having smaller change hitting I could understand why it chooses weaker attack over stronger one.
By the way is it possible to make enemies not use certain spell afer certain events during fight.
Example
start.flag=0
if flag=0
select all cast Fire3
if damage > 0
set flag 0
else set flag 1
endif
else chew bubblegum
endif
I haven't touched the actual AI-data yet so I don't know how it looks like or what commands it uses. That's way my crude example
also, not directly related to PrC, when i updated a fresh kernel with my mod, the file size actually grew, so that it wouldn't fit into a psx iso (testing to see if def was doubled in the psx one... it is btw), but when i opened it with WM and just saved it, the size became SMALLER than it originally was... what is up with that?
So the solution could be to make enemies give way less exp so levelling up is slower and the time you meet bosses you are much lower level but this would then mean getting to the magical level 99 and level 60 points much harder and less likely in a normal game, I do agree enemy AI's need to be improved especially on bosses and of course stronger attacks ones that hurt enough so that you do actually have to heal in battles and even consider fighting on the back row/use sadness, but doing this alone is useless if the enemy gets no attacks in, and the best way to ensure they get attacks in is to boost their hp/dexterity and defenses.
My last post wasn't about barriers.I mentioned about barriers in PrC thread.
That is after all the original intention of GS's AI.
= Halve all non-piercing damage during counter stance
If you wanted numbers
1st Form
Guard Scorpion's Def = D (Min-Max 0-510) (Example 40)
Guard Scorpion's MDf = M (Min-Max 0-510) (Example 256)
2nd Form
Guard Scorpion's Def = D+((512-D)/2) (Min-Max 256-511) (Example 276)
Guard Scorpion's MDf = M+((512-D)/2) (Min-Max 256-511) (Example 384)
This way there was no need for halving while keeping full controll over stats (0-510)
meaning that if i used your way, this is how things would be min/max:I would have complete controll over it's normall stats.
1st - def = 0/510, mdef = 0/510
2nd - def = 215/725, mdef (+128) = 128/638, mdef (x1.5) = 0/765
a section was added to halve the defense (since both games apparently double enemy defense before even the pre-battle ai takes place (likely a core thing), and my ai now halves it, making the defense change more relative, and allowing it to be raised/lowered as desired in an enemy stat editor). once i know how to change the engine to not double the defense anymore i can shrink the size, and if i kept the original direct defense setting
How do you open up a playstation iso file with this program?You don't. You open iso file with either any iso editing tool like isobuster or you mount it with virtual drive, copy kernel.bin from cd to ../myrandomkernelbinfolder/ AND THEN open it with WM.
Look in the "Weapon Damage" drop-down thingy. It'll be there with many other things (including the special effects of the ultimate weapons, and even the special effects of "Everyone's Grudge", "Aire Tam Storm", and "Heartless Angel"). It's really fun to play with.
Huh. Now that I'm looking at Haste and Slow I'm seeing that there's a difference. Haste does always work on everyone and it's 63/63. So do you think that the "/63" label should read "* 4 (%)" or something? I was assuming it was out of 63 because Toad and Mini are 18 and they don't seem to work 72% of the time.I think good label would be "/63 [automatically calculated % value next to it]" so you would know exact change% and it would also show the maximum allowed value. Not that there's a big difference what some label reads as long as I can edit value easily.