• entries
    500
  • comments
    1888
  • views
    333622

Simply Stat-tastic

Sign in to follow this  
EDI

166 views

So last night I took the stats that I computed and moved them into thier respective .sprite XML files.

I was pleased with the results, it provided a good spread of easy characters, mediums and hard ones.

Given that all the enemies are using the same graphics at the moment, it is hard to feel the awesome diversity that is 16 different enemy types ;), hopefully we will get those all rendered soon =)

I have known for quite some time, a little flaw in our battle-system, in the way that protection is used.

example1: One character hits another


//get the attackers damage
dam=attacker.GetMeleeDamage();
//get the defenders protection
pro=defender.GetProtection();
//substract protection from damage
dam-=pro;
//cap to 0
if(dam<0)dam=0;
//apply the damage
defender.lifePoints-=dam;



Now when I first wrote this it all seemed well and good, however it poses a problem. Mainly if an enemy has a protection level higher than the damage you can do to them with any given strike, then you can never hurt them, no matter how much you swing =)

So a better system would be to use a 'Protection Damage Accumulator'

example 2: Usage of the PDA(gah damn acronyms)


//get the attackers damage
dam=attacker.GetMeleeDamage();
//get the defenders protection
pro=defender.GetProtection();
//add dam to pda
pda+=dam;
//if we have been hit to the max of our protection
if(pda>=pro)
{
//reset the pda
pda=0;
//apply the damage
defender.lifePoints-=dam;
//cap to 0
if(dam<0)dam=0;
}


Sign in to follow this  


2 Comments


Recommended Comments

lmfao...

i knew it, i knew it!

damn acronyms!

when i implemented it however,

i used

m_proDamAcc

since m_pda makes it seem too important,

sort like m_iff (identify friend/foe)

*shrug* lol

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now