design question:game skill system

Discussion in 'Python' started by Littlefield, Tyler, Oct 2, 2012.

  1. Hello all:
    I'm looking at a skill/perk system, where the player builds up his char
    by using perk points to add abilities.
    Each perk is under a category, and generally costs go up as you increase
    the perk.
    So I'm trying to figure something out; first, I'd really like the cost
    calculation and all of that to be dynamic, so that I don't have to write
    a calculateCost per object. I'd also like to be able to specify
    dependencies and say a level, as well as other factors before a player
    can obtain a perk and have them self documenting. The idea is that a
    player could do something like:
    data perk extended health
    and it would tell them they require health at 50 before they can
    purchase extended health, as well as the cost, the increase per level
    and the total overall cost.
    Any ideas on how to set this up would be really appreciated.
    Finally, I'm curious how to store and calculate these. I thought about
    using a uid per perk, then storing something like: {uid:level} on the
    player, but means that I have to lookup the name somehow still in the
    main perk database, then use that uid to check if the player has it. Are
    there better ways of storing skills? I'm also thinking about
    calculation; currently the CalculateMaxHp method would have to add up
    all the possible perks for health, then add stats and all that. That
    could get really rough on performance if it's called often; would
    something like a cache work, where you have something like:
    {attribute:dirty}? So if I call CalculateHealth, it checks for the dirty
    flag, and if it doesn't exist just returns the previous max HP, but if
    the dirty flag is set, it recalculates? Then anything modifying health
    (level gains, perks, stat increases/etc) would just set the dirty flag
    and call calculate?
    Thoughts/ideas would be welcome.
    Thanks,

    --
    Take care,
    Ty
    http://tds-solutions.net
    The aspen project: a barebones light-weight mud engine:
    http://code.google.com/p/aspenmud
    He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave.
    Littlefield, Tyler, Oct 2, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BlackHawke
    Replies:
    12
    Views:
    1,564
    Andrew Thompson
    Jan 26, 2004
  2. Replies:
    1
    Views:
    405
    Randy Webb
    Nov 19, 2006
  3. Ian Kelly

    Re: design question:game skill system

    Ian Kelly, Oct 2, 2012, in forum: Python
    Replies:
    0
    Views:
    250
    Ian Kelly
    Oct 2, 2012
  4. Jean-Michel Pichavant

    Re: design question:game skill system

    Jean-Michel Pichavant, Oct 3, 2012, in forum: Python
    Replies:
    2
    Views:
    252
    Ramchandra Apte
    Oct 4, 2012
  5. Littlefield, Tyler

    Re: design question:game skill system

    Littlefield, Tyler, Oct 3, 2012, in forum: Python
    Replies:
    0
    Views:
    252
    Littlefield, Tyler
    Oct 3, 2012
Loading...

Share This Page