Skip to main content
21 events
when toggle format what by license comment
Apr 22, 2021 at 6:34 comment added Egor Hans From my view, avoiding the use of subclasses is something you should never do. But then again, I'm coming from a Java programming environment, and Java pretty much consists of OOP, so I'm not sure if this paradigm applies to C++ as well.
Jan 14, 2021 at 20:43 history edited Vaillancourt
edited tags
Feb 23, 2017 at 22:33 answer added Aithos timeline score: 2
Dec 28, 2016 at 15:11 answer added DantaliaN timeline score: 1
Jan 27, 2016 at 20:04 history edited gkimsey CC BY-SA 3.0
Fixed a dumb typo
Feb 10, 2015 at 13:27 answer added Łukasz Baran timeline score: 3
Feb 7, 2013 at 0:04 answer added user22475 timeline score: 2
Dec 20, 2012 at 4:30 answer added dayrinni timeline score: 15
Jun 4, 2012 at 20:55 history edited gkimsey CC BY-SA 3.0
added 1192 characters in body
Jun 4, 2012 at 20:41 vote accept gkimsey
Jun 2, 2012 at 12:41 answer added Kylotan timeline score: 37
Jun 1, 2012 at 23:16 answer added Degree timeline score: 3
Jun 1, 2012 at 20:52 comment added ashes999 This is not a good answer to the interaction problem, but it seems to me that the decorator pattern applies well here; just apply more buffs (decorators) on top of each other. Maybe with a system to handle interaction by "merging" buffs together (eg. 10x 25% merges into one 100% buff).
Jun 1, 2012 at 20:14 history tweeted twitter.com/#!/StackGameDev/status/208652863981879296
Jun 1, 2012 at 19:40 answer added mgibsonbr timeline score: 7
Jun 1, 2012 at 19:37 answer added Ross timeline score: 25
Jun 1, 2012 at 19:25 comment added gkimsey Right, I had expected each event template for the abstract Buff class would include relevant parameters like that. It would certainly work, but I'm hesitant because it feels like it won't scale well. I have a hard time imagining an MMORPG with several hundred different buffs has a separate class defined for each buff, picking from a hundred different events. Not that I am making that many buffs (probably closer to 30), but if there's a simpler, more elegant, or more flexible system, I'd like to use it. More flexible system = more interesting buffs/abilities.
Jun 1, 2012 at 19:16 comment added user13213 if you have a "onReceiveDamage" method that gets called by a messaging system, or manually, or some other way, it should be easy enough to include a reference to who/what you are taking damage from. So then you could make this information available to your buff
Jun 1, 2012 at 19:15 comment added gkimsey Incidentally I'd already implemented something like that for my Stats object when I was making a system for equip-able weapons and accessories. As you said, it's a decent enough solution for buffs which only modify existing attributes, but of course even then I'll want certain buffs to expire after X turns, others to expire once the effect occurs Y times, etc. I didn't mention this in the main question as it was getting really long already.
Jun 1, 2012 at 19:10 comment added William I'm not posting this as an answer, as I'm just brainstorming, but how about a list of buffs? Each buff has a constant and a factor modifier. Constant would be +10 damage, factor would be 1.10 for a +10% damage boost. In your damage calculations, you iterate all the buffs, to get a total modifier, and then you impose any limitations you want. You'd do this for any kind of modifiable attribute. You'd need a special case method for complicated things though.
Jun 1, 2012 at 18:45 history asked gkimsey CC BY-SA 3.0