Choosing a curve (or function)
A large portion of designing a game is defining functions (in the math sense) for various interactions. Examples: How much damage should an entity take from an explosion, given a distance from the center "r"? How much reward should a player get from defeating an enemy, given a level difference "dl"? How much should a population grow this turn given a current population "p"? My method is to consider what gameplay effect I want, then pick some kind of linear or square function, then tweak until I get the results close to what I want. Often, I have an idea of the shape of the function's curve, but unless it's simple (e.g., linear or exponential), I don't know how to convert it to a function. For example, with population growth I might want a curve that starts shallow, grows quickly, then levels off, but not know that such a curve is called a "sigmoid function." Anyone know of a gallery of curves for use in defining game functions?
You might be a lot better at math than I am but I've found this to be a big time waster. It can be very easy to get engrossed in all the details and permutations of some particular function, but if you don't know the ins and outs and applicability already (i.e., you're asking here) the time you spend learning is time you're not making your game. Not trying to be harsh, btw, but after pursuing population growth functions, Kondratiev waves and other cool modeling mechanisms I had to take a step back and realize that some of the things I put in didn't work and simpler techniques would have let me see what was wrong LONG before I wasted time fiddling with complicated functions.
I think until it comes time to refine your game you should (to quote a very popular engineering expression) "do the simplest thing that could possibly work." Damage, rewards, population growth-- all these things are going to change as you make the game and you may not see how they all interrelate until it's playable enough to develop an opinion.
I think until it comes time to refine your game you should (to quote a very popular engineering expression) "do the simplest thing that could possibly work." Damage, rewards, population growth-- all these things are going to change as you make the game and you may not see how they all interrelate until it's playable enough to develop an opinion.
--------------------Just waiting for the mothership...
Right, but I still eventually need to put in a function that does something close to what good gameplay requires. Often, the simplest solution is sufficient. But when it's not, I don't have a good method for choosing a starting function. I have on occasion wasted a lot of time trying to tweak a function that really wasn't suited for producing the behavior I was looking for.
I'm wondering if there exists a guide, website, or book that says "Here are some inexpensive functions and the shape of the curve they produce, given input x". Or alternately, "If you are looking for a function that initially is very flat, then begins to asymptotically approach 1 as x increases, try this function."
I'm wondering if there exists a guide, website, or book that says "Here are some inexpensive functions and the shape of the curve they produce, given input x". Or alternately, "If you are looking for a function that initially is very flat, then begins to asymptotically approach 1 as x increases, try this function."
If you don't already have one, go pick up a book like The Joy of Mathematics. Those sorts of books have a lot of interesting facts and history that might give you a good idea of what functions to use. For example, one of the initial applications of the Fibonacci sequence was to model the population growth of rabbits. The only downside is that it isn't written with the programmer in mind and it might be a bit of a trick adapting a theoretical treatise into an applicable function.
Mathematica has lots of functions with pictures:
http://functions.wolfram.com/visualizations.html
http://functions.wolfram.com/visualizations.html
--"I'm not at home right now, but" = lights on, but no ones home
It might make more sense to base reward from killing a monster on time spent fighting it rather than level. Or drop rate could be based on this - no matter how many of monster X you kill you get a max of 1 item drop per 30 seconds or minute, so high level players don't stand around 1-shotting them all day.
I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.
Quote:
Original post by sunandshadow
It might make more sense to base reward from killing a monster on time spent fighting it rather than level.
That sounds very easy to cheat. A high-level character could just fight a low-level monster for an hour without attacking and spam the experience. That's why basing reward on level would make so much more sense.
Yeah, the wolfram site mentioned earlier is a good one.
Also, if you ever need to find a function to approximate a table of data, you could try something like this. Although, at this point, you may be over complicating things (as I inevitably do for all of my projects ;)
Also, if you ever need to find a function to approximate a table of data, you could try something like this. Although, at this point, you may be over complicating things (as I inevitably do for all of my projects ;)
The wolfram sites and zunzun are both close to the sort of thing I'm looking for (and both at least somewhat to the purpose). Wolfram's site has only very basic functions, while zunzun's interface is confusing and doesn't provide easy data visualization (I do like the code samples though, which I find easier to understand that mathematical notation).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement