Temple of The Roguelike Forums

Development => Programming => Topic started by: devonps on December 18, 2011, 10:27:32 AM

Title: Spell casting types of costs
Post by: devonps on December 18, 2011, 10:27:32 AM
I'm currently looking into the design of spell casting cost types and currently have designed the following options:


What I've been thinking about lately is whether I should ditch these (standard?) types and go for something slightly different and my thoughts led me to a combination of:


I realise that in essence I'm swapping one inhibitor for another however I do think my second approach provides more tactical play for the player.

Does anyone know of another roguelike that uses my second approach - so I can take a look.


Regards,

Steve.
Title: Re: Spell casting types of costs
Post by: Ancient on December 18, 2011, 10:43:31 AM
I think I played such a roguelike.

*freezes halfway reaching for RL Database and RL list*

Ah, yes! Cardinal Quest demo has timers on spells instead of mana. Its cool down essentially. I am curious in what way mental fatigue differs from mana points.
Title: Re: Spell casting types of costs
Post by: Pueo on December 18, 2011, 10:52:00 AM
I don't know about any specific roguelikes, but I know that there are a few basic options:

Cast from Mana/Mana-like-thing - Pretty basic.  It's also mostly the same thing as cooldown, because you have to wait for the Mana to recharge.
Cast from Health - Can add a tactical side to gameplay, ie, "Do I have enough health to cast this and still survive?" type of thing
Ally Sacrifice - I wouldn't use this one, it seems a bit harsh for one spell
Charges - Each spell can only be used 'x' amount of times, then it needs a recharge. Could be a version of mental fatigue, you get tired after casting a spell 'x' times, for example.

However, some different options could be:

Expendable spells - Make a spell out of some ingredients and you have a one-time charm. I would personally use this as a supplement.

Casting time - It takes 'x' turns to cast Fireball, for example.  Hard to implement without unbalancing the game.

Blood Sacrifice - Cut your health to 10% or so and gain the ability to cast a powerful spell a few times.

That's all I can really think of right now.  :)
Title: Re: Spell casting types of costs
Post by: devonps on December 18, 2011, 11:02:30 AM
Ancient thanks for the reply.

I'd forgotten about Cardinal Quest - I even have a copy of it!

I guess my view is coloured by my experiences with films and books - where I don't see the mage/wizard reaching for a "mana potion" to refill rather they can only cast so many spells at any one time. I'm trying to put together something that is slightly different for my players, something that makes them stop and think or at least slows them down.

At the moment I find hard to quantify any technical difference between the two (just as I said in my original post), except that one goes down in value as it's used and the other increases.

I guess I'm just a little jaded with the whole notion of using "mana potions".

Steve.
Title: Re: Spell casting types of costs
Post by: devonps on December 18, 2011, 11:10:20 AM
I don't know about any specific roguelikes, but I know that there are a few basic options:

Cast from Mana/Mana-like-thing - Pretty basic.  It's also mostly the same thing as cooldown, because you have to wait for the Mana to recharge.
Cast from Health - Can add a tactical side to gameplay, ie, "Do I have enough health to cast this and still survive?" type of thing
Ally Sacrifice - I wouldn't use this one, it seems a bit harsh for one spell
Charges - Each spell can only be used 'x' amount of times, then it needs a recharge. Could be a version of mental fatigue, you get tired after casting a spell 'x' times, for example.

However, some different options could be:

Expendable spells - Make a spell out of some ingredients and you have a one-time charm. I would personally use this as a supplement.

Casting time - It takes 'x' turns to cast Fireball, for example.  Hard to implement without unbalancing the game.

Blood Sacrifice - Cut your health to 10% or so and gain the ability to cast a powerful spell a few times.

That's all I can really think of right now.  :)

Hi Pueo,

You have some interesting ideas there, I've responded accordingly.

Ally sacrifice - if used would be for the Necromancer class mainly, where he can summon lots of weak allies and then use them as sacrifice.
Charges - I didn't think of that, in effect you're actually restricting the spell and not the caster - nice idea.
Expendable spells - Interesting idea, I would need to think about that approach before forming an opinion.
Casting time - I could implement this as a part of my delayed effects sub-system, interesting thought that one.
Blood Sacrifice - I see this as an extension of the "cast from health" mechanic, so that would be fairly easy to implement.

Regards,
Steve.
Title: Re: Spell casting types of costs
Post by: Hamish on December 18, 2011, 12:44:51 PM
For the tileset I am making I have made spell tiles that are written in blood - I like the HP related spell casting as it forces hard choices and gives magic a little dramatic potency.

I don't have extensive knowledge of all the roguelikes out there so I don't know if this has been done already, but how about having manna as a property of the environment rather than the character.

In Larry Nivens 'burning city' books manna exists as a non renewable ambient energy. Areas that see a lot of magic use loose the manna and magic ceases to work. The stories all revolve around wizards looking for alternative sources of manna.

Terrain based manna points would create lots of new areas for strategy, magic users would have to move around a lot and would be drawing on the same manna as there enemies. Non magic users would also be able to take advantage of different levels of ambient manna by keeping to dead zones.

Also in the Larry Niven books the wizards are able to drain magical items of their manna if there is no ambient source - this could allow the player to cast spells by desiccating magic rings, weapons and trinkets.

Unrefined gold is a major source of manna in the books, and cold iron acts as a sink for manna - this could be used to explain why magic users are only allowed staves and silver knives.

something to think about.
Title: Re: Spell casting types of costs
Post by: eclectocrat on December 18, 2011, 01:16:55 PM
I'll tell you what I use in my game Mysterious Castle. (http://www.mysteriouscastle.com)

I'm going for more of a D&D type magic system, where you can learn spells of different levels, and then prepare a certain number of spells with material components when not in battle. In my case the components are mushrooms of different colours. So you can prepare X (lets say 5) level one spells when not fighting, and then during play you can cast them. This puts a limit on what the caster can du during combat, and adds a scarcity value to the material components (mushrooms), which requires you to balance out what spells you prepare/cast. It's a little like the expendable spells system mentioned above, but without being embodied in an object.

PS. For some really great magic systems you need to look at Ultima 8, it's an isometric RPG from 1993/4 which had 5 different magic systems (ok, 4 that the PC could use), each one different from the other. I thought that game felt really magical when you had to arrange red and black candles and various reagents on a pentagram in order to prepare fire spells. If you did it wrong, a demon might appear and smash you! Good times...
Title: Re: Spell casting types of costs
Post by: Darren Grey on December 18, 2011, 02:36:36 PM
I agree that the traditional "spam fireball, chug mana potion" method of combat is bad for mages, and a cooldown system can work very well in a turn-based game to make you think very carefully about your every move.  ToME4 is the best example I know of this, and it even stretches the cooldown system to a lot of vital warrior skills, making for a much more interesting combat system in general.  The best part is it applies to enemies too, so you can try to get them to waste a spell against a temporary shield before closing in to hack them down, and other such tactics.
Title: Re: Spell casting types of costs
Post by: devonps on December 18, 2011, 05:39:46 PM
@Darren Grey - in my game all magic casting monsters (player, enemies, npcs) will use the same magic system and spells, this is something I've baked in from the very first line of code.

@Hamish - I like the idea of the environment controlling whether spells can be cast of not, makes for very interesting choke points in a game.

@Electrocrat - thanks for the tip about Ultima 8; Having the classes perform magic in different ways is something that appeals to me, for example a summoner could only cast (magical) allies who actually cast the spell.

@All - thanks everyone you've given me some really great ideas for my magic system(s) in general as well as providing input into my specific question.

Regards,

Steve.
Title: Re: Spell casting types of costs
Post by: lulero on December 18, 2011, 11:58:45 PM
Wizard101 isn't a very good game, but I like the battle mechanism a lot and I feel it would do great in roguelike settings.

The player owns a deck of cards (spells/skills). Game would goes somewhat like this:
That last point is quite different from the original but I like it better.

Anyway, I consider using a similar system for my project, but since I never finish anything :'( if anyone like the idea it's not mine anyway :P
Title: Re: Spell casting types of costs
Post by: guest509 on December 19, 2011, 02:49:24 AM
  As far as sacrificing an ally, I like this idea. The cost of magic is blood of your friends. If mana does not automatically refill and this is the only way to get more mana...this is cool. 100pts for a baby, 10pts for an old man. 1pt for a chicken. If you run out of mana it can start taking your own life/health.

  Along with cooldowns on most of the abilities, WoW also uses the following mechanisms.

Warlock - Standard refill over time mana, but the player may easily transfer health to mana.

Warrior - Uses rage. It is built up by hurting and getting hurt. Starts at zero. Fades over time. Has the effect that a Warrior stats a fight a big slow but gains ability throughout the fight. They have the ability to finish you off with a huge blow at the end.

Rogue - Uses energy. Starts at 100% and falls quickly. Refills quickly as well. Also certain abilities create combo points which other super abilities also require. This class generally opens a fight big. Then slows down as they build up combo points. Then once their combo bar is full they end in grand fashion.

DK - Uses a 6 rune system of 2 types. Using abilities takes 1 or more runes. Runes refill over time. A sort of cool down system based on the resources not the spell used. Kinda wonky but fun.

Shaman/Mage/Priest/Paladin/Hunter - Standard refilling style mana pools. I think they call the Hunter pool 'focus' or some such. These classes can open big at range but they can run out of mana and peter out.

Druid - Uses the Mage, Rogue or Warrior method depending on what animal form the Druid takes.
Title: Re: Spell casting types of costs
Post by: guest509 on December 19, 2011, 02:54:23 AM
  I wonder if any roguelikes use a food system where you can get sick from eating/drinking too much. This could be a fun little control on how much potion a person chugs.
Title: Re: Spell casting types of costs
Post by: Pueo on December 19, 2011, 03:09:03 AM
  I wonder if any roguelikes use a food system where you can get sick from eating/drinking too much. This could be a fun little control on how much potion a person chugs.

I believe Nethack has a thing were you can vomit if you eat too much, but I don't think that's exactly what you meant.  That's a good idea though, mind if I use it for my project?
Title: Re: Spell casting types of costs
Post by: devonps on December 19, 2011, 07:20:48 AM
@Jo My Warlock class already has spells that do just that - transfer health to mana & vice versa.

I don't play WoW so have no idea what a DK is however based on your description I have a Runecaster class that uses the same concept, so I'm kinda guessing they are the same?
Title: Re: Spell casting types of costs
Post by: devonps on December 23, 2011, 02:06:25 PM
I thought it might be useful to someone to see an overview of my thoughts about the different ideas posted in this thread.

For each idea I've posted the opening paragraph(s) and I've posted a much more indepth article on my blog Veneficus Schola (http://).

Mana

Using mana is a well-known and trusted way of controlling when the player character can cast spells and it is quite simple to implement.

Health

Using the casters health to cast magic is a lesser used alternative to using mana and presents a direct risk to the caster, because low health means a greater chance of death.

To counter this the caster should be provided with cheap and quick ways to increase their health e.g. a spell that will swap mana for health.

Ally sacrifice

Ally sacrifice is a mechanic that allows the caster to sacrifice any number of his/her allies to provide the power to cast any number of spells.

The basic idea is that the death of each ally makes available an amount of “power” that can be passed back to the caster which can then be used to cast one or more spells.

By using this mechanic not only will the casters allies attack all enemies of the caster but upon their death they will return an amount of power back to the caster, which allows the caster then to cast further spells. An interesting side thought is that the power returned to the caster could be based on how many enemies each ally has killed.

Spells have charges

Simply put this means that a spell can be cast a specific number of times without the need for any further preparation, ingredients or penalties to the caster (unless the spell fails).

One of the key questions for this mechanic is how can the spells be prepared?

I can think of using rituals, ingredients and over time as valid options.

Using a totem pole (aka a fetish)

Once the totem pole has been placed on the ground it emits an energy field that provides the caster (or even everyone in that field) with enough energy to cast spells.

The totem pole would last for so many turns before it is exhausted at which point it should be collected by the caster and allowed to recharge over time and of course whilst it is recharging the caster cannot cast spells – quite an interesting challenge for the player I think.

Mental Fatigue

Mental fatigue represents the amount of concentration needed to cast spells, each spell produces fatigue that the caster accumulates over time and therefore makes it slightly more difficult to cast the next spell. If he/she stops casting spells then this fatigue will go down, however if he continues to cast spells then the increase in mental fatigue will affect his physical statues, e.g. they could pass out thus rendering themselves vulnerable to attack and maybe death.

Environment based energy

My initial thoughts (and I admit they are based on a forum comment) are that the terrain will contain both pockets of energy and natural energy seeping from the ground. This will allow the caster to cast spells wherever they are but if they want to cast something powerful or more than 1 spell then they need to move into these pockets.

When the caster is moving around isolated and specific terrain tiles will contain enough energy to allow the casting a single spell. The caster will need some indication of where the next “casting” terrain tile is located and I’m not sure how to do that yet, maybe a visual marker of some kind.

Spell preparation

This allows the caster to have a set number of spells ready to be cast at a moment’s notice. Each spell can only be cast once before it needs preparing again. To offset this one-shot spell casting approach the caster my thoughts are turning towards a quick turn-around for preparing spells and/or maybe only part preparing spells so they can be used quicker.

As I said at the top of this post I've included only the opening paragraph for each description.

Regards,

Steve.
Title: Re: Spell casting types of costs
Post by: jasonpickering on December 23, 2011, 11:11:10 PM
there was an RPG a while ago where you were half dragon (No not skyrim) and the player had these super powerful dragon spells, but each time you used it you lost some of your humanity. it you completely depleted your humanity you lost automatically. it came down to this thing that you see in a lot of other games where the player wont spam spells because they will always be afraid about what they will need later. You use the players fear of what will come up next to manage their spell use.

Example: a lvl 1 minotaur comes around the corner and I blast him with a fireball. next level I run into lvl 5 minotaur. "Damn I should have saved that fireball. I could use another fireball, but what is going to be on the next floor?"

you could even use it as Corruption. perhaps you are calling on an ancient demon and each spell damages your soul. but that same idea you could remove some of your Max health also, which has already been mentioned.

Another idea could be taken from Street Fighter. as you play street fighter you charge up a super meter (I think this is right) well lets say you charge up this super meter somehow (over time, killing enemies, killing enemies with a soul suck move, Exploring). it goes from 1 to 3. Spells would have different values then. so fireball costs 1, but an inferno that burns everyone on screen costs 3. so you could shoot 3 fireballs or use this inferno. Its kind of a modified Mana system. dealing with smaller numbers, and it takes longer to get that 1 MP.
Title: Re: Spell casting types of costs
Post by: Marker Mage on December 24, 2011, 12:30:34 AM
May I suggest having whatever resource used for spell casting being split into more than one resource? It could be as simple as having multiple types of MP that were used for different spells. Maybe spell 1 uses type A MP and type B MP, while spell 2 uses type C and D, spell 3 uses type B and C, and spell 4 uses type A and E. With such a set up, you could cast spell 1 without it affecting how often you can cast spell 2, but casting spell 3 would lower the number of times you can cast spells 1 and 2, while casting spell 4 lowers the number of times you can cast spell 1 without affecting how many times you can cast spell 2 or spell 3. Basically, the kind of thing you see in a multicolored Magic the Gathering deck.

One game that I remember from my childhood that I think made this interesting was Secret of Evermore, which relied on an ingredient-based system for its spell costs. I'm sure that there has probably been a roguelike or two that did something similar. It DOES allow a possibility of setting up a system for assigning random spells to the various pairs of ingredients, which allows the player to try combining random ingredients to see what happens. This brings up another potential type of spell casting cost, risk.

Having risk as a cost means having the spell have a chance of not working how the player expects it to. Maybe it fizzles out and wastes a turn, maybe some of the parameters change unexpectedly so that you get caught in the blast radius, Maybe the target is changed, or maybe the spell just flat out blows up in your face.

If you want to go with a Lovecraftian horror theme, there's always the possibility of having magic cost you sanity. Just have the player experience various effects like seeing stuff that isn't there or having the names of their items change (maybe change "green potion" to "green poison") or having one monster appear to be another if they've been using magic a bit too much. While you're at it, change the descriptions to be more terrifying. And if you really want to scare the player, have the game not react to any key presses for a few seconds.

Rather similar to the sanity cost, but you could also try having a spell leave its caster with a status effect of some sort.
Title: Re: Spell casting types of costs
Post by: Bear on December 24, 2011, 05:47:02 AM
I've been thinking about having spell-point recovery work in an odd way.
Consider if a caster has several different kinds of 'mana' points: short, medium, and long-term. 

Weak spells take 'green' mana; you can recover enough to cast them again in minutes, or maybe seconds.

Medium-power spells take 'yellow' mana; you'll recover in minutes to hours.

And your most powerful spells take 'red' mana, which you recover in terms of days. 

But if you're out of green mana, weak spells would come out of yellow mana.  If you're out of yellow mana, medium-power spells (and low-powered spells if you're also out of green mana) would come out of red mana.

The idea is that the caster needs to be a little bit careful with his resources to avoid squandering his 'red' and 'yellow' mana on 'green' spells, but if that level of care is met, he has a pretty free hand with 'lesser' spells, even while recovering from a 'Major' casting that he can't do very often.

Title: Re: Spell casting types of costs
Post by: devonps on December 24, 2011, 08:55:48 AM
@Jasonpickering - nice idea, I think you have the makings of a 7DRL there my friend :)

@Marker Mage - Another good idea as it takes the basic ingredients approach and expands it a little further.

@Bear - This is a great idea, I wish I'd thought of it, I can see how it could fit into my design but I can also see how much retro-fitting I would have to do to the spell templates.

Thanks all for the responses.

Steve.