Results 1 to 9 of 9

Thread: algorithm help

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    algorithm help

    well there isnt really a forum which will fit this..i think

    since its not actual coding either (though that would be good ) i just stuck it in here...and cuz itll get more exposure

    i have these for 4 variables for 2 opponents, each has their own ratings

    attack
    defense
    agility
    speed

    in addition to that, i have:

    an armor rating (for defense)
    weapons (which add on a certain amount to attack ability)

    i want to use all of the stats for a hit/miss probabily, and then do the hit, and subtract the amount of damage done by the attack. the attack has a certain damage rating, which is used with the attack rating. defensive armor is used in conjunction with the defense rating. i cant really think of anything good

    most of the coding is done aside from this. items they buy are used, such as armor etc.

    ideas/algorithms would be awesome


    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    299
    I suggest making a player class, and have member functions for finding damage done with a certain weapon, taking damage with certain armor, properties for the attributes, etc. For Example


    Class:

    VB Code:
    1. Property Let AttackStrength(NewValue as Byte)
    2.      'code goes here
    3. End Property
    4. Property Get AttackStrength() as Byte
    5.      'code goes here
    6. End Property
    7.  
    8. Public Sub TakeDamage(Amount as Double)
    9.      'code for decreasing health, armor, etc. go here
    10. End Sub
    11.  
    12. Public Function GetDamageDealt(WeaponIndex as Long) as Double
    13.      'code goes here to calculate how much damage a weapon will do with a certain weapon
    14. End Function

    Is that the kind of idea you were looking for? That would make it easier.

  3. #3

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    its in PHP, everything is taken from the DB, each player has an array with their stats in it, like what weapons/armor they have etc
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  4. #4
    Hyperactive Member
    Join Date
    Jun 2002
    Posts
    299
    oops... don't know PHP.

  5. #5

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    yah np. i just need ideas for the algorithms.

    for tha attack ive comeup with:

    abs(weapon damage - (attack rating * weapon damage) / 2)

    something like that.
    i need ideas
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  6. #6
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    you might want to put some randomization in that
    retired member. Thanks for everything

  7. #7

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    theres an idea

    that would be good for hit and miss too

    random(1, (speed * agility) / rand(1, agility))
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  8. #8
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    IF you really want to get a broad set of ideas -
    read Jarulf's guide to Diablo & Hellfire. Everything has a normally distributed probability range for each action - ie. similar monsters are created with ranges of armor ratings, hit probabilities depend on weapon type, dexterity, etc.

    http://www.lurkerlounge.com/jarulf/index.shtml

  9. #9

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ah, thats cool, thanks

    i was looking for something like this

    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

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