Author Topic: [PSX/PC] Battle editor - Proud Clod (1.5.0/FINAL)  (Read 417393 times)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #25 on: 2009-05-29 16:53:41 »
hmm Proud Clad sounds more like what it should have been, I will ask :)

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Official Proud Clod 1.0 Topic
« Reply #26 on: 2009-05-29 16:58:59 »
I also just discovered that if you mime the usage of an item then it doesn't deplete the quantity of the item you just mimed. So you can Stardust Ruby to death if you'd like :D

I thought the answer would be in Hojo's script when he reveals the sample enemies. But alas, nothing. So it's not 4020-4023.


4020|Flag:Unknown(00000001)
4021|Flag:SideAttack
4022|Flag:Unknown(00000004)
4023|Flag:Enabled?
4024|Flag:MainScriptActive
4025|Flag:Defending?
4026|Flag:BackRow
4027|Flag:?Row
4028|Flag:PhysicalImmune
4029|Flag:MagicalImmune
402A|Flag:StatusImmune?
402B|Flag:Unreachable
402C|Flag:Unknown(00001000)
402D|Flag:DeadUnit
402E|Flag:Intangible
403F|Flag:Unknown(00008000)

These are all just bit values too.

Can anyone get the Thunderbird around Wutai to counterattack with lightning? I want to know what 2120 is.

Code: [Select]
If (Battle(2120) AND 2)
{
   TargetMask <- AllOpponent Mask
   Perform ("Lightning", EnemyAttack)
}

So if bit 00000010 is active at 2120, it'll perform Lightning. But what does that bit mean? Zemzelett also has it.

Code: [Select]
If (Battle(2120) AND 3)
{
   TargetMask <- Self
   Perform ("", EnemyAttack)
   <Do flying stuff>
}

It's important somehow.
« Last Edit: 2009-05-29 18:34:42 by NFITC1 »

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #27 on: 2009-05-29 17:39:55 »
i made a simple little pre-battle script to print out the current values for 4020-4022, and the guard hound (since it is the only back attack in the first area) printed out 4020/4022 as 1, and 4021 as 0 in a normal fight (possibly 4021 is any special formation, not just side attacks). will see what is printed on the back attack battle as soon as i encounter it.

edit: bah... when i found it the text didn't show up since back attack took priority to show, so i would need to transfer it all to the main script, or counter script >_>. im not too worried about them right now though, but using output lines is a good way to narrow down what possible things the variables can be.

!!! 4020 is invisibility

i made the first two MP's invisible my setting their 4020 to 00

4022 makes them invisible as well, but their location on the field gets screwed up (they move to the center from what i saw) while 4020 does not, they stay in the same place, and it looks EXACTLY like when my dead MP's came back to life

edit: damn... setting the value to 01 after rezzing the enemy did not fix the invisibility issue, and apparently a variable to check to see if they have been revived already (for my auto life) isnt needed, because being killed a second time (while invisible) without the check enabled, it died for good. i even tried to enable both 4020 and 4022, but no success. it must be some other problem then.

though i can make an enemy disappear with 4020, i cannot make them reappear. maybe it isn't a bit value? whatever the case, changing from invisible to visible is linked to 4020 from what i can tell.

edit: 402c is what makes the enemy stay after killing them, for use with special animations for death i assume. maybe combined with 402c i can make the mp's not disappear with the death script

and sure enough, i set it to 01, and they did not disappear after the first death (or the second actually, but that is easily fixable... but probably no death animation would happen), and i am now going to see if the 402c variable will restore the invisible status (just checking, could be dual function :evil:)

Quote
Can anyone get the Thunderbird around Wutai to counterattack with lightning? I want to know what 2120 is.

Code:

If (Battle(2120) AND 2)
{
   TargetMask <- AllOpponent Mask
   Perform ("Lightning", EnemyAttack)
}


So if bit 00000010 is active at 2120, it'll perform Lightning. But what does that bit mean? Zemzelett also has it.

Code:

If (Battle(2120) AND 3)
{
   TargetMask <- Self
   Perform ("", EnemyAttack)
   <Do flying stuff>
}


It's important somehow.

it could be an attack counter, for how many times it was attacked with whatever, since i know i have seen the zem do the flying crap
« Last Edit: 2009-05-29 18:58:21 by secondadvent »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Official Proud Clod 1.0 Topic
« Reply #28 on: 2009-05-29 18:58:30 »
It is a bit value, but you'll need to unset then set 4020, 4023, and 4022 (usually in that order) so they'll "come back".

Man, this new search feature that I added is awesome. XD

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #29 on: 2009-05-29 19:15:29 »
i will try that. i did manage to make my MP's die the first time without a death animation, and then die the second time with the animation by turning on/off the 402c variable. trying to see what i can do to make the death animation play multiple times. for the turning off of the 402c variable, it will likely have to be as a post attack/general counter, if they can still activate after the death counter, that is.

yeah... i was going to ask about that, but it seems you are way ahead of me >:D

meh... i still can't get them to turn visible again... but at least i know how to get around the invisibility so that they at least can come back to life once.

Quote
It is a bit value, but you'll need to unset then set 4020, 4023, and 4022 (usually in that order) so they'll "come back".

is it turn them each off then on (i.e. 4020 off/on, 4023 off/on, 4022 off/on), unset them all then set them all, or something else, because them staying invisible is annoying, and having invisibility as an ai script instead of an animation could be useful.

also, if you were to have a status effect (good or bad) and then be given immunity to the status/statuses that remove it, would you be able to get rid of the status if it wasn't temporary? i know giving yourself fury/sadness and equipping a ribbon, then trying to use the opposite status giving item in battle, it doesn't remove it, because you are immune to the "toggling" of the stat on or off. if there is a space in the ai for elemental resistances (giving temporary elemental resistances in certain situations) as well as status resistances, things would be very interesting. an enemy could give you a piercing status ailment (ignores immunity) and lock you with the immunity to the status on, keeping you unable to heal it (like giving death sentence), and if having an immunity to healing element meant no resurrection/healing (since you can revive with death immunity), they could essentially lock you from helping your ally who is bound to die. kind of a delayed quicksand attack that ruby uses, but much more evil (especially if final attack+phoenix can't rez you >:D). but i don't know if there are such ai possibilities, and am not sure if rezzing can be prevented through the health immunity (i am pretty sure it is, like with the bone mail of ffv).

is it possible to have a battle lead to another (battle chain) without needing to hex edit, as in calling a new fight from the ai? because that would be a great help (or having PrC have it added in >:D), since it would make testing easier (without having to extract and rebuild the scene.bin file to change battle formation data).
« Last Edit: 2009-05-29 20:27:42 by secondadvent »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Official Proud Clod 1.0 Topic
« Reply #30 on: 2009-05-29 20:39:17 »
is it turn them each off then on (i.e. 4020 off/on, 4023 off/on, 4022 off/on), unset them all then set them all

That's what I'm suggesting, but no promises on the result.

also, if you were to have a status effect (good or bad) and then be given immunity to the status/statuses that remove it, would you be able to get rid of the status if it wasn't temporary? i know giving yourself fury/sadness and equipping a ribbon, then trying to use the opposite status giving item in battle, it doesn't remove it, because you are immune to the "toggling" of the stat on or off.

You mean like that bug in FFVI? I don't think there's a way of knowing except forcing a character to have a status they are supposed to be immune to and trying to cure them of it. Since all the statuses go away after battle (and nothing prevents Fury/Sadness) there's really no way to know.

if there is a space in the ai for elemental resistances (giving temporary elemental resistances in certain situations) as well as status resistances, things would be very interesting. an enemy could give you a piercing status ailment (ignores immunity) and lock you with the immunity to the status on, keeping you unable to heal it (like giving death sentence), and if having an immunity to healing element meant no resurrection/healing (since you can revive with death immunity), they could essentially lock you from helping your ally who is bound to die. kind of a delayed quicksand attack that ruby uses, but much more evil (especially if final attack+phoenix can't rez you >:D). but i don't know if there are such ai possibilities, and am not sure if rezzing can be prevented through the health immunity (i am pretty sure it is, like with the bone mail of ffv).

I don't know if it's actually stored in the data that the AI has access to. It's been possible in previous FFs to change a character's elemental resistance in battle, but I don't know about this one. Let us know if you find it.

is it possible to have a battle lead to another (battle chain) without needing to hex edit, as in calling a new fight from the ai? because that would be a great help (or having PrC have it added in >:D), since it would make testing easier (without having to extract and rebuild the scene.bin file to change battle formation data).

Planning on adding that ability to PrC.....eventually. Right now I'm focusing on individual units, possibly expanding to formation placement. then focusing on the formation itself.

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #31 on: 2009-05-29 20:49:57 »
Quote
also, if you were to have a status effect (good or bad) and then be given immunity to the status/statuses that remove it, would you be able to get rid of the status if it wasn't temporary? i know giving yourself fury/sadness and equipping a ribbon, then trying to use the opposite status giving item in battle, it doesn't remove it, because you are immune to the "toggling" of the stat on or off.

You mean like that bug in FFVI? I don't think there's a way of knowing except forcing a character to have a status they are supposed to be immune to and trying to cure them of it. Since all the statuses go away after battle (and nothing prevents Fury/Sadness) there's really no way to know.

actually ribbon prevents sadness/fury, so yes i can know. i did give myself fury outside of battle, equipped the ribbon, went into a battle and used a tranquilizer, and my limit gauge was still red from fury.

update: yes, if you are immune or absorb (guessing on it since it is healing as damage then) the healing element, phoenix downs will not work to revive you. so, if it is possible to call status/elemental resistances from the ai, things can be made pretty cruel.

for the 2120 thing, it is also used in the sample:ho512 fight, where it's 2120 becomes = to it's children when one dies, so maybe it has something to do with that? i could fight a x4 thunderbird fight and set their main to output their current 2120 (from 0-2, which should be high enough hopefully) and try things out to see what raises it.

edit: i think that it is a magic counter, i used ice on one, it did a normal attack, and right after it attacked, i used ice again and it countered with it's lightning attack when it obviously wasn't it's turn (meaning it was turly a counter attack). i tried the same thing with physical attacks and nothing happened (have 255 speed, and set my attack low, and hit three times before it went with no counter). 2110 could be the physical counterpart of this, and maybe 2130 a universal one? just speculation at least, but i know that 2120 is definitely raised when being hit with magic (that they do not absorb), and if i remember correctly from past playthroughs, zem did usually fly up after i used magic on it.

2120 is definitely a magic counter, but there doesn't seem to be a physical one, at least in either 2130 or 2110. possibly elsewhere though
« Last Edit: 2009-05-29 22:06:40 by secondadvent »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Official Proud Clod 1.0 Topic
« Reply #32 on: 2009-05-29 21:46:30 »
Two pages already and I only started the topic yesterday. :)

I updated the first post with the version I've been playing with all day. Have fun with it. It should resolve a few bugs that the previous version had.
I'll be gone next week so let me know before then if there's something wrong with it or I won't be able to fix it soon.

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #33 on: 2009-05-29 22:14:49 »
unless 41c0/41a0 have some special value to ho512, then it is useless for it to have the 2120 of it's minions as it's own. 2120 is a magic counter (how many times you got hit with magic, which seems to only like to be anded to 02 or higher), so unless the other two are dependent on a counter, such as a random or some status change, i can see no reason to have it in it's script. one unknown when solved leads to other unknowns <_<.

any other unknowns you want me to try to figure out?

ok, a bug that has been bugging me is where the ai editing will not open up, requiring a restart of PrC. occasionally, the ai button will just stop working, and no matter which scene file within the scene.bin is looked at, the button remains dead, until the scene.bin/another scene.bin is opened up. correction... until a new PrC is opened up >_>. seems to be when i run ffvii that it acts up, since i leave it open... must be a sharing problem then, or a coincidence :-P. also, the character ai tab on the task bar doesn't appear anymore... i don't know if it is just my computer or if you meant for it (or bug), but it was much easier to keep track of when the tab was on the task bar (may actually be the cause of the "bug" i am getting... the editor is up, PrC is calling it, but since it isn't visible, it is as if it isn't appearing though it is actually here). if you meant for this... i have to say that i preferred it the other way, especially since i cannot set it to "always on top" either <_<

i tried 402A to see if it was status immunity, but it was not... i was able to poison an mp with the bio spell with it active. whatever sephy uses it for, it isn't for status immunity :-P.being immune to magic should prevent most of the statuses anyway, only if they are on a weapon/phys attack would be able to get past magic immunity, but he has both, so total immunity anyway.

4025 is definitely defending check, so you shouldn't need the ? anymore >:D

no more time to check stuff for today... i will continue checking tomorrow, if i can get any sleep with these damned cats  :x
« Last Edit: 2009-05-29 23:14:28 by secondadvent »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Official Proud Clod 1.0 Topic
« Reply #34 on: 2009-05-30 00:17:24 »
ok, a bug that has been bugging me is where the ai editing will not open up, requiring a restart of PrC. occasionally, the ai button will just stop working, and no matter which scene file within the scene.bin is looked at, the button remains dead, until the scene.bin/another scene.bin is opened up. correction... until a new PrC is opened up >_>. seems to be when i run ffvii that it acts up, since i leave it open... must be a sharing problem then, or a coincidence :-P. also, the character ai tab on the task bar doesn't appear anymore... i don't know if it is just my computer or if you meant for it (or bug), but it was much easier to keep track of when the tab was on the task bar (may actually be the cause of the "bug" i am getting... the editor is up, PrC is calling it, but since it isn't visible, it is as if it isn't appearing though it is actually here). if you meant for this... i have to say that i preferred it the other way, especially since i cannot set it to "always on top" either <_<

This isn't a bug. It's a weird thing with the window Z-Order that I can't figure out how to change. You can still Alt-Tab to the AI Window, but don't change the scene while it's still up or you will end up overwriting a scene's AI (and thus screwing up all those battle formations). I tried to fix it earlier, but I didn't get it right. In WM, when you lose focus of the raw data window it just goes away. Since the AI window is a little more sensitive I didn't want it to just disappear, but I couldn't get it to bring itself to the front. If anyone knows how to do this in VB.NET, let me know.

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #35 on: 2009-05-30 07:50:26 »
could you just make it a part of the main PrC window, instead of making it a whole new window? i know it'd probably take a lot to change it like that, but it could also prevent the scene change bug, if you make the ai window the only part able to be changed until you close out of the ai editor part, or "cancel" out (since it'd be a part of the main, if you didn't want to save the changes to that ai edit, but wanted to keep changes elsewhere, and since the X button would close everything, a cancel button would be needed). you could make it like a new tab to the main window, but make it ask if you want to keep your changes when attempting to return to the scene section, and the close button wasn't pressed (save button?).

of course finding out how to do what you wanted would work as well, but you'd have to either make the main window unable to be clicked on, or make the scene unable to be changed while the ai window is up.

wow... there is a lot of errors in the main scripting of the game, like anding a number to zero when trying to get a non-zero value... 0 AND anything is 0. i even tested to see if the game somehow used something else for anding, made 0 AND 1, 1 AND 1, and 2 AND 2, and the results were false, true, true, meaning 0 and 1 is 0 (as is 0 and anything), so a lot of the scripting (hell, 90% of grunt's is broken) doesn't work as intended because they start the variables as 0 instead of as 1, which would make the ai work properly.

i am going to make the ai work as intended, using terence's enemy mech. guide as a base for what is intended, and fixing anything that should work one way but doesn't. i tested the grunts in battle, and when they were in the front row, and i was in the front, they did beamgun/handclaw at a 50/50 rate (expected if not everybody was in the front or back rows), and when everybody was in the back, they did a 50/50 rate as well, when it should have been at most a 1/8 chance for handclaw. if i were to change the variables in the ai to start as 1, not zero, then the entire script would likely work correctly (though once again the shoot element beamgun, like the mp's machine gun, is not a ranged weapon).

my rewritten version will work as intended originally, though like most other enemies, it isn't needed (just being done so that people will have a smaller scene as a base working as originally intended, especially for those psx modders who want the original ai in tact, (and since they have limited changing room normally) mine will be that, with bugfixes :-P).

ok... i know how to see if there is any enemy in the front or back row, but not to see if they are ALL in the front or back... to do so, would i have to make an if that checks for (allActiveOpponents.backRow=1 && NOT allActiveOpponents.backRow=0), so that it'd first see if there was any enemy in the back, then check to see if an enemy is in the front, and only continue if someone was in the back but not the front? i do not see any magic function to only return true if all are in the front (mono/guard only use the if any is in the front/back method). i know it will work, but it is kinda big to write, even using variables for the value. meh... it will still make it smaller than the current 850 byte script <_<.

edit: this does work to check for all in the front or back, so i guess i can't complain. i made a test to print 00 (front) if (someone in front && not in back), 01 (back) if (someone in back && not in front), and 02 if neither previous ones were true. the start, barret and cloud were front, and it printed 00, i moved one back and 02 printed, then moved the other back and 01 printed. the original test was only for checking if one was in the front row (seeing if it was true if all were in front), and it printed either 00 or 01, never 02. too bad i don't know of a quick and easy checking method <_<.

ok, the way that i am scripting the ai for the grunt (and will pass over to others if needed for even more space) is making the ai jump to the end when an attack is to be set (the attacks are set at the end), and then finalize there. so what i am doing is going through the regular if statements to find out the target and attack needed to be used, but instead of repeatedly setting a variable for the attack throughout the ai, i am just making it set one time, and the script jumping to the setting whenever it is ready to attack. everything else needs to be set before setting the attack itself, because otherwise it will perfrom the attack early without setting a specific target, but in the case of the grunt enemy, it is pretty easy and efficient to do it this way. but it is hard for the ai editor to show the C equivalent, and somewhat hard to follow (but nowhere near as hard to follow as the original grunt ai... that is a mess >_>).

i was wondering how you have it lay out the code, do you have it just draw brackets and indent based on where the jumps are located, and have it try to follow the jump to see how to put the brackets? if you were to have it draw a left bracket at the start of an if (when a 70 appears), and follow the pointer to the location given and place a right bracket there, and indent everything in between, that'd make the spacing better. do the same for 71, and for 72, actually have the disassembler follow the code and write it right after where the jump was located, so that things were to look more accurate. looping jumps could be a problem in this way, but put the normal LOOP visual after drawing the code once.

ok, this part will porbably be a little big, but should explain what i mean a little bit more (feel free to hurt me if i am just thinking it is easier to do than what it actually is):
Code: [Select]
this is from the beginning of my mono drive code:
0x000   00   0000
0x003   52
0x004   70   003b
0x007   81
0x008   60   02
0x00a   34
0x00b   70   0021
0x00e   93   (Enemy Sighted!)
0x01e   72   0034
0x021   93   (Warning! Warning!)
0x034   10   0000
0x037   60   01
0x039   90
0x03a   73
0x03b   02   2060
0x03e   02   4140
0x041   80
0x042   60   04
0x044   44
0x045   81
0x046   60   03
0x048   34
0x049   52
0x04a   50
0x04b   70   0084
...

if you follow the jumps, and use the way i said to place the brackets, it would appear like this:

if (Not (LocalVar:0000))
{ //places because of the 70
        if (Random MOD 2)
        {
                Display String: "Enemy Sighted!"
                LocalVar:0000 <- 1 // followed the 72 and placed the things within up until the SCRIPT END
                SCRIPT END
        } //places here because it is the end of the jump
        else
        {
                Display String: "Warning! Warning!"
                LocalVar:0000 <- 1
                SCRIPT END
        }
} // placed here because it is the end of the jump
if (((Self.MP > 4)  And Not  (Random MOD 3)))
{ // goes on, but rather big, so i just used this small part as an example.

now, the program's normal output for this code:

If (Not  (LocalVar:0000) )
{
If (Random MOD 2)
{
Display String: "Enemy Sighted!"

}
        Else
{
Display String: "Warning! Warning!"
}
LocalVar:0000 <- 1
SCRIPT END} // goes fine until here, and then the indentation craps out for whatever reason
If ( ( (Self.MP > 4)  And Not  (Random MOD 3) ) )
{

from what i have seen, it is mainly the indentation going wrong, which should be pretty easy to fix (again, hurting is
allowed :-P), the addition of the code from a jump on (as seen with the message then variable/end statement) would
just help things be easier to follow for mass jumping programs. the only problems i see with this jumping idea is possible
looping errors, where it keeps trying to make a loop repeatedly within the same loop (like writing infinite if's instead of a
 while), instead of writing once and printing loop at the spot it would return, as well as it taking a while to render the C
code from the hex, since it would take a good bit longer depending on the coder's format.

but if these were implemented, it would make following your own, and others' code much easier.

if someone just looked at the disassembled version of my grunt ai, it would appear to have multiple empty if statements (what happens when it is true, no the actual statement itself), when it is just jumping elsewhere in the script to save space.

oh, and where are the battle square battle formations located, because they are apparently not normal formations?
« Last Edit: 2009-05-30 15:16:55 by secondadvent »

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #36 on: 2009-05-30 21:49:00 »
Quote from: secondadvent
oh, and where are the battle square battle formations located, because they are apparently not normal formations?

The formation IDs should be in the field file clsin2_1 (use meteor to open it). AFAIK there isn't anything unusual about them in the scene file (I might be wrong about this); it's the opcode in the field file that makes all the strange things happen. I say that I might be wrong because some things that we thought were the domain of the field file opcodes can be done with the scene file as well (such as making it possible/impossible to escape).

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Official Proud Clod 1.0 Topic
« Reply #37 on: 2009-05-31 00:03:10 »
Quote
wow... there is a lot of errors in the main scripting of the game, like anding a number to zero when trying to get a non-zero value... 0 AND anything is 0. i even tested to see if the game somehow used something else for anding, made 0 AND 1, 1 AND 1, and 2 AND 2, and the results were false, true, true, meaning 0 and 1 is 0 (as is 0 and anything), so a lot of the scripting (hell, 90% of grunt's is broken) doesn't work as intended because they start the variables as 0 instead of as 1, which would make the ai work properly.

These are compiler oddities. It has nothing to do with the way they wrote it, just the way the code was made into the assembler. I've noticed lots of stuff like that in various scripts that don't make lots of sense. So I guess what I'm saying is there's lots of room for improvement in the scripts if you know the tricks.

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #38 on: 2009-05-31 01:35:59 »
well everybody up to guard scorpion (he would be done but i fell asleep :-P) is working perfectly, and since there isn't a copy/paste function yet, i just manually copy/paste everything with translhextion and repoint the ai pointers. what would be fun is if i could get the going from invisible/visible working, because then a vanish spell could be added, nulling physical hits (since the intangibility opcode makes both miss) and making magic activate the reappearing act (all through the characters' ai, and nulling is the closest to getting it like normal vanish that i can think of at the moment).

gave blind to smoke shot for the sweepers, since their ai is clearly based off of it inflicting it.

thanks for the battle square info (thought it would be there if nowhere else), it will help knowing that for when i get to my mod. and i kind of figured that the variables being wrong was due to the programmers, but it seems not. perhaps it was an earlier version of whatever they were using to write the code, and somebody new to the "language" of vii programmed in such an odd way that it crapped the program out >:D. i noticed 1st ray and sweeper being much different from the previous four, so maybe they were made with a newer version. sweeper had jumps in weird, unused places (72 jump after a previous 72 jump, with nothing pointing to it), which would be consistent with using a program that you could insert regular code with (extra jumps being end brackets). seems they took the easy way out >:D.

finally at guard scorpion, but was wondering what would be more appropriate, having it's def/mdef raise relative to it's current amounts (with error checking to see if it will cap it off at 512 (or is it 510/511?), requiring code to be added, or keeping it as is (bad for anybody attempting to change it's def/mdef in a mod, without editing ai) which sets it to exact amounts? i am probably going to go with a relative jump that will still make the def change to the same number as was there originally, but unless the main can have some reduction, then i am actually making the ai bigger >_>.

hmm... my scene.bin is based off of the psx version (i think... since all def values are half of what they are in the EM guide, and it is based off of the pc one, and i was using the psx scene as a base since at the time i couldnt get the pc one to work), so i don't know whether or not to use the base defense listed in the guide, or halve it and go from there since the enemies are already half def. i also don't know if the pc/psx ai is the same or not, though the only differences i can possibly see are bugfixes in ai, and the def doubling being to try to raise the difficulty (fail), so my version could seem crappily lain out because it is the first version of it (sans jpn one), and the pc one is different in some places. oh well, i will still keep this as the base, and if i feel like it, just double all the enemies' def, though this is technically being done for psx users anyway, so probably not. i'll just compare the def in the ai to the EM faq and change as needed (though my ai will match the pc versions').

apparently there is no need for any error checking, since it will never break 500 for either stat, so that's a relief. max def for those hacking only stats, not ai, will be 490 def, 489 mdef. if its defenses were that high, 800 hp would be painful to rip through.

ok, now i am confused... i looked at the scene from the install disk, and it has everybody's def being the same as the psx versions' so they would seem to be identical. however, when adding 106 to GS's mdef, bolt did ~30 damage instead of ~80-90 it would take with 256 mdef, like usually taken. now i figured that if the game automatically doubles everybody's defense as a pre-battle for everyone, and the psx version doesn't then things will be difficult >_>. to make the pc one correct, i have to subtract 44 mdef, and for the psx add 106 mdef. so if an enemy has 255 defense in the pc version, they will essentially nullify any damage done, and if any are to add defense, then things could be a problem. i am going to check with the scorpion to see what happens at over 512 defense/mdef.

ok, def at/over 512 just sets damage to one, and hitting a weakness does double, so max of 2 dmg a hit :-P.
« Last Edit: 2009-05-31 12:38:31 by secondadvent »

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #39 on: 2009-06-02 17:20:57 »
ok, to bump and add some feedback:

some little things i have noticed while using the ai editor is that when adding a new line to it with enter, there is sometimes issues with where the new line is placed.when trying to add code to the top of your ai code, the editor does not want to make a new line appear above the topmost line, and places it below instead, forcing you to rewrite the topline code on a new line, and then adding the new code over the original top line code, where you can then add the remaining lines easily. example:

Code: [Select]
topmost line example:
12   0000

pressing enter:
12   0000
//new line

way to add code above (73's always want to add lines above, so only issue may be when adding multiple ends):
12   0000
//new line

12   0000
12   0000 //rewrite the previous line in the new line

//new code
12   0000

//new code
//new line
12   0000

it doesn't like to add lines above the top line, and this seems to be the only way to work around it.

other times the program will allow the line to be added above, but not below, forcing yet another method of getting the new line to appear below the top line (making a new line above, then making the new line in between the top and the one below it)

also, when clicking onto a slot to look at it's contents and click away without pressing enter, it displays an error message, even though nothing is wrong. if done in a dialogue box (at least it happened to me with guard scorpion), it may mess up the contents somehow (i did not notice anything different, but the offsets all messed up). this is not a good thing, especially when you accidentally click away then press enter, since the popup box is set to quit by default, so just by clicking outside of a box without clicking enter, it erases all that you had done up to that point if you aren't careful.

i think i am going to step away from ffvii for a little bit, but i will continue soon, and hopefully learn more unknowns :-P. also, you wouldn't happen to know how to remove the pc versions' defense doubling (apparently a global pre-battle that happens before other pre-battle ai are called), since it is throwing the guard scorpion's ai out of whack (my modded version, since it is using relative defense boosting, the psx versions' is very simple, it will never reach over 490 for either defense, even at 255 initial defense and in the laser counter phase, but the pc version's INITIAL m.defense for the guard scorpion is 300 (150 x 2), and since the game sets it to 256 right away, no matter what you change it to, it will not change in game without ai editing (which is why i am implementing this into the ai). using the same ai for the pc as the psx, the guard scorpion will easily cap out m.def WITHOUT increasing from the initial 150, which is why i have a problem. i can work around this by making his defenses /2 at the start, and use the initial ai i have for him (using more room than it already should), but this would have to be added to any other enemy with defense modding in battle.

i know that last paragraph was really long and probably hard to understand, but if you know how to remove the pc versions' innate start of battle defense doubling (scene.bin files have same base defense between versions), that would be wonderful to know.

edit: it appears that the psx version has the def doubling for enemies as well? i tested the damage a lv 6 (start of game) cloud should do with the buster sword against a 50 def enemy (edited MP enemy) using the battle mechanics equations, and found that he should be doing around 37 damage to the MP. when i fought the edited MP, in both versions (using a fresh scene.bin for each, from each specific version, so a pc scene.bin from the install disk, and a fresh scene.bin from an unedited psx ffvii iso) he took ~32 damage from cloud, when he should take ~37. so i went back to the equation and typed in 100 def instead of 50, and sure enough the results were around what i had seen in the game. so, either the game gives an innate *2 defense (both defenses, in both games), or a 100 def mod for both defenses, because either one would result in this. if it is possible to turn this feature off (by removing it entirely, or replacing 82 with 81, or 100 def mod with 0 def mod), then i would be a happy hacker. if you know anything please tell me.

also, how do you turn on the materia menu at the start of the game?
« Last Edit: 2009-06-03 07:49:33 by secondadvent »

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #40 on: 2009-06-05 07:03:27 »
It's about as user-friendly as an AI editor can be :-P

And if you want to use it with the PSX version, you need to use CDmage to extract the scene.bin file, edit it as usual, then use CDmage to put the file back into the ISO. As long as you don't make the scene.bin file any bigger, it should work.

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #41 on: 2009-06-05 13:24:11 »
and i am in the process of making a scene.bin for the psx (or pc for those who want it) that massively shrinks the ai while doing what the ai was intended to do (as well as fixing bugs), so that psx users do not have to worry about this problem too much. though my style of ai editing is a little weird, so those wishing to add to the ai could have trouble, unless they start from scratch :-P.

however, those who only want to change basic stuff, such as stats and enemy moves (not so basic for the moves) should have no limits in the psx one, unlike they do now. gonna take a while, but will eventually get done :-P.

and yeah... unless you know how to program the ai, you aren't going to be able to with this editor... it takes some learning to do.

warbaque

  • *
  • Posts: 44
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #42 on: 2009-06-05 14:53:28 »
If I edited all monsters, their stats and attacks in one scene.bin and for example secondadvent wrote better AI for them later, would it be possible to copy AI data from one scene.bin to the other without changing other options? I assume it isn't as simple as copy-pasting with hex-editor? If I recall correctly AI-data is all over the place in all scenes.

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #43 on: 2009-06-05 15:10:27 »
AI data is in one place (more or less). Conveniently, it's right at the end.

However, within the AI section the scripts for each enemy are not all the same size, and there are pointers at the start of the AI section pointing to the beginning of each of the enemies' scripts. If you copy/paste the AI from some enemies in a scene, but not all, you'll need to fix these pointers yourself (otherwise, the game won't know where to look for the second/third enemy's script).

If you copy the AI for all of the enemies in a scene, then you can copy/paste without any problems.

warbaque

  • *
  • Posts: 44
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #44 on: 2009-06-05 15:33:53 »
Would copying all AI-data from other scene.bin require copy-pasting 256 times (once per every scene. off course excluding those scenes with only dummy/unused enemies) assuming all enemies were changed?

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #45 on: 2009-06-05 15:58:17 »
Erm...I think so  :oops:

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #46 on: 2009-06-05 16:14:44 »
it would require that, since there isn't an editor i know of that can directly copy the ai (even this one... i have to manually retype ai for each new enemy, or hex copy it in, and manually rechange the pointers there), so the best way would be to extract all 256 scene files (in my scene.bin there are currently 19 blank scenes, and some more i know i could delete some enemies from, but not the entire scene data), and hax edit the new ai values in from mine, which isn't too hard to do if you know where to copy from, and it'd be a direct paste, filling the extra stuff with FF (null) values, and since the scene.bin is 256 compressed scene files, more of the same value (in this case FF) causes it to shrink much better.

currently with the first reactor's enemies alone, up to and including the guard scorpion, i shrunk the ai 6816 bytes, removed 12 useless scenes (big save in size), and the current scene.bin size is 256 kb (reduces/increases by 8kb whenever it needs more room or has enough free space to shrink, it doesn't directly shrink as it is changed, i.e. a 1kb reduction to a 256kb scene would either become a 248kb scene (if shrunk enough overall), or stay at 256, but with a good bit more room for editing in that area).

guard scorpion actually grew, but this is because i made it more def change friendly, meaning it has the usual in-battle defense, but usually you could make both defenses 255, and it would still have the same def in-battle, since the ai set it to an exact number, not to a relative increase. 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, i could actually have saved about 10% of the space that GS takes up (it's ai has a big portion of dialogue in it, wich is where much of the size comes from), however my goal is to make it as hacker friendly as possible, though it will still be good for normal users, just fixing ai bugs and such.

actually, shrinking the ai could improve performance in-game, since a smaller ai takes less time to be completed, causing less wait time between attacks, though most people will not really be able to see the difference. wait time, as in when a move causes the atb to stop isn't what i mean, i mean the time it takes to finish the ai script. smaller ai also means more room to add more to the ai itself, not just the stats, without making it go past the psx size limit :-P.

i think i will make my own thread when i completely finish with the reactor (going back over the ai to see if they can be modified more, and i know some definitely can be), and have some people test them out to see if there are any bugs, but there shouldn't be any in the original enemies i added... just the copied ones since i had to manually retype them, and didn't test them after that :-P. the first reactor enemies are also (most anyway) in the sector 7 train graveyard, and have different formations there, so testing there would be nice as well. if anybody wants to test it, since it wouldn't be a completed release, i will email the scene.bin to you if you want them, becuase i don't want a lot of people wanting them too fast, since it will be a long time until i complete this little project >:D.
« Last Edit: 2009-06-05 16:19:07 by secondadvent »

warbaque

  • *
  • Posts: 44
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #47 on: 2009-06-05 16:51:26 »
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

I don't have time to currently test it but does Def and MDf both get doubled by engine? Or only Df?

Either way why change this behavior? This way we easily achieve Def range of 0-510 without any need to tinker enemy AI. Wouldn't it take less space also especially for enemies that had Def stat >255 when you wouln't need any lines of code to boost it's Def stat. And it's also easier and faster to edit only enemy stats when you don't need to worry about their AI.

Now that I think of it all enemy stats should have a multiplier of 2. That way one could create easily enemies with absurd str or mag for example.
« Last Edit: 2009-06-05 17:07:11 by warbaque »

secondadvent

  • *
  • Posts: 287
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #48 on: 2009-06-05 17:50:07 »
both def and mdef are doubled by the engine, and yes it is true that enemies would need less room to have their def to go up to 510, since it is doubled initially. but, the thing is, enemies shouldn't need to almost null damage (255, the base max for the defenses halves all damage, except def ignoring things, and 510, the doubled max, would take the damage to pretty much nothing, around 1-100 for powerful attacks, since the damage done is damage = damage * (512 - def) / 512, making 10000 damage taken down to  ~40 damage dealt, a really big decrease. if an enemy had that much defense, then it is likely that they wouldn't have much life, or the fight would be really unnecessarily long, especially since hp can go pretty damn high.

yes, an enemy with 400 defense (200 base) would still take plenty of damage, but if you had a good ai, great moves, and ample hp on it, then that high of defense wouldn't really be needed. the main problem with most of the vii fights, is that the enemy ai is too simple, and their moves too weak. many enemies are too low level to be doing a ton of damage, and some at very high levels would still be very easy since their ai sucks. if you balance out the game well, and make it hard from there, then mass def boosting isn't really necessary, just overkill, and making the fights much longer than needed to be.

i guess that the def doubling is good for now, and will still be needed when my first compressed ai scene.bin is done, since the enemies will still be essentially the same, but when i make my REAL difficulty hack (want this done so that i have plenty of breathing room, and so that psx version users can still enjoy my hack, since it should still fit into the original iso easily), i am hoping that i will have a way to stop the initial doubling, even though it is likely many enemies late-game will be hitting the higher stat marks, and the end game optional bosses will definitely be taking roids, so only a few enemies should need past 255 defense, if they even really need it at all. usually, if you know the enemy ai very well, and have a very nice setup, you should eventually win anyway, but my hack is going to be cruel to the users, so massive defense would just be too much :-P.

warbaque

  • *
  • Posts: 44
    • View Profile
Official Proud Clod 1.0 Topic
« Reply #49 on: 2009-06-05 18:15:01 »
I know all the formulas. What I meant that wouldn't it be more effient to have all enemies using half of intended def values and have engine double it than have all enemies at their intended def values and use ai-data for those few enemies that have df >255.

But I agree with you that:
More HP, High Defence -> longer fights
Smart/unpredictable AI, High STR/MAG/Speed -> harder fights

Problem is if you make AI too unpredictable it makes coming up with good tactic against that enemy very hard and winning becomes too much based on luck.