0
\$\begingroup\$

I'm building a Diablo clone using Unreal Engine 4 and have been having trouble wrapping my head around how the combat calculations should work. I copied a lot of the core stats from the original diablo game as a starting point.

Visited Websites:

How to develop RPG Damage Formulas?

http://diablo.blizzpro.com/2014/05/17/basic-theorycrafting-damage-formula/

https://diablo.fandom.com/wiki/Damage

http://diablo3blog.blogspot.com/p/diablo-3-damage-explanation-and-guides.html

So for the data model, I'm storing the character stats in a struct called PlayerStatsStruct.h. I also set some limits for how high the stats could go.

PlayerStatsStruct.h:

USTRUCT()
struct FPlayerStatsStruct {
    GENERATED_USTRUCT_BODY()

    FPlayerStatsStruct();

    UPROPERTY(EditAnywhere)
    FString Name;

    UPROPERTY(EditAnywhere)
    float TotalExperience;

    UPROPERTY(EditAnywhere)
    int32 Strength; // MAX OF 99

    UPROPERTY(EditAnywhere)
    int32 Dexterity; // MAX OF 99

    UPROPERTY(EditAnywhere)
    int32 Vitality; // MAX OF 99

    UPROPERTY(EditAnywhere)
    int32 Magic; // MAX OF 99

    UPROPERTY(EditAnywhere)
    int32 Agility; // MAX OF 99
 
    UPROPERTY(EditAnywhere)
    float Health; // MAX OF 1000

    UPROPERTY(EditAnywhere)
    float Mana; // MAX OF 1000

    UPROPERTY(EditAnywhere)
    bool Invulnerable;
};

Here is the struct I'm using for every monster.

MonsterStatsStruct.h

USTRUCT()
struct FMonsterStatsStruct {
    GENERATED_USTRUCT_BODY()

    FMonsterStatsStruct();

    UPROPERTY(EditAnywhere)
    FString Name;

    UPROPERTY(EditAnywhere)
    int32 Level;

    UPROPERTY(EditAnywhere)
    float Health; // MAX OF 1000

    UPROPERTY(EditAnywhere)
    float Defense;

    UPROPERTY(EditAnywhere)
    float AttackSpeed;

    UPROPERTY(EditAnywhere)
    float AttackDamageMin;

    UPROPERTY(EditAnywhere)
    float AttackDamageMax;

    UPROPERTY(EditAnywhere)
    float MovementSpeeed;
};

I made these formulas for determining the current Max Mana and Max Health like so:

MaxHealth = 218.f * FMath::Loge(Stats->Vitality) // MAX OF 1000 when Vitality is 99

MaxMana = 218.f * FMath::Loge(Stats->Magic) // MAX OF 1000 when Magic is 99

The main things that I'm stuck on are:

  1. How do I determine the net damage inflicted on an enemy given both the Player Stats and the Enemy stats?
  2. What exactly does defense do in combat?
  3. How is dexterity related to defense?

I think at large the concept is this right?: TotalDamageToEnemy = PlayerAttack - Enemy Defense

The problem is that the concept of defense is really abstract to me right now.

Thanks for your help.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Are you determined to copy the mechanics of Diablo as authentically as possible or do you just want to create your own mechanics with a similar playstyle? Because in the latter case I would advise a completely different approach. \$\endgroup\$
    – Philipp
    Commented Jun 17, 2020 at 19:25
  • \$\begingroup\$ I think I would want to create a similar playstyle but not exact. What approach did you have in mind? \$\endgroup\$ Commented Jun 18, 2020 at 0:53

1 Answer 1

1
\$\begingroup\$

When you intend to create your own game inspired by Diablo and not an authentic clone, then I would recommend a more iterative approach to game design. Start simple and add complexity gradually.

Don't add player stats before you know exactly what they are supposed to be doing. Start with very few stats and very simple formulas. Then playtest to see how it plays in practice. While playtesting, you will notice that there are some situations where your game mechanics are not particularly interesting, have balance problems or do not deliver the game experience you intended. You can now modify your formulas or add more mechanical features to your game to address these itches.

When you look at a finished game made by other teams, then you usually see the end-result of following this process for several months or even years. A system which started out simple, but got increasingly complex as they iterated the design. But the choices they made for their game are not necessarily the same choices which are the right ones for your game.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .