Documentation Tutorial
Once you have copied the Primary pointer into a new file, you can compare it with other Primary pointers quite easily. It also makes it easy to work your way through the bytes and find the values we have identified (list kept in first post of this thread).
What you then need to do, is open Cheat Engine. Follow the tutorial presented the first time you run it, though as far as the step 3 (that's all you need that is relevant to this task).
Once you know how, you can then scan for values - use the "Memory Scan Options" to scan between the start and end of a specific Primary pointer. If you begin with an "unknown initial value scan", then proceed onto an "unchanged value" scan, you should get a good list of results. Using this method, change any values that you think represent in-game stats, and check in game to see if the change has registered. If you verify an unknown value, make a post here and let us know! If you see the OP you will also find out where the Alpha Address/Pointer is located (see my last post on the previous page for info on this). We don't know much about the data stored at the Alpha Address, but we do know some of the interesting stats (such as ammo) are stored there.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
What's your ideas relating to ground types?
I've confirmed another pointer at the Primary Address. This one seems to relate to units_tables, and we've named it Beta pointer for now. It's structure is a little harder to understand than the Alpha pointer (unit_stats_land). The Beta pointer begins at byte 72 in the primary pointer. As usual, four byte little-endian.
There doesn't seem to be a header in these files, which is understandable as there is no difference between a naval entry and a land entry in units_tables.
From the beginning of the memory at the Beta Address:
Byte 36 - Four byte int, recruit time
Byte 40 - Four byte int, unit upkeep cost
Byte 72 - four byte int, unit limit
There's also a lot more pointers here, probably to the string based data you see in units_tables in PFM.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
It would be faaaar more effort than it's worth to use any of Warscapes data such as 'ground types' when implementing our own gameplay mechanics, we could much easier link it to our own set of maps or data.
Ok, I'll see if I can find anything of interest. Is data necessarily coded by 4 bytes? Are there values to avoid?
Under the Patronage of Leonidas the Lion|Patron of Imperator of Rome - Dewy - Crazyeyesreaper|American and Proud
Empire uses quite a lot of floats. If interested, you could check a variable's type by opening one of the DBFileTypes text files associated with PFM, or a schema for DBE and looking at the relevant variable.
While that's true, that's because the values are so small only a single byte is needed (imagine how many unit related stats are smaller than 255). I'm very confident that we're not dealing with any single byte numbers. So @ anyone looking to help with this - my advice would be to keep looking at four byte patterns.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Under the Patronage of Leonidas the Lion|Patron of Imperator of Rome - Dewy - Crazyeyesreaper|American and Proud
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Also all the models use lots of float (either 2 byte (half) or 4 byte (single)) values, that I verified from game memory. It is doubtful 2 byte floats would be used anywhere else in the game.
The ESF save game files are serialized objects, so there might/should be some similarity between the memory representation and the ESF.
so these should be types used
- 00 - This is not a valid type code
- 01 - 8-bit, boolean (0 false, 1 true)
- 02 - 8-bit signed integer
- 03 - 16-bit signed integer
- 04 - 32-bit signed int
- 05 - 64-bit signed integer
- 06 - 8-bit unsigned int
- 07 - 16-bit unsigned integer
- 08 - 32-bit unsigned int
- 09 - 64-bit something 64-bit unsigned integer
- 0a - 32-bit single precision float
- 0b - 64-bit double precision float
- 0c - pair of 32-bit single precision floats (x,y coordinates)
- 0d - triple of 32-bit single precision floats (x,y,z coordinates)
- 0e - UTF-16 string (encoded directly in old ESF formats, or index to lookup table in S2TW's new format)
- 0f - ASCII string (encoded directly in old ESF formats, or index to lookup table in S2TW's new format)
- 10 - 16-bit angle (1 = 2π/65536)
- 40..4f - array types directly corresponding to 00..0f scalar types
- 80 - object with multiple fields
- 81 - array of objects of the same type
Another essential data type you will encounter in memory is, following my project's naming convention, NTW::Utils::Array<T>.
It's 12 bytes long: size_t max_size, size_t size, T *data.
Most of times you'll find it in Array<T*> form (= array of object pointers), but wide-char strings (Array<wchar_t>) are also very common.
Unit's 16-bit orientations were called, at least in battles, TABANGLEs. I think to remember the conversion was just matter of multiplying by a factor (0.0054931641) and performing one type casting.
Bye.
Ultimately what could be achieved with this method? give me a few examples...would this mean we could edit the campaign map?
.......... ..........
PC Specs
Attrition System, proper Supply Lines and something else you can think of^^
Attrition is all that's guaranteed so far. And it's going to take a long time to design, any concept I've came up with so far would add a massive loading overhead. But I'll work on efficiency later As for supply lines, we've met a stumbling block. Things like ammo, unit defence values, reloading skill (i.e. static data that doesn't really change based on play) are stored in one common location for all units of the same type. So any change to, say, French line infantry would effect every single unit of French line infantry in the game. We're considering re-routing the memory to our own custom addresses, in order to assign these stats on a unit-by-unit basis. But there's a lot of issues with that, not least of all game stability. Hopefully we'll come up with something
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell