Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30677
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <prvs=6160a5c19=jeanmichel@sequans.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'cache': 0.05; 'level,': 0.07; 'welcome.': 0.07; 'subject:question': 0.08; 'lookup': 0.09; 'perks': 0.09; 'subject:design': 0.09; 'cc:addr:python-list': 0.10; '"python': 0.16; 'dynamic,': 0.16; 'flag,': 0.16; 'rough': 0.16; 'set,': 0.16; 'storing': 0.16; 'char': 0.17; 'specify': 0.17; 'thanks,': 0.18; 'trying': 0.21; 'all:': 0.22; 'decorators': 0.22; 'effort.': 0.22; 'finally,': 0.22; 'modifying': 0.22; 'object.': 0.22; 'work,': 0.22; "i'd": 0.22; 'cc:2**0': 0.23; 'player': 0.23; 'cc:no real name:2**0': 0.24; 'idea': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'appreciated.': 0.26; 'first,': 0.27; "doesn't": 0.28; 'points': 0.29; "i'm": 0.29; 'that.': 0.30; 'checks': 0.30; 'figure': 0.30; 'point': 0.31; 'system,': 0.32; '-----': 0.32; 'generally': 0.32; 'could': 0.32; 'builds': 0.33; 'curious': 0.33; 'like:': 0.33; 'hi,': 0.33; 'self': 0.34; 'exist': 0.35; 'problem,': 0.35; 'something': 0.35; 'there': 0.35; 'add': 0.36; 'really': 0.36; 'but': 0.36; 'skip:{ 10': 0.36; 'method': 0.36; 'anything': 0.36; 'possible': 0.37; 'level': 0.37; 'previous': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'performance': 0.39; 'called': 0.39; 'google': 0.39; 'where': 0.40; 'think': 0.40; 'your': 0.60; 'received:194': 0.61; 'costs': 0.64; 'total': 0.65; 'overall': 0.66; 'purchase': 0.67; 'increase': 0.72; 'subject::': 0.83; 'cost,': 0.84; 'subject:system': 0.84; 'dirty': 0.91; 'factors': 0.95 |
| X-IronPort-AV | E=Sophos;i="4.80,527,1344204000"; d="scan'208";a="770820" |
| X-Virus-Scanned | amavisd-new at zimbra.sequans.com |
| Date | Wed, 3 Oct 2012 10:50:09 +0200 (CEST) |
| From | Jean-Michel Pichavant <jeanmichel@sequans.com> |
| To | Tyler Littlefield <tyler@tysdomain.com> |
| In-Reply-To | <506B47DB.9030401@tysdomain.com> |
| Subject | Re: design question:game skill system |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Mailer | Zimbra 7.2.0_GA_2669 (ZimbraWebClient - GC7 (Linux)/7.2.0_GA_2669) |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1757.1349254197.27098.python-list@python.org> (permalink) |
| Lines | 54 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1349254197 news.xs4all.nl 6878 [2001:888:2000:d::a6]:60627 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:30677 |
Show key headers only | View raw
----- Original Message -----
> 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,
Hi,
Again, do not think about performances before actually having an issue with them. What's the point to optimize something that doesn't need it ?
For your cache problem, google "python memoize decorator" for a bunch of decorators that will allow you to cache your data without any effort.
JM
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: design question:game skill system Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-10-03 10:50 +0200 Re: design question:game skill system Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 06:19 -0700 Re: design question:game skill system Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 06:19 -0700
csiph-web