[DiscordArchive] oh wow it's for retail?
[DiscordArchive] oh wow it's for retail?
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:17:17.439000+00:00
Original source
the bitmask itself can range from 0 to 255, but it only handles 8 unique professions. The remaining 248 possible values are for every combination possible of those 8 professions.
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:19:08.245000+00:00
Original source
a 32-bit mask will have values from 0 to 4294967295, but that entire range of numbers just covers every possible combination of the 32 bits - in our case, phases
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:20:06.496000+00:00
Original source
the bit values are just 2^X-1 where X is the position (unless you start counting at 0 like a nerd, then just 2^X)
Archived author: Barnes • Posted: 2023-08-17T03:20:54.901000+00:00
Original source
so 1s across the board would allow someone to do all professions which would be 255
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:21:07.101000+00:00
Original source
so the 16th unique phase is 2^(16-1) = 32768
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:21:11.447000+00:00
Original source
correct
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:23:25.777000+00:00
Original source
and then you can do binary comparisons to answer questions like "does your bitmask contain leatherworking? Does it contain skinning AND leatherworking? Does it contain skinning OR leatherworking? Does it contain skinning and NOT leatherworking? Does it contain skinning OR leatherworking but not both?"
Archived author: Visk • Posted: 2023-08-17T03:24:06.123000+00:00
Original source
I just want to say, you guys are next level with this knowledge!
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:25:04.764000+00:00
Original source
bitmasks are very efficient because you can pack a lot of meaning into one of the smaller pieces of data (a single byte, in the above case)
Archived author: Vale the Violet Mote • Posted: 2023-08-17T03:25:49.821000+00:00
Original source
and they're very fast for a computer to work with, calling back to the just-mentioned binary comparisons