View previous topic :: View next topic |
Author |
Message |
h3x1c Master Cheater
Reputation: 17
Joined: 27 Apr 2013 Posts: 306
|
Posted: Wed Aug 03, 2016 9:44 am Post subject: Is there a specific term for this? |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Aug 03, 2016 6:48 pm Post subject: |
|
|
Process of using bit masking to compress 8 logic true/false flags into a single byte.
/shrug
|
|
Back to top |
|
 |
ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Wed Aug 03, 2016 7:32 pm Post subject: |
|
|
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 |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Wed Aug 03, 2016 8:04 pm Post subject: |
|
|
They're also called boolean values (1 for true, 0 for false).
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Thu Aug 04, 2016 3:15 am Post subject: |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 6:05 am Post subject: |
|
|
A set is an easier way to visual what's going on. His set is: Code: | SkullSet=(Level1Skull, Level2Skull, Level3Skull); |
|
|
Back to top |
|
 |
h3x1c Master Cheater
Reputation: 17
Joined: 27 Apr 2013 Posts: 306
|
Posted: Thu Aug 04, 2016 9:01 am Post subject: |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Aug 04, 2016 10:26 am Post subject: |
|
|
Nope. Not likely to see this in a game, because they're not coded in COBOL or for the mainframe.
Don't waste too many brain cells on that.
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Aug 04, 2016 4:44 pm Post subject: |
|
|
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 |
|
 |
|