Java-Gaming.org Hi !
 Featured games (90) games approved by the League of Dukes Games in Showcase (778) Games in Android Showcase (231) games submitted by our members Games in WIP (856) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 Calculating RPG damage / defense values  (Read 7072 times) 0 Members and 1 Guest are viewing this topic.
pixelprime

Junior Devvie

Medals: 3

 « Posted 2012-03-07 22:44:02 »

Hi again all,

I'm creating a (very simple) roguelike dungeon crawler, and had a couple of questions regarding the way damage can be calculated when fighting an enemy.

I've got a rough idea of how I want it to work, but I know there are fairly well-set conventions for this sort of thing, so I want to see if I'm on the right track.

Every entity (player and enemy alike) has the following stats:

- Health (how many hit points it has)
- Damage (how much damage it deals as a maximum)
- Defense (how much defense it has against taking damage)

So, for example, the player starts with 100 health, 4 damage, and 5 defense. A weak enemy of equal level may have perhaps 30% or less weaker stats; so a weak enemy might have: 30 health, 1 damage, 2 defense.

When I'm writing in my calculations for attacking, I'm using the following assumptions:

1) Player attacks, so we start by first assuming the attack will initially cause maximum damage of 4.
2) The enemy's defense is used as a mitigating factor for this damage, and is converted to a percentage
3) The weak enemy's defense, as shown above, can now mitigate 2% of the player's maximum damage
4) Because defense isn't guaranteed, a randomisation is run to calculate how much of that defense to use (0 - 2%, in this case)
5) The player's maximum damage value is reduced by this defense value - so if reduced by 2% defense, it results in a damage of 3.92.

Obviously, these numbers are pretty small. But compare this to perhaps later in the game where a player's weapon can deal a maximum of, say, 300 damage. Fighting an enemy with health of 500 and a defense of 40 could potentially have a worst case scenario of your weapon only doing a total of 180 damage (40% of 300).

What I want to know is whether or not this method is sound? It sounds right in my head, and obviously gives me some degree of flexibility to add further damage types if I want to get clever:

- Player's main weapon deals max. of 200 melee damage
- Main weapon also deals 80 fire damage
- Enemy has 0 defense, but 100 fire resist
- Player's main weapon hits for the full 200 damage, but fire resist can reduce that additional damage down to as little as zero.

And so on.

I'd appreciate any thoughts from veterans of these types of game systems.

Thanks!
sproingie

JGO Kernel

Medals: 202

 « Reply #1 - Posted 2012-03-07 23:04:20 »

It's the same story for any RPG or CCG or game with mechanics determined by formula: the proof of the pudding is in the tasting.  And by tasting, I mean running it in a sim millions of times til you have statistical model results that have a nice satisfying distribution, no game-breakingly chaotic effects from any of the variables, and no singularities that make any stat redundant and unnecessary.  Once you have a baseline model that makes you happy, any further tweaks to the game you make can be tested against it to make sure you don't break the game.

On top of that, it also has to be fun.  Frankly, elements of "fire" and "fire resist" are kind of old hat.  Dress them up in some lore, make the choices of powers and resists interesting and not just four colors of the same thing.

UprightPath
 « Reply #2 - Posted 2012-03-07 23:06:16 »

To me, it seems the changes in damage/health/defense are going to be feel more like "fake" progression. I mean, I know that you'll be able to curb-stomp most weak enemies when you get to the higher levels, but on the higher level enemies it'll end up feeling like they're the same as prior ones.

Not that this is a bad thing necessarily. That's just my view.

All of the factors you just described could be fun and interesting.

I just have a question about the how your percentage system is going to work: How often are you going to have high percentages of damage reduction? Because that's got to be one of the most frustrating things in the world, especially when you're relying on random drops, to run into an enemy who is completely immune to physic damage, when you're playing a physical damaging character.

Another possible option is to have something like a comparison between Damage/Defense, and use that as a relative modifier. Like, if their attack is greater than the enemy's defense, give them a percentage bonus, if it's less a penalty.

Also, COLOR PIE is delicious if it's done right and interestingly. Like giving you information that you can take as truth from the start of the game such as "Fire creatures are always weak against Water", "Water creatures are always weak against Air", "Air is always weak against Earth", "Earth is always weak against Fire". Or something like that... Then stick to it! Ugh, it's another frustration to have such information laid down, only to have it broken fairly soon into the game, without explanation.

sproingie

JGO Kernel

Medals: 202

 « Reply #3 - Posted 2012-03-07 23:12:28 »

Pretty much every RPG does the treadmill of escalating damage by the player countered by toughness of the enemy, and it's not necessarily a bad thing, especially when your animations and effects scale up to be suitably spectacular.  A tried-and-true trick to make the player aware of their new 9000+ power level is that after challenging a player for a while so they level up, you bring in a few of the enemies from several levels back, unscaled, just to let the player glorify in the easy slaughter of what was formerly a menace.
UprightPath
 « Reply #4 - Posted 2012-03-07 23:30:51 »

That's true enough! About the pulling enemies back.

I've just always been a bit bothered by the escalating number syndrome. I mean, it feels like I could be doing the same amount of damage, with just a hidden multiplier somewhere to make the numbers look bigger. Games like WoW are a good example, where on average it takes the same time to kill an enemy of equal level, regardless of your level. The only real way you know you're doing more damage is by attacking weaker enemies and seeing them go down in a single hit.

This however, is just a preference thing. I mean, there's nothing wrong with having escalating damages. I just like the idea that I'm doing the same damage to equal level enemies, then I hit a weak enemy and there's a delicious spike. Like I'm critting lower level enemies because of my mad skills, not because I've just got a magical atom-edged vorpal-blade.

pixelprime

Junior Devvie

Medals: 3

 « Reply #5 - Posted 2012-03-08 15:36:36 »

I don't necessarily think 'color pie' syndrome, as humorously exampled earlier, is necessarily bad. My use of the term 'fire resistance' was just as a way of trying to convey the extensibility of this type of system, rather than bolt-in a specific facet from the game.

In reality, there are so many more interesting thing you can do with defensive statistics, but essentially it all boils down to something being able to resist, parry or deflect a portion of the damage received.

Having an RPG where your character can reliably hit with 100% of their strength makes most battles very predictable, difficult or not. I based my own attempts of designing this type of system on existing RPG games where some of the following can be true:

- You can deal a baseline level of damage, which can be affected negatively by a random value, but potentially boosted by a positive one (i.e. a 'critical' hit). This works the same for anything else that can attack, unless modified in such a way as to remove some elements of this.

- Both the player and all attacking / attackable entities in the world have some modicum of defense, meaning that they can resist a portion of your damage. They may also be immune or protected against additional damage modifiers. I'm loathe to use the example now, but this might include things like fire, cold, poison etc.

- There is room for stats to be given to allow a certain 'minimum' or 'unresistable' amount of damage to be inflicted, which negates all forms of defense (for that portion of damage only).

I can't be too far off the accepted model, can I? I appreciate the comments relating to the (obvious) unoriginal nature of this system, but I'm conflicted enough over this already.

Part of me want to create something that people find similar enough to feel comfortable with, and another part of me wants to inject some fresh life into these systems - but without alienating the player and making them feel conflicted over something they'd feel more comfortable with.
Pages: [1]
 ignore  |  Print

 hadezbladez (360 views) 2018-11-16 13:46:03 hadezbladez (194 views) 2018-11-16 13:41:33 hadezbladez (363 views) 2018-11-16 13:35:35 hadezbladez (91 views) 2018-11-16 13:32:03 EgonOlsen (2193 views) 2018-06-10 19:43:48 EgonOlsen (2228 views) 2018-06-10 19:43:44 EgonOlsen (1385 views) 2018-06-10 19:43:20 DesertCoockie (2023 views) 2018-05-13 18:23:11 nelsongames (1675 views) 2018-04-24 18:15:36 nelsongames (2313 views) 2018-04-24 18:14:32
 LiquidNitrogen 14x KaiHH 14x Spasi 13x orange451 13x 65K 10x bullen 9x NuclearPixels 9x polinc 7x Zemlaynin 7x VaTTeRGeR 6x gouessej 5x CJC 3x cygnus 3x philfrei 3x SHC 2x princec 2x
 Deployment and Packagingby mudlee2018-08-22 18:09:50Java Gaming Resourcesby gouessej2018-08-22 08:19:41Deployment and Packagingby gouessej2018-08-22 08:04:08Deployment and Packagingby gouessej2018-08-22 08:03:45Deployment and Packagingby philfrei2018-08-20 02:33:38Deployment and Packagingby philfrei2018-08-20 02:29:55Deployment and Packagingby philfrei2018-08-19 23:56:20Deployment and Packagingby philfrei2018-08-19 23:54:46
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org