View Single Post
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 12-24-2017 , 14:14   Re: [ H3LP ] Entity members
Reply With Quote #4

Quote:
Originally Posted by CrazY. View Post
Basically this is a "hack" method, I was thinking of something like bit-fields, but even so, it was worth the try.
Basically this is what you have to use and there is no better solution. Using array of 2056 cells is painful. (Thats 8 kB of memory )

Bit-fields can only be used to store several boolean values (8) in a single byte. So you can't just store float numbers such as 100.0 in one bit. Also a variable can store up to 32 values (4 bytes * 8 bits = 32 boolean values) and that's the reason why often can be seen, bit-flags to be used for players instead of array of 32 cells.

Last edited by KiLLeR.; 12-24-2017 at 14:28.
KiLLeR. is offline