Users browsing this thread: 1 Guest(s)
Battlescript variables...

#1
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Ok, it's time to ask the infamous question:

I've searched everywhere infos about that, but i never found some decent data... i'm talking about the variables used from monsters for some check in their AI script...

What i know:
- Variables from 0 to 2(or 3) are the most used from any monster, because they return to 0 at the end of the battle, pretty much useful;

- All the others keep their current value even after the fight ends, as far as i know they are used for take note of some battle related fact and you shouldn't touch them, unless you really know what you're doing...

What i don't know: (and wanna find an answer, of course)

1) Which infos are stored in all those variables? I mean... i saw var 4 and 5 involved with Locke when he steals merchant or soldier suit, but i think that what really changes his sprite is the 2 related battle events... something tells me that it would have been the same even if the used variables were 6 and 7, as far you make the check to the right variables...
The most frequently used variable if var 36, used for many bosses(even in many hacks) and usually changed to 0, before the battle ends... what var 36 do?!
And so the others... var 10, var 34, var 100, var 255? So much variables, so few infos about them...

2) Are ALL variables used from the game for something? Is there any group of variables left there without a meaning? I'd really like to use them for many different purposes, i see an huge potential in their use...

3) Are their value changed only in battle with battlescript, or some event might suddenly do that, without even letting me realize it?

4) Say i'm stubborn and wanna use them at any cost... what i'm gonna risk, doing that?


This is probably the argument that interest me most in all FF6 hacking aspects: Unless it's a totally unknown field of the game, i don't really get why no one even thought to some custom use of those variables...


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#2
Posts: 2,549
Threads: 98
Thanks Received: 147
Thanks Given: 159
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
I can't recall where I obtained this info from or who provided it, I would guess it is from Mnrogar's Den and probably Imzogelmo but I'm not sure since I can't check do to both it and Slick Productions being down...

This more or less catalogs what the normally used ones are for (except for the ??? ones...):

Code:
Variable     Use
00 - 03      Unused
04 - 08      ???
09           ???
0A           Used to change SrBehemoth to Undead SrBehemoth (If bit 7 is set)
0B           If bit 1 set, Morph lasts half as long, If bit 2 set, Morph is unusable, Other bits ???
0C           ???
0D           Number of battles fought with Cursed Shield
0E - 0F      Doom Gaze's HP
10 - 17      ???
18           Elements nullified by forcefield
19           Number of targets for last attack
1A           Number of types of monsters active in combat
1B - 23      ???
24           Battle formation (low byte)
Variables 04 - 17 retain their values at end of combat.

That should answer some of what you are wondering at least. I'm not sure about using any past this like if they would work, or the consequences of doing so, but I'd imagine that using the important ones in other applications, if you were stubborn like you say, wouldn't be a good idea - if they are anything like memory bits that get set, telling the game various important battle infos and probably messing up your script etc., but I'm not sure what's really going on behind the scenes with these variables. All I know is you can set 7 bits on 1 var so there shouldn't be a need to go up to 255 or reuse ones that are used for important things like this list says, unless you go psychotic making a boss lol.

Besides that, you could always try testing ones past this list and see if they behave as normal, it kind of is uncharted territory you could say and you would be like a pioneer in the field, figuring stuff out and sharing the info with the world! Wink


We are born, live, die and then do the same thing over again.
Quote  

#3
Posts: 212
Threads: 1
Thanks Received: 11
Thanks Given: 2
Joined: Oct 2014
Reputation: 7
Status
None
Maybe we can determine what these unknown variables are? Consider:
Code:
0D - Number of battles fought with Cursed Shield
0E/0F - Doom Gaze's HP
18 - Force Field
And from the RAM map...
Code:
$3EBE/$3EBF - Doom Gaze's HP
$3EC0 - Number of battles fought with Cursed Shield
$3EC8 - Force Field
It seems to me like the Cursed Shield variable is mislabeled in one of these sets.




https://github.com/abyssonym/beyondchaos
Beyond Chaos is a full-game randomizer for FF6.
Quote  

#4
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
So it was true! I searched yesterday right Doom Gaze variable and it didn't match with my documents. (received from Madsiur)

That mislead me and discouraged from trying to understand the relation between ram and other documents... still the one which must match at any cost is Battlescript AI: When Doomgaze dies Var 13(0D, i think) is changed... trying to use math, it was related to Cursed Shield before, but now sounds more clear.

Look Gi, if i didn't use more that var 0-3 with my Ultimate Czar Dragon, then it doesn't really exist a boss which has a true need of other variables, just to change forms and other behaviors! Laugh

The reason why i need of those variables is to create some kind of hidden event from some random encounter... i can easily think on how to reproduce Giantuar event from FF6 advance: i just need of a cactuar and an available battle variable, which don't resets its value after battle.

The best thing would be learning how to manipulate variables with known effects: If i'm not wrong there's one also for recognize if Zone Eater engulfed the party or not: now imagine to be able to use all the 8 bits of that var and so being able to create gates for 8 hidden dungeons(Gogo's lair included)...
To be honest those variables could be the greatest resource for us, we just need to find out how to use them...


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#5
Posts: 5
Threads: 1
Thanks Received: 0
Thanks Given: 0
Joined: Nov 2014
Reputation: 0
Status
None
This bit of code here copies the battle variables back to the normal event flags. It should be simple to correlate them.

Code:
C2/49D5: A2 13        LDX #$13
C2/49D7: BD B4 3E     LDA $3EB4,X    (copy in-battle event bytes)
C2/49DA: 9D C9 1D     STA $1DC9,X    ( back into normal out-of-battle event bytes)
C2/49DD: CA           DEX
C2/49DE: 10 F7        BPL $49D7      (iterate 20 times)
  Find
Quote  

#6
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
... Huh? Could you explain better how it works and/or how to have a proper use of this info?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#7
Posts: 212
Threads: 1
Thanks Received: 11
Thanks Given: 2
Joined: Oct 2014
Reputation: 7
Status
None
He's saying that every time you fight a battle, the chunk of memory starting at $1DC9 gets copied to the location $3EB4. So the actual location of these event variables, when you're not in battle, is at $1DC9.




https://github.com/abyssonym/beyondchaos
Beyond Chaos is a full-game randomizer for FF6.
Quote  

#8
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Yeah, that makes sense... the good new is that there's a clear connection between battles and map events, in both the directions! That gives me some new idea...

Now... in the ram there's some space for those 20 variables and those few lines makes possible to load/store them all together, as far they are in a single block...
Shouldn't be possible to expand the number of variables that keep their value after battle, then?

The other thing i don't understand is... var 0-3 are restored to 0 after battle, the following 20 vars not... how 'bout all the others, until var 255?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#9
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(01-28-2015, 08:18 PM)Tenkarider Wrote: Now... in the ram there's some space for those 20 variables and those few lines makes possible to load/store them all together, as far they are in a single block...

There's space in SRAM but free space in RAM is rather limited, but the memory copy falls into SRAM ($1600 to $1FFF) so you should be fine. You can use the bushido names free RAM if you need a large block.

(01-28-2015, 08:18 PM)Tenkarider Wrote: Shouldn't be possible to expand the number of variables that keep their value after battle, then?

Seee above answer.

(01-28-2015, 08:18 PM)Tenkarider Wrote: The other thing i don't understand is... var 0-3 are restored to 0 after battle, the following 20 vars not... how 'bout all the others, until var 255?

What makes you think there is 255 battle variables? The RAM copy iteration is 20 times but I know only 13 bytes documented. $1DD6 to $1DDC are unlabeled, so they might be unused.

Also you might find this useful, taken from the event bits document:

Code:
RAM    Description
-------------------------------------------------------------------------------
1DC9-D Unused?
1DCE:0 Disables the "M-M-M-MAGIC!?" scene for the M-TekArmor battle (never set)
1DCE:1 Unused?
1DCE:2 Unused?
1DCE:3 Unused?
1DCE:4 Unused?
1DCE:5 Unused?
1DCE:6 Unused?
1DCE:7 Unused?
1DCF:0 Enables the SrBehemoth formation interchange
1DCF:1 (Reserved for additional interchanges.)
1DCF:2 (Reserved for additional interchanges.)
1DCF:3 (Reserved for additional interchanges.)
1DCF:4 (Reserved for additional interchanges.)
1DCF:5 (Reserved for additional interchanges.)
1DCF:6 (Reserved for additional interchanges.)
1DCF:7 (Reserved for additional interchanges.)
1DD0:0 Removes or replaces a number of commands (set for Fanatics' Tower)
1DD0:1 Halves the speed with which the Morph bar is depleted
1DD0:2 Enables permanent Morph status
1DD0:3 Unused?
1DD0:4 Unused?
1DD0:5 Unused?
1DD0:6 Unused?
1DD0:7 Unused? (Cleared in every battle.)
1DD1:0 The party was annihilated
1DD1:1 Enables the "M-M-M-MAGIC!?" scene to be triggered
1DD1:2 Enables the Morph command
1DD1:3 Enables the display of ability points acquired
1DD1:4 The party escaped the battle
1DD1:5 A timer caused a battle or menu to abort
1DD1:6 Enables the display of the battle and menu timers
1DD1:7 The party was engulfed
1DD2:0 Defeated Doom Gaze
1DD2:1 Gau was handed a Dried Meat
1DD2:2 Unused?
1DD2:3 Disables Shadow from leaving randomly
1DD2:4 Stole the clothes of a merchant
1DD2:5 Stole the uniform of an officer
1DD2:6 Unused?
1DD2:7 Unused?
1DD3-4 Doom Gaze's HP
1DD5   Number of victories with Cursed Shld
1DD6-C Unused?
  Find
Quote  

#10
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Sounds like an updated version of the event bit document i have... good.
Why i'm assuming there are 255 variables? Because all battlescript AI commands that involves var bits/var value operations(set,toggle,clear/increment,decrement,assign) and checks to var's bit/value allows you to do that from var 0 to var 255...

Is it happening again? I mean, even this time, like with call formation command there's no limitation after the last existing var and so you're gonna touch some value that involves something else? (and so risking to do huge damage?)


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite