# Designing RPG formulas (stat growth, damage, etc)

25 replies to this topic

### #21 Sinaz

Sinaz

MCP Killer

• Retired Staff
• 2751 posts
• Version:GM8

Posted 25 October 2011 - 06:53 PM

So can you describe an algorithm to populate a look up table with a Gaussian distribution-- in a hypothetical designed however best would illustrate the process? I thirst for knowledge!
• 0

### #22 xshortguy

xshortguy

GMC Member

• Global Moderators
• 4186 posts
• Version:GM:Studio

Posted 26 October 2011 - 01:30 AM

You can simply use the function for the gauss script:

$f(t) = \displaystyle \frac{1}{\sigma \sqrt{2 \pi}} \exp{ \Big(-\frac{1}{2 \sigma^2} (t - \mu)^2 \Big) }$

If you wanted to compute the cumulative Gaussian function, you can use the definition of the integral:
Spoiler

• 0

### #23 Yal

Yal

Gun Princess

• Global Moderators
• 5837 posts
• Version:GM8.1

Posted 28 October 2011 - 02:40 PM

If you have access to something like MATLAB, you could also compute a bunch of (x,y) pairs for the function, then least-square-adapt some cheaper function (e.g. a Ax^2 + Bx + C polynomial or a half-period sine wave segment) that runs trough these pairs. That could be used for other functions that won't benefit that much from a look-up table (e.g. lots of interpolation between table values would happen since the input is full of "fractional-part bias") and that still has to be called a lot.

If you're interested, I could give you some MATLAB code we've used for school assignments for doing just that.
• 0

### #24 TheouAegis

TheouAegis

GMC Member

• GMC Member
• 4714 posts
• Version:GM8

Posted 11 November 2011 - 02:52 AM

If you ever decide all this is too much to work out, you can always try the Shining Force method. Shining Force went with what was asked about earlier, where every 100 XP levels you up. The system had its pros and cons, based on how it was designed (some of the flaws remained throughout the entire series). The experience you gained from killing enemies was based on the level difference. It was a pretty predictable pattern too. Missing gained you 1 XP. Hitting gained you some amount based on something like 25*(1-(enemy_level-my_level)/enemy_level). Killing an enemy doubled that. AOE spells could potentially level a mage up very quickly, since the exp was additive. You also gained experience somewhat randomly (but with specific seeds) for casting spells and the effectiveness of the spell. For example, healing an ally for 8 HP granted you 1 to 5 XP, let's say, but healing an ally for 15 HP (the cap for Heal 1) granted you 10 XP, and fully healing an ally for 14 or 15 HP granted you 15 XP. This had a serious flaw that could easily be exploited in Shining Force II whereby a healer with the Boost spell could cast Boost on the party for up to 50 XP per cast since it's an AOE at level 2 or 3 (I forgot). One of the heroes in SF2 had the spell Aura, which was horribly bugged, since casting it at level 3 could grant 50 XP easily. Spamming these two skills resulted in an instant level up. Then you recall out of the battle and then go back and do it over again. With patience, you could easily get your monk up to level 99 and solo the final boss.

Anyway, the game mechanics were balanced out in some way by assigning each hero (there were many) set stats for level 99 (kinda like Pokemon) and then various stats would be raised as the hero gained levels. There could be 15 or 16 heroes in a battle all vying for XP from a limited number of enemies. This in turn helped keep levels low (the final boss fight would probably be at level 36 or so on average, I think). Considering only healers could easily reach level 99, it wasn't worthwhile to have one hero try to kill off all the enemies, since that would make each hero weaker. For a real challenge, you can try beating the game without recalling from any battles.

I personally like those mechanics better than what most RPGs do these days.
• 0

### #25 Melle1

Melle1

GMC Member

• GMC Member
• 224 posts
• Version:GM8

Posted 12 November 2011 - 04:38 AM

Sorry, I neglected to post the actual open source file, here is the link.

The file has a working battle room, a Base HP for ally and enemy. An increase from spamming a move. But I do not know how to KO myself or OPPONENT, for gold or dropped items. Feel free to rip the formulas from the code. To actually fight, there will be a one digit number above Your HP, 0 is Neutral Attack, and 1 is Fire Buster.

I'm sure there might be a glitch or two, but here's something you can use.

HERE's my input for the topic related issues. I assume you are looking for an example curve to distribute exp and level caps. But if I were you i'd just use a MAX EXP amount, based on the Max level.
• 0

### #26 Yal

Yal

Gun Princess

• Global Moderators
• 5837 posts
• Version:GM8.1

Posted 15 November 2011 - 11:01 AM

...But I do not know how to KO myself or OPPONENT, for gold or dropped items. Feel free to rip the formulas from the code...

...I assume you are looking for an example curve to distribute exp and level caps...

I assume you made that assumption without reading my post, or at least without understanding it.

You also gained experience somewhat randomly (but with specific seeds) for casting spells and the effectiveness of the spell. For example, healing an ally for 8 HP granted you 1 to 5 XP, let's say, but healing an ally for 15 HP (the cap for Heal 1) granted you 10 XP, and fully healing an ally for 14 or 15 HP granted you 15 XP.

That's an interesting game design issue: you get XP for killing enemies, but there's a limited supply of enemies that will eventually run out. You also get XP for healing your allies, and they will never run out, so the only character that can get an infinite amount of XP is the healer.

The obvious way to limit that, of course, would be to limit the MP the healer has; for instance, making MP impossible to recover - the starting MP the healer gets is all MP he'll get for the duration of the entire game. But I guess most player wouldn't like that approach...
• 0

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

0 members, 0 guests, 0 anonymous users