Public Group

# tutorials on statistic elements of a game?

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

## Recommended Posts

Hi, i'm curious to know how these text-based web games (or any game for that matter) go about handling the statistics. Example: you are a person, you are stronger if you have a shield, eat food, sleep, have weapons etc. So when you go and fight with another member, the member with more shield power, food, weapons has a better chance of defeating the other member. your strength I'm sure is also relative to how all the other members are doing right? Are there any books that cover these topics? tutorials?

##### Share on other sites
I don't know if such things exist; many computer game systems are based on old pen-and-paper RPGs, meaning the art of developing such systems seems to gradually be getting lost.

I've been considering writing an article on it in the future, but that's no help to you now, I know.

The very simple answer is: pick what sort of outcomes you want, analyse the statistics for it, then create the system so that it works out that way. eg. If you want the average person to be able to take 10 hits in battle, then you simply make sure than weapons deal average damage equivalent to 1/10th of the average person's health. Once you have the core operations balanced, you can add subtle modifiers such as the food, rest, etc.

Every game is different, so there can never be an 'answer' to how to do it.

##### Share on other sites
Hi,

Basically I'm looking for an example so I can understand it better, not really looking for a 'solution' like you said its different for each game/scenerio.

##### Share on other sites
If you are really interested in Text-based games I suggest you look at the D&D players guide. Like Kylotan said, many older games were based off this one.

You can either buy it (I think its like 30 dollars...) or just go read it in your closest bookstore (not all carry them) or hobby shop.

But if you are lazy, the mechanics for attacking someone are what they call an Attack Roll. You attack roll is compared against your targets Armor Class, both of which can be modified with stats, spells, armor, and miscellaneous happenings.

You can see it in action here http://www.wizards.com/playdnd/playdnd.asp

##### Share on other sites
ok that demo gave me some idea on how things could possibly be coded.

that was a good graphical example of how I could possibly code a text game, except one doesn't HAVE to show the actual method of how things are calculated (like D&D shows your role to the user, along with what you need to defeat your oponent and then how damage is calculated etc.)

i guess you guys are more into directx type development?

##### Share on other sites
I would personally recommend to you the arctan function, since its shape lends itself quite nicely to RPG-style combat systems. From there, you can add modifiers to transform the function how you see fit (some knowledge of trig is helpful here).

If you wish to play around with equations, you can use GraphCalc. It has a nifty feature called n-slider - you write an equation with an extra variable "n", the value of which you can control using a slider. This allows you to see the effect a particular variable has on how the graph looks. I only wish it supported multiple n-sliders, though...

Finally, you should take a look at this article: Randomness Without Replacement. It basically says that your random number generator should work more like a deck of cards rather than a pair of dice; every time a random number is generated, it should be taken out of the "deck of cards" to avoid having it pulled again and again. This avoids the dilemma of "frustration" for players, or bad luck with random numbers, which may supposedly drive some people to quit your game.

And remember, this is the 21st century. Unless you manage a truly massive MMORPG, don't worry too much about the complexity of the equation you use for producing your "attack roll", "armor class", etc. The CPU can handle it.

Hopefully, this will get you started [smile]

##### Share on other sites
do you guys think this book would help me much?

http://www.amazon.com/gp/product/1592000908/sr=8-3/qid=1152496713/ref=pd_bbs_3/002-0779609-4105651?ie=UTF8

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 31
• 16
• 11
• 10
• ### Forum Statistics

• Total Topics
634118
• Total Posts
3015609
×