A way to avoid memory loss

At the moment I have a system where I write the state of the gamepad into the structure and save it in the list of states for recording the input during the video game. The full state of the pad is 192 bits per frame, but it's a bit wasteful. For example, if the analog triggers on the pad are not pressed, they still take 32 bits up, each in storage. Therefore, I obviously want to save some space.

I tried to set this value to NULL, but it does not seem to affect the size of the binary that the system saves at the end of the match.

What alternatives are available in a situation where you only need to write or save certain values, but maintain the integrity of the data structure?

EDIT:

I think I found a solution ;. I used to try to set the values ​​to NULL by overriding the standard float with System.Nullable in the structure. My idea is that setting this to NULL in the structure will serialize a lot less. My impression is that NULL is written as 4 bits. Perhaps it is possible. Anyway, the code I had before had a pretty obvious error, so I came back and fixed it again. Now I get much smaller repetitions, and the accuracy seems to be just as good, so I'm going to assume that cheating NULL is doing something right.

+5
source share
4 answers

This is what you do.

-, , . , , - - , , .

, - 3 . /. , 3 + . , , , - ( ) . , .

, , , .

+1

, . , .

( ) (WHAT 3xough):

8 , . 1, ( ) , .. .

+2

/ .

, .

+1

? .

, .

1 1 .

0

All Articles