[WIP] Custom Game Settings (FF7)

  • Thread starter Thread starter Wutai Clan
  • Start date Start date
Status
Not open for further replies.
...That was the battle structure I was just telling you about. What, then, do you have as the Battle stat location?
The values you said were the active party, seems to do just that(world\field), the other characters don't seem to be calculated except for in the savemap. For battle, it passes the active party data into local variables. (Within the battle loop functions)

Though, I haven't fully decoded it, there could be more going on, or I could be misreading what's happening.

I just figured out how to find the opcodes, you basically, take an opcode.

MPu\IncreaseMP = 0x45
Opcode Structure = 0x009055A0

(0x45 x 4) + 0x009055A0 = 0x009056B4 [MPu\IncreaseMP]

That's the position in the OPCODE structure, the function is actually located here. [0x0061F801]

Btw, that function isn't directly usable, it uses local variables, and calls IncreaseMP[0x006CBBBF]..
 
Last edited:
I just figured out how to find the opcodes, you basically, take an opcode.

MPu\IncreaseMP = 0x45
Opcode Structure = 0x009055A0

(0x45 x 4) + 0x009055A0 = 0x009056B4 [MPu\IncreaseMP]

(...)
That 0x9055A0 (argh... address that's been burned into my memory...) is a base for all Script Op handlers. When a game gets an Opcode, it calculates the offset where a pointer to that function is stored (in a fashion: 0x9055A0 + Opcode << 2), and just calls it.
2 pages back. You're saying that you don't want to discover things on your own if it's already decoded, and asking for people to step in and share, and then you just do it on your own anyway? Why bother asking...
 
2 pages back. You're saying that you don't want to discover things on your own if it's already decoded, and asking for people to step in and share, and then you just do it on your own anyway? Why bother asking...
When did I say that?

I asked for help in my very first post, and I accepted help, and integrated values NFITC1 told me about. But I also said I would decode what I have to.

I will discover things on my own if I have to, but I'd rather not do work, that's already been done.

As for why I would go ahead and do it on my own, that's because I'm working on a project, I want to accomplish my goals, not sit around and wait for answers that might come.

Your answer was wrong, maybe shift left 2 equals 4, but why tell me answers in a format the game doesn't use? The game explicitly says eax * 4, not << 2... That's why I didn't use your info, it didn't match up with anything I was seeing. (And since we're bringing up 2 pages ago, you KNEW I had trouble understanding bit shifts, so why intentionally change a simple multiplication formula to use a bit shift?)

So try being less fancy, and being more correct, and someone might trust\use your data.

---

How hard is this.

Formula:
OPCODEBASE + (OPCODE * 4) = OPCODE LOCATION

Example:
0x009055A0 + (0x45 * 4) = 0x009056B4

Using fancy formulas doesn't make you look smarter, and it only serves to confuse people.

I understood the bit shift with AddItems, because the game uses that formula, I could see it, and knew what you were talking about. (ie, It didn't require me to go out and learn binary to decode your answer. Decoding the game is enough work, I don't need\want to decode your answers as well, so I ignore anything you say that doesn't match up with the actual code.)
 
Last edited:
Ok, so from the top:
When did I say that?
Here.

I asked for help in my very first post, and I accepted help, and integrated values NFITC1 told me about. But I also said I would decode what I have to.

I will discover things on my own if I have to, but I'd rather not do work, that's already been done.

As for why I would go ahead and do it on my own, that's because I'm working on a project, I want to accomplish my goals, not sit around and wait for answers that might come.
Nothing wrong with doing things on your own. That's for sure.

Your answer was wrong (...)
No it wasn't.

(...) maybe shift right 2 equals 4
... shift left, but yes, it does equal *4. Of course it does.

(...) but why tell me answers in a format the game doesn't use?
FF7 (for PC) was written in C++, and "<<" is a C/C++ operator explicitly convertable to SAL/SHL, also...

The game explicitly says eax * 4, not << 2...
No it doesn't. That's what your debugger/disassembler shows to you. The machine code actually says 0x9055A0 + EAX SHL 2. That's how the CPU will compute it.

That's why I didn't use your info, it didn't match up with anything I was seeing. (And since we're bringing up 2 pages ago, you KNEW I had trouble understanding bit shifts, so intentionally change a simple multiplication formula to use a bit shift?)
YES. That's exactly what I did - I intentionally used a bit shift operator. But if I didn't - you'd still get an answer with an array of function pointers.

So try being less fancy, and being more correct, and someone might trust your data.
I stand correct. And << is actually pretty important operator.

I'm not your enemy, just wanted to make sure that you understood the shifting thing. In the source code, it looked something like this:
Code: [Select]
Code:
...fieldOpcodesPointer[scriptOpcode](args)...
Still, no *4 in here - that's because compiler is smart enough to know that a function pointer in a 32bit app is 32bit long, so the whole array has a 4-byte alignment. Multiplications are actually pretty slow - in oppose to bit-shifts. That's also a reason why you'd see some unreferenced 1-byte field between other, larger structs  - the alignment is important and the game speeds up when the addresses are 4-byte divisable and the CPU can do just "address + eax << 2".

//---

I understood the bit shift with AddItems, because the game uses that formula, I could see it, and knew what you were talking about. (ie, It didn't require me to go out and learn binary to decode your answer. Decoding the game is enough work, I don't need\want to decode your answers as well, so I ignore anything you say that doesn't match up with the actual code.)
That's why I hate .NET/Java. It spoils people.
 
Last edited:
That's what your debugger showed you.

It looks like this in my debugger..

Call Near DWORD PTR [EAX*4+9055A0]

Your debugger sucks, it's a structure, this is how structures are used in ASM.

--

I'm not spoiled, bit shifts are ASM math optimizations, even most C++ users never use them directly, it has nothing to do with C#.
 
Last edited:
That's what your debugger showed you.

It looks like this in my debugger..

Call Near DWORD PTR [EAX*4+9055A0]

Your debugger sucks, it's a structure, this is how structures are used in ASM.
You don't pay attention - I was talking about machine code - debugger is just nice and shows it as *4 (mine does too). And it's not a structure. At it's best you could call it an array.

//---

PS: It's not an array, it's a structure, learn the difference. It's C code, not C++, the port was done in C++, not this, it's the original C code. (Only the graphics, etc, are using C++, ie port specific code.)
Didn't pay attention one more time - I actually said "FF7 (for PC)". Doesn't matter anyway, bit-shifts are not C++ - specific.

And as for the scruct thing - prove it. Write a C listing (a simple one) that would compile into such code - then we'll talk.
 
Last edited:
You don't pay attention - I was talking about machine code - debugger is just nice and shows it as *4 (mine does too). And it's not a structure. At it's best you could call it an array.
It's a structure.

At any rate, IDA and the debugger show it as eax*4, so why change the formula?

Seriously, just write the formulas to match what I'm looking at, or, I'm going to assume you are wrong. It's pretty simple. We're not machines, we're people, use people code, alright.
 
Last edited:
Right. Sorry for that.
I highly doubt it.

And, as far as I know the CPU just executes the code, the compiler makes all the optimizations, not the CPU. So it doesn't look like that, ever, except in your little delusional mind. If it looked like that anywhere, it would show up in IDA\Debugger, it doesn't.

IDA doesn't do that elsewhere, there are plenty of places where the code uses bit shifting, but you're right, just for this one function, it decided to change the code to be easier to read.  ::)  -- (And how do you think IDA get's the code, it executes it, and reads what happened on the stack\registers, that's what it saw occur, so that's how the machine code really looks.)

I don't appreciate being confronted over bullsh*t, especially when it was your own mistake that caused the issue to begin with. Had you explained yourself clearly, in a straightforward manner, I would have used your info, you didn't, so I didn't, end of f*cking story.

---

Even if it does that at some low level, I've mentioned that bit shifting isn't something I understand well. What I asked for was accurate info, not math lessons. I'll figure that out on my own time, as it becomes necessary. So your excuse for doing so, ie, helping me out, is BS.

Regardless, everyone else managed to give me info that lined up with the debugger\disassembler, you didn't. That's why I used their info, and not yours.
 
Last edited:
You seem to have removed some content, so no quotes for those parts.
I highly doubt it.
Oh, but I do! I'm sorry for thinking that you can actually be smarter than a debugger. The "fancy operator" I used is being taught in one of the firsts classes of C (in case of bit logic and/or operator precedence, whichever comes first). From now on, I'll be sure to double-check if the provided data is in way you'd understand.

And about .NET (C# in your case) not having anything to do with spoiling people (can't quote you now) - it does. Microsoft had made a very successful attempt to provide people with a programming language where everything* can be done with a few lines of code. It spoils people in a way that they EXPECT that everything they need is out there, somewhere (in a C# and VB.NET version).

*everything - everything that they've thought you'd need

And, as far as I know the CPU just executes the code, the compiler makes all the optimizations, not the CPU. So it doesn't look like that, ever, except in your little delusional mind.
Right about the first sentence. Let's see what we've established: CPU doesn't do optimization, just executes the code.

If it looked like that anywhere, it would show up in IDA\Debugger, it doesn't.

IDA doesn't do that elsewhere, there are plenty of places where the code uses bit shifting, but you're right, just for this one function, it decided to change the code to be easier to read.  ::)
Second one (after removing the sarcasm): IDA will not make any attempt at providing user with more-friendly data.

Now let's produce some code with that famous opcode part. To the right you'd see a disassembled line, and to the left - actual machine code.
Code: [Select]
Code:
FF140D A0559000        CALL DWORD PTR DS:[ECX+9055A0]FF144D A0559000        CALL DWORD PTR DS:[ECX*2+9055A0]FF148D A0559000        CALL DWORD PTR DS:[ECX*4+9055A0]FF14CD A0559000        CALL DWORD PTR DS:[ECX*8+9055A0]
The only byte that changes is the 3rd one (0x0D -> 0x4D -> 0x8D -> 0xCD). In binary:
00001101
01001101
10001101
11001101
You'd expect it to be 1, 2, 4 & 8, but that's actually 0, 1, 2 (SHL 2 equals *4 ) and 3 (SHL 3 equals *8 ), so it actually does a bit-shift. So, "just for this one function, it decided to change the code to be easier to read"? No way! (disclaimer: not saying that's bad).

(And how do you think IDA get's the code, it executes it, and reads what happened on the stack\registers, that's what it saw occur, so that's how the machine code really looks.)
LoL ;) No, Mister Ignorant :) It interprets it, at it's best, parse maybe, but sure as hell does not execute it. That would be a big security hole if it just "oh, lets run it and see what it does, yay!". Machine code is the hex codes you see next to each disassembled line ;)

I don't appreciate being confronted over bullsh*t, especially when it was your own mistake that caused the issue to begin with. Had you explained yourself clearly, in a straightforward manner, I would have used your info, you didn't, so I didn't, end of f*cking story.

---

Even if it does that at some low level, I've mentioned that bit shifting isn't something I understand well. What I asked for was accurate info, not math lessons. I'll figure that out on my own time, as it becomes necessary. So your excuse for doing so, ie, helping me out, is BS.

Regardless, everyone else managed to give me info that lined up with the debugger\disassembler, you didn't. That's why I used their info, and not yours.
In short:
The only mistake I did was assuming that you actually did understand the "thing" (no, it wasn't me who started explaning it to you) - I was giving you info in a manner I thought that you'd surely understand now. I stand corrected.
 
I'll be sure to double-check if the provided data is in way you'd understand.
Why not just post it in binary next time, that'll be helpful.

0001011010101000101001000010001001011001010001001010100101010010

There ya go, good luck decoding.. Don't be an ass, just post the sh*t in plain English, unless it actually requires you to use some formula, like AddItems did, etc,. That way, someone can look, and go, oh, that's what he's talking about, I see it.

(Btw, I've learned how to use the shift operator since then, these are past tense answers, as in, why I ignored the post days ago.)

And about .NET (C# in your case) not having anything to do with spoiling people (can't quote you now) - it does.
You can't learn C++ without the internet, a book, or schooling, it's such a nonsensical language, that you will be constantly referencing something.

With C#, the intellisense alone is generally enough to figure it out(if not, you can easily look at the source via reflection\metadata\etc.), I rarely need to reference anything with it. In C++, you have to use a reference just to do simple data conversions. (Do I really need to Google for three hours to figure out something C# does with ease, is that what makes a "good" language. If you say so. Without the internet, you couldn't do sh*t in C\C++, you'd get stuck with some obscure error, and struggle for months trying to figure it out. Argue if you want, but you know it's true.)

There is a reason C# is taking over as the industry standard, it's because it's better. C# rules for the same reason remote controls do, because it's easier than walking across the room, and changing channels manually. Get it?

Still not clear, here is how I see C++..

http://en.wikipedia.org/wiki/Rube_Goldberg_machine

No, Mister Ignorant :) It interprets it, at it's best, parse maybe, but sure as hell does not execute it. That would be a big security hole if it just "oh, lets run it and see what it does, yay!". Machine code is the hex codes you see next to each disassembled line ;)
Yes, in a world without virtualization, that might be true, however, that's not our world. (You can easily execute any code safely if you know what you are doing.)

No, hex isn't machine code, binary is, hex is for human benefit, like ASM, and C++, etc,.

http://en.wikipedia.org/wiki/Binary_numeral_system
http://en.wikipedia.org/wiki/Hexadecimal

In short:
The only mistake I did was assuming that you actually did understand the "thing" (no, it wasn't me who started explaning it to you) - I was giving you info in a manner I thought that you'd surely understand now. I stand corrected.
The mistake you made, was coming into my topic, and acting like an a*shole, who cares if I ignored your post, and figured it out myself? F*ck off. Seriously.

Btw, you just volunteered yourself to finish this project. Good luck. :)

@All, direct all inquiries to dziugo, he is the COMPUTER MASTER, and will have this project done in no time. I'm sure he'll have no trouble doing anything I've done, since he's so much smarter than me. (Sure, I know, he's had the last six years to do so, and hasn't, but, he was just biding his time, the sleeper has awakened, you'll see.)
 
Last edited:
Don't be an ass, just post the sh*t in plain English,
Can I second this.  No offence but there seem to be a lot of people around who like to look smart by being complicated.  So many times it happens that I ask for a simple explanation and get a ton of jumble back. It is very irritating.  When I ask how I can make a section of code simpler, I do not expect a 100 page essay.  Just give me the 1 line of code.

 8)
 
Last edited:
Agreed. :)

---

Furthermore.

Some of you, are a*sholes.

For example, I release an "Alpha" in less than a week after the project was born, which is very quick, and then, I get this ->  >:( Because, said alpha wasn't a perfect working release.

You do realize, that was extremely quick for what I did, and not many people could do the same. More importantly, software companies, have many test PC's, with different hardware, software, and operating systems installed. They have bug testers, quality assurance, etc,.

Despite all those measures, even paid software has bugs. (After months\years in development.)

Now, you, are giving me angry faces, because a one week old alpha release, which hasn't had the benefit of being tested on various machines, or going through rigorous bug testing, and quality assurance testing, isn't working properly? Does anyone see the problem here?

I try to come up with a solution, and post several debug builds, but, no, you're done, and not helping me anymore, I wasted your time apparently, because an alpha wasn't f*cking immaculate. Piss off. You couldn't do any better, and expecting it from me, for FREE no less, I should kill you.

So, that really pissed me off.

Here read this..

http://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha

Now, I got this jerkoff showing up, why did you figure that out on your own, I told you how to do it?

Because, no you didn't, isn't it clear, your information made no sense, so I figured it out myself. (I mean, why would someone figure something out themselves, if you had told them in a clear manner, it's not even possible. If you told me, and I understood it, then I couldn't possibly figure it out myself, because you already told me,. Nevermind, you're too stupid to get it.)
 
Last edited:
A word of advice Wutai, ignore those which piss you off on the internet. There will always be people that expect something for nothing, and even more still that will criticize you work yet will not or cannot do work of their own, and even more still that will keep asking you when the next release is. My point being, if you are not able to shrug these things off then you will blow a gasket (which you look very close to doing already.)
 
I don't know if some parts of your latest reply were directed at me specifically Wutai Clan, but let me tell you why I "left".

1) because I noticed that other people started playtesting your mod, too. I thought you were in good hands -- guess you weren't.

2) I really don't have the technical knowledge to help you.

3) I have a mod of my own that's taking almost all of my free time, and I noticed that with the way your program works, the two wouldn't be compatible.

So yeah. Sorry for "leaving" like that, but I'm focusing on my mod right now. The most important thing when working on tools/mods, is to make them for your own pleasure first. Also, another reason why I didn't create a topic about my mod, is because I'm aware the attitude of other people could bring me down (sometimes to the point of wanting to drop it all). And I don't want that.

When I finally make a thread about my mod, I won't care much if it's being shot down or if people don't care about it, since at least it will be fully playable. I'm really making my mod for my own needs/pleasure first, and I suggest you do the same (if the two are comparable).
 
Last edited:
Well, I've decided to keep working on the project.

I can't promise it will work for everyone, and since no one would run the debug builds, I can't do much about that. I'll make a new thread when it's ready for release. (Could be days\weeks\months, hard to say.)
 
I have tried testing it but whenever I run them game this error pops up "You have an error in your config file, some options may  not have been parsed. (no such option 'load_library'), im using the latest Aali's Custom graphics driver.

Would you mind telling me how could I do this with Cheat Engine, I already have EXP and Ap adresses, but I don't know how to make my Cheat Engine to double the EXP or AP.
 
Status
Not open for further replies.
Back
Top