OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 25 Jan 2017 12:30 AM |
This thread will be covering the RPG algorithms. Examples provided. Please make sure you have some scripting knowledge, or at least know basic math, before reading.
--------------------------------------------------
What is an RPG algorithm? I like to define it as a mathematical formula that helps create stats and the huge effects it has on the course of action.
Is it important? Yes. Different games all around the world has its own unique algorithm, varying from really simple to, well, Albert Einstein level.
You know when you're playing your favorite game, oh you know, Pokemon, and you always wonder, "hmm, if my tackle dealt half Zigzagoon's HP, it should kill it once more" and somehow it ends up with 1 hp and uses tackle on you, critical hits and you die. Ah... good ole' days.
Anyways, you always wonder how it works. How does the attack vary for each pokemon? Why does the damage say "120" but it doesn't really deal 120? Well, Pokemon has it's own algorithms, from damage, to catch rate. The damage formula looks something like this (totally did not search "Pokemon Damage Formula"): local Damage = ((2 * Level + 10) / 250 * (Attack / Defense) * Base + 2) * Modifier
I will not go in-depth on how this formula works, but I will teach you on how it works and what you will need to look out for.
--------------------------------------------------
Note: Below are EXAMPLES. Do not use them for real work. Remember that making a formula is NOT EASY. Why? If you make a formula that seems perfect, you need to adjust every other formula accordingly to match it. You don't want your game to be really difficult at the start, like getting 1 hit KO'ed by a slime and somehow 1 hit KO'ing bosses later on. Trust me, I know from experience.
These are the things I keep in mind when making these algorithms: How fast should the pace go? Will this work for all scenarios? Will this be unfair against x? How should buffs/debuffs work? How long will it take to level up? etc.
This may not apply to all of us. This will have infinite amounts of trials and errors.
Let's jump on to experience. Now, a "basic" experience will look something like this (A slight change with the exponential value can change EVERYTHING. I mean it. It will change the average play time drastically.): local Experience = 10 * (Level ^ 2)
Converting that into a data table (Search "Desmos Graphing Calculator", it works wonders): Level 1 = 10 EXP Level 10 = 1,000 EXP Level 50 = 25,000 EXP Level 1.0.0 == 100K EXP (was filtered, had to change)
According to our data table here, it seems that we need to adjust our enemy EXP accordingly depending on the average level range when being first encountered.
This is an example of a "difficult" level up system (my opinion) because in 10 levels, you will need 100x more exp you need than when you first started playing. Lowering down the exponential value should do it (if necessary).
With this, you have to tie this directly to the enemy exp rate. Here's an example: local DropEXP = (Level ^ 1.3) * 3
Converting that into a data table: Level 1 Enemy = 3 EXP Level 10 Enemy ~= 60 EXP Level 50 Enemy ~= 485 EXP Level 100 Enemy ~= 1,194 EXP
Now let's imagine we are level 9, farming level 10 enemies to level up. With these 2 algorithms, it will take us ~= 17 enemies to level up.
Now this is where the "keep this in mind" comes in: For any normal RPG game: 17 enemies ~= 20 minutes of farming (considering you're level 9 with low tier equipment)
If you're satisfied with this, move on to the mid ranges.
Imagine you're level 49, trying to get to 50. It will take us ~= 52 enemies to level up.
"Woah woah woah, did I just read 52? Isn't that, well, too easy to level up then?" You are absolutely correct. This is where you need to adjust the formula and repeat the whole process.
--------------------------------------------------
What I just showed you above is basic, yet time consuming and difficult, an EXAMPLE of what you'll be running into when making formulas.
I will not be covering advanced formulas, such as defense, luck, damage, and all that because it varies depending on the game developer. If you wanna see those, consider checking the link below.
--------------------------------------------------
Thanks for reading. This took me ~ 40 minutes to write (:
--------------------------------------------------
Based off a reference made by Ryuzoji: https://forum.roblox.com/Forum/ShowPost.aspx?PostID=193511484 |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|
|
| 25 Jan 2017 11:19 AM |
40 mins! Round of applause for ye
Want to be supported by developers in a positive atmosphere? Then join Studio BSD: https://www.roblox.com/My/Groups.aspx?gid=1013064 |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|
|
| 26 Jan 2017 03:42 PM |
Nice! Also, I think this applies to more than just RPGs. Knowing how to do these kind of formulas can be vital to your success in making a good game of almost any genre. I could even see how this type of formula could be used in a horror game. Those 40 minutes were well spent!
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 04:01 PM |
| True, thanks for the feedback (: |
|
|
| Report Abuse |
|
|
| |
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:05 PM |
| Currently not accepting helps in game developing right now. Sorry. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2017 06:56 PM |
| here is a formula that I use a lot CurrentSpeed-((CurrentSpeed-MaxSpeed)/MaxAgility)*CurrentAgility It changes it so that whenever the max level for a stat changes so will the rate at which the other stat changes(In this case speed) Example in which I use ############################# |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 07:13 PM |
| Filtered, but thanks for sharing your formula :) |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|
|
| 30 Jan 2017 03:47 PM |
BTW, I found out that ROBLOX uses this type of equation for physics:
Friction: CoefficientOfFriction = PartAFriction * PartAFrictionWeight + PartBFriction * PartBFrictionWeight / (PartAFrictionWeight + PartBFrictionWeight)
Elasticity: Elasticity = PartAElasticity * PartAElasticityWeight + PartBElasticity * PartBElasticityWeight / (PartAElasticityWeight + PartBElasticityWeight)
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 30 Jan 2017 03:55 PM |
Nice job (:
Where did you find that at lol |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2017 07:58 PM |
The ROBLOX wiki: http://wiki.roblox.com/index.php?title=API:PhysicalProperties
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|