Jump to content
  • Advertisement
Sign in to follow this  
Eralp

Spawn time according to level?

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

I couldnt decide where to open this thread(there should be one more forum part which starts with game :D), so sorry if this is wrong forum. I want some kind of algorithm, which i can use for defining the spawn of the next monster.So far i have something that is very useless.I will be glad if u help me to develop it or rebuild it. srand (GetTickCount ()); int r = (rand() % 175) + 75; canavaryaratmaframe = framecount + r - levelcount*10 ; and what do you need to know to build an algorithm, the max level or any kind of information?? thanks

Share this post


Link to post
Share on other sites
Advertisement
I had a big reply typed out then I realised I didn't really follow what you wanted to do, heh.

You want the spawn time to decrease in relation to the player's level (i.e. spawn time is inversely proportional to the player's level)?

Share this post


Link to post
Share on other sites
So, what you want to do is have monsters spawn quicker the higher your level?

OK. What you're describing can be modeled many different ways, you just have to pick one and stick with it.

One way is with a hyperbolic function, i.e.

spawn time = 1 / (player level)

Get something like Graphmatica or some other graphing program and fiddle with numbers like this:

spawn time = 2 / (player level), spawn time = 1 / (2 * (player level)) etc.

Until you get a curve that looks like what you're trying to achieve. What you want to remember about these graphs is the the height is the spawn time and the distance across (to the right) is the player's level.

This kind of curve will increase very quickly, which is why it is important to fiddle with the numbers to get the shape you're after.

Other ways of doing it would be to set a minimum spawn time and say something like:

spawn time = -(player level) + (spawn time at level 0)

After a time, this will become 0 and even less than 0. This is why you need a minimum for this kind of equation.

Anything like this will give you an algorithm to use. You just have to fiddle until it looks nice.

Share this post


Link to post
Share on other sites
i slept and went to school after my message and now.. :D


Quote:
Original post by BigFreak
I had a big reply typed out then I realised I didn't really follow what you wanted to do, heh.

You want the spawn time to decrease in relation to the player's level (i.e. spawn time is inversely proportional to the player's level)?


Yes thats exactly what i want.

And NickHighIQ, i have "derive" which can help me to find some curves.Lets see what i can find =)

thanks for ur replies



Share this post


Link to post
Share on other sites
so far i have

((300/x) - 20) - ((((300/x) - 20)/100)*z)

x is levelcount and z is a random between 10-30.

that looks good in higher levels as a curve(after like level 6).

but before higher levels it gives huge framecounts like 200 or so,what can i do for that? another algorithm for lower levels :S i need help from experienced game-makers..

ps: my game has 14 levels,for now

Share this post


Link to post
Share on other sites
I'd think about it on a slightly higher level to what you are right now.

You essentially want:

timeToSpawnInSeconds = -k * player.level

k will be the however-many-times-less-than-the-player-level-the-spawn-time-should-be constant, maybe with some other things multiplied by, added to, or subtracted from. But in its most basic form it'll look like that. Try and keep it simple when you're just calculating the formula. And factorise! :D

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!