Posts for Pasky13


1 2
9 10 11
20 21
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Is there a WIP of this game up by chance? Or are people just planning the route and such still?
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
PikachuMan wrote:
We already have a topic of this game here.
That topic is so old and doesn't even discuss much, the last post was made in 2005 for crying out loud....I don't see anything wrong with this new topic.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
I'd like to see someone other than Haggar honestly. Haggar is boring, he has limited moves, plus we've already seen it done with haggar. I'd like to see a Guy or Cody run.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Rygar is the only one that comes to mind.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Well, I'd still rather see a 1 player TAS of the arcade version than the SNES version. Looking forward to your run.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
You should make a 2-player run of the arcade version with mame-rr. I see no point in TASing the SNES version now that arcade games can be TAS'd. Just my opinion.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Finished all the areas for the random battles and enemy grouping, and fixed my script to correctly display remaining steps until an encounter when the step counter rolls over. I set it to display the next 5 encounters. It's possible to predict the enemy groups indefinitely. Link to video With this it's possible to add to the script a way to determine how many encounters until you reach one you want (i.e. how many more to encounter a pink puff etc...) since the enemy you get is determined by the encounter number. Anyways, that's the progress so far, I'm gonna work on getting some in battle items going next I think. Thanks to bond617's GFAQ text file (http://www.gamefaqs.com/snes/522596-final-fantasy-ii/faqs/53579) I was able to just parse his text file and get all enemy names for the encounter group.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
FatRatKnight wrote:
Clearly, for that encounter increment anomaly, there's an encounter at step 0xEB shared by both areas. It's just that one part doesn't have it at 0xD9 while another part does, and by walking around the area that won't encounter it, you skip the 0xD9 encounter and continue on to the 0xEB encounter, where both regions will encounter something (and neither region has encounters in 0xDA to 0xEA). Similar concept with the no encounter zones that still increment on steps.
I see, that explains it.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
I'm not sure if this was known, but I know for sure people knew about the tiles in castles that would increment the step counter for random battles. Well there is another room that does this, inside the underground dungeon for the crystal where kain betrays the party. Here is an example of what I mean: Link to video Also found a strange anomaly with the random battle formula. I'm unsure what causes this at all, and it only seems to happen sometimes and only at this Y on the earth world map (that I've discovered anyways, there may be more of these on other maps) position. If you move to the left, you get a different amount of steps until an encounter, if you keep going right the encounter will occur. But if you move to the left and and increment enough steps that the counter that was on the right will pass, it will continue with the left side's counter instead. It doesn't always happen either, I displayed this by walking left and then right after the first encounter in the video. I'm not sure what causes it, but it's no error on my script because both counters will trigger the encounter if you stick with it. Example: Link to video Not sure if this would help a TAS, but I thought it was worth mentioning.[/video]
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
After checking on a couple of things this evening, the game seems to have 4 different routines for random encounters and what enemy group you get. 0x7E1700 holds a value that goes from 00-03.
00:  Earth worldmap
01:  Underground worldmap
02:  Moon worldmap
03:  Dungeons/Towns
Earth World Map:
008951: BNE 00895c ($9)
00895C: LDA $1700
00895F: CMP #$00
008961: BNE 00899d ($3a)
008963: LDA $1707  // Load 7E1707 into the accumulator
008966: LSRA  // Shift the byte right 2 times
008967: LSRA
008968: AND #$f8  // And it against 0xF8
00896A: STA $06  // Store the result in 0x7E0606
00896C: LDA $1706  // Load 0x7E1706 into the accumulator
00896F: LSRA // Shift the byte right 5 times
008970: LSRA
008971: LSRA
008972: LSRA
008973: LSRA
008974: CLC  // Clear the carry flag
008975: ADC $06  // Add the value at 0x70606 to the accumulator
008977: TAX  // Copy the value of the accumulator into register X
008978: LDA $0ec300,X  //  Load 0x0EC300 + Register X into the accumulator
00897C: STA $06  // Store the result into 0x7E0606
00897E: PHX  // Push Index Register X
00897F: PLY  // Pull Index Register Y
008980: LDA $c0 // This loads 7E06C0 into the accumulator, to zero out the accumulator
008982: BNE 008994 ($10)
008984: LDA $86  // Load 7E0686 into the accumulator
008986: TAX  // Copy the accumulators value into X
008987: LDA $14ee00,X // Load 0x14EE00 + X into the accumulator
00898B: CLC  // Clear the carry flag
00898C: ADC $17ef // Add the value at 0x7E17EF to the accumulator, this seems to only change on a reset
00898F: CMP $06  //  Compare the accumulator's value against 0x7E0606, if 0x7E0606 is greater than the accumulator, don't set the carry flag
008991: BCC 008994 ($1) // Branch on carry, if this does not branch, an encounter occurs 
Underground:
0089A5: LDA $86 ; Encounter formula begins here
0089A7: TAX
0089A8: LDA $14ee00,X
0089AC: CLC
0089AD: ADC $17ef
0089B0: CMP $0ec340
0089B4: BCC 0089b7 ($1) ;  Triggers battle if branch not taken
The moon Random Battle formula seems to be the exact same formula as the underworld formula since 0x0EC340 and 0x0EC341 contain the same value of 0x08. I assume it uses a different routine because the way it loads the enemies different, since it's all in the same routine. Moon world map:
0089DC: LDA $86 ; Encounter formula begins here
0089DE: TAX
0089DF: LDA $14ee00,X
0089E3: CLC
0089E4: ADC $17ef
0089E7: CMP $0ec341
0089EB: BCC 0089ee ($1) ;  Triggers battle if branch not taken
Dungeons: (And anywhere else that isn't the world map that can encounter enemies randomly)
008A35: LDA $1702 ; Encounter begins
008A38: STA $3d
008A3A: LDA $1701
008A3D: BEQ 008a41 ($2)
008A41: STA $3e
008A43: LDX $3d
008A45: LDA $0ec342,X
008A49: BEQ 008a60 ($15)
008A4B: STA $06
008A4D: LDA $c0
008A4F: BNE 008a73 ($22)
008A51: LDA $86
008A53: TAX 
008A54: LDA $14ee00,X
008A58: CLC
008A59: ADC $17ef
008A5C: CMP $06
008A5E: BCC 008a73 ($13)  ;  Triggers battle if branch not taken
Already successfully added them in lua and it seems to be correct. I still haven't fixed the value of 0x7E0686 rolling over in my script however v_v.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
funnyhair wrote:
Do you plan to increase the current run? it is definetly improvable and I would love to see it improved with all the things you are doing!
Probably not. I refuse to use the 'Pause Glitch'. I think it retracts from the entertainment value of the run having that stupid "PAUSE" box in the middle of battles and any run submitted without it would probably be rejected.
Vykan12 wrote:
Wow, that is a seriously impressive script you're working on, Pasky13! What's motivated you to tackle this challenge out of the blue?
I just love FFIV. I usually target a game from now and then that I want to see how it works (usually games I grew up playing). This just happens to be the current one.
Time/SpaceMage wrote:
If there's CPU info you want, that's easy enough to search for... Here's a resource over at ol' Zophar's...
Thanks, but there is an even better document that holds more than enough information about the 65C816 (Instruction set starts at pg. 326): http://www.westerndesigncenter.com/wdc/datasheets/Programmanual.pdf
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Just figured out how enemy groups get calculated and made a script to show the next encounter group. Only bad part is, I have to manually add the names for each group value v_v, oh well I don't mind. I got plenty of time and in no rush. Anyways, here is how they are calculated for the world map. Here is the actual code for the monster groups, it's actually a part of the encounter subroutine. I'm too lazy to explain everything this time. Just know that 0x7E1800 is where the result of the monster group gets stored (at 008A16: STA $1800)
008963: LDA $1707
008966: LSRA
008967: LSRA
008968: AND #$f8
00896A: STA $06 ;val1
00896C: LDA $1706
00896F: LSRA
008970: LSRA
008971: LSRA
008972: LSRA
008973: LSRA
008974: CLC
008975: ADC $06
008977: TAX  ;x1
008978: LDA $0ec300,X  
00897C: STA $06 
00897E: PHX
00897F: PLY
008980: LDA $c0
008982: BNE 008994 ($10)
008984: LDA $86 
008986: TAX 
008987: LDA $14ee00,X 
00898B: CLC
00898C: ADC $17ef 
00898F: CMP $06 
008991: BCC 008994 ($1)
008994: PHY
008995: PLX 
008996: LDA $0ec542,X  
00899A: JMP $8a0b
008A0B: JSR $8ad2
008AD2: STA $3d
008AD4: STZ $3e
008AD6: ASL $3d
008AD8: ROL $3e
008ADA: ASL $3d
008ADC: ROL $3e
008ADE: ASL $3d  
008AE0: ROL $3e
008AE2: LDA $c0
008AE4: BNE 008b01 ($1b)
008AE6: LDA $87 
008AE8: TAX 
008AE9: LDA $14ee00,X   
008AED: CLC
008AEE: ADC $17ee  
008AF1: INC $87
008AF3: BNE 008b03 ($e)
008B03: LDX $3d 
008B05: CMP #$2b
008B07: BCC 008b28 ($1f)
008B09: INX 
008B0A: CMP #$56
008B0C: BCC 008b28 ($1a)
008B0E: INX
008B0F: CMP #$81
008B11: BCC 008b28 ($15)
008B13: INX
008B14: CMP #$ac
008B16: BCC 008b28 ($10)
008B18: INX
008B19: CMP #$cc
008B1B: BCC 008b28 ($b)
008B1D: INX
008B1E: CMP #$ec
008B20: BCC 008b28 ($6)
008B22: INX
008B23: CMP #$fc
008B25: BCC 008b28 ($1)
008B27: INX
008B28: STX $3d
008B2A: RTS
008A0E: STZ $3e
008A10: LDX $3d
008A12: LDA $0ec796,X
008A16: STA $1800
Dungeons seem to use a different subroutine because no breakpoints were being set inside that part of the code when I went to one. I'll have to see how those work some other time. I haven't fixed the encounter script yet, so if it rolls over it will just recalculate so I put the step counter next to the 'steps left' so I'll know when it's going to roll over and the 'steps left' will recalculate. Link to video[/video]
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
pirate_sephiroth wrote:
pointless poll, Rockin Kats will obviously win because nobody wants to get out of their comfort zone. you see why it's important to get a opinion from someone clever enough and outside the contest now?
This saddens me that the contest is gonna most likely be held using an already published game :(.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Lex wrote:
Use the modulo operator (%).
myint = 0xFFFE
myint2 = (myint + 0x350) % 0xFFFF
Thank you.
I think.....therefore I am not Barry Burton
Post subject: Lua help with data types
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
I'm curious if Lua allows you to set a data type for variables. The reason I ask is I need a number to roll over...i.e. I want a 2 byte integer.
myint = 0xFFFE
myint2 = myint + 0x350
I want myint2 to return 0x34E. Do I have to do this manually or can I declare a 2 byte data type with Lua? I tried looking at the reference manual and I didn't see anything that allows you to do this. Thanks.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Well, I reversed the random encounter address....at least I know what triggers it anyways. 7E0686 is incremented every step you take. It basically becomes the offset for a pointer to a table of values that the encounter code compares against.
008951: BNE 00895c ($9)
00895C: LDA $1700
00895F: CMP #$00
008961: BNE 00899d ($3a)
008963: LDA $1707  // Load 7E1707 into the accumulator
008966: LSRA  // Shift the byte right 2 times
008967: LSRA
008968: AND #$f8  // And it against 0xF8
00896A: STA $06  // Store the result in 0x7E0606
00896C: LDA $1706  // Load 0x7E1706 into the accumulator
00896F: LSRA // Shift the byte right 5 times
008970: LSRA
008971: LSRA
008972: LSRA
008973: LSRA
008974: CLC  // Clear the carry flag
008975: ADC $06  // Add the value at 0x70606 to the accumulator
008977: TAX  // Copy the value of the accumulator into register X
008978: LDA $0ec300,X  //  Load 0x0EC300 + Register X into the accumulator
00897C: STA $06  // Store the result into 0x7E0606
00897E: PHX  // Push Index Register X
00897F: PLY  // Pull Index Register Y
008980: LDA $c0 // This loads 7E06C0 into the accumulator, to zero out the accumulator
008982: BNE 008994 ($10)
008984: LDA $86  // Load 7E0686 into the accumulator
008986: TAX  // Copy the accumulators value into X
008987: LDA $14ee00,X // Load 0x14EE00 + X into the accumulator
00898B: CLC  // Clear the carry flag
00898C: ADC $17ef // Add the value at 0x7E17EF to the accumulator, this seems to only change on a reset
00898F: CMP $06  //  Compare the accumulator's value against 0x7E0606, if 0x7E0606 is greater than the accumulator, don't set the carry flag
008991: BCC 008994 ($1) // Branch on carry, if this does not branch, an encounter occurs
I've only tested on the earth world map. Well, that's what I've found so far. EDIT: Successfully reproduced this in Lua and made a step counter for the random encounter. EDIT: Just noticed that the step counter would incorrectly display the steps if the value at 0x7E0686 rolled over (i.e. FE -> FF -> 00). I figured out why, because when this rolls over, the value at 0x7E17EF increases by 0x11, so the step counter gets recalculated. Link to video
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
FatRatKnight wrote:
7E1845 - Apparently a timer for battle. Watch this carefully. 7E2A07 - Another timer? I'm guessing it's for one of your own characters. 7E2A70 - Yet another timer? Same here. I spent a little time (less than an hour) looking into this game after reading the discussion here. All I knew was that timers were involved, and likely ticks if the game isn't paused. Mainly running the published TAS while taking a look, and I'm pretty sure the timers won't tick whenever that TAS pauses the game. I hope this is a good point to continue your searches with. EDIT: Some more information... 7E2A07 - Player 1 Timer 7E2A1C - Player 2 Timer 7E2A31 - Player 3 Timer 7E2A46 - Player 4 Timer 7E2A5B - Player 5 Timer 7E2A70 - Enemy 1 Timer 7E2A85 - Enemy 2 Timer 7E2A9A - Enemy 3 Timer 7E2AAF - Enemy 4 Timer 7E2AC4 - Enemy 5 Timer 7E2AD9 - Enemy 6 Timer Basically, these are 0x15 apart. Feel free to investigate these.
Yup, I found these slightly before you did ^_^ thanks to looking at the GBA version of the game which used the same system. The ATB for chars and monsters counts down from a number generated from their agility. Apparently monsters can get different values during the fight something to do with a lookup table and their agility modifier. Players seem to have some randomness applied only at the beginning of the battle, then it seems to be fixed, but not absolutely sure. Link to video So I have the ATB bars working (implemented poorly in lua, but it does the job). Now I wanna work on getting a random encounter step display to show how many more steps until an encounter. Anyone have any information on how it works? I know the step counter is at: 0x7E0686 but not sure what it is compared against. There seems to be another address that gets incremented as well and I think it has something to do with the random encounter formula also: 0x7E0688 But I'm unsure, my knowledge with the CPU instruction set of the SNES is limited. Hopefully someone else already knows how it works, I couldn't find any documents on it at gamefaqs in the algorithm FAQ or at romhacking.net. Thanks for all the help.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
funnyhair wrote:
Pasky, Deign put in some mem adresses in the submission text. Try those, (I do not remeber what is there.) Or ask deign, maybe he knows.
Thanks, I just checked though, http://tasvideos.org/2033S.html He mentions nothing on the character timers or monster timers. I believe deign has also been MIA for a while, so no good in trying to contact him =/. Still having trouble locating this.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Anyone happen to know where the ATB is for the chars and the monsters? Or how the game determines who is next? Link to video
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Time/SpaceMage wrote:
From a quick search through RHDN: FF2 game data Of interest in ram.txt,
29A5-29AC Horizontal position for each monster.
Thanks! Such a great site!
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
amaurea wrote:
I made a script for ff6 which does this. Perhaps ff4 does things similarly enough that the script will be of help to you.
Yes, this is exactly what I was thinking of doing.....however it seems FFIII/VI uses the sprite layer for enemies, unlike FFIV that uses BG layer 1 :(, I can't find any x,y cords for the enemies FF4. I'm praying they aren't preset in tables and it just reads from a table where to draw the enemy, but that's what it is looking like. Any tips on how you located the enemy coordinates in FFIII/VI? EDIT: I've tried looking to see if there is any kind of structure that would contain it for each enemy near their life values. All I could find are their HP, str, and other attributes. Nothing that has to do with their coordinates. I'm assuming FF6 was much easier and the structure contained all of this in one spot =/. Thanks.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
DarkKobold wrote:
Pasky13 wrote:
Ok, I've found the player character X/Y addresses, but I cannot find the enemy X/Y =/. I have a feeling they are fixed numbers but maybe someone else knows? :(
Enemy X/Y? Do you have the wrong game? Final Fantasy games work by step counting - take a fixed number of steps, encounter, reset step counter. This is why Deign saves and resets during his TAS - it resets the step counter without actually having an encounter. Every FF with known encounter mechanics uses this, AFAIK.
What? I'm not talking about the random encounter generator, I'm talking about the enemy sprites in the battle screen so I can draw HP and such above them...not sure where you got the idea about the random encounter. EDIT: Well, it looks like the enemy's aren't sprites, only the player characters. The enemies are apart of BG0. I'm unsure where the SNES stores information for BG0 in RAM.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Ok, I've found the player character X/Y addresses, but I cannot find the enemy X/Y =/. I have a feeling they are fixed numbers but maybe someone else knows? :(
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Odd, I found a value inside of cheat engine. But doing a ram search inside of Snes9X doesn't yield anything. Apparently the sprites are seperated into six tiles, and I found the x position for 3 of the tiles, but I guess it's not located inside of the SNES's ram. EDIT: Found the x,y. At least for the middle character slot. Just need to analyze it more before I post more info. It may not really help the TAS, i'm just curious. Cool, found all 5 characters, now to find the enemies. I have some plans for a battle script that may aid in optimizing battles. I don't want to announce anything because I'm not sure if I have time to complete it anytime soon.
I think.....therefore I am not Barry Burton
Experienced Forum User, Published Author, Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Does anyone know the memory addresses for the sprites on screen? Would like to be able to draw above the enemy or player character sprites with the lua engine but I haven't been able to find any x/y coordinates. I tried increase/decrease searches by starting with the player characters (increasing/decreasing when they walk forward and backward during the "fight" command) and I never get any usable results.
I think.....therefore I am not Barry Burton
1 2
9 10 11
20 21