• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Plethora

Special Skills, Spells, and Abilities

1 post in this topic

So after a good deal of work, I have a basic SRPG style battle system up and running.  I have characters and enemies (no AI yet) that take turns.  They can move around and perform basic attacks.  I'm reasonably happy with the way I have the system laid out behind the scenes, which I'll detail in as concise a way as possible, and then get to my question:

 

  • I have a Battle_Controller class which handles input, both from keyboard and mouse events (in SFML), and from GUI events. 
  • I have a Battle_Map class which handles the map itself (tile map). 
  • I have a Battle_Manager class which handles the battle in different ways.  It maintains an std::list with the turn order, it activates the character or enemy whose turn it is, and theoretically, it should provide the interface through which the various units on the battlefield interact.  Currently, there is an attack method that takes an attacker and defender and resolves the attack.
  • Finally, I have a Character class and an Enemy class, both of which derive from an interface called iUnit (which would also be used for neutral characters, AI controlled allies, etc).  They are primarily collections of data and don't actually "do" anything on their own. 

So with that in mind, I've started to think about how I might integrate skills and what not.  The thing is, attacking is easy, since all the access I need is to two units on the battlefield.  I pull statistics from those two units, perform some calculations, and assign damage as needed.

 

But for a game where I want to put a great deal of emphasis on a wide variety of special skills, I'm having trouble planning out how to implement a robust and extendable system.  For one thing, just off the top of my head, I want to have spells that alter the terrain, so I'll need a pipeline to alter the tiles in the Battle_Map.  I want buffs and debuffs that work for some number of turns, so I'll have to have a way to maintain those counters somewhere.  I mean, ultimately the problem is that various skills, spells, and abilities will need to potentially have access to just about any data that relates to the battle (and, in some cases, maybe some outside battle data as well).  I'm not sure how I can achieve this while still maintaining some semblence of decoupling.

 

For a second thing, I'm kind of wondering where and how I should specify who has access to which skills, and further, where I should define what skills do what.  My tentative plan is to have characters and enemies and so on maintain a simple std::vector<bool> skills which will have as many entries as there are total skills in the game.  So, say skill #5 is fireball, a character who can cast fireball would have a skills[4] entry which evaluated as true where a character who couldn't would have skills[4] evaluate as false.  Its not exactly elegant, but I think it would work.

 

But then the problem is, I'll have to define what these skills actually do somewhere.  Maybe a dedicated class that just has skill related methods (one method per skill in the game)?  That could be huge and unweildy, but I think it would work...

 

Ultimately, I'm just having trouble envisioning how all these things should work together on a conceptual level.  This is a technical question, but I'm not looking for very specific code advice, just a general overview of how these things are usually done.

 

0

Share this post


Link to post
Share on other sites

Why don't you make a class Skill and add a list in your iUnit class that will contain numerous instances of Skill(for the different skills) - basically your units will contain a list of skills.  Add some method in iUnit to access a given skill (basically you search in the list of skills) and from there you can use the Skill class methods for the given instance of skill. 

 

Something like this:

class iUnit
{

protected:
list list_of_skills;

Skill& access_skill_by_index(unsigned short input_index)
{
   //find the given instance of skill in list_of_skills by using the input_index
   //and return that instance
}

...

};

 

You can use whatever you find better for "list" - an array, a vector, a linked list etc. And you can code the access_skill_by_index method differently - you might want to access a given skill by some other means.

Edited by lightxbulb
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0