• Topic Archived
You're browsing the GameFAQs Message Boards as a guest. Sign Up for free (or Log In if you already have an account) to be able to post messages, change how messages are displayed, and view media in posts.

User Info: MeteorStrike

MeteorStrike
11 years ago#21
Well, the changing villagers to officers (from the other thread) and the Rebel Forces stuff is gonna have to wait for another time... I'll post the info on the tactics damage power, though, since I already have most of it done anyways... I'll finish it up within the next day or so... but the other 2 things you asked for are gonna have to take a rain check :p

User Info: Xian_Zhu_Xuande

Xian_Zhu_Xuande
11 years ago#22
Thanks for all you've done. :)

I've got one more question for you to keep an eye on while you're playing the game, if you continue playing the game. I wonder if the An Sha flags are checked when an opposing officer uses An Sha on one of your own? I'll keep an eye on that while playing but it will be a little difficult to test without watching the runtime settings. I'll sort all of that out down the road. I'm trying to use whatever freetime I've got for this sort of thing to finish up the Wei mod while I've still got some freetime at all.

If you're busy or if you've had enough of this little project please don't worry about any more information. I appreciate everything you've shared.
Kongming’s Archives: kongming.net (Three Kingdoms Web Site)
Scholars of Shen Zhou: the-scholars.com (Three Kingdoms Forum)

User Info: MeteorStrike

MeteorStrike
11 years ago#23
The tactics damage, including the An Sha immunity, is all part of the Damage formula. I only traced the physical damage when I made the javascript page that calculates the damage, but it's still part of the same algorithm. That said, all of this data should correspond to anyone that is attacking, whether it be an ally or enemy unit. Just to be sure, though, I checked, and it does get called the same when the enemy attacks...

User Info: Xian_Zhu_Xuande

Xian_Zhu_Xuande
11 years ago#24
Thanks again. This could be fun...
Kongming’s Archives: kongming.net (Three Kingdoms Web Site)
Scholars of Shen Zhou: the-scholars.com (Three Kingdoms Forum)

User Info: MeteorStrike

MeteorStrike
11 years ago#25
Here's info on the damage inflicted by tactics:

The damage algorithm contains this information. For my damage algorithm script page, I simply did physical damage, which is a branch done in the execution of the damage algorithm. Here are the details for tactics:



$9778:B9 8B BB LDA $BB8B,Y
$977B:85 10 STA $10
$977D:B9 AA BB LDA $BBAA,Y
$9780:85 11 STA $11
$9782:A9 00 LDA #$00
$9784:85 12 STA $12
$9786:85 15 STA $15
$9788:20 29 AE JSR $AE29
$978B:85 14 STA $14
$978D:20 5F C1 JSR $C15F



The function $AE29 returns the bigger of STR or INT for the attacking unit. The "damage potential" for tactics is stored at $BB8B,Y and $BBAA,Y. Basically, the array at $BB8B,Y contains the low byte values and the $BBAA,Y array contains all the high values. I'm pretty sure you know what this means by now.

So basically, as the first step in the calculation process,

( tactic damage potential ) * ( bigger of STR or INT ) / 256 = Initial Damage.

After this, a lot more processing is obviously done, but the damage potential of a tactic should reflect the actual damage very accurately...

Note that this is NOT the entire algorithm. After this step, the game continues to calculate a "random variance" which is based on another array:



$9790:A5 AC LDA $AC
$9792:65 AF ADC $AF
$9794:29 0F AND #$0F
$9796:A8 TAY
$9797:B9 A0 99 LDA $99A0,Y
$979A:85 14 STA $14
$979C:B9 B0 99 LDA $99B0,Y
$979F:85 15 STA $15
$97A1:20 5F C1 JSR $C15F



There are also additional calculations done, such as defending general being on DEFENSE mode and such things. The question you asked, though, has a simple answer: check the arrays at $BB8B,Y and $BBAA,Y. Here is the info in them for reference:

Tactic ID = Tactic Name = Type of Tactic = Damage Potential.

01 = Lian Huo = Damage = 003C = 60
02 = Ye Huo = Damage = 008C = 140
03 = Yan Re = Damage = 00AA = 170
04 = Da Re = Damage = 0514 = 1300
05 = Huo Shen = Damage = 07D0 = 2000
06 = Shui Tu = Damage = 0064 = 100
07 = Shui Xing = Damage = 00A0 = 160
08 = Shui Lei = Damage = 00C8 = 200
09 = Hong Shui = Damage = 05DC = 1500
10 = Shui Long = Damage = 09C4 = 2500



Note that all other tactic IDs have 0 in these arrays. This is because the other ones do not do damage. Also:

0x3BB9B = $BB8B,Y
0x3BBBA = $BBAA,Y

I'll have to look at the healing stuff separately... It's not part of the damage algorithm (for obvious reasons?)

User Info: MeteorStrike

MeteorStrike
11 years ago#26
As expected, healing tactic recovery is performed at a different location by a different algorithm:



// Below, we read healing potential of the tactic used,
// which is stored at $BC0C,Y and $BC11,Y.
// Note that for healing tactics,
// 11 <= Y <= 15
// and therefore, the arrays used are actually
// $BC17 -> $BC1B
// $BC1C -> $BC20

$BA17:B9 0C BC LDA $BC0C,Y
$BA1A:85 10 STA $10
$BA1C:B9 11 BC LDA $BC11,Y
$BA1F:85 11 STA $11
$BA21:A9 00 LDA #$00
$BA23:85 12 STA $12
$BA25:85 15 STA $15
$BA27:20 29 AE JSR $AE29
$BA2A:85 14 STA $14
$BA2C:20 5F C1 JSR $C15F



Much like the damage tactics, this works out to:

( tactic healing potential ) * ( bigger of STR or INT ) / 256 = Initial Healing potential.

I didn't trace anything else, so I can't say much more about what happens after this, and how the final healing points is affected, but this is pretty much where the healing potential for each different tactic is computed. IIRC, healing via tactics is always constant... is it not? At least for the specific user...

Tactic ID = Tactic Name = Type of Tactic = Healing Potential.

11 = Chi Xin = Recovery = 0064 = 100
12 = Tong Xian = Recovery = 01F4 = 500
13 = Yin Xian = Recovery = 03E8 = 1000
14 = Jin Xian = Recovery = 1194 = 4500
15 = Wan Fu = Recovery = FFFF = 65535

Also:

0x3BC27 = $BC17
0x3BC2C = $BC1C

OK, I need to get back to more important things, so I'll leave any other unanswered questions for the future... if I remember about them at the time... :p

User Info: MeteorStrike

MeteorStrike
11 years ago#27
One last note: Keep in mind that "damage potential" and "healing potential" does not necessarily define the FINAL maximum values... there are additional calculations after the above-posted code that may increase or decrease the values further... just thought I'd make that clear before someone whines about it.... >_>

User Info: Xian_Zhu_Xuande

Xian_Zhu_Xuande
11 years ago#28
Now this is going to be fun to play with. Thank you!

Am I reading this correctly? The game looks at both strength and intelligence and chooses the higher of the two for damage potential? In other words, Zhang Fei could do some hard-core damage if he ever manages to successfully hit with a tactic?

This would actually explain why Guan Yu always seemed like an excellent go-to guy for fire tactics through the beginning of the game--I think I even wrote in my walkthrough that Guan Yu does excellent tactic damage and should be used for that reason (although it never made too much sense as his intelligence wasn't quite high enough to warrant damage on the level he often dished out). That would also mean that Zhao Yun would be a great person to use tactics with.
Kongming’s Archives: kongming.net (Three Kingdoms Web Site)
Scholars of Shen Zhou: the-scholars.com (Three Kingdoms Forum)

User Info: Xian_Zhu_Xuande

Xian_Zhu_Xuande
11 years ago#29
Nevermind. Upon re-reading you stated the answer quite explicitly. :)
Kongming’s Archives: kongming.net (Three Kingdoms Web Site)
Scholars of Shen Zhou: the-scholars.com (Three Kingdoms Forum)

User Info: MeteorStrike

MeteorStrike
11 years ago#30
I had time to kill, so I did the random enemies also:

I'm not gonna post the whole assembly code algorithm, since most of it will be ignored anyways. Instead, here are the details you asked:

$6026 = A number that is generated when you enter a battle. This number will be between 1 and 8 inclusive. It is calculated based on the position on the world map. Basically, this tells the game what "area" you are in. All random encounters in the first area of the game will generate a 1. All random encounters in the second area will generate a 2, and so on. If you ever wanted an "official" indication of what chapter you're in, and how many "chapters" the game has, this is it! The game is clearly divided into 8 chapters, and this value reflects which chapter area you are in on the map. I will call this the chapter number from now on in this discussion. (1 -> 8)

OK, now for the other stuff:

RANDOM ENEMIES' HP:

// 0x3E41B = $E40B = Start random enemies' HP amounts.
// 2 bytes per possible HP amount, 4 possible values for HP per chapter.

For each random unit, the game will calculate a random number between 0 and 3, and will use this for a look-up table to get the unit's HP value. So for each chapter, there are 4 possible HP values used for the units, and each HP value is 2 bytes long, and there are 8 chapters, so this comes out to ( 2 bytes per value ) * ( 4 random values per chapter ) * ( 8 chapters ) = 64 bytes. All values are stored sequentially, by chapter order.

RANDOM ENEMIES' WEAPONS:

// 0x3E49B = $E48B,X = Start of random enemies' weapons ( used for enemies 1 - 3 )
// 0x3E4A3 = $E493,X = Start of random enemies' weapons ( used for enemies 4 - ? )

Here's where things start getting complex. The weapons for random enemies are always the same for the given area, BUT depending on the enemy unit type, the weapons might be different. Below is the list of all the different possible random enemies that show up in the game, with their IDs:

01 = Pirate Force
02 = Brigand Force
03 = Bandit Force
04 = Rebel Force

So for Pirate Force, Brigand Force, and Bandit Force, the weapons are stored at 0x3E49B, one possible weapon per chapter. But if the enemy is a Rebel Force, they have their own list they use for weapons, at 0x3E4A3, which also has 1 possible weapon available per chapter. Note that the weapon determines the AP value, but it is the WEAPON that is used in calculating damage, and not necessarily the displayed AP power. (See Damage algorithm elsewhere for more info)

RANDOM ENEMIES' ARMORS:

// 0x3E4BB = $E4AB,X = Start of random enemies' armors ( used for enemies 1 - 2 )
// 0x3E4C3 = $E4B3,X = Start of random enemies' armors ( used for enemy 3 )
// 0x3E4B3 = $E4A3,X = Start of random enemies' armors ( used for enemies 4 - ? )
// 0x3E738 = $E728,X = Actual Defense Power for armors

This is pretty much the same as the weapons stuff, but for the following differences:

1. Pirate Force + Brigand Force has their own list of armors for each chapter, Bandit Force also has their own list, and Rebel Force has its own list. A little more variety than with weapons.

2. The values that are read from these lists give you an index into the array at 0x3E738, which contains the actual AC values.
  • Topic Archived

GameFAQs Q&A