I would like to know how to search Wealth value. I haven't found it yet.
Wealth if a Float value, and it can have fractions, so I do a search in between. So if $$ is 356.87 I'll search for a value between 356.8 and 356.9 (to account for rounding).
Make sure the age didn't change, and there was no save/load during the search process, and try again. The game seems to also randomly change the address, so sometimes you need to try it several times before it works (At least in my experience).
I seem to have some issues copypasting this into Cheat Engine; I keep getting line error messages. Is there something I'm missing?
Just paste it into a text file and rename it to .CT instead of .TXT, then you can open it in CE like any other table.
Re: [Request] Millennia
Posted: Sat Mar 30, 2024 8:49 pm
by matt1713
Does anyone understand what the game pointers from BabyGroot's table does? The development one is pretty self explanatory, but what does the "hot seat" one do? The all imports pointer doesn't appear to do anything either.
First - Open tab research > after that press shift and click research [ farming, scouting or worker (just anything) ]. Second- Active Script, Waiting For AoB Read. Script Research Always Done
1. Copy code ( Select All Code And CTRL + C )
2. Open cheat engine
4. Paste Code in Cheat Engine
5. Done
Video Tutorial
I'm receiving an error that seems to disable keyboard interactions with the game. When I try activating the Game Data script, I receive an error message, "This script uses nearby allocation but it is impossible to allocate nearby 17EBFE55FFB. Please rewrite the script to function without nearby allocation. Try executing the script anyhow and allocate on the region outside reach of 2GB? (The target will crash if the script was not designed with this failure in mind)".
Re: [Request] Millennia
Posted: Sun Mar 31, 2024 6:58 am
by SlipperyEel
So despite a lot of hair pulling, I came up empty on finding pointers for the resources. However, it seems that the values for them are stored in a fixed sized array, so using an AOB scan to find the offset of the first resource (wealth) lets you easily populate all the other values:
I still need to test it some more to ensure it is consistent, and possibly see if I can trim the size of the AOB a little (since it grew pretty huge - 96 bytes - in order to make it unique). I've also only played up to the fourth age, so I know there are still additional resource types that I have yet to encounter in future ages which will need to be added.
Edit: So with further experimentation, it seems like it is more inconsistent than I first thought. It looks like there are two arrays of resource values. I originally thought that the first was for the UI display and the second was for the actual values. But after additional testing it seems like the true values can occur in either array, and sometimes one resource will have its actual value in the first array while another will have its actual value in the second array. It also seems like the offset from the starting value are not consistent, at least for the UI values when the actual value is in the other array. Not sure how practical nailing that down consistently is going to be.
Edit 2: So after further experimentation, I think the relative offsets of certain values might shift around between ages, which would put the kibosh on this approach. Although it does seem like Culture and Wealth might still be doable at least.
Speaking of Culture, that seems to work differently from the rest. The others clearly have a separate actual value and a UI display value. While Culture also has two values, the first one seems to determine both the display and actual values, and the second value updates to reflect a change in-game. But changing the second value in CE doesn't appear to do anything.
So despite a lot of hair pulling, I came up empty on finding pointers for the resources. However, it seems that the values for them are stored in a fixed sized array, so using an AOB scan to find the offset of the first resource (wealth) lets you easily populate all the other values:
I still need to test it some more to ensure it is consistent, and possibly see if I can trim the size of the AOB a little (since it grew pretty huge - 96 bytes - in order to make it unique). I've also only played up to the fourth age, so I know there are still additional resource types that I have yet to encounter in future ages which will need to be added.
Edit: So with further experimentation, it seems like it is more inconsistent than I first thought. It looks like there are two arrays of resource values. I originally thought that the first was for the UI display and the second was for the actual values. But after additional testing it seems like the true values can occur in either array, and sometimes one resource will have its actual value in the first array while another will have its actual value in the second array. It also seems like the offset from the starting value are not consistent, at least for the UI values when the actual value is in the other array. Not sure how practical nailing that down consistently is going to be.
Edit 2: So after further experimentation, I think the relative offsets of certain values might shift around between ages, which would put the kibosh on this approach. Although it does seem like Culture and Wealth might still be doable at least.
Speaking of Culture, that seems to work differently from the rest. The others clearly have a separate actual value and a UI display value. While Culture also has two values, the first one seems to determine both the display and actual values, and the second value updates to reflect a change in-game. But changing the second value in CE doesn't appear to do anything.
From what I have tested the values usually changes with a new government
Re: [Request] Millennia
Posted: Sun Mar 31, 2024 5:53 pm
by Darkedone02
This sound like one extremely long codebreaker code just for resources and xp.
This is just to edit the value itself, i think the code itself would be more or less easier if you could change the gain multiplier, and if possible, control the losses to a negligible loss.
Re: [Request] Millennia
Posted: Sun Mar 31, 2024 7:19 pm
by emdasdas
It happens to someone that the load and save buttons don't work, I already reinstalled and it gives me the same error
Re: [Request] Millennia
Posted: Mon Apr 01, 2024 9:27 am
by SlipperyEel
So with additional playing around, it seems like there are indeed two arrays of resource values. While it seems the offsets between each value within a given array are fixed, the offset from one array to the other appears to change without any consistent pattern. There also doesn't seem to be any consistency as to which array the real or UI value appears in, which is frustrating. However, if you can track down the two Culture addresses yourself via a manual scan then you can have the attached table automatically find the other addresses for you, due to the fixed offsets:
Instructions: You'll have to manually scan for your Culture value. This is a float and will have two addresses. Once you find those, copy each address and enter them into the table sub-headers as pictured above. The other values will then automatically populate. When editing a given resource, for example Warfare, edit the value in both entries. N.B.: You can select both values using CTRL and then change them simultaneously.
There are presumably still other values in later ages that I haven't encountered yet. I'll add those as I come across them. I also have no idea if this will reliably work across the entire game, as I have given it limited testing with my existing pool of saves.
If someone wants to find pointers to the Culture addresses or figure out a working AOB scan and automate the whole thing, go right ahead. There might also be a better way to handle two sets of addresses for a given value, maybe with an Lua script.
Edit: OK I have managed to find a ridiculously large AOB that seems to be unique and has - so far in my limited local testing - proved to work consistently. I have created a table with a Lua script that will do the scan and populate the values if it correctly finds two addresses (otherwise it pops up an error). CE will freeze momentarily when activating the scan, and the values will take a few seconds to populate afterwards. I suspect that this AOB will probably need further adjustment once more people test it, so consider this a beta. If you do manage to break it, I'd appreciate it if you could do a manual scan to find your Culture address and then open the memory viewer and copy the 256 bytes starting from that address. Paste it in a text file and attach it here so I can compare it.
So with additional playing around, it seems like there are indeed two arrays of resource values. While it seems the offsets between each value within a given array are fixed, the offset from one array to the other appears to change without any consistent pattern. There also doesn't seem to be any consistency as to which array the real or UI value appears in, which is frustrating. However, if you can track down the two Culture addresses yourself via a manual scan then you can have the attached table automatically find the other addresses for you, due to the fixed offsets:
Instructions: You'll have to manually scan for your Culture value. This is a float and will have two addresses. Once you find those, copy each address and enter them into the table sub-headers as pictured above. The other values will then automatically populate. When editing a given resource, for example Warfare, edit the value in both entries. N.B.: You can select both values using CTRL and then change them simultaneously.
There are presumably still other values in later ages that I haven't encountered yet. I'll add those as I come across them. I also have no idea if this will reliably work across the entire game, as I have given it limited testing with my existing pool of saves.
If someone wants to find pointers to the Culture addresses or figure out a working AOB scan and automate the whole thing, go right ahead. There might also be a better way to handle two sets of addresses for a given value, maybe with an Lua script.
I can't get it to work, what needs to be done to enable the boxes?
So with additional playing around, it seems like there are indeed two arrays of resource values. While it seems the offsets between each value within a given array are fixed, the offset from one array to the other appears to change without any consistent pattern. There also doesn't seem to be any consistency as to which array the real or UI value appears in, which is frustrating. However, if you can track down the two Culture addresses yourself via a manual scan then you can have the attached table automatically find the other addresses for you, due to the fixed offsets:
Instructions: You'll have to manually scan for your Culture value. This is a float and will have two addresses. Once you find those, copy each address and enter them into the table sub-headers as pictured above. The other values will then automatically populate. When editing a given resource, for example Warfare, edit the value in both entries. N.B.: You can select both values using CTRL and then change them simultaneously.
There are presumably still other values in later ages that I haven't encountered yet. I'll add those as I come across them. I also have no idea if this will reliably work across the entire game, as I have given it limited testing with my existing pool of saves.
If someone wants to find pointers to the Culture addresses or figure out a working AOB scan and automate the whole thing, go right ahead. There might also be a better way to handle two sets of addresses for a given value, maybe with an Lua script.
I can't get it to work, what needs to be done to enable the boxes?
1) Make sure you selected Millennia.exe as the process to attach the table to.
2) Open both tables (I.E. Millennia --> Player Resources 1 & Player Resources 2).
3) Do a search for your culture stat starting on turn 2 (don't bother searching for 0 on turn 1, will take a long time finishing the search). Make sure you're using FLOAT value types instead of the default 4 Bytes. You should see your current culture stat when you hover over the culture section in the top left table (Ex. "1.6/8 to next culture Power" --> the 1.6 is what you search/update scan for.)
4) After 1-3 turns, updating the value/search for your culture stat each turn, you should have narrowed it down to 2 values (should be the exact same float value).
5) What you want are the addresses - not the actual float values-. Now, for the first address (Right-click-->Copy Selected Addresses); copy it and insert/override the placeholder "00000000" next to the "Player Resources 1 - Enter Culture's 1st address ->".
6) Now do the same for the second address and put it in the same placeholder in the Player Resources 2 section. If done correctly, the tables should have auto-populated.
So with additional playing around, it seems like there are indeed two arrays of resource values. While it seems the offsets between each value within a given array are fixed, the offset from one array to the other appears to change without any consistent pattern. There also doesn't seem to be any consistency as to which array the real or UI value appears in, which is frustrating. However, if you can track down the two Culture addresses yourself via a manual scan then you can have the attached table automatically find the other addresses for you, due to the fixed offsets:
Instructions: You'll have to manually scan for your Culture value. This is a float and will have two addresses. Once you find those, copy each address and enter them into the table sub-headers as pictured above. The other values will then automatically populate. When editing a given resource, for example Warfare, edit the value in both entries. N.B.: You can select both values using CTRL and then change them simultaneously.
There are presumably still other values in later ages that I haven't encountered yet. I'll add those as I come across them. I also have no idea if this will reliably work across the entire game, as I have given it limited testing with my existing pool of saves.
If someone wants to find pointers to the Culture addresses or figure out a working AOB scan and automate the whole thing, go right ahead. There might also be a better way to handle two sets of addresses for a given value, maybe with an Lua script.
Edit: OK I have managed to find a ridiculously large AOB that seems to be unique and has - so far in my limited local testing - proved to work consistently. I have created a table with a Lua script that will do the scan and populate the values if it correctly finds two addresses (otherwise it pops up an error). CE will freeze momentarily when activating the scan, and the values will take a few seconds to populate afterwards. I suspect that this AOB will probably need further adjustment once more people test it, so consider this a beta. If you do manage to break it, I'd appreciate it if you could do a manual scan to find your Culture address and then open the memory viewer and copy the 256 bytes starting from that address. Paste it in a text file and attach it here so I can compare it.
So the second script doesn't work, but the first one works perfectly after populating the 1st and 2nd addresses. Thank you very much.