Author Topic: Changing enemy colors with editing AI  (Read 9594 times)

ff7rules

  • *
  • Posts: 423
    • View Profile
Changing enemy colors with editing AI
« on: 2009-08-15 14:39:46 »
 From Gjoerulv.

It's probably possible. The "only" thing you need to do is to find the address for gamma/brightness and change/set the value for it. If you remember the way you changed the size of the enemy by AI modding it shouldn't be too hard.

IF XXXX is the address and YY is the value you want then it should look something like this.:

12 (2060)
11 (XXXX)
80
60 (YY)
90
 
The addres is over 0x4000 but under 0x4FFF. Value 00h - FFh. If you have the Proud Cloud app. you could look in the data file that follows to explore known addresses.

Thats alot of adresses to test myself help anyone? :P heres what i got so far. Wwill edit as I try more)

Self.Flag:Unknown(00000001) <- 128 = 4020
Self.Flag:SideAttack <- 128 = 4021
Self.Flag:Unknown(00000004) <- 128 =4022
Self.Flag:Enabled? <- 128 = 4023
Self.Flag:MainScriptActive <- 128 = 4024
Self.Flag:Defending? <- 128=4025
Self.Flag:BackRow <- 128=4026
Self.Flag:?Row <- 128=4027
Self.Flag:PhysicalImmune <- 128=4028
Self.Flag:MagicalImmune <- 128=4029
Self.Flag:Unknown(00000400) <- 128=402A
Self.Flag:Unreachable <- 128=402B
Self.Flag:Unknown(00001000) <- 128=402C
Self.Flag:DeadUnit <- 128=402D
Self.Flag:Invisible <- 128=402E
Self.Unknown(402F) <- 128=402F Reflect all?
Self.Flag:Unknown(00010000) <- 128=4030 nothing noticeable
Self.Flag:Unknown(00020000) <- 128=4031 absorb all magic
Self.Flag:Unknown(00040000) <- 128=4032
Self.Flag:Unknown(00080000) <- 128=4033
Self.Flag:Unknown(00100000) <- 128=4034
Self.Flag:Unknown(00200000) <- 128=4035
Self.Flag:Unknown(00400000) <- 128=4036

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #1 on: 2009-08-15 14:47:53 »
I'll have a go at some of these.

BTW, did you find out anything about using summon models as enemy models?

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #2 on: 2009-08-15 14:50:12 »
I'll have a go at some of these.

BTW, did you find out anything about using summon models as enemy models?

Yeah, it can be done in the PC version but psx won't work. Theres some really interesting values to be found just gonna take along time.

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #3 on: 2009-08-15 15:00:12 »
I've just tried 4037 and 4038 with the MP and the Guard Hound, and I didn't see any effects. I'll keep on looking.


BTW, did you find out anything about using summon models as enemy models?

Yeah, it can be done in the PC version but psx won't work. Theres some really interesting values to be found just gonna take along time.

That's a shame. Perhaps you could report report those findings in the thread, thereby bumping it :wink:
« Last Edit: 2009-08-15 15:03:49 by Kudistos Megistos »

secondadvent

  • *
  • Posts: 287
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #4 on: 2009-08-15 15:39:36 »
i will list the unknown addresses from my PrC dat file, which should be less than the normal dat file that comes with it, since i have found out  a few of the unknowns on my own (not listing flags, since a single stray flag is doubtful to help in this instance :P):

4030-403f
40b0-40b7
41ao-421f (big section between used stuff)
4240-4267
4278-427f
4300-433f (4340-435f is a type of status infliction that affects all in the row EXCEPT the enemy hit IIRC, sort of a blade beam like infliction, but has some weirdness to it)
4360-4fff (the main chunk, doubt much of it is used though)

it is those ranges that would have the color data if it is there, though i don't think it is anywhere before 4360, since i have tried some stuff while looking for the enemy drop/steal items and rates, though i did find the item/money (gil caps at 65535) data that they "stole" from you, like the vice enemy uses when it steals from you (4280 for gil and 4290 for item :P). i haven't tried all that much in the upper region of the data, but it should become pretty apparent when you hit one of the sections (color or drops), because making it a set value would be noticeable right away in many cases (if an MP turned white, then i think you hit the right area XD).

if you guys are looking through the unknown data (i may join in again sometime soon), keep an eye out for other things while you are in there... i would like to stumble upon the drop/steal/morph items and rates, and possibly the manip. moves for the enemy, for my leveling mod once i return to it :P. and, if you want, i can post the contents of my PrC dat file for you to use, though I am not entirely sure if it is all accurate, but it should give a decent idea of how some of it works, and a lot of my flags are separated rather than in one clump, like the elemental resistances.

you could probably make a pre-battle section for whichever test enemy (MP is a good one :P), and set a few unknowns at a time to see what all changes, and slowly move on as you go, if you hit anything interesting just remove unknowns until you can pinpoint the cause ;).

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #5 on: 2009-08-15 16:02:00 »
WOW that list would be great! also i think i found the values that make it so you miss more with attacks so it just increases the evasion. glad so many people are into this :)

secondadvent

  • *
  • Posts: 287
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #6 on: 2009-08-15 17:00:41 »
ok, i sort of looked at the memory of the game and found the location of the 4000-433f data (403f is the max for one enemy's data), the reason why when i activated 4340-435f and it inflicted a status when i attacked an enemy (and didn't inflict the status to the main enemy) is because it was pointing to the data for the next enemy, the 4340+ is the next enemy in the formation's data, so i was inflicting a status to the other enemy :P.

so if it is anywhere (along with the item data hopefully), it will be between 4000 and 433f inclusively, so that narrows down the possibilities some :D. lemme modify my list some to accommodate these new findings, and i will post what i know... and done :P. now it doesn't have everything, and some of it is just modified parts of the original, but there is more than there is in the normal dat file, so it should at least have some interesting data:

Code: [Select]
4000|Status:Death
4001|Status:NearDeath
4002|Status:Sleep
4003|Status:Poison
4004|Status:Sadness
4005|Status:Fury
4006|Status:Confu
4007|Status:Silence
4008|Status:Haste
4009|Status:Slow
400A|Status:Stop
400B|Status:Frog
400C|Status:Small
400D|Status:SlowNumb
400E|Status:Petrify
400F|Status:Regen
4010|Status:Barrier
4011|Status:MBarrier
4012|Status:Reflect
4013|Status:Dual
4014|Status:Shield
4015|Status:D.Sentence
4016|Status:Manipulate
4017|Status:Berserk
4018|Status:Peerless
4019|Status:Paralysis
401A|Status:Darkness
401B|Status:DualDrain
401C|Status:DeathForce
401D|Status:Resist
401E|Status:"LuckyGirl"
401F|Status:Imprisoned
4020|Flag:Invisible
4021|Flag:SideAttack
4022|Flag:Unknown(00000004)
4023|Flag:Targetable
4024|Flag:MainScriptActive
4025|Flag:Defending
4026|Flag:BackRow
4027|Flag:Facing
4028|Flag:PhysicalImmune
4029|Flag:MagicalImmune
402A|Flag:Unknown(00000400)
402B|Flag:Unreachable
402C|Flag:NoDeathAnimation
402D|Flag:DeadUnit
402E|Flag:Tangible
402F|Flag:Unknown(00008000)
4030|Flag:Unknown(00010000)
4031|Flag:Unknown(00020000)
4032|Flag:Unknown(00040000)
4033|Flag:Unknown(00080000)
4034|Flag:Unknown(00100000)
4035|Flag:Unknown(00200000)
4036|Flag:Unknown(00400000)
4037|Flag:Unknown(00800000)
4038|Flag:Unknown(01000000)
4039|Flag:Unknown(02000000)
403A|Flag:Unknown(04000000)
403B|Flag:Unknown(08000000)
403C|Flag:Unknown(10000000)
403D|Flag:Unknown(20000000)
403E|Flag:Unknown(40000000)
403F|Flag:Unknown(80000000)
4040|Index
4048|Level
4050|ElementalWeakness?
4058|GreatestElementalDamage
4060|FormationNumber
4068|AttackPower
4070|MagicPower
4078|Evade%
4080|IdleAnimID
4088|DamageAnimID
4090|BackDamageMult
4098|SizeScale
40A0|DEX
40A8|LUK
40B0|Unknown(40B0)
40B8|AllyCovered
40C0|AttackMask
40D0|PreviousAttacker
40E0|PreviousPhysAttacker
40F0|PreviousMagAttacker
4100|PhysDefense
4110|MagDefense
4120|EnemyID
4130|AbsorbFire
4131|AbsorbIce
4132|AbsorbLightning
4133|AbsorbEarth
4134|AbsorbPoison
4135|AbsorbGravity
4136|AbsorbWater
4137|AbsorbWind
4138|AbsorbHoly
4139|AbsorbRestorative
413A|AbsorbCut
413B|AbsorbHit
413C|AbsorbPunch
413D|AbsorbShoot
413E|AbsorbShout
413F|AbsorbHidden
4140|MP
4150|MMP
4160|HP
4180|MHP
41A0|Unknown(41A0)
41A8|Unknown(41A8)
41B0|Unknown(41B0)
41B8|Unknown(41B8)
41C0|Unknown(41C0)
41C8|Unknown(41C8)
41D0|Unknown(41D0)
41D8|Unknown(41D8)
41E0|Unknown(41E0)
41E8|Unknown(41E8)
41F0|Unknown(41F0)
41F8|Unknown(41F8)
4200|Unknown(4200)
4208|Unknown(4208)
4210|Unknown(4210)
4218|Unknown(4218)
4220|InitialStatus:Death
4221|InitialStatus:NearDeath
4222|InitialStatus:Sleep
4223|InitialStatus:Poison
4224|InitialStatus:Sadness
4225|InitialStatus:Fury
4226|InitialStatus:Confu
4227|InitialStatus:Silence
4228|InitialStatus:Haste
4229|InitialStatus:Slow
422A|InitialStatus:Stop
422B|InitialStatus:Frog
422C|InitialStatus:Small
422D|InitialStatus:SlowNumb
422E|InitialStatus:Petrify
422F|InitialStatus:Regen
4230|InitialStatus:Barrier
4231|InitialStatus:MBarrier
4232|InitialStatus:Reflect
4233|InitialStatus:Dual
4234|InitialStatus:Shield
4235|InitialStatus:D.Sentence
4236|InitialStatus:Manipulate
4237|InitialStatus:Berserk
4238|InitialStatus:Peerless
4239|InitialStatus:Paralysis
423A|InitialStatus:Darkness
423B|InitialStatus:DualDrain
423C|InitialStatus:DeathForce
423D|InitialStatus:Resist
423E|InitialStatus:"LuckyGirl"
423F|InitialStatus:Imprisoned
4240|Unknown(4240)
4248|Unknown(4248)
4250|Unknown(4250)
4258|Unknown(4258)
4260|Unknown(4260)
4268|MagEvade%
4270|BattleRow
4278|Unknown(4278)
4280|ReturnedGil
4290|ReturnedItem
42A0|NullFire
42A1|NullIce
42A2|NullLightning
42A3|NullEarth
42A4|NullPoison
42A5|NullGravity
42A6|NullWater
42A7|NullWind
42A8|NullHoly
42A9|NullRestorative
42AA|NullCut
42AB|NullHit
42AC|NullPunch
42AD|NullShoot
42AE|NullShout
42AF|NullHidden
42B0|AP
42C0|Gil
42E0|Exp
4300|Unknown(4300)
4308|Unknown(4308)
4310|Unknown(4310)
4318|Unknown(4318)
4320|Unknown(4320)
4328|Unknown(4328)
4330|Unknown(4330)
4338|Unknown(4338)

i will work on my recently dumped data and see what all i can find, hopefully i can pinpoint something :P.

edit: nope, i cannot see anything that would possibly point to drop/stea/morph/manip stuff (for me), but 4278 has FF in it, and 4260 has 01, while all of the rest has 00, so those are the only two unknown values with any number in them at all sans 00, but i don't know what they do, i will have to test them and see real quick.

it seems that there will be no real way to change any of the values we wanted through AI, at least through the 4XXX data, but there may still be a way to do it, but how exactly i do not know... it could be something in the 2XXX area, since there are other things in there besides masks (like the magic counter, which counts the amount of times magic was cast (not entirely sure on the mechanics, it may have to hit an enemy to increment it, been a while since testing it :P), battle ID,  and the camera data), so it could still be possible, though I wouldn't know where to look exactly. all i know is that from the data i just looked at, 4XXX isn't looking good for much more data :/.
« Last Edit: 2009-08-15 18:06:00 by secondadvent »

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #7 on: 2009-08-16 09:13:10 »
Wow secondadvent you have been working hard!

Just had a though maybe the answer is in the gameshark code?

Im no expert with these things so i really don't know also i looked at 2000 down to 0 there mostly local variables


ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #8 on: 2009-08-18 08:53:05 »
I am sorry to bump this but me and gamefac have made a pretty awesome discovery!

it seems in prc changing the value of say darkness inflicts more than just tht one element and makes them flash different colors!

example

Display String: "Vincent "The beginning of your nightmare.""
Pause
Self.Status:Berserk <- Self.Status:Berserk + 80
SCRIPT END

 and vincent does nothing
 but when i attacked him
 he went into manipulation status
 you know that right?
 it glows BLUE

 So changing that value makes them glow (flash different colors are we on to something here or not would you say?

secondadvent

  • *
  • Posts: 287
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #9 on: 2009-08-18 11:04:51 »
i am thinking that is because the statuses are flags, they are either on (1) or off (0), so inputting a value of 80 (which is a byte value) into a bit value will cause it to actually change other values, and not necessarily the one you intended. a value of 80 will change two statuses if you were to do a self.berserk <- 80, it would give you Dual Drain and resist statuses, not the berserk status (why you had the manipulate status, the one below berserk activate i don't know, it could be because you added the berserk's own amount back to itself, why i do not know :/). look at it in bit form, each bit is worth a certain value when activated in a byte, and you add all of the active bits together to get the total for that byte, like so:

active bit worth:
bit 0 = 1
bit 1 = 2
bit 2 = 4
bit 3 = 8
bit 4 = 16
bit 5 = 32
bit 6 = 64
bit 7 = 128

and to get the value of 80, you activate bit 6 and bit 4 because 64+16=80. bit 0 is where berserk is, since that is where you are starting the pointing from, so compare the above bot list to this list:

4017|Status:Berserk (bit 0, which is inactive)
4018|Status:Peerless
4019|Status:Paralysis
401A|Status:Darkness
401B|Status:DualDrain (bit 4 activates this)
401C|Status:DeathForce
401D|Status:Resist (bit 6 activates this)
401E|Status:"LuckyGirl"

you can see how the bits match up to the different statuses. when you deal with flags (one bit values), you only ever want to use bit one, so only a 0 for off, or 1 for on should be used, or things you didn't expect can and will happen :P. as for it activating the manipulation status, it could be due to how you set up the setting of the berserk stat, you have it as self.berserk <- self.berserk + 80, while if you wanted to just activate/disable the stat, you would only do self.berserk <- 1 or 0 (or 80 in your case :P), having the self.berserk in there makes it add it's own value to itself, which isn't needed for flags (other stats it can be needed if you want to not just set the stat, if you wanted to heal X amount of hp, you would go self.hp <- self.hp +x, if you just went self.hp <- x, you would only have x life then, which can be bad depending on what you were aiming for :D).

if your code was:
Code: [Select]
12 2060
10 4017
80
12 2060 //bad, you would be trying to add a pointer to a pointer instead of a value to a pointer
10 4017
80
60 50 //50 is 80 in hex :P
30
90

instead of:
Code: [Select]
12 2060
10 4017
80
02 2060
00 4017
80
60 50
30
90

then you could have unforeseen things happen, because i do not know how that particular piece of code would cause your status infliction to react, it could very well cause the manip stat to activate, i don't know :P. it could even be what you have the berserk flag's type as, 10 is for bit (flags) values, 11 for bytes, etc., so having the wrong one for what you are trying to do can cause issues as well, if you have it as 10, which it should be, it has to try and fit the value of 80, which is outside of it's range, into that bit value, which isn't good... i can't say for sure the exact cause of it having manip activated, but i do know that you are not getting what you aimed for because you are trying to place the wrong sized value into the berserk flag :P.

and so ends another long post by me <_<. or does it? XD

[offtopicz]
this will be off topic, but i have been working on my leveling AI, and i have got it pretty much perfect now, the most total size of the AI that can be used up if all three enemies in a scene raise EVERY stat (with my equations i am using :P), would be just under 31%, and for the most part it will not take up too much space for the bigger battles, since they are usually in a scene by themselves (like ruby/emerald), so they will have ~10% taken up by leveling, and the rest would be free to make them uber XD. i was trying to test out that berserk issue, and got raped because i forgot i still had the MP enemy to be from cloud's level to cloud's level +64... so i was getting 1hko'ed a little bit  :roll:. oh well, maybe now i can finally start back up my hard mod again, now that the roadblock is out of the way (and i have made an awesome excel spreadsheet to calculate the exact stats they will have, including the critical chance, base damage, damage resisted (in %, just a basic idea of the damage that enemy will resist with their defense/m.def, and it has two graphs to show their stat growth's all together, and more >:3), i am still somewhat working on another game though, so my progress will likely be slower, not to mention i still need to do my AI compression mod along with it :P.[/offtopicz]

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Changing enemy colors with editing AI
« Reply #10 on: 2009-08-19 20:09:48 »
I emailed the guy who created the code. Heres what he had to say.

I hacked them (years ago, at that), using a GSPro and comparative searches (using a status, perhaps Darkness, as a basis for the comparisons). Beyond that, I have no further info. Sorry, and good luck.

Thats all he had to say im afaird.