RPG combat system.

Blitz3D Forums/Blitz3D Programming/RPG combat system.

Vertigo(Posted 2007) [#1]
Hello all. Sorry I feel like Im flooding the boards here. My MMORPG is really starting to come along. A mock inventory system is in the works and everything else seems to be going great. However; I have a serious issue with the combat system. My brain apparently just cannot fathom the equations. Ive ported many over to bb such as Guild Wars and Diablo 2's. I have the equations expression for expression and it never seems to act consistently. As you may know having a balanced and 100% accurate combat system is a must for this type of game. Enough ranting. Does anyone feel like helping me code a base combat system to build upon later? Or does anyone know of any Expressions/equations that take into account a lot of modifiers?

Any help would be appreciated.


Buggy(Posted 2007) [#2]
Just make an equation yourself that takes into account a lot of modifiers:

damage# = strength#*level*weaponDamage#/enemyWeakness#*Rand(-5, 5)

Something like that.


Jasu(Posted 2007) [#3]
Most common problems in those kinds of long equations is caused by float to integer conversions.
int1% = 7
flt1# = 3.256

val1# = int1 * flt1
val2# = flt1 * int1

Those two equations return a different result. The val2 returns the accurate result and val1 should be modified
val1# = Float(int1) * flt1
to work properly.

Is this the problem?


GitTech(Posted 2007) [#4]

Those two equations return a different result.



They give the same result here.


Vertigo(Posted 2007) [#5]
My issue is consistency and balance. Of which I have neither when it comes to making arbitrary values for modifiers and then making sense out of it. I can just come up with some random numbers and sure it may work, but it needs to be balanced. Ala I dont want some player to have just the right ammount of Strength and just the right weapon attributes to break the equation. I guess what im asking is why do most rpgs use the same(or similar in nature) values for items and modifiers and get the same results. Why does this value effect that one etc. There is just so much to it that coming up with an entire system is proving difficult. Id much rather continue the work ive been making on the server end of things rather that this combat carp haha.


Farflame(Posted 2007) [#6]
That's kind of the opposite to me, I love tinkering around with stuff like this, but I actually get bored of programming quite fast - programming is just a way to get my ideas working really.

Truth is, what you're talking about is a very complicated issue. Most RPG's use similar systems because that's what works, and in my opinion, because they're lacking imagination. You're right though, the guts of the program are absolutely vital to the success of the game, and if you don't get this part right, the rest will fail. As an example, I'm currently working on a football (Soccer) game. It's absolutely crucial that the match itself works correctly and uses the player's skills to generate a convincing result - otherwise the rest of the game will fail regardless.

Unfortunately I don't think we can help too much because the problem is too broad. What sort of numbers are you using for your characters and items? If it's very similar to an existing game such as D&D or WoW then you could probably just try to mimic their results. Personally I'd go for a whole new system, but that would be ambitious.


Vertigo(Posted 2007) [#7]
@ Farflame

Read my post I made earlier titled "RPG Inventory system" that contains how the items are used. *sighs*... I did not play enough real RPG's as a kid... as a result I am destined to failure with this combat system. I'll just make my own from the ground up and do the whole trial error thing and try to duplicate any unforseen issues.

At least my chance to hit equation works 100% of the time haha.

chance_to_hit = 100 * Base_atk / (base_atk + defender_def) * 2 * Attacker_lvl / (attacker_lvl + defender_lvl)
hit = rand(1,100)
if chance_to_hit>hit then do_that_whole_crazy_check_damage_thing


Leto(Posted 2007) [#8]
Hi Vertigo. You possibly got yourself into deep water :) I am making a turn-based RPG and doing the algorithms is complicated and really specific to your game's attributes.

Some things I started with:
- Researched many RPGs, esp console titles (which mine is styled after), finding common attributes (e.g. what people are familiar with)
- Looked up the D&D calculations. These of course are rather basic since it's designed for table-top play. It can provide ideas at least. Some other table-top roleplay games may have better calcs.
- Googled for RPG algorithms. You can actually find some good ideas here and there
- Thought about it all and how I wanted to shape the combat

My calculations, for turn-based, wouldn't suit real-time games. Also if you found algorithms they're not going to be plug-n-play, they're going to take time and thought.

Not easy, that's for sure.


Leto(Posted 2007) [#9]
Also, this is a worthwhile read about 'random' numbers and probability which can be vital to combat algorithms:

"Statistically Speaking, It's Probably a Good Game, Part 1: Probability for Game Designers"

http://www.gamasutra.com/features/20061018/sigman_01.shtml


Farflame(Posted 2007) [#10]
Sorry Vertigo, I was just making a few broad suggestions. As Leto says, this is a very complex subject - depending on how complex your game is I suppose. When you look at how a game such as WoW works, the chance of a hit are based on dozens of factors - and even then I think it's still a bit too simple. You've got strength + skill with weapon + agility + class + other stuff vs the opponents armour + agility + dodge skill etc etc. It really is specific to your game and will require lots of testing to get it right.


Jasu(Posted 2007) [#11]

They give the same result here.


Oh yeah, I meant
val1# = (int1 * flt1)
val2# = (flt1 * int1)

This is probably off topic already, but I hate unfinished business...