Spawn system

Can the base chance of a spawn be lowered as more of them propagate the map? That way if there are 20 units on the map already, the chances of another of that type spawning is say 30% less? Also, which units get the first crack at spawning on a tile? If bears are at the top of the list for example, that would seem to give them the best chance of spawning. If that is the case, then either the first unit in the queue must be randomized, or the most rare spawn be at the top of the queue.
Good idea. I could store the units spawned by a certain spawn rule and then reduce the spawn chance for each such unit still alive.
The list order should not have a big impact as every single spawn is done independently at the moment so you can even have more than one unit spawn on the same plot in the same turn.
 
Good idea. I could store the units spawned by a certain spawn rule and then reduce the spawn chance for each such unit still alive.
The list order should not have a big impact as every single spawn is done independently at the moment so you can even have more than one unit spawn on the same plot in the same turn.

Ah yes, the new spawn system allows stack spawning. The previous method I believe would not spawn a unit if one existed there already.

The world totals will need to scale for map size, but I'm sure you know that already. ;)

The other issue may be that some of the animals start spawning earlier, turn-wise. So that gives them more time to reproduce before the other animals get their shot.
 
Ah yes, the new spawn system allows stack spawning. The previous method I believe would not spawn a unit if one existed there already.

The world totals will need to scale for map size, but I'm sure you know that already. ;)

The other issue may be that some of the animals start spawning earlier, turn-wise. So that gives them more time to reproduce before the other animals get their shot.
If I remember the code correctly, there is only the limit to local density, not any enforced limit that there is no other unit on the plot.
 
If I remember the code correctly, there is only the limit to local density, not any enforced limit that there is no other unit on the plot.

You're right. I remembered incorrectly. Here is Koshling's post on that:

http://forums.civfanatics.com/showpost.php?p=10794060&postcount=190


So they won't spawn if the tile is owned by someone or a non-barb unit is on it. Or depending on density-- though now that I read it again, I'm not sure if that means no spawn if there is a single unit of that same type within a radius of the tile # specified, or if the density = number of units per some area size he defines as "local" ??? :confused:

Edit: Sorry, Koshling. Should have been you :mischief:
 
You're right. I remembered incorrectly. Here is DH's post on that:

http://forums.civfanatics.com/showpost.php?p=10794715&postcount=192

So they won't spawn if the tile is owned by someone or a non-barb unit is on it. Or depending on density-- though now that I read it again, I'm not sure if that means no spawn if there is a single unit of that same type within a radius of the tile # specified, or if the density = number of units per some area size he defines as "local" ??? :confused:

'he' was me actually. 'local' means within a not-disclosed-extrernally radius, but it's currently 3. The actual radius doesn't effect the XML tuning since it's specified in min 'tiles/unit' - any more than that ratio an the spawn is inhibitted (so if you're in the middle of a landmass there will be 49 tiles considered so its (#units)/49 as the local density - if you're on a coast it may be less than 49 but it still calculates the same area-independent ratio). The density counts only the unit of type being spawned, so it's strictly a density for THAT spawn type.
 
'he' was me actually. 'local' means within a not-disclosed-extrernally radius, but it's currently 3. The actual radius doesn't effect the XML tuning since it's specified in min 'tiles/unit' - any more than that ratio an the spawn is inhibitted (so if you're in the middle of a landmass there will be 49 tiles considered so its (#units)/49 as the local density - if you're on a coast it may be less than 49 but it still calculates the same area-independent ratio). The density counts only the unit of type being spawned, so it's strictly a density for THAT spawn type.

Ok, so if the setting is 1 then, the same unit type will NOT spawn if another unit of that same type already exists within that radius 3, including the spawn tile itself, correct? And by type that means the exact same unit, so even if 20 Cows were grazing in the area, a Bison could spring up in the middle of them-- or any other non-Cow.


I edited my earlier post to quote the right person. Sorry about that. :blush:
 
Ok, so if the setting is 1 then, the same unit type will NOT spawn if another unit of that same type already exists within that radius 3, including the spawn tile itself, correct? And by type that means the exact same unit, so even if 20 Cows were grazing in the area, a Bison could spring up in the middle of them-- or any other non-Cow.


I edited my earlier post to quote the right person. Sorry about that. :blush:

No. A value of 1 means there cannot be more than 1 per tile, so the spawn would be disabled if there were already 49 units of that type within the 3 radius (7X7 square centereed on the spawn point)! '1' is NOT a number I recommend using :) Neandertahls I think are set to 5, so the spawn will stop if the there is more than 1 neanderthal per 5 tiles locally (10 in the 7X7 square in the simple case).

On the second part, correct. A Bison spawn will only count other bison in its density evaluation (if need be we could extend the spawn XML to have a concept of a 'unit family' thoguh so that density would apply to spawns within a family).
 
No. A value of 1 means there cannot be more than 1 per tile, so the spawn would be disabled if there were already 49 units of that type within the 3 radius (7X7 square centereed on the spawn point)! '1' is NOT a number I recommend using :) Neandertahls I think are set to 5, so the spawn will stop if the there is more than 1 neanderthal per 5 tiles locally (10 in the 7X7 square in the simple case).

Ok, it is a little confusing then. Intuitively I would consider the number as how many units maximum within the set radius. Not unit per set tile ratio. So if the radius is 3 tiles, then a setting of 5 would mean that the spawn stops if there are 5 or more of those units within the radius of 3. That is what "MaxLocalDensity" sounds like to me anyway.


On the second part, correct. A Bison spawn will only count other bison in its density evaluation (if need be we could extend the spawn XML to have a concept of a 'unit family' thoguh so that density would apply to spawns within a family).

Maybe in the future, but I don't see an immediate need. :)
 
AIAndy, If you want, you can do what you like with the spawns for Gorilla, Orangutan, Panda, and both salt water crocs. The first three are a bit low due the choice of resource I had available. The crocs are about right but need to be restricted in spawn range to the tropics.

With higher rates of animals I don't get any barbarian units or cities spawning.

I do use my graphically challenged units when I test and I will have to up the mermaids and leviathans call them various sharks and whales.
 
Ok, it is a little confusing then. Intuitively I would consider the number as how many units maximum within the set radius. Not unit per set tile ratio. So if the radius is 3 tiles, then a setting of 5 would mean that the spawn stops if there are 5 or more of those units within the radius of 3. That is what "MaxLocalDensity" sounds like to me anyway.

Right, but the number of tiles within the radius varies depending on the terrain (sea etc. cuts out possible places units can be). That's why I dont tell you its a radius of 3 because you cant draw any conclusions on the number of tiles involved anyway, and why it has to be a density, NOT an absolute number. Ideally it would be 1/5th rather than '5' but then I'd have to make it a non-integer which I didn't want to do, so it's actually 1/density which I admit is slightly confusing ;-) However, this way is more flexible and works correctly with any defintion of 'local' in a totally terrain-independent manner which was the main point.
 
I noticed that a lot of animals spawned resources on the map. So much so I would get like huge clusters of them in areas. I think that they should not spawn resources on the map as often OR have the resources that do spawn from units not generate on the map as much to compensate for the units making them.
 
I noticed that a lot of animals spawned resources on the map. So much so I would get like huge clusters of them in areas. I think that they should not spawn resources on the map as often OR have the resources that do spawn from units not generate on the map as much to compensate for the units making them.

Currently there is only a 40% chance of the subdued animal spawning a resource instead of being captured. What % do you suggest?
 
Animal spawn rates seem VERY low to me. In 50 turns in quite a large area I saw noen at all. I ran debug to see what was happening and it was averaging about 1 animal per turn WORLDWIDE.
 
AIAndy, If you want, you can do what you like with the spawns for Gorilla, Orangutan, Panda, and both salt water crocs. The first three are a bit low due the choice of resource I had available. The crocs are about right but need to be restricted in spawn range to the tropics.

With higher rates of animals I don't get any barbarian units or cities spawning.

I do use my graphically challenged units when I test and I will have to up the mermaids and leviathans call them various sharks and whales.
Added gorilla and orangutan spawn rule from jungle.
Panda only spawns from Bamboo now (as it should be).
Salt water crocs restricted to 30 degrees from equator.
Penguins restricted to southern hemisphere.
Polar bear restricted to northern hemisphere near the poles.
 
Added gorilla and orangutan spawn rule from jungle.
Panda only spawns from Bamboo now (as it should be).
Salt water crocs restricted to 30 degrees from equator.
Penguins restricted to southern hemisphere.
Polar bear restricted to northern hemisphere near the poles.

I must be using an old schema because I could not find the latitude restrictions. I was about to release river crocs and snakes.
 
I just added that feature and pushed it to the SVN before that post (only the Afforess schema in the main xml folder is changed, so copy to modules when needed).
Looks like this:
<bLatitudeAbs>1</bLatitudeAbs>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>30</iMaxLatitude>
The first one governs if the the absolute value of the latitude should be used (0 - 90) or not (-90 - 90).
 
I just added that feature and pushed it to the SVN before that post (only the Afforess schema in the main xml folder is changed, so copy to modules when needed).
Looks like this:
<bLatitudeAbs>1</bLatitudeAbs>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>30</iMaxLatitude>
The first one governs if the the absolute value of the latitude should be used (0 - 90) or not (-90 - 90).


Yeah, i was just looking at FfH2 and they have that also.
 
Animal spawn rates seem VERY low to me. In 50 turns in quite a large area I saw noen at all. I ran debug to see what was happening and it was averaging about 1 animal per turn WORLDWIDE.
@Koshling.

I too am experiencing VERY LOW animal spawn rates on a Giant sized map.(V17). I have played over 500 turns and have never seen a Neanderthal unit either.
 
Top Bottom