The "How do stats increase at level up?" formula not working

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
Chronoboy
Slime Knight
Posts: 281
Joined: Tue Nov 30, 2010 6:01 am
Location: Canada

The "How do stats increase at level up?" formula n

Post by Chronoboy »

The formula on the wiki:
http://rpg.hamsterrepublic.com/ohrrpgce ... evel_up%3F
Doesn't seem to be working for me, here's my Python code I'm using to attempt to figure out a stats on a specific level:

Code: Select all

$ python -c "import math; level, a0, a99 = 5, 0, 1000; print math.floor((.8 + level / 50) * level * ((a99 - a0) / 275.222) + a0 + .1 )"
14.0
According to the wiki, at level 5, it should be 16. It seems to break at level 2, where I get 5 and it should be 6, now if I run this:

Code: Select all

$ python -c "import math; level, a0, a99 = 99, 0, 1000; print math.floor((.8 + level / 50) * level * ((a99 - a0) / 275.222) + a0 + .1 )"
647.0
I got 647, but at level 99, it should be 1000!! Can someone update the wiki with the correct formula. It makes it really difficult to plan out proper battle formations and enemies when I can't figure out how powerful I player should be to enter a specific area. Doesn't CUSTOM have an option to display what the stats will be at a specific level depending on what's entered in the Hero stats screen?

I don't mean to complain so much, but I really want to release this game with proper hero stats(or save games will break if I update it in the future).
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

I don't know, the formula seems to work fine for me when calculating stats. Would it help if I sent a copy of the spreadsheet that I use for calculating enemies and hero stats?
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

yeah, the stat growth thing is jacked up. If you start a hero at a level higher than 0 it'll have screwed up stats. I had level 40 characters starting out with level 2-3 (maybe 4) stats.
This is very problematic.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

This had me puzzled for a moment. I even went into a test rpg file and levelled up a hero a whole bunch using the CTRL+F5 debug key to make sure the numbers are correct.

The chart in that article is correct, and the formula is also correct.

However, the formula is pseudocode, not python. Take a look at this operation:

Code: Select all

level / 50

Code: Select all

james@rhinoctopus:~/src/misc$ python2.7
Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 5 / 50
0

Code: Select all

james@rhinoctopus:~/src/misc$ python3
Python 3.2.3 (default, Oct 19 2012, 20:13:42) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 5 / 50
0.1
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Meowskivich wrote:yeah, the stat growth thing is jacked up. If you start a hero at a level higher than 0 it'll have screwed up stats. I had level 40 characters starting out with level 2-3 (maybe 4) stats.
This is very problematic.
That sounds like a bug! Have you mentioned this before? Do you have a test-case I can see?
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

I've had this problem in the past, I'm pretty sure I've brought it up before.
It's likely in the Merciful Mungbeans thread.

I'll look for it real quick.

edit: (herp removed)

About halfway into the 4th page.

super edit: BZRT! wrong quote

hopefully final edit:
Pastskivich wrote:Gradual posts: tonight I'll post small update bits.

First: For some reason, this metal monster thing I'm trying to do up is the opposite a problem of what I had before.
What happened before was that exploiting the metal monster weakness of bludgeoning attacks would be too overpowered, so I had to actually make it do less damage.
Now, I'm guessing perhaps a change in damage calculations?, I can't make it powerful enough to do more than 1 damage. I'm currently on the case, I'll let you know with a second post if I succeed or go on to something else.

second and final for the night: Okay, metal monster problem, still not solved. I think I may have a solution. I'll try it out tomorrow.
Now new issues. There was an item I was gonna make that you would be harmed by healing skills and items, though you're immune to status ailments. Since I couldn't make healing hurt you, I just made you immune to healing skills.
Now. here's something really wacky. What's up with hero stat calculations?

Here's my history with it. At first I had it set up where you get 1 to 3 points in a stat per level (depending on character), but when added to the party, they're added at level 40, but they have the stats of a freakin' level 1 or 2.
Here's how it is now! I then changed "level 0" stats as to being level 40 stats, but now the characters are starting with max stats?! WHAT THE HECK! MAKE UP YOUR MIND OHRRPGCE!

seriously though, jimmy, if you're reading this, you may wanna fix this madness. or at least give a calculator so I can figure out how to manipulate the thing so I can make the stats how it's supposed to be. I want the maximum attack power to be an achievement, not automatically obtained.

super edit: turns out I derped on the stats thing, I had 20 attack on the starter weapon which is supposed to have 5 attack. Still, this needs to be fixed for starting stats, I hate having my characters slightly more powerful than I intend them to be.

omega edit: or in the other case, have them so unreasonably lower than what it should have ever been.
That was weird, well, here this is.
Last edited by Meowskivich on Thu May 02, 2013 3:23 pm, edited 3 times in total.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

How were the heroes being added to your party at level 40? Was it from a text box? from a shop/hire? From a plotscript?
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

textbox
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I just tested this out, and I am not able to reproduce any problems.

I added an NPC to the world map in a test copy of Wandering Hamster, and had it show a text box that added an extra copy of Dusty to the team. I gave Dusty 0 mp at level 0 and 1000 mp at level 99, and then tested various values for his base level. Dusty was always added with the correct stats for his base level.
super edit: turns out I derped on the stats thing, I had 20 attack on the starter weapon which is supposed to have 5 attack. Still, this needs to be fixed for starting stats, I hate having my characters slightly more powerful than I intend them to be.
Is it possible that the stat modification from the default weapon was the only problem? Are you still able to reproduce any problems in your current copy of Merciful Mungbeans?
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

I'll try to make it reproduced in a little bit, I've "fixed" it by setting level 0 stats to being level 40 stats, so they're slightly more powerful than I want them to be, but it gets the job done.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
Chronoboy
Slime Knight
Posts: 281
Joined: Tue Nov 30, 2010 6:01 am
Location: Canada

Post by Chronoboy »

Bob the Hamster wrote:This had me puzzled for a moment. I even went into a test rpg file and levelled up a hero a whole bunch using the CTRL+F5 debug key to make sure the numbers are correct.

The chart in that article is correct, and the formula is also correct.

However, the formula is pseudocode, not python. Take a look at this operation:

Code: Select all

level / 50

Code: Select all

james@rhinoctopus:~/src/misc$ python2.7
Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 5 / 50
0
And I am using Python 2.6.6(Blame Debian's slow release cycle). Thanks!

Here is a working version for those who are stick with Python <3 like mois:

Code: Select all

$ python -c "from __future__ import division; import math; level, a0, a99 = 5, 0, 1000; print math.floor&#40;&#40;.8 + level / 50&#41; * level * &#40;&#40;a99 - a0&#41; / 275.222&#41; + a0 + .1 &#41;"
16.0
Wonderful!
Last edited by Chronoboy on Fri May 03, 2013 12:17 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

The simple solution is to divide by 50.0 instead of 50.
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

I feel special being able to sorta understand that python. Ask me a year ago and I wouldn't understand a lick of it.
And what would be the non-simple way, tmc?
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Well as opposed to the way Chronoboy fixed it with "from __future__ import division", which causes division to behave in the Python 3 way, always doing floating point division even on integers.
Chronoboy
Slime Knight
Posts: 281
Joined: Tue Nov 30, 2010 6:01 am
Location: Canada

Post by Chronoboy »

TMC wrote:The simple solution is to divide by 50.0 instead of 50.
Thanks TMC, that's great to know. I use Python normally for web development and the odd script, not for math problems. I wasn't sure how to force the float type over int. It's good to know Pytnon 3 favors float over int though.
Post Reply