ICJ's so-old-I-can't-find-it-anywhere XP question.

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: ICJ's so-old-I-can't-find-it-anywhere XP question.

by Ice Cream Jonsey » Fri Jul 25, 2014 7:30 am

I don't think I ever updated the original thread. The poster by the name of Nitku wrote some code to help me use larger ints -- three ints working together for the 000,000,000 fields and such.

Yeah, what you suggest is how I would tackle it and I love the progress bar. Since I was generating all the XP values for monsters on the fly I was worried about something blowing past the 32,000 limit and just not catching it in betatest (so killing one monster gets you a level) but I think we're good now.

I'll try to paste the code he wrote.

ICJ's so-old-I-can't-find-it-anywhere XP question.

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.

Top