Jump to content
  • Advertisement
Sign in to follow this  
Fradno

An Algorithm To Decide The Cost Of Skills/techniques.

This topic is 758 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

Has anybody made a system in their game where they don't need to input the cost of a spell/skill/technique, only it's active parameters, and based on the parameters, a calculation is made that determines the move cost?

 

It always seems to me that the cost of moves in some games are decided arbitrarily and inconsistently. : I Possibly due to time constraints and different teams working on different move sets maybe.

Share this post


Link to post
Share on other sites
Advertisement

I've seen several games where the cost of 'things' is calculated algorithmically, based on a formula the developers created. But often the designers want to override those values based on their own experience, because the formula may not capture the true cost or benefit of a certain skill, spell, unit type, or whatever. In fact it's often close to impossible to derive a formula that is always accurate in all conditions. And sometimes they make certain things cheaper to encourage players to use them, purely to add variety to the game.

 

It's common for designers to have a formula in their docs that they all work from when deciding a cost, but they don't usually have that built into the game itself for the reasons above.

Edited by Kylotan

Share this post


Link to post
Share on other sites

It always seems to me that the cost of moves in some games are decided arbitrarily and inconsistently.

Because it's difficult; so difficult that implementing a system to optimize move costs automatically is likely to be even more difficult.

The right way to choose move costs is playtesting to discover problems, exploits, opportunities etc. and to find the most fun variant of the game; being able to predict how a cost change would affect the game is usually a bad sign (it means that the game is simple and strategies are trivial or obvious).

Share this post


Link to post
Share on other sites

The paper and pencil roleplaying game system 'Champions' (a Superhero RPG) comes to mind. It had an extensive system for calculating costs for various abilities, which was quite impressive in some ways. I'm not sure if the MMO version kept any of that same system, but it might have.

 

One thing I thought was interesting about it was that powers increased exponentially while the costs increased linearly (kind of). So without spending a crazy amount of points, you could have a character with enough strength to 'lift a battleship', which is the sort of thing the superhero genre emphasized a lot. Being able to quantify 'how many points' someone like Thor has vs someone like Spiderman has was pretty ambitious.

Share this post


Link to post
Share on other sites

One thing I thought was interesting about it was that powers increased exponentially while the costs increased linearly (kind of).
Such a cost scale is typical of roleplaying games, where decency and gamemaster control ensure diminishing returns for very high power levels (i.e. few battleships to lift, and only in appropriate cases).

In a videogame exploitation of cheaply obtained high power levels is more likely; exactly the sort of thing that should be playtested out of existence.

Share this post


Link to post
Share on other sites

Kylotan: I see, yeah, especially if some stat combination has a return that doesn't reflect it's stats on papers? I think stuff like "absorb enemy hp on hit" really unbalances things. If a flat value could be determined from such an effect, then that flat value becomes the abilitis "cost" and then can be added to any attacks to add to their cost.

 

@LorenzoGatti Hmm, I see what your saying, but I mean something like this: Say you have to add "attacks" to a database in your game. The engine for determine the cost is done. So you have these field values where you input the numbers, and out comes out the ENERGY or MP cost of that move. Say something simple like "(Attack * Accuracy) * 0.1" With Attack value going from 1 to 150 and Accuracy going from 0 to 1. So an attack of 50 with 0.7 accuracy would yield a cost of 3.5 points. An attack with max value of 150 and 1 would yield a cost of 15, while another attack of same power but 0.2 accuracy would cost 7. {Accuracy is multiplied off the users own accuracy stat, and goes into an algorithm that puts it against the opponents own dodge and agility combination, rather than being 0 to 100% flat rate} Anyway, yeah, in simple terms, it would be a simple game.

 

But now add other things, such as HP or energy absorbtion. If absorbs say 50% of hp on hit, then the cost should be x1.5 within the algorithm for damage above.

 

If it has a stat attacking effect, the cost would be linearly proportional, and so on I guess in a game like this, it would be hard to implement wordy effects like "Puts so and so to sleep for number of turns?" yeah? But couldn't the number of turns and such be implemented into the calculation? The algorithm to determine an attack cost would be something like {((attack * accuracy)+(effect * special))*0.1)} I mean theres gotta be a way to make the calculations for even more complex stuf if somebody tried hard enough, and just, really really wanted it. This is of course with linear algorithms. I've seen some games use an algorithm, where more potent stuff had costs with efficiency values that dropped the stronger the attack. In physics, it's kind of this way with diminishing returns I believe!

 

I think it IS possible, BUT the system woudl be so user unfriendly, only the most hardcore and intellectual players would even take interest in tinkering with such a complex system. While making it ot user friendly would result in the scenario you envision of simple tactics and shallow gameplay.

 

@polychrome Interesting! I never heard of such a system that exponentially increased something compared to the cost. It's usually the other way around!! lol For example, in Armored core, a booster with 11,000 output had a cost per second of 3,000, yet the strongest booster, with about 29,000 boost power, had a cost of 22,000 per second! Basically, you picked between moving a high average speed a lot, or the ability to dodge anything, but with high costs and the risk of engine bust if done too much.

Edited by Fradno

Share this post


Link to post
Share on other sites
I never heard of such a system that exponentially increased something compared to the cost. It's usually the other way around!! lol For example, in Armored core, a booster with 11,000 output had a cost per second of 3,000, yet the strongest booster, with about 29,000 boost power, had a cost of 22,000 per second!

Such a cost scale is typical of games where either

  • there should be a soft cap on power levels: the expensive options are inefficient and therefore avoided, but not forbidden because they might have a valid niche.
  • the usefulness of higher power increases disproportionately (I don't know what the mentioned boosters are, but if a rating of 29K is enough for some important purpose and a rating of 11K means certain death, the better booster is much more valuable than 2.64 times the small one; according to the Armored Core designers, 7.33 times more valuable).

Specific rules like these are just examples of game balance. You like formulas, but no formula can establish that the appropriate costs of your boosters are 3K and 22K. A formula can only interpolate between tested cases in the hope of approximating the right result in intermediate cases;

Edited by LorenzoGatti

Share this post


Link to post
Share on other sites

I mean theres gotta be a way to make the calculations for even more complex stuf if somebody tried hard enough, and just, really really wanted it.


Let's take an example: I can choose 2 light tanks that deal 10 damage per hit, or 1 heavy tank that deals 20. Assume they have health proportional to that as well. On a pure "damage per second" formula (commonly used by online RPGs and MOBAS) these 2 are equivalent, and the damage absorption capacity adds up to the same amount, so a light tank should cost half a heavy tank.

But what if part of the gameplay involves blocking narrow passes and bridges to stop infantry crossing? The light tanks might be worth more here because they can block 2 places rather than 1.

What if there's an opposing unit that is really fragile, but deals enough damage in one hit to destroy a light tank outright, but not a heavy tank? Suddenly heavy tanks seem better value because there's a chance it could just take out both your light tanks before they get a chance to fire, but the heavy tank will be able to fire back and destroy it.

What if having to control 2 light tanks effectively is more of a burden on human players, meaning they should be priced more cheaply? Whereas for an AI it's no extra work at all.

To throw another spanner in the works, what if the light tanks always deal 10 damage a hit, but the heavy tank deals a random number between 0 and 40. The average damage is the same as before. But... if you're faced with a deadly opponent who has 18 health, you want the light tanks to take it out immediately. But it has almost a 50% chance of surviving a hit from the heavy tank. The tables are turned if the opponent has 21 health. The light tanks now have no chance of killing it on round one; but the heavy tank has half a chance of doing so.

The only way I would consider this to be close to solvable is by running a machine learning algorithm on it to fit the formula to the stats, based on playing the game and measuring how the outcome differs from the prediction. That's because there are always hidden benefits and costs that only emerge from the design of your game, and which go beyond easily recognised numerical values.

Edited by Kylotan

Share this post


Link to post
Share on other sites

@LorenzoGatti Oh yeah, you definitely are right about that. Back then, I decided I wanted "the fastest" character, what ended up happening was my character could only move at top speed for 2-3 seconds before blowing up from the sheer heat cost of having the highest output boosters. Sure, anything could be dodged, but only in 1 second spurts. Normal boosting is usually continuous, lasting for 15 to 20 seconds on an efficiently built character before you stop to regain back lost energy. The "heat" mechanic was a "soft cap" to prevent people going all out in speed without paying the price in some way. I took the niche anyway and was able to build a viable play style that allowed me to beat any but the most competitive of players. I miss games like that, which let you build your own stats within their system, and the "cost" of all your actions would be determined based on numerical values that gave pros and cons to your character. They probably did tweak an initial formula and play tested the game enough that they determined the high speed from a 29,000 output booster was worth the high drain{and heat}. Maybe the original formula gave it a lower cost, but after much testing, they tweaked some variable to increase the cost non-linearly the higher it went. {11,000 output gave about 210 to 270 kph speed while 22,000 output on the same character gave 530 kph, roughtly around those areas.}

 

@Kylotan Oh in the case of RTS, i can't imagine there would be any sort of linear formula that could balance unit stats. For example, I like how they determined 100 mineral cost gave either 4 zerglings at 35 hp, 5 damage melee, 2 marines at 40 hp, 6 damage with range, and 1 Zealot, with 60 shields, 100 hp, and 16 damage melee{delivered in bursts of 8 damage, which means 1 armor would be -2 to the 16.} To have figured that out I imagine they pitted these units against each other in various situations. At choke points, open areas, hit and run, and all other sorts of strategies that a single unit can accomplish.

 

Yes, I can't imagine a formula to create such results. I was thinking more along the lines of a game like Armored Core, where certain areas can be tweaked seperately from others{and each area is simple to understand, but when all are combined, creates for a complex game}, for example, I can imagine projectiles getting their own tuning/editing, to increase their velocity yet decrease damage at same cost, or increase all stats, but the cost of it going up immensely, with the design idea for such a move being "Betting it all in one shot", which is probably the motto for why a formula increases cost of higher stat things more than when they are lower dis-proportionally.

 

Well, in RTS, I guess if you could edit their stats, it would either effect the cost or stats, but since a single unit doesn't have a linear function like a projectile or boosting in a physics based game, you have to consider all the possible outcomes for that single unit in various situations, which is what makes it hard to balance. The very nature of current RTS is the reason why stats have to be play tested in order for them to be balanced.

 

Usually the source of inbalance is "infinity" in some aspect of the game. Remove it and you should be able to create a game that can eventually have even a formula for determining the constant cost of motion. {But I think there is some confusion, I just want to emphasize, I'm talking about action games with stats, constant motion, and constant draining of a meter as important aspects within the game, which allows the possibility of the exploration of "energy loss".

Share this post


Link to post
Share on other sites

Hi,

 

@Fradno

I think you should read this article : http://archive.gamedev.net/archive/reference/design/features/balance/default.html

 

This part could answer your initial question : 

"Attempts to reach perfect balance mathematically are best avoided, except with fairly simple game systems. For instance, balancing Risk isn't terribly difficult because the game rules are fairly simple, and player choices can be quantified very effectively. Balancing monopoly is doable, but trickier than risk, because the random element (dice rolling) can produce much more widespread effects than it does in risk, and also because monopoly has a much larger number of distinct game elements (chance cards, mortgage rules, jail, etc). More complexity, such as that in a modern RTS, creates a situation where a complete mathematical play balance solution is worth of a doctoral thesis. "

 

I am actually interested in studying game balancing, if by any chance you have documents related to this, please give me the links ;)

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!