• 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
eagle18

database design to store magic attack and effect

8 posts in this topic

I want to create a database that can store a magic/skill and it's effect to target like rpg style. For some example : 

my hero have some active magic/skill and passive skill, 

active skill may damage and slowed attack speed of enemy for couple of seconds. or maybe only stun some enemies for couple of seconds but not damage the enemies

passive skill may increase status of hero like hit point, or/and attack power

 

how I can store them as a table in database ?

 

and last sorry for my bad english, 

thank you

0

Share this post


Link to post
Share on other sites

I don't think you really need to store them in a database, but rather design them in a smart way. This will at least reduce the amount of spells you have. You can obviously store them in a database, but how depends also on what the spells are based on (player level, player selection, item choice)

 

You don't need to store every single variation of a spell. In the end, it's nothing more than a number that does something (healing or damage) with 0 or more side effects (like a stun) and perhaps a timer, or whatever you want a certain spell to have. This, same as above, also depends on what affects your spells.

 

I guess it also depends a bit on how big the game is, or rather, how many different kind of spells you're going to have. I would personally think it's more of a hybrid between storing base spells in some way (doesn't need to be a database per se, perhaps some XML file, I don't know) where different factors (player level, stats, etc) are a modifier for the final outcome.

 

I guess it can also be achieved with scripting the spells (so the designers don't have to dive in the actual code).

 

In the end it probably also depends a bit on how many spells you have though. Maybe setting up a scripting language or parsing through some database/file isn't worth the effort if you're going to have 5 base spells with level based variations that don't need to be stored.

 

Others can probably shed some more light on it, but this should at least give you something to think about. :)

2

Share this post


Link to post
Share on other sites

as rld says, no need to store them in database. i think you should store them in binary file, or even hard-code it in your library. database means slow on setup, and fast on query. but your query quite simple, read only. database system is suitable for huge number of query or complex query. such as you must read 100 records/second, or store 1000000 records to file, or you need to take some data that match some conditions.

Edited by ngoaho91
1

Share this post


Link to post
Share on other sites

"Database" is probably the wrong word.  It is usually associated with relational databases, which is why so many people suggested SQL-based engines.

 

SQL is used in relational databases. This kind of database is great for big data with one-to-many and many-to-many relationships.  For example, one customer might have thousands of order invoices and payments and shipping details, and the database all told may have millions of entries.  These are great for businesses.

 

While a relational database is great for many computing solutions, it is generally not an ideal solution for the problem that was described.

 

 

 

You can maintain a few simple data tables (not SQL-based databases) that solve the problem fairly easily.  Create a structure or class that defines each one, and dump them all in an array.  If spells and effects are different enough you might consider having two arrays, one for each.  Then each player can track any spells or effects that are on them by referencing the ID.  You will also need some way to store the data, probably in a format like XML or JSON or something you write yourself. The process of loading the data is called serialization, and your favorite search engine can find many thousand examples of serialization code.

2

Share this post


Link to post
Share on other sites

A proper relational database is overkill -- I suppose if you were using a database heavily for other things it would make sense to consolidate storage systems, but that's certainly not a dependency you want to take just for this.

 

If it were me, I'd design my spells and other effects as a component system, and then have a set of factories to build them from a declarative sort of description; or, tie that into a scripting language like Lua to define the languages.

0

Share this post


Link to post
Share on other sites

thanks for your suggestion,

but the problem is our game designer haven't designed all of magic in game, and not only that, because the game will be connected with server  cause if some parameter will change it will be the database not the code. Oh and we using sqlite for the database.

0

Share this post


Link to post
Share on other sites

From the perspective of a client/server I would consider restricting the details of the spell effects to the server side only, and only propagate data necessary for visualization  to the clients. This would allow you to create effects and spells and such that don't need to be communicated to the clients, potentially even while the game is still running. The clients just need to download the visual aspects of the effects such as animations, textures, particle systems, hud icons, and many of those can be shared or mixed and matched between skills. The client need not even have any knowledge of the spell system in general. Maybe the client has only the capability to communicate targeting information to the server and activate spells by an id value, and the server kicks communicates streams of visualization instructions at entity positions to relevant players around those locations in a generic way that has no dependency on the spell system.

 

Alternately, is your question more about how to structure the definition of a spell effect?

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