by The Happiness Engine » Thu Jul 24, 2014 5:55 pm
Remember that one time you asked for ideas about how to scale XP for your new game with only an int field to hold it and I suggested this really irritating exponential function idea?
I had a new idea: Use a 2nd int as a sub-xp field.
One implementation: You have your int var called level and it displays on your screen as "Level: 30" or what have you. You have another int called progress and it can just draw a % bar. Monsters are worth a fixed XP. That XP fills the progress bar, and when it hits "eh" you level. You now have up to int^2 to scale your game with. You could stack this idea if you were insane.
Back to my fetish for hard scaling math: "progress" is probably less than maxint, and when you fill it level times you advance, so 1st level you need X. 2nd level requires 2X, etc. You'd need a 3rd int to track that with I think, unless you can do really fancy things with bitfields.
Remember that one time you asked for ideas about how to scale XP for your new game with only an int field to hold it and I suggested this really irritating exponential function idea?
[b][i]I had a new idea[/i][/b]: Use a 2nd int as a sub-xp field.
One implementation: You have your int var called level and it displays on your screen as "Level: 30" or what have you. You have another int called progress and it can just draw a % bar. Monsters are worth a fixed XP. That XP fills the progress bar, and when it hits "eh" you level. You now have up to int^2 to scale your game with. You could stack this idea if you were insane.
Back to my fetish for hard scaling math: "progress" is probably less than maxint, and when you fill it level times you advance, so 1st level you need X. 2nd level requires 2X, etc. You'd need a 3rd int to track that with I think, unless you can do really fancy things with bitfields.