Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Dec 2012
Offline Last Active Aug 12 2015 09:38 PM

Topics I've Started

Properly managing abilities/spells

10 July 2015 - 12:15 AM

Hi all,


I've been spending the last few days thinking on how to best implement the spells in the game I'm working on. This might or might not be a waste of time, but I want to make sure I dont design and code something that will cause me headaches later on.


Basically, most actions the user or AI performs in my game are "abilities" that are executed. Opening the map executes the OpenMapAbility::Execute(), moving on the battle map executes MoveAbility::Execute() and so forth.


My worry with this design is that while having the game actions performed by each of the abilities classes (inside their Execute() function), they require access to only part of the game core they modify/use, but I foresee a lot of maintenance using this system, as changes to the core game might require modifying tons and tons of classes in order to handle the changes.


Another way to do it would be to use a super class that takes as input the ability to cast, which seems like a better way to manage things, but then the class becomes very large, and instead of requiring just a few dependencies, it requires much more access to the game world.


I guess my question is, what would be the best way to manage a pretty extensive set of abilities/game actions, allowing for easy changes to be made, and given the fact that I quite inexperienced, I need to implement a system that wont be a nightmare.


Sorry for my not so amazing English, and thanks for any inputs, my searches on Google were of no help!



Slower ID3DXSprite:Draw() on non-aligned source rect position/size

25 January 2015 - 02:36 PM

I'm using DirectX 9 and ID3DXSprite to draw my graphics, and I was wondering if using ID3DXSprite:Draw() with a source rect that is not aligned on a specific boundary, or if the source rect has an odd or unaligned width would slow down the rendering.


I know this might have been an issue decades ago, but I am wondering is such issues might be lingering in DirectX 9 or on some video cards.


I tried to google that stuff, but I couldn't find anything definitive.


Thanks for any tips!