MaxOhn / rosu-pp

PP and star calculation for all osu! gamemodes
MIT License
79 stars 40 forks source link

mods #27

Closed 0120-500-500 closed 10 months ago

0120-500-500 commented 10 months ago

I'm not sure about the numbers when specifying mods. HD=8 HR=16 DT=64 I understand up to this point, but but I don't understand the rest. I looked around for about an hour and could not find it (maybe because I don't understand English very well). I would be very grateful if you could help me.

MaxOhn commented 10 months ago

The legacy way of specifying mods in osu! is via "bitflags". Essentially, you can image mods as 32 bits, each one is either 0 or 1. Each mod is assigned a specific position in those 32 bits. NoFail has the 1st position, Hidden has the 4th, and FL is 11th so when representing the mods NFHDFL as bits, it would look like

10000001001
|      |  |
FL     HD NF

If we now translate the binary number 10000001001 to a decimal number, we get 1024 + 8 + 1 = 1033 for NFHDFL. You can find a full list of mods and their decimal values here.

0120-500-500 commented 10 months ago

Thank you very much.