dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: RPG-style stats...

  1. #1
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693

    RPG-style stats...

    Well I've been fooling around with an RPG-style battle engine that I'm making, in its very early stages; I don't plan to use it for an actual RPG, but I am having some trouble with stats and battle mechanics. I am not sure if this is something I should be asking for help or just one of those things I should buck up and try to figure out on my own, feel free to let me know. Basically what I'm referring to is stuff like Strength, Vitality, Agility, Dexterity, Int, and maybe Luck... Where I'm running into my issues is how to calculate stuff like success rates for hitting the enemy etc. I used to play a game called Ragnarok Online so I'm getting my ideas from them. My original plan is to have those be the base stats, which lead to 'sub-stats' such as Hitrate (chance to hit, based off dex), Flee (chance to evade, based off vit), Magic Defence (magic tolerance, based off int), Attack (how hard you hit, based off str), Defense (how well you take the damage, based off vit). All of these substats I was wanting to have secondary causes, such as class modifiers (if you are a thief/ninja, whatever, your flee based off agi will be higher than if you were a knight).

    Anyways I'm just having trouble figuring out how to make good formulas for all this stuff, I figure it will take a lot of testing to get everything right; however, does anyone have any suggestions as to where to look for ideas for these kind of formulas? Is it even okay to "steal" stat formulas?

    I was fooling around with my calculation of checking if a hit will succeed but I don't know, my calculation seems... so.. not how it should be lol...
    Code:
    hitfactor = (50+user_dex) - vic_agi;
    	chance = random(101);
    	if (chance < hitfactor){
    		hit = true;
    	} else {
    		hit = false;
    	}
    Anyways, feel free to tell me I'm a jerk and shouldn't need help with this, even though I'm hoping that's not the case!

    Thanks in advance,

    ChaseNYC
    mmm signature

  2. #2
    Software Developer mickm's Avatar
    Join Date
    Sep 2006
    Location
    Kingston [ON]
    Posts
    115
    I got this in another forum which appears to be down...
    http://forums.gamemaker.nl/index.php?showtopic=164161
    cached: http://72.14.203.104/search?q=cache:...lnk&cd=9&gl=ca


    Code:
    Hero
    Strength = 35
    Agility = 10
    Dexterity = 20
    Health = 130
    Armor = 30
    Weapon Skill = 20
    Dodge Skill = 15
    
    Enemy
    Strength = 15
    Agility = 30
    Dexterity = 25
    Health = 70
    Armor = 10
    Weapon Skill = 15
    Dodge Skill = 25
    
    Chance to Hit:
    x = Base(50) + Hero Dex(20) + Hero Weapon(20) = 90
    y = Enemy Agility(30) + Enemy Dodge(25) = 55
    
    x - y = 35%
    Post you game for free at Gamestack.org. We send the user straight to your website, no iFrames or other leeching methods.

    Please check out Gamestack.org for more information.

  3. #3
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    I think someone on this forum had all the formulas for Dungeons & Dragons..? You might be able to find it with a forum search (think it was abbreviated to D&D in the thread).
    http://www.birchlabs.co.uk/
    You know you want to.

  4. #4
    Axis Games Djugan's Avatar
    Join Date
    Oct 2003
    Posts
    238
    I've made two full-lenth RPG games and am currently in development of my 3rd. I use different formulas for each game, but the general concept remains the same. For every adjustable stat in the game (strength, agility, stamina, whatever you want to use), you have that directly affect one aspect of a combat-related attribute (see below). The specific numbers in the forumla will be different depending how many HP you want them to have and how big you want each hits to be, but the structure of the formula will be the same.

    What I like to use is a "base" method. For every character and enemy, depending on their level and stats, they are assigned a base value for certain combat-related attributes like damage, armor, magic resistance, accuracy, dodge, etc. These attributes are directly affected by a characters current strength, stamina, agility, wisdom, etc. Each base value has a direct counterpart (damage vs defense, accuracy vs dodge).

    When two characters get into a fight, their base values are compared against each other to determine certain events in a fight. Here's a brief example:

    Code:
    //Player 1 - Attacker
    strength=100;
    resilience=90;
    agility=80;
    dexterity=85;
    
    damage=(strength*.5)+weaponDamage;
    accuracy=(dexterity*.5)+weaponSkill;
    
    //Player 2 - Defender
    strength=90;
    resilience=100;
    agility=85;
    dexterity=95;
    
    defense=(resilience*.5)+armor;
    dodge=(agility*.5)-(armor*.1);
    In the above example, damage would be compared against defense to determine the amount that the hit does, and dodge would be compared against accuracy to determine the chance that the hit is avoided. This is a very, very basic example of the implementation of this method. Which character stats you choose to use, and which of those stats affect the combat related attributes are up to you.

    Let me know if you have any questions.

    Edit: Another important thing to remember is that you want the stats to intuitively affect the correct combat attributes. It wouldn't make much sense to have strength affect your chance to dodge.
    Last edited by Djugan; 02-23-2007 at 01:49 PM.

  5. #5
    Trainee coder Viza's Avatar
    Join Date
    Sep 2006
    Location
    Melbourne, Down under
    Posts
    513
    Quote Originally Posted by VENGEANCE MX
    I think someone on this forum had all the formulas for Dungeons & Dragons..? You might be able to find it with a forum search (think it was abbreviated to D&D in the thread).
    I'm not 100% sure, but I'm pretty sure that it was Everfornever who had all of those formulas in one of his 'Lost' game threads

    Viza

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center