Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Calculating RPG damage / defense values  (Read 2640 times)
0 Members and 1 Guest are viewing this topic.
Offline pixelprime

Junior Member


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!
Offline 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.

Offline 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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 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.
Offline 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.

Offline pixelprime

Junior Member


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  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (21 views)
2014-09-12 09:08:26

Norakomi (55 views)
2014-09-10 13:57:51

TehJavaDev (65 views)
2014-09-10 06:39:09

Tekkerue (32 views)
2014-09-09 02:24:56

mitcheeb (54 views)
2014-09-08 06:06:29

BurntPizza (38 views)
2014-09-07 01:13:42

Longarmx (24 views)
2014-09-07 01:12:14

Longarmx (30 views)
2014-09-07 01:11:22

Longarmx (28 views)
2014-09-07 01:10:19

mitcheeb (36 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!