Hex-editing the registry: The starting point - important new information

  • 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.
  1. Boards
  2. Romance of the Three Kingdoms II
  3. Hex-editing the registry: The starting point - important new information

User Info: ServantOfMagnus

ServantOfMagnus
4 years ago#1
There is very important code located at 17D5E - 17D75

I have posted several times on how to hex-edit the registry of officers so that you can put who you want where you want when you want. If you have read and understood those posts, you know that you have to use the code to chain the officers together, and that everything has to be in the right order. And that there are two chains per scenario - the first, for all of the officers who are in the game (either active or hidden) when the scenario starts, and the second, for all of the officers who will show up in a later year.

I had written that the first officer in the chain of here-right-now officers is the first officer in the first province which contains an officer (either active or hidden) at the beginning of the scenario. In the original game code, that would be:

Gongsun Zan in scenarios 1, 2

Jiang Yiqu in scenarios 3, 4, 6

Li Tong in scenario 5

I had thought that since the game knows where everyone is, it just knew to find the 'first officer in the first province....' to begin. Ha ha ha. I had forgotten that computers are stupid and they need to be told everything.

The code at 17D5E - 17D75 tells the game which officer to start each chain with. The order is scenario 1 right-now chain, scenario 1 later chain, scenario 2 right-now chain, scenario 2 later chain, scenario 3 right-now chain, and so forth.

If you're hex-editing, and your chains don't start with the same officer numbers that the chains in the original game start with, you need to change this code. If you don't, your edits won't work.

I found this out the hard way. I coded in the custom registry that I and my two brothers have collaborated on for a mod of the game, but it was not immediately successful. At the rule-which-province screen, most rulers generated the dreaded 'Liu Biao glitch'. But not all of them - some generated what I expected. Still, the game wouldn't run.

After working on the problem for a while and running experiments on the code, I finally came to the conclusion that, somehow, my registry was broken. I now believe that that is always what the 'Liu Biao glitch' indicates. But my chains were perfect - did the game not like the officer numbers I had assigned, or maybe something else about our scenarios?

In my experiments, I 'broke' the original game by messing up Cao Cao. But Gongsun Zan and Yuan Shao showed up OK at the choose-your-ruler screen. Those rulers would come before Cao Cao in the chain. So the part of the chain before the break was working....

In my own broken registry, the rulers who didn't suffer from the glitch were in higher-numbered provinces than those who did - the opposite of what happened in the experiments. Then it dawned on me: if the game started the chains at a predetermined place, rather than just with the 'first officer in the first province...', that would explain what I was seeing. My chains were broken, but the part AFTER the break was working. The game was just starting in the middle of the chains rather than at the beginning, because my chains started with different officer numbers from the original code.

So I went to my spreadsheet to figure out what officer numbers the chains started with in the original code, and, sure enough, I found those exact officer numbers in the code, right before the registry starts. And it all seemed so obvious and I felt like an idiot : - )

I'll let you know if I learn anything else as the mod nears completion, but as of right now, I do believe it is possible to create your own officers and scenarios from scratch.

I am finding myself second-guessing many of the roster and scenario decisions made for this mod; we did do a reasonable amount of warping of time and space. That is, I'm not sure how good it's going to be. But, I can always make another one....

User Info: RimmerDallJr

RimmerDallJr
4 years ago#2
Nice work here it is fine looking.

User Info: DragonAtma

DragonAtma
4 years ago#3
Aha! Now I can return to modding RoTK2.

There are still a few things left to find, though:

* The flood-fill points (for determining where provinces are colored). I found the exact pixels — the upper-left corner of the red squares in http://img14.imageshack.us/img14/5066/floodfillspots.png (off-province parts are in yellow, as some provinces — such as 5 and 17 — are almost completely off-province), but not where the game stores them.
* When they mark a province’s number (as opposed to it being an empty square for, say, provinces you cannot invade), it grabs a specific tile for the province. If you change the map, you have to find and change the tiles on that list, or it’ll use the tile corresponding to the vanilla version. So in http://img841.imageshack.us/img841/6821/drunkpath.png , province 15′s tile would be taken from the 8/9 border. No, I haven’t found the list despite trying.
* Which spots they flash. Fortunately, we have that info! Values 4 and 6 of the 11776 block are the x and y positions, respectively.
* We need to find battle maps. Until then, there will be some problems. Invading province 4 from the northwest, for example, will have you trapped by mountains.

So if you take requests, those are (to my knowledge) the only four things left for us to edit the map without breaking things...
My NES, SNES, and GB all work just fine. Why should I downgrade to a Wii U, PS4, or XBone?

User Info: Cao_Bao

Cao_Bao
4 years ago#4
Sir, please find the offset position for age limitation.
Soon after a general reach age 65, then next year the stars start to target him (example: A star has fallen from the sky, giving evil omen to Tao Qian).
(The general was badly hit by the star, and his wounds cause his death on the next year).

I wish to change the number 65 into 100 or 120 (real limit for human age), or just 50 (Oda Nobunaga: "man's life is fifty years.")

--
A star has fallen from the sky, bringing evil omen to Tao Qian.
Tao Qian's strategy: *bribe*; stars switches sides.

User Info: DragonAtma

DragonAtma
4 years ago#5
Well, there should be coding something like this:

if (age>randbetween(65,100) {
....[star falls coding]
}

If we had the coding for it, then we could just look up -- and change -- the death formula, both here and in other Koei games.

Just remember that I'm somewhat weird, so (say) "AB CD xx" would make more sense to me than the usual "LDL IFG xx" (or whatever) people normally give.
My NES, SNES, and GB all work just fine. Why should I downgrade to a Wii U, PS4, or XBone?

User Info: jununhere

jununhere
4 years ago#6
Great find Magnus!!

User Info: RimmerDallJr

RimmerDallJr
4 years ago#7
I will see if i can help with searching about the age.
Confidence is light and charm at its best.

User Info: RimmerDallJr

RimmerDallJr
4 years ago#8
Not able to find in the rom yet. I tried save state for the age it may be loose because it is not near the ruler data.
Confidence is light and charm at its best.

User Info: DragonAtma

DragonAtma
4 years ago#9
If you haven't looked at http://www.mediafire.com/download/d0qnfaceln1wal8/rotk2-data-Atma.ods , you should; the first page is a partial map of what data is where.
My NES, SNES, and GB all work just fine. Why should I downgrade to a Wii U, PS4, or XBone?

User Info: RimmerDallJr

RimmerDallJr
4 years ago#10
I downloaded this , looks well. I just wish i knew what i was looking for in it. I heard their 3 hidden stat of the officers in this game. I would be glad to know each officers other numbers.
Confidence is light and charm at its best.
  1. Boards
  2. Romance of the Three Kingdoms II
  3. Hex-editing the registry: The starting point - important new information

Report Message

Terms of Use Violations:

Etiquette Issues:

Notes (optional; required for "Other"):
Add user to Ignore List after reporting

Topic Sticky

You are not allowed to request a sticky.

Update Topic Flair

You are not allowed to update this topic's flair.

  • Topic Archived