• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By jhocking
      My bestselling and highly recommended Unity book has been fully revised! Unity in Action, Second Edition teaches you to write and deploy games with the Unity game development platform. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer.

      Foreword by Jesse Schell, author of The Art of Game Design

      Don't take my word for it being good, look at the sky-high ratings on GoodReads.

      You can order the ebook directly from the publisher's site, or order the book on Amazon to get both the physical book and a coupon to download the ebook!
    • By ThunderTwonk
      Hello everyone, I am working on a game idea and since I am still in the process of learning C# and the features available in unity I was hoping some of you might be able to offer me a little insight on things in general for getting started.
      I guess the basic components of what I'm wanting to create would be a Multi-levels management/city builder/rpg.
      The goal is to provide a framework for players to interact with, build in and affect the world both from a 3rd person action RPG as well as a zoomed out 4x style view (This would be something unlocked through gameplay)
      As for my questions go I was wondering if anyone had resources that could help me learn.  I've been on youtube as well as enrolled in an online course for basic unity and C# and will continue those but if anyone has any words of advice, a place that has good information and tutorials etc.
      Thanks for your time.
    • By Cahit Karahan

      Hi, I'm new in this forum. It is honorable to see such communities exist. I would like to share my new game. I did for android with unity. I know the game is a little awkward , but you have to know that this game is from the time when Unity's name is Unity3D  I have made my first game when I was 12. Now I am 22.  I have taken a lot of experience in this process and I can make better games nowadays. I have published this game nowadays but actually this game is very old but also it is very special for me :))
      I have just wanted to retouch and share this game, because it has a very important place for me.

      It's a special free 3D horror adventure action game for the halloween. Fun with scary sound effects and musics, 3D realistic graphics, you will feel the horror in the deep of your heart. Use your reflex. Totally free adventure. Totally scary horror game. 

      Tamarra, she is a beast from our world. She needs to consume souls from innocent people to stay alive. Story begins, the old Elaris tribe had lost their everything because of this beast who lived in the well. Araknas was the most powerful warrior of the tribe. One day, Araknas's mother was killed by the servant beasts of Tamarra. That's how Araknas's journey to the well begins. Tamara's well is guarded by horrible beasts. Araknas has to pass all servant beasts until he reaches Tamarra.

      Even death at the end is worth the revenge. 
      Are you brave enough to jump into Tamarra's well?

      Survive from witch attacks, clown attacks and many scary creature.

      - Realistic 3D graphics.
      - Scary sounds.
      - Scary musics.
      - Best experience with headphones.
      - A demon cage where you can imprison all the demons one by one
      - The witches do not like help, but they love blood stone. Witch store where you can develop your abilities and get new abilities.
      - Countless beasts.
      - At the end of the well there is a hidden surprise for you.

      *We do not recommend this game to people with clown phobia, spider phobia, or panic attacks.*

      **!!!**Note : This game is an early-access game, we are upgrading new features every day, new beasts, new improvements, as an example online 1vs1 fall on the list, so stay on connect and follow Halloween : Horror Well on Google Play.**!!!**

    • By INFRA
      SCAN. DRILL. SURVIVE.   ISOLATED Release in May 1st 2018   https://store.steampowered.com/app/805950/Isolated/   A game by Jérémie Bertrand Music & Sound Design by Pierrick Querolle *** Our solar system has been invaded by strangers. For the purpose of a possible negotiation, a team of astronauts is sent to the moon. Alas, they are shot before even arriving on the scene. Only one astronaut survives the crash and his only goal will be to go home...   GAMEPLAY   Shoot enemy ships to avoid being invaded. Be precise in your movements, because it's better to lose a bit of life at the top than to lose it all at the bottom. Take out your drill to destroy the stones in your path. Validate your identity to cross the different laboratories. Reach the flag before losing your three lives.   And all that... at the same time! Will you be able to go home? If the answer is yes, how long will it take?
    • By BigJiggly
      Hello! So, I've been the leader of BJP for a while now. I'm a bit bored of taking the role I always take, leader. I was hoping someone out there is looking to forge a team maybe and needs a programmer. 
      I have experience mainly in the Unity engine(C# intermediate) and I have a very small amount of knowledge on Shaders, as well as experience on developing games(usually end up stuck in dev hell) and leading experience from my last team which at one point reached 11 people. I personally love the Unity engine and prefer to use it as it's the development environment I'm comfortable with. 
      I have used Unity for over a year and a few months, I'd consider myself an intermediate at the Engine, but to this day Unity still surprises me. 
      I live in the United Kingdom, I find it a bit strange to work with other programmers as the ones I've worked with tend to leave their code heavily unoptimised and I'm a on the go optimise kind of guy, I also like to get things done quickly.
      If you're a new team and need a programmer that has high levels of ambition and strives to maintain the motivation throughout the team, then I'm your guy. I don't care if you're just beginning because I'm all for helping people learn!
      To finish this off: I like to get things done and I like to get them done right the first time, if I fail I will do it again and again, etc, until I loose all motivation. So if you're a modeller or an artist, please don't leave me to do all the modelling/art as well as the programming and sound. I do have experience in all those areas but my main power is in programming and I'd prefer to keep it that way.
      [If this was posted in the wrong forum, sorry, I don't really know the layout of this website yet]
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity RPG Systems Design - Spells and Items?

This topic is 798 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey there.  I'm getting ready to implement some RPG systems in my Unity game.  I could really use some insight from someone who has developed such systems professionally.  I'm quite fond of MMO spell systems in particular for their sheer flexibility.  Teal deer at the bottom.


Regarding spells first, I've seen all manner of designs.  Some systems have spells as child objects of a character, some as monolithic assets that characters reference and feed data into, some as objects in a database that also have data fed into them.  I've seen uber-spell classes, very inheritance-based spell systems, some that use composition with Spell Effects, and so-on and so-forth.


Personally, I like the idea of having spells be ScriptableObject assets.  It's a simple thing that can be serialized in Unity's inspector, it allows inheritance-based extension, and it's very easy to manage.  This kind of setup would of course be the "monolithic asset" sort of thing, where a Spell asset is like a technique the character is performing.  However, this does come with some significant downsides.  As there is only one instance of any particular Spell, using events would not be feasible, and they couldn't use any per-character variables.  Every single function would require that the character be fed into the spell so it can read and respond.


I can't know for certain, but I suspect this is how WoW and ESO do things, given that they have multiple instances of the same ability.  WoW for example can have as many as a dozen versions of the same spell, as older versions are replaced on a character as they train up the ranks.  The reason I suspect that ESO does the same is that when a toggled ability levels up, it seems to be removed and replaced with an exact duplicate.  Thus I figure that the game's per-spell experience lines are not actually part of the spell itself, but rather held separately in the character's skill progression.

public bool CanCast (Character caster);
public void Cast (Character caster, Character target);
public void Cancel (Character caster);
public int GetManaCost (Character caster);

This also brings into the question the subject of targeting.  Some spells require a target to cast.  Some have targets optional.  Some merely require a direction or a position in 3D space.  But one thing is for sure; if targets can be fed through to any spells whatsoever, the base system will need such an option.  This is where things get really confusing for me.  I could definitely use some advice.  Right now I'm thinking of simply having a Cast (Character caster) function, and then the spell itself reacts contextually.  What do you think?

The other subject is items.  Initially I had thought a simple ScriptableObject system might be good for this as well, but as opposed to Spells, Items require a lot more optional functionality.  Items can be upgraded, modified, transmogrified, made in multiple styles, have durability and such.  I would probably need a more open-ended system for something like this, and I can tell it's probably going to require a lot of custom editor scripts...

TL;DR:  What exactly goes into designing good Spell and Item systems for RPGs?  How would you design one, and what have your favorite designs been?

Edited by Mysterious Bakemono

Share this post

Link to post
Share on other sites

I'm working on the design for a small rpg design myself. Only started on the rpg system recently and my notes about magic systems can be found on at http://www.gamedevpensieve.com/design/mechanics/magic. Not much yet :).

For the spell you can create a instance of the FireBall spell each time the player cast a fireball. When it is created give it the target and all others paramters it needs. Send in the players skill level in Elemental magic for example so the ball can get larger.

Share this post

Link to post
Share on other sites

Scriptable and Unity do not really go together hand in hand unless you add in some other sort of language to prevent unity from getting flooded with instances of inherited classes.


I think Javascript might work if C# and Javascript plays nice on Unity. Then it'd mean that you'd have a single class that gets instanced, and then loads in a script that gets fed data.


RPGs have been known for being notoriously hard however. Especially if you wanted fast iteration times.

Currently for my set up, Spells are defined in Lua, and are very scriptable. Characters do not Own spells, as that would be pretty wasteful.  But they do reference them via container. Besides I don't have control over that. Lua passes tables by reference. When the container is linked to the spell, the Container has direct access (but not ability to modify) the data of the spell. So it can grab the description, cool down, time to cast, and any other details.

When the container's GUI element is clicked, it plays the animation as the cast time goes. At the end of the timer, an Event is fired, and will tick on the next game update. Reason being is... no real good reason. Mostly to prevent small latencies for physically enabled objects

Each spell has a sub component naturally. A fire ball will fly down a path and strike something to explode where it then runs the logic for its hit test after next physics update. A healing spell will lock onto and follow someone, and apply it's healing after a certain animation.


So to break it down.

Spell Container: Player's access. Reads data from a spell's descriptor. On a successful cast, this will also lock the player out till the cooldown is over.
Spell Descriptor: The Spell's descriptor. Provides rudimentary function for selection. Spells always needs at least one item. Lua dynamically types everything. But in C#, you'll probably want to make this a list of args.

Spell Entity: Carries on the logic of the spell in the physical world.


I should note that Spell Descriptor is a parent of the Spell Entity Table. The Spell entity however is kept separate so it can be instanced efficiently.Target data is set to the entity. be it velocity, a point in space, or a person. This variable is kept as the entity updates it's logic.


All Spells' descriptors are stored in a global table.


Items tend to roll a little differently here.


Like spells their bases are stored. But they are entities by default. So they can be dropped into the world with a temporary ID if they are a normal instanciation, or a unique id if randomly generated. When they are in the characters inventory. They too have a general container tied to UI elements. When the item is stored in that containers location, it's just referenced to the entity table.

When the item is used, It's used instantly, or added to the character's qeue (if the character needs to play an animation).

Edited by Tangletail

Share this post

Link to post
Share on other sites


Ah, this is kind of what I'm going for, I think.  I am likewise trying to avoid too much instantiation where it isn't necessary.  Part of why I want to go for a ScriptableObject Spell and a character that merely contains a list of references to spells, is because instantiation is completely unnecessary and at times detrimental to functionality.  I am curious about how you manage target data.  How do you go about determining targets in code?

I'm thinking of ignoring target information in the initial function, and then allow the Spell itself to get the appropriate data.  Getting the target data may also include putting the character into an "aiming" state or the like.  Then there only needs to be a single Cast function, and I don't have to worry about all the minor details ahead of time.


It sounds like your idea for items is similar to what I've done; to have a monolithic template of some kind, and then item object instances that contain a reference to that template.  My confusion here is with regard to the individual items in a player's inventory.  There has to be some kind of per-object data to items, but items also need a static template.  I have considered using a byte array inside the item container class, but that feels like it could get messy...

Share this post

Link to post
Share on other sites

Spell Descriptor handles all targeting functions.

When the Container is activated, it calls the function of the spells descriptor  from the global reference. This function will determine if it's an AOE, a skillshot projectile, or a selection.

That collected data is then passed onto a spawned entity, which it acts upon on it's update. Keep in mind that my engine uses a Actor system similar to unreals.


For items... what do you mean per-object data? Do you mean it's a templated object that's unique? If so, you copy it, change data, create an identifier, store it in a -unique- database. You still use a reference to that instantiation if it's in your inventory.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement