• 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

11 years ago#71

Level 51 has a value of 999,999 associated with it in the ROM. If you adjust the experience requirements of later level-ups above 999,999 there's an unfortunate surprise waiting when you actually reach level 50.

Like I mentioned above, you should not assume that the memory allocated after "level 51" is used for levels... That data is most likely used for other things... you need to accept level 51 as the highest level. Inserting additional memory is one of those things that is either impossible or will take you a looong time to get working properly...

User Info: MeteorStrike

11 years ago#72
Not sure what you mean by the Sprites thing, but the Colors used for the Sprites are stored at 0x3C610. For example, changing 0x3C613 from 15 to 01 will make Liu Bei blue instead of red...

User Info: JC152

11 years ago#73
I've been following this thread along, and wanted to share this website with anyone who has the time and skill to go through it. There's a link that shows some rom data with some analysis for both this game and its sequel. The only catch is that the data may only apply for Japanese version.


Here's a translated bit about some code. I have no idea if this is relevant or not, however.


User Info: kawaiifan

11 years ago#74
*amazed* @.@

Nice work! *cheers* \^.^/
kawaiifan misses her gfaqs9 ;.;

User Info: kawaiifan

11 years ago#75
*visits and saves* ^.^
kawaiifan misses her gfaqs9 ;.;

User Info: Xian_Zhu_Xuande

11 years ago#76
Hi MeteorStrike!

I was wondering if you could help me with one more request? In Ling Ling castle—the final area of Jingzhou—there's a fellow who likes like Pang Tong (in the original ROM), found in a house outside the city. He's the one who says, "Search the around me." Under him is a sword.

We've encountered something odd, though. Whenever we edit characters in the ROM his sprite changes around, but sometimes people have had problems with his sprite glitching and going all strange on us. We haven't been able to figure out why it happens. If you've got a moment would you mind paying him a visit to see where the game gets the value for his sprite? It would help a lot in changing him back to Pang Tong when this happens—or it would help us to figure out why this is happening in the first place.

Kongming’s Archives: kongming.net (Three Kingdoms Web Site)
Scholars of Shen Zhou: the-scholars.com (Three Kingdoms Forum)

User Info: MeteorStrike

11 years ago#77
Well, there are 4 patterns that make up each character sprite, and 2 character sprites per character so that the game alternates between the two sprites and makes it seem like its moving. This means that a moving character should have a total of 8 patterns.

This particular villager you speak of, his first pattern starts at 0x1D10 and his last pattern ends at 0x1D8F. (Since each pattern is 16 bytes)

I tried changing his patterns to all transparent and all solid and I had no problems... If this is the memory address you tried, then try to make your modifications on a clean ROM and see if the glitching still occurs...

User Info: ludmeister

11 years ago#78
Hi Meteorstrike,

I'm new to this thread as I have just started to pick up Destiny of an Editor hacking, but am thoroughly impressed with your knowledge of NES assembly and such. Thanks for taking the time to answer so many questions concerning the ROM. I had fun working on a personal Armament list for my mod last night :-)

I do have a couple of questions for you, and I'm pretty sure no one has asked this:

Do you know how soldiers gained per level is calculated? I know that in an officer's soldiers byte, anything "7f" or less is a static total; and it seems that anything "80" or greater allows that general to gain soldiers. I'd love to be able to change up the soldier progression curve if this is possible. I'd especially like to know how to change that wonderful starting soldier total... seems to be 100 for all officers who gain soldiers at level up.

I tested what each value from "80" to "a3" yield when levelling up from 1 to 2. Here's that table:

80 - 14 Huang Zhong leveling
81 - 14
82 - 12
83 - 12
84 - 10
85 - 13 Ma Chao leveling
86 - 13
87 - 13
88 - 13
89 - 10
8a - 14 Guan Yu leveling
8b - 14
8c - 14
8d - 12
8e - 10
8f - 12 Zhao Yun Leveling
90 - 13
91 - 14
92 - 14
93 - 10
94 - 14 Zhang Fei leveling
95 - 14
96 - 14
97 - 12
98 - 10
99 - 3
9a - 7
9b - 7
9c - 15
9d - 67
9e - 44
9f - 37
a0 - 78
a1 - 52
a2 - 6
a3 - 66

Second, and I know this would require a decent knowledge of assembly, but I would like to be able to either

1) Allow TP gains even when no strategist has learned a tactic that level, or
2) Increase the number of TP gained per level. That would be a concession if #1 is unfeasible.

Level up algorithm seems to follow this progression (at least, this is the way it displays):
Increase each general's soldier counts.
Check if a general learned a tactic.
If at least one does, display all generals that were eligible to learn it.
Gain TP.

My guess is that it should be a matter of finding where the TP increasing algorithm is located, and then, instead of cutting leveling short if no one learned a tactic and returning to the game, you would branch to the beginning of the TP increasing algorithm.

Thanks for taking the time to listen to my ramblings and questions. At the very least, one Destiny of an Emperor fan is really excited about finding out about this stuff.

User Info: MeteorStrike

11 years ago#79
Well, as far as your TP question goes, here it is:

When you gain a level, the game tests to see if someone had enough INT to learn a tactic. If someone does, you also gain TP. The following Game Genie code will always give you the TP gain, regardless of whether or not someone learned a tactic or even if your party had no tactician:

// Always "learn tactic" and gain TP after level up:
// B628 ? 2A : 00 = AAXUAVZZ

2 things to note (WARNINGS):

1 - The game's code was made in such a way that the gaining of TP is merged with the learning of the tactic. In other words, if you use this code and no one learned a tactic, it will say "learned tactic [whatever]" and then you get the points. To dis-associate these two would probably take massive code rewriting (or at least a lot of tracing to figure out a work-around) and I'm not willing to do that. This is how the game was written, so... tough. :p

So when you get past level 30, beware, because the "new tactics learned" could lead to a crash. Note that even though it will say you learned the tactic, NO ONE will actually learn it, (assuming no one could) so this will be correct and should not cause any problems. HOWEVER, when the game tries to show you which tactic you learned and you're past level 30, you could end up with gibberish text displayed, and THAT can cause a game crash (or not, I'm not gonna bother testing this...)

2 - If you keep gaining TP past level 30, will you overflow? It appears TP is 3 bytes in size, so you should be able to get up to 999 Max TP just fine... but... keep an eye out...

Now, as far as how many POINTS you gain for the TP, this is stored in a list of 16 entries, each which contains a number between 3 and 5. A random entry in this table is chosen and its number is how many TP you gained.

The table is located at 0x3B666 and contains the following values:

$B656 == 0x3B666 =
03 04 05 03 04 05 04 05
04 05 04 05 04 05 04 04

So you got the following probabilities to gain TP:

03 = 2 in 16
04 = 8 in 16
05 = 6 in 16

User Info: MeteorStrike

11 years ago#80
The gaining of the levels is actually quite a simple algorithm, but like anything in assembly, it's annoying to decode. I found the assembly code which deals with HP, but I just don't want to trace it right now for 2 reasons: 1 - I am doing something else and I don't have time for it right now, and 2 - The algorithm is so simple, you can figure it out by mere observation, (and looking at a little bit of code too) so here it is:

Every unit, as you said, starts with 100 HP:

00:B4AB:A9 64 LDA #$64
00:B4AD:85 10 STA $0010

This value is hard-coded for everyone right here. You can use the following Game Genie code to start with 200 HP instead of 100 as an example:

// Start with 200 HP instead of 100:
// B4AC ? 64 : C8 = EKXUGGGV

Note that this will be for executable code, so this determines your Max HP when you start the game, and when you get a level-up, so its not like you can put in the code, disable it, and then continue from 200 HP after a level-up. The 100 value is hard-coded into the algorithm.

Now, you will notice that, instead of going from 100 to 114 HP on the first level up for Guan Yu, you will go from 200 to 228. Everything is doubled, including the level-up amount (from +14 to +28)

The algorithm simply adds a certain percentage of your current HP to your total for each level gained. The formula is the following for EVERYONE:

Current Max HP = 100 * ( ( 256 + DX ) / 256 ) ^ ( level - 1 )

The value of DX is different for each General (or potentially different, some of them can re-use the same value. :p

For Guan Yu, DX = 0x24 == 36.
For Zhang Fei, DX = 0x26 == 38, which gives us:

Level --- Soldiers
1 = 100
2 = 114.84375
3 = 131.890869140625
4 = 151.4684200286865234375
5 = 173.95201362669467926025390625
50 = 88157.829677227159636497911258936

NOTE that I used a calculator to generate this simple, sample table, and this is WRONG. A calculator will work with floating-point values, but the game works with discrete numbers. There is no exponential opcode in NES assembly. You have to multiply the value n times, so you should get:

1 = 100
2 = 114
3 = 130
4 = 149
5 = 171

Now, how does the game determine what DX is? Well, it uses the values you posted to look into an array:

00:B4D6:B9 0B B5 LDA $B50B,Y @ $B51F = #$26

$B50B == 0x3B51B

where Y == the value you posted that is less than 0x80. (Zhang Fei == 0x14, Guan Yu == 0x0A)
  • Topic Archived

GameFAQs Q&A