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 


Is there a specific term for this?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
h3x1c
Master Cheater
Reputation: 17

Joined: 27 Apr 2013
Posts: 306

PostPosted: Wed Aug 03, 2016 9:44 am    Post subject: Is there a specific term for this? Reply with quote

I ran across an interesting value in a game that uses the 1 bits from a nibble to indicate an item!

For example, 1111 would show 4 of an item on the screen, where 0011 would show 2. Consequently, 1001 also shows 2, as does 1010, 0101, and so forth, the same being the case for any number displayed on the screen from 1-4 based on any given nibble.

With that said, the game never writes bits like that because of the control flow of the bitwise instructions (in other words, you'll always have the nibble look like this as you gain items: 0001 for 1, 0011 for 2, 0111 for 3, 1111 for 4).

So, each byte at a max value of FF equals 8 items. Kind of interesting and I've never seen it before. Bit masking is what I think it falls under, but I didn't know if there was something else to describe this particular scenario. Thanks!

_________________
Back to top
View user's profile Send private message Visit poster's website
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Aug 03, 2016 6:48 pm    Post subject: Reply with quote

Process of using bit masking to compress 8 logic true/false flags into a single byte.
/shrug
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Wed Aug 03, 2016 7:32 pm    Post subject: Reply with quote

It's often used in memory scanners as bit masking is an effective way to save results (ie variables that passed all scans) within a memory block.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Aug 03, 2016 8:04 pm    Post subject: Reply with quote

They're also called boolean values (1 for true, 0 for false). Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Thu Aug 04, 2016 3:15 am    Post subject: Reply with quote

could also be a set

e. g pascal (omg who uses that?) tends to store sets into a single byte if possible
Code:
 
type
  TApple=(GreenApple, RedApple, YellowApple, BlueApple);
  TAppleSet=set of TApple;

var Apples:TAppleSet;
...
Apples:=[GreenApple, YellowApple];

Apples would then be encoded as 0101

and after this:
Code:

Apples:=Apples+[BlueApple];

it'd be 1101

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 6:05 am    Post subject: Reply with quote

A set is an easier way to visual what's going on. His set is:
Code:
SkullSet=(Level1Skull, Level2Skull, Level3Skull);
Back to top
View user's profile Send private message
h3x1c
Master Cheater
Reputation: 17

Joined: 27 Apr 2013
Posts: 306

PostPosted: Thu Aug 04, 2016 9:01 am    Post subject: Reply with quote

Great feedback from all of you with this. Thank you!

I've been trying to research outdated/alternate methods of storing information after running across this. Just ran into packed-decimal format and have been reading through this wonderful explanation of it.

Have any of you ran into games with values stored like that yet?

_________________
Back to top
View user's profile Send private message Visit poster's website
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Aug 04, 2016 10:26 am    Post subject: Reply with quote

Nope. Not likely to see this in a game, because they're not coded in COBOL or for the mainframe. Smile
Don't waste too many brain cells on that.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Aug 04, 2016 4:44 pm    Post subject: Reply with quote

Metro: Last Light also uses this data type for number of syringes.

"Population count" ("Hamming weight") - 5 set bits means 5, 4 set bits (doesn't matter which one) means 4, and so on.

I also wrote custom type some time ago:
http://forum.cheatengine.org/viewtopic.php?t=565981

PS: this custom type can be used to find some game Boolean variables.

 

_________________
Back to top
View user's profile Send private message MSN Messenger
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