• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[Mechanic] Unit spawn rate calculation

Status
Not open for further replies.
Feb 5, 2012
61
9
10
27
#1
This is just a suggestion for a unit spawn rate formula. Or at least the scaffolding of one for people to work with/on.


Time of next spawn = (base time rate, lets put 10s as a placeholder) +
((minion number*2)/(Dungeon attraction value/minion number+1))
/(portal number)

Comes to: Time (s) = 10s + ((m*2)/(A/m+1))/P

As such: the base time rate is the basic amount of minimum time to get a creature from claimming the portal, and is the base rate upon wich additional time is added due to increases in minion number. This is counteracted by the dungeon attraction value (wich is how big your dungeon is/specal attraction features. The dungeon heart always counts as 1) which decreases the rate at which the time between minion spawn increases, and the number of portals also decreases time. The minion number +1 is just so that we dont end up dividing by 0 and freaking the machine out.

alterations to this could be to define the dungeon attraction value as special things unique to maps, like special claim rooms etc but arnt portals. An example could be the number of claimed and destroyed hero gates you own counting as +1 to this value. though in this formula it is ment to represent the number of room attraction points, like bookcases for warlocks in DK2 as an example.

Another could be to discard the portal bonus and instead have the portals filling up a time bar, up to the next defined creature time (hidden from player), so it spawns creatures at random portals and can sometimes cut down the time that way in a scaleable manner. This also means you dont realy need to design a random portal to portal spawn system.

As of current the mechanism, if we define dungeon attraction as 1, and portal number as 1 gives:
1st creature: 10s
2nd creature: 14s
3rd creature: 23s
5th creature: 50s
20th creature: 770s
these are times from the last creature spawned. you could reset its timer to 0s passed every time a creature dies in combat to also make combat more of a gamble.

Thoughts? :) its just a suggestion.
 
Nov 10, 2011
141
15
10
25
The Netherlands
#2
I tried calculating your formula (with "dungeon attraction" as 1 and portal number as 1), and I got some different results. Did I miss anything?

10 + ((m*2) / (A/m+1))/P

m = 0, 1, 2, 4, 19 (having , creatures, going to attract (m+1)th one)

10 + ((0) / (1/1))/1 = 10 (attracting first creature)
10 + ((2) / (1/2))/1 = 14 (attracting second creature)
10 + ((4) / (1/3))/1 = 22 (attracting third creature)
10 + ((8) / (1/4))/1 = 42 (attracting fifth creature)
10 + ((38 / (1/20))/1 = 770 (attracting twentieth creature)

Regardless, I think exponentional increases in attraction time this severe go quite too far. For the twentieth creature, with one portal, one would need to wait nearly 13 minutes for a single creature, which is simply way too long. Sure, "dungeon attraction" could influence this value, but it's quite vaguely defined so I have no idea what to make of that. Even then, with, say, a dungeon value of 20, it'd still take 48 seconds for the twentieth creature which is still simply too much in my opinion.
 
Feb 5, 2012
61
9
10
27
#3
the main factor in this would be the m*2. just change the *2 to a more suitable escalatory value and walla. you can change it downwards if you think the time is too long at 20th creature or it climbs in times too fast easily.

I did the calculations in my head i believe, it would probably help to list all factors out longhand, the main aim was to interlink everything and then try find a way to regulate it suitably. The attraction value is intrinsical linked up to room sizes. ie: 3x3 torture chamber would give you a torture wheel, thus producing 1. the average dungeon uses 5x5 rooms, wich im gonna presume makes 3 points, which can shift depending on what the designers think constitues a point of attraction for creatures, this value can then shift depending on what the average number of rooms will be in the dungeon. so a 20 room dungeon of 5x5 rooms, would create 60+1 for dumgeon heart points. this is fairly big. in DK2 you usualy made up to 13 or so rooms. so around 39 points+1 for dungeon heart.

The below examples are for a dungeon with only a heart and a portal keep in mind. this is to simplify it for easy understanding.

10 + ((m*2) / (A/m+1))/P

1: 10 + ((0*2)/(1/0+1))/1 = 10+ (0/1)/1 =10+0 = 10s
2: 10+ ((1*2)/(1/1+1))/1 = 10+ (2/0.5)/1=10+4 = 14s
3: 10+ ((2*2)/(1/2+1))/1 = 10+ (4/ 0.333)/1=10+ 12=22s
4: 10+ ((3*2)/(1/3+1))/1 = 10+ (6/0.25)/1 = 10+ 24= 34s
5: 10+ ((5*2)/(1/5+1))/1 = 10+ (10/0.2)/1 = 10+ 50 = 60s

20: 10+ ((19*2)/(1/19+1))/1 = 10+(38/0.05)/1=10+ 760 =770s

Again i state, this is for a dungeon with only the dungeon heart and the portal and nothing else. The key to this is to try slow down creature growth so it dosent flood everyone wile not having a cap on numbers. If you dont do something then youll end up with so many creatures you cant pay or feed them. Of course this is why the gods gave us sacrificial temples to boost our blood manna supplies.

You may think this suits a larger keeper and you would be right, but for the size of what that keeper has to have to maintain this is huge, theyll most likely need so many creatures in comparison just to keep ahold of their land wich would have to sprawl something cronic to have any large unbalancing effect. Its also an easy strategy of capping a keepers population by limiting his wriggle room or by taking his rooms and selling them.
 
Mar 11, 2012
48
16
170
#4
It's nice and simple.

It will result in - assuming dungeon attraction isn't under the players control - the dungeon filling up with creatures at a fixed and steady rate.

I think I would like it better if two aspects were changed:
  • The formula not based on "a creature" but on a specific creature type - so you have a countdown for every creature type you are attracting at the moment
  • The player can directly influence the spawn rate by tweaking the dungeon design
Example:
  • Say you build a 3x3 torture chamber to attract a dark mistress (to talk in dungeon keeper terms) this would start a countdown for a mistress to be attracted. Now say you build a 5x5 torture chamber - this would double the countdown speed. Now say you actually torture a creature, this would again double the countdown rate.
  • You also build a 5 x 5 lair and hatchery, this will start the countdown to a bile demon in parallel
  • You also build a barracks to start attracting a troll
  • The countdown to the mistress reaches 0 first, resulting in a mistress to enter the dungeon. The countdown from the mistress is reset with a bigger value (similar to your formula, but only based on number of mistresses in the dungeon)
  • All other creature countdowns now get multiplied by a value - this calculation needs to be determined, but should result in there not spawning a creature for a certain amount of time, but countdowns that were about to reach 0 should get an advantage
  • Every creature type has a different starting value, which grows in a similar version (so if it takes half the time to attract a troll then it does to attract a mistress you should always end up with roughly double the trolls compared to mistresses provided you do not lose creatures and you do not make a dungeon layout that would double (or slow down!) the countdown rate of either creature.
 
Feb 5, 2012
61
9
10
27
#5
To implament that it would be a relativly simple matter of making variations of the 10 + ((m*2) / (A/m+1))/P formula, were m = that minion types number instead, and the 10 could be changed for the more powerfull types. The A would then be linked up with the room type the creature is attatched to instead of dungeon wide. and actions in the room that temp boost the value for the next creature ie: torture should probably just give you a + x number of seconds passed value bonus instead of affecting the A value.

Thus: 10 + ((m*2) / (A/m+1))/P
m= minions of that species
A= attraction of room/conditions present in dungeon that affect that creature
P= portal number
The 10 at the start varies, and the *2 varies. to have something appear at half the rate of a *2 being. they would be a *1.5 instead, and start at 5 instead of 10. This is a guess, i cant be arsed to make up the graphs to test this of current.

Torture and other attractive acts should be linked with a full completion of the act, ie: if you torture a soul and he converts. no bonus to mistress, but if he dies, a time bonus is added (none carry over after a mistress is spawned), speeding up the time for the next mistress. since it takes a wile to complete this task it cant be abused too much. other tasks can vary their time bonus.

You would also have to marry this system so that the creation of a new room dosent automaticaly mean a new creature, ide suppose this could be affected via room placement. Ie: a hatchery next to the treasury dosent do anything negative or posative, but a hatchery next to the workshop or trainning room gains a boost. wile one next to the prison causes a negative effect. This can all be incorporated into the A value.

to make other creatures numbers affect the value, you just have a C -for crowding ide say- that represents all the other minions in the dungeon, and have a set value like say 1.1 and multiply the entire result by this. Ie: 1 mistess *1.1 = 1.1

to take the second creature calculations, this would boost the time up from 10 for the first of its kind, to 11s. this isent much, but it will accumulate quite easily, hence why i chose a small value. You would need to do alot of trial and error to get to a good value.
 
Status
Not open for further replies.
Top Bottom