Crusader Kings III | Steam v1.13.1.1 | Updated: 2024-Oct-8

Upload your cheat tables here (No requests)
Zanzer
RCE Fanatics
RCE Fanatics
Posts: 1131
Joined: Fri Mar 03, 2017 10:48 pm
Reputation: 3805

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by Zanzer »

Haven't played the game yet to see what the code's doing, but have you tried using the Binary CE type and just setting the length to 15 bits?

How to use this cheat table?
  1. Install Cheat Engine
  2. Double-click the .CT file in order to open it.
  3. Click the PC icon in Cheat Engine in order to select the game process.
  4. Keep the list.
  5. Activate the trainer options by checking boxes or setting values from 0 to 1

User avatar
CompactDisc
Table Makers
Table Makers
Posts: 694
Joined: Tue Mar 07, 2017 11:52 am
Reputation: 853

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by CompactDisc »

tfigment wrote:
Wed Sep 02, 2020 4:56 pm
ReZpawner. rinnioveraci is not wrong exactly. The gold value is actually quite complicated involving shifts and rotates. When negative it is actually wrong but the pointer is right its the interpretation of the value that is wrong. I can only suggest dont let it drop below 0.

Also when value is really large its wrong. I expose it since most of the time you are in the range where the value is basically right and is more useful than not to show it. I may work on a custom type to handle it more correctly but its tricky and time consuming to write and test and I'd rather do other things like figure out holdings or DNA.
Gold isn't all that weird, except for the multiplier. It's in a different location and format than you might expect.

Gold is positioned at +230 from the base pointer. (or +130 +230 for you), it's an 8-byte value and is multiplied by 32768 (which is 2^15 as mentioned before).

Guanfei
Expert Cheater
Expert Cheater
Posts: 74
Joined: Mon Apr 24, 2017 12:14 am
Reputation: 12

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by Guanfei »

I can't make it work, it doesn't detect my active character.

EDIT: it detects a character, but not my active one, and it keeps changing.

tfigment
Table Makers
Table Makers
Posts: 659
Joined: Sat Apr 15, 2017 12:49 am
Reputation: 854

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by tfigment »

I disagree that Gold is just bit shifted. Look at ck3.exe+9F29ED in steam version. Its not just shifting and why would they do that and include imul edx,edx,000003E8 to scale the shifted value by 1000 when they could just do what they did with other values.

There is several masks, shr, shl, sar instructions. This looks like obfuscation as I can see no reason for having done it and they just never removed it from either CK2 or CK3. Much of that code seems to try to cap at max Int4 and min Int4 so why make it 8 byte. Is it just to avoid integer overflow?

I guess where is the sign bit stored is I guess the next question is it on one of the trailing bytes. I guess its still implied in there. Anyway I prefer the half value at least it in correct magnitude most of the time.

Anyway if anyone wants to write a registerCustomTypeAutoAssembler() function that handles it correctly, I'll add it to the table.

tfigment
Table Makers
Table Makers
Posts: 659
Joined: Sat Apr 15, 2017 12:49 am
Reputation: 854

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by tfigment »

Guanfei wrote:
Wed Sep 02, 2020 6:24 pm
I can't make it work, it doesn't detect my active character.

EDIT: it detects a character, but not my active one, and it keeps changing.
Is the character it detects the head of your dynasty? I'm pulling the root from that so I'm guessing that is wrong and I need to test something else.

Update: This is the problem. I'll find another place to get the player pointer. I switch to the dynasty one to get renown and just used the character pointer. I'll go back to my original code.


New Update: V3 includes new root character detection to find the current played character

User avatar
Darkedone02
Expert Cheater
Expert Cheater
Posts: 970
Joined: Thu Mar 02, 2017 11:42 pm
Reputation: 114

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by Darkedone02 »

ummm.... I decided to play uppland and when using your table, I get this... Xbox game pass version

Image

Guanfei
Expert Cheater
Expert Cheater
Posts: 74
Joined: Mon Apr 24, 2017 12:14 am
Reputation: 12

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by Guanfei »

tfigment wrote:
Wed Sep 02, 2020 7:55 pm
Guanfei wrote:
Wed Sep 02, 2020 6:24 pm
I can't make it work, it doesn't detect my active character.

EDIT: it detects a character, but not my active one, and it keeps changing.
Is the character it detects the head of your dynasty? I'm pulling the root from that so I'm guessing that is wrong and I need to test something else.

Update: This is the problem. I'll find another place to get the player pointer. I switch to the dynasty one to get renown and just used the character pointer. I'll go back to my original code.


New Update: V3 includes new root character detection to find the current played character
To answer you, if that's still relevant, no, it points at people that aren't even in my dynasty or my country. I played as the king of France, and it pointed once at some spanish dude, once at some guy from scandinavia (I guess, from the name) then an italian.

tfigment
Table Makers
Table Makers
Posts: 659
Joined: Sat Apr 15, 2017 12:49 am
Reputation: 854

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by tfigment »

Ok. The v1 and v2 have their own quirks but can mostly work while paused. I found a random person that this reproduces so trying to figure out what is different now. Unfortunately I'm not finding stable code to get these pointers from probably because of the multithreading changes the make the game run fast.

Zanzer
RCE Fanatics
RCE Fanatics
Posts: 1131
Joined: Fri Mar 03, 2017 10:48 pm
Reputation: 3805

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by Zanzer »

Gold:
Pointer Offset: 231
Record Type: Binary
Length: 32
Startbit: 7

As for the other variables that are x1000, that's no different from a game storing time as a whole number in milliseconds vs a float in seconds. Just pretend like there is a decimal point 3 positions from the end. I assume the game does this because most of the game has events triggered by elapsed milliseconds and then it adds that total to all of your monthly stats. Just some optimization.

After that, I quit. This type of game isn't my cup of tea. :)
Last edited by Zanzer on Wed Sep 02, 2020 11:21 pm, edited 2 times in total.

Guanfei
Expert Cheater
Expert Cheater
Posts: 74
Joined: Mon Apr 24, 2017 12:14 am
Reputation: 12

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by Guanfei »

tfigment wrote:
Wed Sep 02, 2020 10:54 pm
Ok. The v1 and v2 have their own quirks but can mostly work while paused. I found a random person that this reproduces so trying to figure out what is different now. Unfortunately I'm not finding stable code to get these pointers from probably because of the multithreading changes the make the game run fast.
v3 works so far, I just tried, it points at the right character and the cheats works.

danielyee
Expert Cheater
Expert Cheater
Posts: 1303
Joined: Wed Apr 05, 2017 11:38 pm
Reputation: 151

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by danielyee »

Hello great table sifu...thanks for the help..i just need god mode on my own army ..gold and full abilites on the kings...with families..thanks

michaelanglo.l
Cheater
Cheater
Posts: 41
Joined: Sun May 12, 2019 1:01 am
Reputation: 2

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by michaelanglo.l »

It seems that i can not change the stats by 'modified stats' , is that can not be changed or can only be changed by 'saved stats'?

tfigment
Table Makers
Table Makers
Posts: 659
Joined: Sat Apr 15, 2017 12:49 am
Reputation: 854

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by tfigment »

Update v4: Ok yet another attempt at stable character pointers. I feel really good about the Selected Character Pointer (removed not root restriction as a result). That seems to really only be active during certain characters. I don't feel great about the Root character detection as that still gets called when time is game is not paused. Still looking for better place to hook for root character pointer.

Also thanks to gold discussion I found that i need to use cdq with idiv in the data conversion to handle negative (x1000) values more correctly ( there is still some roundoff error when entering negative values which I assume is rare that I need to look at but its mostly correct).
michaelanglo.l wrote:
Thu Sep 03, 2020 1:47 am
It seems that i can not change the stats by 'modified stats' , is that can not be changed or can only be changed by 'saved stats'?
Modified Stats are updated by the game based on perks and other things so will be overridden. You should modify the base stats. The Modified Values are really for feedback.

There are 2 copies of base stats in the structure and frankly haven't tried to figure out which one is correct.

Zanzer wrote:
Wed Sep 02, 2020 10:58 pm
Gold:
Pointer Offset: 231
Record Type: Binary
Length: 32
Startbit: 7

As for the other variables that are x1000, that's no different from a game storing time as a whole number in milliseconds vs a float in seconds. Just pretend like there is a decimal point 3 positions from the end. I assume the game does this because most of the game has events triggered by elapsed milliseconds and then it adds that total to all of your monthly stats. Just some optimization.

After that, I quit. This type of game isn't my cup of tea. :)
Not sure this is quite right I'll play with it and if it works better than the short then I'll make it the default.

They use the 1000 for decimal point precision and round off while playing the game. I just dont prefer to enter those values since the game doesn't show it that way.

Update: Tested. It doesn't work correctly for negative numbers. I'll add it to next table however since they both fail that and this is still better than current.

User avatar
megatek
Noobzor
Noobzor
Posts: 7
Joined: Thu Mar 09, 2017 5:41 am
Reputation: 1

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by megatek »

Hello,

Recifense is working on a table so please have patience. It'll come when it's done and we must all be grateful for the game support. I don't have employees from fearless and a good table is worth the wait time. :)

rlurking
Cheater
Cheater
Posts: 33
Joined: Fri Jun 23, 2017 6:33 pm
Reputation: 23

Re: Crusader Kings III | Steam | Updated: 2020-Sep-2

Post by rlurking »

Looks like this is the place to dump CK3 info.

ck3.exe+29B1BF0 is the base address of the structure containing ironman flag & the integrity/checksum flag
+F9 = checksum/integrity, 0 disables achievements
+FA = ironman, 0 disables ironman
  • The +F9 check seems to be a rollup of all the different checks that are done (mod checksum, save file modification, debug mode enabled) that were independent flags in CK2
ck3.exe+29B076A is the debug/console enabled flag (normally enable by setting -debug_mode as a flag in a shortcut to the exe)
  • Unlike in CK2, running console commands does not flip the integrity switch, instead it only checks against the debug/console enabled flag.
A very basic achievement test did appear to succeed, though the ingame achievement menu is fubared (displays nothing).

Code: Select all

// Reading ironman flag
ck3.exe+337229 - 48 89 05 C0A96702     - mov [ck3.exe+29B1BF0],rax { (A6CCEBE000) }             
ck3.exe+337230 - 0FB6 80 FA000000      - movzx eax,byte ptr [rax+000000FA]                      - reads ironman flag
ck3.exe+337237 - 48 8D 54 24 48        - lea rdx,[rsp+48]

Code: Select all

// on hitting console button (~), check for debug mode enabled
ck3.exe+1461870 - 40 57                 - push rdi
ck3.exe+1461872 - 48 83 EC 50           - sub rsp,50 { 80 }
ck3.exe+1461876 - 48 C7 44 24 20 FEFFFFFF - mov qword ptr [rsp+20],FFFFFFFFFFFFFFFE { -2 }
ck3.exe+146187F - 48 89 5C 24 60        - mov [rsp+60],rbx
ck3.exe+1461884 - 48 8B D9              - mov rbx,rcx
ck3.exe+1461887 - 80 3D DCEE5401 00     - cmp byte ptr [ck3.exe+29B076A],00 { (1),0 }           - compares debug mode (console) flag
ck3.exe+146188E - 75 09                 - jne ck3.exe+1461899
ck3.exe+1461890 - C6 41 48 00           - mov byte ptr [rcx+48],00 { 0 }
ck3.exe+1461894 - E9 C8000000           - jmp ck3.exe+1461961
ck3.exe+1461899 - 48 8B 49 50           - mov rcx,[rcx+50]

Code: Select all

// checking if debug/console enabled & setting the integrity flag
ck3.exe+13196EF - 80 3D 74706901 00     - cmp byte ptr [ck3.exe+29B076A],00 { (0),0 }           - checks against debug mode flag
ck3.exe+13196F6 - 0F94 C0               - sete al                                               
ck3.exe+13196F9 - 20 83 F9000000        - and [rbx+000000F9],al                                 - writes integrity flag
Last edited by rlurking on Thu Sep 03, 2020 3:57 am, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: admantx, Alex985, Google [Bot], Keksro, LemonRust, rkuzunoha