Game Development Community

Magic Charging

by James Margaris · in General Discussion · 03/26/2003 (12:29 am) · 14 replies

So I started work on magic charging, I want to very briefly describe what I have working now, and ask for opinions on a few things.

Right now when you hold down the mouse button your energy starts to rise. (Starts at zero) At 50% it changes color to signify that you are level 1, at 100% it changes color again to signify you are at level 2. Right now I am using a varation of the fire staff, at level 2 it shoots out the level 1 projectile (the normal fire staff proj) and a second one that travels much faster. (Just a cheesy test for now)

There are a few options I want to try, like:
1: When charging you move slower.
2: When you reach full charge the charge stops slowly dropping, and if you don't fire you eventually drop power level again.
3: If you reach full charge and sit on it for a long time, you overload and explode.

All three of these basically accomplish the same thing, which is prevents you from running away, charging up at your base, then running back and attacking with some super-charged spell. I will most likely test out all 3. Originally I was leaning towards 1, but now I am not so sure, just because with already reduce movement speed it could be a pain, especially if you are travelling in a group and keep slowing them down.

But my main question is, how long should it take to charge levels relative to each other? Right now charging to from empty to level 1 takes the exact same amount of time as charging from level 1 to level 2. (that was the easiest thing to do for testing)

I think there should be a generic rule, I want to avoid each spell having different charge rates for different levels. (Harder to learn that, and harder to program) Maybe each level should take 50% longer than the previous level? Keep in mind that different spells could have a different number of levels, and what each level does can be totally independent.

I guess it really depends on how much better the higher levels are than the lower ones...I don't have any convincing thoughts, I wonder if anyone else has any compelling arguments for a certain recharge rate.

It does work pretty well though, even at this early stage it seems like it would add a fair amount of strategy and variety.

#1
03/26/2003 (3:11 am)
Hmm... you also have to consider the person who wants to charge and hold ready a level 3 spell when they have the capability to cast up to a level 7.

Generally I'd say give each level of spell a bonus effect, but keep a standard formula for damage/secs of charge... if you aren't charging you start to lose power, if you charge for too long (not necessarily at one time to allow for "holding" at a level 3 spell charge) without fireing you might get mystic energy backlash.
#2
03/26/2003 (5:25 am)
I'm not a particularly big fan of exploding after sitting for a while. If it takes 30 seconds to charge to a level 7 spell it's not going to be very practical to ever use it if you can't sit on it for a while. Maybe the longer you sit on it the more magic points it costs to cast with a max of 1 point under the next level? That way it's better to cast it early so you can cast it more times but doesn't discourage someone from using higher level spells.

For recharge rate I wouldn't completely discount having them all charge at the same rate. Unless you make a formla along the lines of 1/x I think the later levels will take too long to charge too.

Of course this all depends on how many levels you were thinking of having and how powerful you want magic to be.

Another possibility would be for your charge up rate to be a function of your movement speed. So the faster your moving the slower you charge. That might be a good balancer for fighting against melee characters. I'm starting to get off topic though so I'll end it there ;)

Alc
#3
03/26/2003 (9:22 am)
'Exploding when charged too long' seems to me to be an encouragement to follow a gameplay where the magician needs to be protected for the time it takes to perform a ritual, then he wastes half the town, or something like that. It's a different feel from just being able to kick booty all over, right now.

Good way to keep melee types and ranged attackers on par with powerful magician types. You need all three types; no one type should dominate.
#4
03/26/2003 (10:56 am)
Charge time could be proportional to the power, radius, duration and range. Different spells could charge more in a particular field. The fire spell could increase in radius and range, while the zappy spell could increase in range and power, for example.

Instead of exploding after sitting on it for a while, the energy could escape in short bursts dealing damage at the same time. The amount of energy released in the burst could be proportional to the amount of energy currently charged, and the effects would resemble the spell but not be directed in any way whatsoever.
#5
03/26/2003 (11:51 am)
If it didn't overcharge after hitting your peak, people would just keep releasing the charge button when it starts to drop, and keep recharging at that same level. The lower level spells aren't supposed to be useless; the higher level spells are supposed to be incredibly dangerous. This way, a high level spell would be something you'd rarely see, rather than an everyday practice. If you have a level ten spell or something, the highest you should normally see would be a level five, which should be on par with a powerful melee attack (enough to kill weaker players, like the Elven sorceress). A ten in this situation would take a lot longer and be able to take out a lot of players at once. Hence it would be overkill to use it in most scenerios anyway, unless you're on the outskirts of a village.

Charging levels should take about 50% more time than their previous level's time. To signify this, once you hit the max level, the meter could turn black or something obvious, and start to fill at a medium rate, so you could see how much time you have. Also, overcharging a spell with only two levels shouldn't do much damage. Overcharging a level ten spell would kill you and damage a small radius around you. The damage dealt should be 50% of the max level's damage rating. In cases of special spells like poison or slow, the effect would hit you with no damage, and last 50% of the max level's time (or effect). For enhancement spells, there would be no overcharge damage or drawbacks, just a limited time to use it before it uses itself.

As far as speed goes, how about lowering speed based on the spell's strength? On level 1 you'd slow down 50%, level 2 60% and so on. You'd stop moving entirely on level 6, which most spells wouldn't have anyway, just the most lethal ones. That should also look fairly smooth in the player animations, I think.

Magic should also be fairly hard to charge. Otherwise I could hop into a fast, magically potent elf sorceress player and charge level 1 spells from a distance, hurling them at an Orc or Gollem that has no magic. When they get too close, I turn around and use my slightly superior speed to escape with ease. Once they lose interest or I gain enough ground on them, I turn around and keep using level 1 spells.

Now that I think about it that way, it would always be more beneficial to keep using low level spells unless higher levels more than doubled power. If a level 1 ice spell did 50HP of damage, and a level 2 did 75HP of damage (50% of the previous spell's), then I could perform two level 1 spells in the same time, maybe less, for 100HP of damage. So the time would either have to be lowered or the damage raised. It makes more sense to raise the damage though, to say 150% of the last level, and have only a few levels instead of a lot.
#6
03/27/2003 (11:41 pm)
I agree with Eli except for a question or two. If it is possible to interupt a magic user while they are charging a spell that would have a huge effect on the balance issue. If I had a spell charged to level 1 and was half way to charging to level two and got hit by an arrow from a charging orc what would be the result. Would I always keep the level one spell even if I'd only barely charged past it (level 1 and 2% towards 2) or would it be possible for me to drop below and still have to charge back up to level 1? If you could be dropped below a level if you were close enough (say 30% over it) then it might be worth some overcharging just to make sure that you maintain spell casting abilities at all.

Reduced movement needs to be considered also here. If you can still move quickly while charging your spells you can dodge ranged attacks easier than if your movement is slowed. I don't think that a 1st level charge should cause a 50% movement reduction unless there are only a couple of levels. Maybe 30% on 1st then 50% on second. Also, I don't think that the magic user should ever be totally rooted to the spot except for maybe the highest level of spell.

One potential benefit to overcharging causing eventual explosion would be suicide attacks by magic users. If you are pretty sure your going to die, why not overcharge (if you have the time) and take out any nearby enemies in the process.
#7
03/28/2003 (12:13 am)
Ok, let me clarify one thing about the charging first. You charge by holding down the mouse button, and when you *release* the mouse button the spell fires. So, you cannot charge up, release, charge up again and *then* cast the spell.

What I want to avoid is people charging a powerful spell in their base, running to the front lines and casting it, then retreating and charging up again. Whether or not that is a problem really depends on how powerful the max level spells are. I tend to think that having really powerful spells that take a long time to charge is a bad idea, because the spell casters will end up spending most of their time charging.

The problem with the mana-based approach from before is that after you cast your spells you really have nothing to do but wait for for your meter to recharge. If spells take a really long time to charge under the charge system you have basically the same problem, a lot of downtime.

Right now charging a level 1 spell takes about 4 seconds, level 2 8 seconds. That doesn't seem like a long time, but I think if you start asking people to charge for more than 15-20 seconds they are going to get bored.

I like the idea that getting hit reduces your charge level, that is something I had thought of before but did not mention above. That mimics the typical idea that you need to concentrate to cast a spell.

Basically the goal is that the player should always be *doing* something. If they can lose meter by being hit it means that while charging they still have to be dodging and paying attention. Of course if they get in close combat they won't get a chance to do much, but that's the whole idea of Wizards right? (That's why you bring along a couple burly buddies)

I am leaning away from changing movement speed, because although it does add some strategy and perhaps realism it makes controlling the characters less fun. For a while I had the backwards and sideways speeds of the characters set to realistic levels, but it just was *not* enjoyable. And as I mentioned, it would be hard to work in groups when the wizard char was always lagging behind.

Here is what I am thinking for the first rev:

1. When you get hit you lose some amount of charge. (Can sink below whatever level you were at)

2. If you reach full meter and hold onto it for too long you start taking damage over time. I like this better than just exploding, because it gives you more control and cost/benefit analysis, you *can* if you want take some damage to get in the perfect position/timing.

Another thing is that higher charge spells will not just be more powerful, but perhaps a bit different. For example a level 1 lightening spell may do a lot of damage to 1 target, whereas level 2 may do more damage overall buy spread over multiple targets. Basically it shouldn't just be a matter of "if you have more time, keep charging." There may be some cases where there is still some decision to be made, rather than "higher level = better in every way."


---

A side note about movement speeds. Right now the elf is faster than the orc, and has better range. So the elf can beat the orc for free 1 on 1 if she is willing to play keep-away. However I don't feel like that means the elf is broken, at least not in CTF. Pecking away from long range is not a good way to protect a flag or cap a flag. Also 1 on 1 the elf might win but what about 2 on 2? The orcs could try to get her between them, nail one, then go after the other one.

That said, I expect that in the end magic users will move slower than other chars. Maybe make it so you move faster/slower depending on the weapon you have equipped or total inventory, so an orc with just a sword could run down a magic user. Or give fighting characters dashing ability but not give it to magic users.
#8
03/28/2003 (12:19 am)
Let me just add that I am not wedded to any idea, I am willing to keep trying different things until one of them is fun. It's important to have considered the possibilities, but in the end what matters is how it works in game. There are a lot of example of people falling in love with pet ideas to the detriment of the project. The same goes for melee combat and all other aspects of the game as well.
#9
03/28/2003 (8:15 am)
What I meant by change the charge rate changing with movement speed is to have the mage charge faster if they are standing still or walking rather then running.

I would say in terms of charge times that the best would be, if there were say four spell levels, that the level four spell would take one second more then half the length of a battle. So if a battle would last 30 seconds then the charge would take 16. That way have the choice between casting two level threes or casting one level four and a level two and so on. The more spell levels the harder it's going to be to balance and still make the spells progressive.

Alc
#10
03/28/2003 (9:45 am)
I think that having the higher levels spells have different effects is a great idea and I'm all for it! I think Greg's idea makes some sense but it might be tough to balance in-game.
#11
03/28/2003 (5:33 pm)
James, we were discussing the possibility of an endurance meter last night, and I figured that it could be incorporated here as well. For spells with more power (it probably will come up), to reduce the abuse of level 1 spells, you could lower the player's endurance some every time they cast a spell. Or, when you charge you could consume your endurance (a resource).

That would negate abuse of certain spells by limiting the time you can fire them off without creating the need for long charge times.
#12
04/05/2003 (1:23 am)
What about "fizzling" chances for building up? instead of starting at 0 and building to 1, then 2, etc., a player would start at level 1 with a 0% chance of casting successfully. Then the odds of it working would build up to 100% and hold a while so they'd have a chance to cast a sure spell, then build to 0% lvl 2. This makes full use of all the player's charging time, which will be especially nice if you decide to make the higher levels take forever to charge.
#13
04/05/2003 (3:13 am)
What about casting duration being the main source of temptation to cast higher level spells?

Here's some detail:

Charging is quicker for each level of charge obtained meaning that a level 1 spell may take a few seconds to produce effectively, yet a level 8 spell would come rapidly and would depend on the players ability to activate it at the proper level. Where the stake is raised is when a higher level spell is used it takes a longer amount of time to cast it as the energy amounted is concentrated and released. In this time the caster is at a high level of vulnerability and must be protected otherwise his concentration is intrupted and the spell fails before it is properly released.

For instance, take an idea for a lightning spell. At lower levels it deals less damage to less random targets in the area of effect. At higher levels it deals greater damage to more enemies in the range of effect (and possibly at a greater range).

Level 1 would take about 2 to 3 seconds to charge, which would be the slowest charge meaning a better and more accurate casting yet less of an effect from the spell and almost no concentration time. When the charge hits level 1 and begins it's ascent to level 2, you release the button/key and you take a fraction of a second to concentrate the small amount of energy and zap one or two enemies for some slight electrical damage. Quick and effective enough for a level 1 spell!

Now, for a higher level, lets use level 5 for an example. First you charge to level 1 which takes about 2 to 3 seconds as usual, then level 2 which is about 2 seconds flat, then level 3 which is at about 1.5 seconds, then level 4 at 1 second flat, then finaly, and with an accurate release of the button/key, at level 5 in almost 1 second of time on it's half-a-second climb to level 6! Considering you didn't release the key too quickly and ended up with a level 4 spell, the mage would begin to focus their energy in order to unleash it on their foes, yet it would take about 10 solid seconds (again determined consecutively by level) in order to fully concentrate the energy into it's casting form, which happens to be a constant 5 second random burst of violent lighning frying any foes who happen to be caught in a bolt for about 2/3 damage in the vicinity of the spell radius!

Some things that could be key:

Untill a charge is released the mage may move freely to a secure area. The mage may not move when concentrating!

When concentrating, the mage must remain in a trance-like state to complete the spell. Any attack which interupts this state simply negates the charge and forces the mage to begin charging again at level 0 (penalty may not be wise here, testing suggested). If the mage so chooses, they may cancel a charged spell at any time by pressing the cast key again, yet they gain a greater chance of causing harm to themselves (and possibly those nearby reguardless of team?), a percentage which rises as the concentration time is spent (which can be effectively shown as the opposite of the charge being acquired in graphic form, it depletes as the concentration time expires).

When a high level spell such as the one here is finaly cast, the mage can move at a walking pace while the spell is in effect untill it has expired at which time they regain their normal movement rate and their charge is reset to level 0.

Play with it and see how interesting it could be to use! It would make alot more sense to those concerned with actual RPG magic systems (instead of a giant time limit in order to charge a spell)!

Some bonuses to this system -

Casting accuratly is effected by player skill and timing.

Ideal for teams to protect the mage while they are basicly defenseless... also good for quest/campaign relevant spellcasting where a certain spell must be cast in a dangerous area.

Makes for some creative spellcasting effects.

Mages are well balanced with the other races.

Possible negative sides -

Lag induced accuracy reduction unless it's based as a client side function, but could still be an issue.

May be pretty bad if a team has 2 or more mages swapping turns with similar high level spells against a team with only 1 or no mages (could use a specil mage vs. mage spell for this like a dispell field or a confusion spell :).

Creative envy ;)

Just my thoughts on a way to go, but so far it seems like a good alternative and it shouldn't be too hard to incorporate into the game, just some simple consecutive timing math. :)

I'll still be thinking either way though! Good job so far!

- Christopher Dapo ~ Ronixus
#14
04/08/2003 (11:03 am)
How about loosening the idea of levels a little, and instead have the parameters of the overall spell increase smoothly over time. You dont have to lose levels altogether, there would still be different levels with different parameters but in between they would be blended/interpolated (so it wouldnt be just a straight linear slide from 0 to the highest level. Interpolation could be sinusoidal to further keep the levels prominent without having discrete steps.
It would give the player more control over the spell, and a wider variety of specific spells cast - very few spells would be exactly the same, but some might be quite similar. The system would feel fuller because each instance of a particular spell would still have slightly different parameters therefore not being entirely predictable, and deeper than just randomizing discrete levels on the server because the randomisation comes from the players own input.

Also, I think this may have been mentioned before, or be an obvious step to take, but anyway, the max level reachable could be determined by the players classes magic level (plus the effects of any magical artifacts carried or used or whatever), after which the player starts to take damage, and charging can also slow down to make it impossible to reach much higher levels.