ID:155956
 
I looked for a resource but can't find one, i tried to make on myself but failed. I want to make a level system where you level up and can level up by fighting, aswell as a combat system.

Thank You,
Atriosv6
By fighting, you mean killing, right?
In response to Gtgoku55
yeah like attack.
In response to Atriosv6
Never really tried it out myself. Gonna go add it in than I'll come back for you. (If I can get it working.)
In response to Gtgoku55
Thank you really appreciated
I solved the problem. I'm proud of myself. Didn't comment on it, though. Just tell me if you need it to be commented on. EDIT: Remember to add the vars

mob
proc
DeathCheck() //check to see if an attack is deadly
if (Health<=0) //if the defender's HP is low enough...
world << "[src] dies!" //give the death messaging
Isdead=1
del src

Del()
var/obj/gold/G = new(loc) //create a new obj from the gold blueprint
G.amount = rand(1,100) //set its amount variable randomly
src.exp+=456
..() //call the parent

mob
proc
DeathExp()
if (Isdead<=1)
src.exp+=1000

proc
lvlcheck()
if(src.exp >=usr.expn)
src.Level +=1
src.exp = 0
src.expn = usr.expn * 2
In response to Gtgoku55
About as basic as it comes, but it works just fine. Unfortunately the reason i believe a lot of RPG's on Byond don't do as well as hoped, is because the creators use very simple, linear, and often random functions in their mechanics. Some coders just put down the first number that comes to their minds.

An example is say you're building a gold drop system, your average mediocre coder might just put "rand(10,100)" Okay...that's nice and all, If you're building a game to be played a the same level forever...

What i do is i use several variables from the slain mob. Let's make an example.

Monster #1

Atk: 7
Def: 5
Agi: 6
Int: 3
Vit: 4

Now this may seem random, but here's how i came up with the stats for this mob. I chose a difficulty for the mob, between 20 and 40. 20 being an easy mob, 40 being a hard mob of the same level. I used this number to divvy up the stat points between all of the stats, and if you count, i chose a difficulty of 20 for this mob. Not how would one calculate HP for something like this? I myself would use a formula like this:

HP = ((((def + vit) - Agi) + |Atk - Int|) + level) * 5

Now you just saw this an shat in your britches. Why would i use something this random, well let's plug in to find the result:

HP = ((((5 + 4) - 6) + |7 - 3|) + 1) * 5

This looks very scary, but here's my logic, which is needed for ANY mechanic you'll ever create, a little common sense. The Def and Vit increase HP, now faster opponents (High AGI) would have lower HP, because not being able to hit something as often AND it not dying any faster is a combination that makes for frustrated players! Now the ATK and INT are used mostly for attacks, so i used an absolute value after getting the difference, that was if one stat is way higher than the other, they have a few more HP to cover that open end with, unlike a balanced ATK and INT, that can attack well at close AND long range, should have less HP. Do you get it? Let's solve this and see our product!

HP = (((9 - 6) + |7 - 3|) + 1) * 5
HP = ((3 + |7 - 3|) + 1) * 5
HP = ((3 + 4) + 1) * 5
HP = (7 + 1) * 5
HP = 8 * 5
HP = 40

So this mobs HP equal 40, now i know what you're screaming at me now, "WHAT DOES THE "* 5" DO THERE?!" That's simple. This number is probably more Balanced at 10, but 5 is fine for now. It's the approx. number of hits that an average player of the mobs level should take to kill it. So this, ON AVERAGE, would take about 5 hits to kill, with a player dealing on average of 8 points of damage every attack. I say 10 now, because the higher levels your players get, the faster they can kill, now once you reach a certain level, you can use a piece wise function to constantly increase the algorithm, as such, let's let that 5 be a variable named "Hits":
(if monster.level <= 10)
Hits = 5
(if monster.level >= 10 && < 20)
Hits = 7
(if monster.level >= 20 && < 30)
Hits = 10
(if monster.level == 30)
Hits = 15


In this case, say the mobs level is 25, and the difficulty was 30, an average level 25 Mob. So the mob is a Stone Guard, so mainly melee based, high defense and vit, low agi and int.

Stone Guard

Atk: 10
Def: 7
Agi: 3
Int: 2
Vit: 8

HP = ((((7+8)-3)+|10-2|)+25)*10

The product of this is:

HP = 450

Pretty cool huh? Now you can scale this up to something near WoW scaling, well into the 10's of thousands if you want, these are just some arbitrary examples to get my point across.

I'll let you use your imagination to create a custom and variable gold drop system from here. Sorry for posting something so in depth, but i believe it necessary to get my full point across. And i'm also sorry i didn't post a death and level up example, i realize this was sort of off topic, but trust me, without this, your Leveling and death mechanics are useless. If you were helped at all by this, even in the slightest little bit, i know i did my job to help new coders become great coders.

- Lily S. Deliroso
In response to DarkLily762
Hmm, mines was meant to be simple, btw.
In response to Gtgoku55
I know, and sorry if it seemed like I was trying to outshine you, that wasn't the intent i had. I'm just simply tired of RPG's game mechanics being so ridiculously unbalanced with each other, that the whole game is ruined, I rarely play RPG's on byond anymore because i hate running into PoS first timer's trying to make a mark, games. I'm a personal believer in newbs getting a chance to show off their skills and all, but if we had a different section for first timers to post games like that, so others can give constructive criticism, that would keep them from constantly hosting stuff no one wants to join on their own free will. They get better, learn new tricks, and we get to see into the imaginations of who might be replacing the next generation of programmers. I try to be positive with everyone :D

PS. if my message seems a little mixed, i just wanna help the most i can, no matter the skill level.

-Lily S. Deliroso
In response to DarkLily762
Well, good luck with helping out. I just figured out that I had the ability to make a complete leveling system like that, regardless of how basic it is.
In response to Gtgoku55
I never once complained about how your system worked, It's probably best if he starts off with something that easy anyways.
In response to DarkLily762
<.< I think we have misunderstanding. That last sentence from me was just random chatter. Sorry if I confused you.