Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Rome 2 Total War Can't change 1 variable!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
MrMustard
How do I cheat?
Reputation: 0

Joined: 25 Mar 2022
Posts: 1

PostPosted: Mon Mar 28, 2022 5:59 am    Post subject: Rome 2 Total War Can't change 1 variable! Reply with quote

Some variables in this game are easy and I've been able to find and edit them no problem.

But one is incredibly hard to find.

It's called civil war protection, and here's how it behaves in-game:

When you start a new campaign, your faction is protected from a civil war for 20 turns. When you hover over the protected icon (pictured) in game it says "Currently protected... Turns remaining: 20."

Then when you end the turn, and hover over it, it says 19. Then 18, then 17 then 16 going down each turn.

Then when 20 turns have elapsed, you have a risk of civil war breaking out every turn.

Then if a civil war does break out, you're protected for 10 turns from a second civil war from breaking out.

So I would have thought there would be a variable in the game that goes, 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0, *now risk of civil war* *civl war breaks out* 10,9,8,7,6,5,4,3,2,1,0 *second civil war breaks out* 10,9,8,7,6,5,4,3,2,1,0

I thought this would be esay to find a variable that follows such a simple pattern. But it's been impossible. I've had a friend who mem edits games for fun and he can't figure it out either.

Open ended question but what's going on here? Is the number stored as a different symbol as in string or byte form maybe, and the game's using it's own counting system or something?

Despite important variables like money being completely open to being edited, the game does seem to have some obscurity. There is litterally no human readble strings to be found in the entire memory, for example. My friend said maybe all the text in the game was rasterized (i.e they're images) which is why we can't find any strings whatsoever.

Another point, the protected variable can only be viewed when in-game and when hovering over the protected iccon. Maybe because I'm not hovering over it when in cheat-engine, I can't scan for it. So my first solid question is, how do I leave the in-game cursor hovering over the protected icon so it's displaying the information I want, while I use cheat engine with my real cursor in windows? Is there a windows trick or some sort of softwhere I can use to keep the in-game cursor hovering over something in-game while i click in windows (i.e cheat engine) with my real cursor?

Even that probably won't work though as we can't find strings in game...but however it's displaying strings, the UI must be getting its information from somwhere

Hoping this obscurity is a known-thing and someone knows some further steps I can take.



risk.JPG
 Description:
How to protected icon changes which some sort of variable changes. I thought it would be a simple 32 bit int going under 0 but I guess not. That 36% risk is easy to manipulate to a different int in-game but also proving impossible to find in cheat engine!
 Filesize:  9.99 KB
 Viewed:  9203 Time(s)

risk.JPG



protected.JPG
 Description:
The protected icon, a bowl with fire in it, displaying 1 turn of protection because I'm hovering over it in-game.
 Filesize:  43.3 KB
 Viewed:  9201 Time(s)

protected.JPG


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Mar 28, 2022 10:52 am    Post subject: Re: Rome 2 Total War Can't change 1 variable! Reply with quote

MrMustard wrote:
So my first solid question is, how do I leave the in-game cursor hovering over the protected icon so it's displaying the information I want, while I use cheat engine with my real cursor in windows? Is there a windows trick or some sort of softwhere I can use to keep the in-game cursor hovering over something in-game while i click in windows (i.e cheat engine) with my real cursor?
-Use hotkeys within CE to perform your scans.

Better yet, though, I would use ultimap if scanning is not yielding any viable results.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Mon Mar 28, 2022 11:05 am    Post subject: Reply with quote

Those numbers that count down could just be temporaries and the important values could be mutated less often or never (immediates). e.g.:
Code:
int get_civil_war_protection_start(GameState game) {
  if (game.turns_passed >= 20)
    return 0;
  else
    return 20 - game.turns_passed;
}
Here, that "20... 19... 18..." counter is only ever stored temporally on the stack. You won't find it. The important values are the immediate 20 and the variable `game.turns_passed`.

For that "recent civil war" protection, maybe the game stores the most recent civil war and calculates the "10... 9... 8..." counter in the same way.

Generally, any information relating to time in games has countless different ways it could be encoded in memory. I can't list all of them.
These examples are just to point out that maybe you should change the way you're scanning. e.g. `unchanged value` scans while it's counting down and a `changed value` scan either after war breaks out or after it reaches 0.

Ultimap can also be useful, but only if you know how to read assembly.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Mon Mar 28, 2022 11:53 am    Post subject: Reply with quote

You have great advice already so I want to offer another perspective to approach this from that you are already noticing yourself.

Games often have an onHover/onSelect function that runs when something is hovered or selected. This value is usually easy to find because it uses one static pointer and merely changes the address pointed to to match the hovered or selected entity in the game.

As suggested above, you will want to set hotkeys for new scan, changed, and unchanged.

Hover/select something, new scan.
Hover/select something new, changed.
Hover/select something new, return to last hovered/selected something, unchanged.

If this finds an address then you are in business! Find what instruction writes that address and now you can set up an AA script which performs different actions based on what is hovered or selected.

Once you have these base addresses, you can dissect them for the entity structure and/or find what accesses those addresses to find another function that runs constantly in the background so your script isn't tied to your mouse or interactions.

From there you can see what correlates with those percentages and perhaps edit them yourself.

Good luck!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites