# help to find the adequate formula

2 replies to this topic

### #1rogerdv

Member

• Members
• 99 posts

Posted 08 June 2004 - 02:24 PM

Hi
I need to find a formula to implement the life and mana regeneration process. Life regeneration depends on a primary statistic (constitution) and maybe some external modifier provided by items. Mana regeneration depends on constitution, but also on life level, the more damaged you are, the lower you recover your energy. And of course, on external modifiers. the returned value must be the amount of points to regenerate per minute of game time.
Can somebody suggest me a way to calculate this?

### #2anubis

Senior Member

• Members
• 2225 posts

Posted 08 June 2004 - 02:45 PM

liferegen = hp * (constitution * (1 / maxconstitution))
manaregen = liferegen - (liferegen * (maxhp - hp) / maxhp)

ok, a bit simple but maybe this is enough for you :) you might want to use some kind of interpolation. this way you can adjust how much influence each constitution upgrade has (like take an interpolation that has little influence with low const and increases later on).
If Prolog is the answer, what is the question ?

DevMaster Staff

• Members
• 1057 posts

Posted 10 June 2004 - 10:46 AM

I dont know if you've already checked it out. But if you go to gamefaqs.com and seach for the FAQs dor some RPGs, there is usually a formula FAQ lying around somewhere as well. You can use those to get ideas on how to implement your own formulas. I know for sure that there are Xenogears and Final Fantasy formula faqs. Im sure you can find otheres as well.

#### 1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users