1
DF Modding / Re: Dwarf Therapist (LATEST 0.5.4 6/10/10 see first post)
« on: June 22, 2010, 11:33:00 am »Ahuh, so just what actually is a vector in this sense briefly.Well... a stretch of memory containing items of identical size and type. They have a descriptor part that says where they start, where the stretch of memory given to them ends (alloc_end) and how long they actually are (end). Depending on compiler and the implementation of vectors, the descriptors can have different layout in memory.
So... a vector descriptor on Linux is just the three values:
start, end, alloc_end
A vector descriptor old MS C++ compilers used looked like this:
nonsense, start, end, alloc_end
A vector descriptor new MS C++ compilers use:
nonsense, nonsense, nonsense, start, end, alloc_end
All parts have the size of 4 bytes. The nonsense parts have some internal use, but understanding them isn't essential for reading the data.
DT is using the second form even when it's not right (AFAIK, it's been some time I checked). DFHack can use all of them, depending on the particular version of DF it's working with. So to get the right address for DT, you have to do some hexadecimal arithmetic.
Interesting. Well, that explains that. I couldn't figure out why it worked for DFHack and stone sense RC2 - I used it to make a memory.xml which apparently works, and didn't work for DT. But as I'm interested in this sort of stuff, if you don't mind, what sort of maths I mean what calculations. Hex doesn't bother me, I've been playing around with it for years (more than most of the people here have been alive). But I need to know more about how memory actually works.

