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

Discuss text adventures here! The classics like those from Infocom, Magnetic Scrolls, Adventure International and Level 9 and the ones we're making today.

Moderators: Ice Cream Jonsey, AArdvark

User avatar
The Happiness Engine
Posts: 497
Joined: Thu Aug 02, 2012 4:16 pm

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

Post 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.

User avatar
Ice Cream Jonsey
Posts: 21871
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado

Post 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.
the dark and gritty...Ice Cream Jonsey!

Post Reply