Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Some Curve Generator or Algorhythms for the same purpose

I wonder if any of you know anything about implementing curve generators for your games, I'm trying to do it for Gosu right now and maybe some script for RMXP, but I haven't found something that could lend me a hand on how to find an useful curve generator or some basic algorhythms or anything the like.

If you know of anything that might help me with this, please feel free to post your ideas or algorhythms or anything else.
 

Zeriab

Sponsor

A first would be to draw the curves as examples and show it here.
The process of drawing and explaining the structure of the curves may give you ideas on how to move further on.
It will at least give you deeper insight

*hugs*
- Zeriab
 
I'm sorry but I don't think so, I need to at least understand or get some algorhythms so I can code it for any purpose I might have in mind but drawing them is like trying to write a HTML webpage on a notebook made of paper and wait until it gets executed by itself, which would never happen. If no one can or will help me at least a bit, it's OK, I won't get mad at anyone, but I'm not expecting to read more simple, straight answers that never let me play with something more substantial concerning coding / scripting.
 

Zeriab

Sponsor

kyonides":17ftnyho said:
I'm sorry but I don't think so, I need to at least understand or get some algorhythms so I can code it for (...)

That is exactly the reason for my suggestion ^_^
I had hoped you would have done it and posted the results and your thoughts about the results. I would have gone on from there together with you.
I will not give you a solution and it's cool if you don't want to go the other way.

You can try to play with some polynomials putting logarithms in and whatnot trying to a formula which gives you a nice curve.

*hugs*
 
yeah if you try playing with some parameters of a polynomial expression, you should be able to generate some nice curves:

result = ax² + bx + c,
where x could be the current level,
a, b and c would be different value, affecting the curve, they can be negative if you wish.
result = c if x == 0

there you can try different expressions, and see the graphic result :)
http://rechneronline.de/function-graphs/
 
Mmm, I didn't know about that website, it's better than drawing the curves by hand. Thanks for the link.

BTW I forgot I could also use excel or calc for the same purpose...
 
Bézier curves can be really nice for generating parameters curves. I have worked with them for simulating RMXP/VX "Generate Curve" dialog, that includes the growth speed, and the result is almost identical.

Check method "def ButtonAcceptClick(sender, e)" in this file: http://rmvxpeditor.svn.sourceforge.net/ ... iew=markup
That will generate a curve based on 3 points (The second point Y must be between first and third one).

And check method "def ButtonAcceptClick(sender, e)" in this file too: http://rmvxpeditor.svn.sourceforge.net/ ... iew=markup
This one does almost the same, but works like rmxp "Generate Curve" dialog.

Both codes are with comments, so it shouldn't be hard to understand. I recommend you anyways to read something about bezier curves in wiki or somewhere.

Hope this helps you :)

Edit: D'Oh!... Necroposting :/ I'm sorry, realized too late....
 
You know, I have the actual RMXP parameter curve generator algorithm sitting in an old backup. I just dug it up for this case, since nobody else seems to have ever figured it out. This is taken directly from a .txt file that I've had archived for a couple of years now:

eq1 = (((maxlevel-minlevel)/2)^2)

eq2 = ((((((maxstat-minstat)/2)*((maxlevel-minlevel)/2))-((maxlevel-minlevel)/2))/(maxlevel-minlevel))*(-1*z))

eq3 = ((((maxstat-minstat)/2)*((maxlevel-minlevel)/2))+(((((maxstat-minstat)/2)*((maxlevel-minlevel)/2))+(((maxstat-minstat)/2))-((maxlevel+minlevel)/2))*z))

eq4 = ((((minstat*(maxlevel-minlevel))-(maxstat+minstat))/2)+minstat)*((maxlevel-minlevel)/2)+(((((maxstat-minstat)/2)*((maxlevel-minlevel)/2))+(minstat*2)+(maxlevel+minlevel)+((maxlevel+minlevel)/2))*(-1*z))

((((((minstat*(maxlevel-minlevel))-(maxstat+minstat))/2)+minstat)*((99-1)/2))+((((7467-741)/2)*((99-1)/2))+((741*2)+(99+1)+((99+1)/2))*z))

x = current level
z = multiplier (-1 to 1)

y = (eq2/eq1)x^2 + (eq3/eq1)x + (eq4/eq1)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top