Spawn system

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.

I find that at higher rates of animal spawn you don't get any barbarian units or cities. There is still some room between what it is now and the higher rates I tried.
 
Started a new game with Planet Generator on Marathon, Raging Barbs. Started getting attacked quite early and it has turned into a steady stream of Neanderthals as they spawn over and over and then head to my city.

After checking the world map, I found 2-3 areas with loads of Neanderthals, and the rest pretty much none. (pic attached) I think it's really a matter of them spawning from the bonus placements and where there are no Bison, Deer, or Ivory, there are no Neanderthals. I think spawning them from terrain and feature combinations will spread them out a bit more. Same goes for animals. Tried to use AIAndy's tags for those, but don't think they are setup to use with Neanderthals yet.

On a related note, I had a lot of turns to test the -75% City Attack and it seemed to work pretty well. I had 2 Slingers and 2 Clubmen (and the Cave Dwelling NW) and they were able to hold the city, although they were taking damage. Some of the other AIs were wiped out already-- the ones in those Neanderthal infested areas, but I saw ONE civ that had the Cave Dwelling, so I'm hopeful he'll survive.
 

Attachments

  • Spawn Infestation.jpg
    Spawn Infestation.jpg
    141.2 KB · Views: 108
@EldrinFal: You have to copy the new scheme to the Neanderthal folder to use those tags (Afforess_CIV4UnitSchema.xml in the main Assets/XML/Units folder). Also rename it so it replaces the schema in the respective subfolder.
 
@EldrinFal: You have to copy the new scheme to the Neanderthal folder to use those tags (Afforess_CIV4UnitSchema.xml in the main Assets/XML/Units folder). Also rename it so it replaces the schema in the respective subfolder.

Thanks. I'll test that out when I get home today. :)

AIAndy, were you going to integrate the previous mentioned idea for reducing spawn chance based on world population of that unit? (To help improve variety of animal units)
 
Thanks. I'll test that out when I get home today. :)

AIAndy, were you going to integrate the previous mentioned idea for reducing spawn chance based on world population of that unit? (To help improve variety of animal units)
I will introduce some such method but I don't know yet when (probably I will go with one initial analysis of spawn spots though).
At first reducing the spawn chance based on the local density might be enough.
 
Thanks. I'll test that out when I get home today. :)

AIAndy, were you going to integrate the previous mentioned idea for reducing spawn chance based on world population of that unit? (To help improve variety of animal units)

It won't impact variety at all, since one type spawning has utterly zero impact on the probability of another type spawning - EVERY spawen is applied (completely independently) every turn. All it would do is reduce population of the over-spawning type a bit (without any compensatory increase in any other type)
 
It won't impact variety at all, since one type spawning has utterly zero impact on the probability of another type spawning - EVERY spawen is applied (completely independently) every turn. All it would do is reduce population of the over-spawning type a bit (without any compensatory increase in any other type)

That's what happens when I reply early in the morning. Brain isn't fully awake :coffee:

I still had it in my mind that the spawn was a single queue of sorts where if one animal spawned, it wouldn't spawn another (that turn in that tile).

Let's see how terrain/feature based spawn spreads them and if it makes the distribution more even, then that should take care of it (which it should in theory). If not, then we'll have to look at spawn density in general to help distribute.

I will do the schema for the Neanderthals later today and have them spawn from several variations to see how that works. It should be a good test case for the process as a whole.
 
That's what happens when I reply early in the morning. Brain isn't fully awake :coffee:

I still had it in my mind that the spawn was a single queue of sorts where if one animal spawned, it wouldn't spawn another (that turn in that tile).

Let's see how terrain/feature based spawn spreads them and if it makes the distribution more even, then that should take care of it (which it should in theory). If not, then we'll have to look at spawn density in general to help distribute.

I will do the schema for the Neanderthals later today and have them spawn from several variations to see how that works. It should be a good test case for the process as a whole.

Ok. Bear in mind the relative frequency of the terrains you use though as compared to the resources it uses now. A forest spawn for example will need a MUCH lower spawn rate because there are many moer forest tiles.
 
Ok. Bear in mind the relative frequency of the terrains you use though as compared to the resources it uses now. A forest spawn for example will need a MUCH lower spawn rate because there are many moer forest tiles.

Yeah, I was going to bring the rate to 24. If Raging doubles that, then I expect 12 as the effective rate. We'll see how that works with Forest, which I suspect has the widest range of growth.
 
Yeah, I was going to bring the rate to 24. If Raging doubles that, then I expect 12 as the effective rate. We'll see how that works with Forest, which I suspect has the widest range of growth.

Rate, not density. The existing rates are 15, 15, and 10 for the 3 waves. That means (taking the first wave as illustration), each suitable bonus tile will spawn a Neanderthal every 15 turns. Since forest is about 10 times more prevalent than the bonuses (guess) you'll need somewhere closer to 150 I think.
 
Ok. Bear in mind the relative frequency of the terrains you use though as compared to the resources it uses now. A forest spawn for example will need a MUCH lower spawn rate because there are many moer forest tiles.
That is one of the main things that need correction because in many cases that varies a lot.
So I guess the actual spawn rate should be a formula depending on these things:
  • Number of plots in the area the spawn plot belongs to
  • Number of spawn plots in the area
  • Number of units spawned in that area from this spawn rule
  • Number of units in the area belonging to the same SpawnGroup (meaning a new int tag for the unit xml)
  • Local density of the unit type
  • Local density of the units belonging to the same SpawnGroup
 
That is one of the main things that need correction because in many cases that varies a lot.
So I guess the actual spawn rate should be a formula depending on these things:
  • Number of plots in the area the spawn plot belongs to
  • Number of spawn plots in the area
  • Number of units spawned in that area from this spawn rule
  • Number of units in the area belonging to the same SpawnGroup (meaning a new int tag for the unit xml)
  • Local density of the unit type
  • Local density of the units belonging to the same SpawnGroup

Depends what you want. If you want a flat distribution independent of the frequency of the terrains etc. then you just want an option that allows spawn from any plot really! Some spawns may deliberately be connected with the frequency of certain bonuses and so on (horses from horse for example), and deliberately be rare when those bonuses are.

Neanderthals are a bit odd, since the choice of bonuses to spawn them is a little arbitrary. A value that says 'give me a flat spawn rate' while STILL forcing the spawns to occur on bonuses might be good, since flat rate is probably what we want (more or less) for Neanderthals, BUT having them spawn from a few fixed points adds flavor and also strategy (since keeping those spots under observation will prevent the spawns - which you lose by going to terain-based, or pure flat).

So actually what you ideally want is to restrict the spawn points to bonuses [or some other restricted small set of plots] (and have map generators assure that at least one is present on each substantial land mass), yet still have the landmass-wide rate directly proportional to the size of the landmass (or some other area-based normalization). The problem is that while you can define such a flag easily, implementing it without starting to chew up significant CPU time on spawns for large maps) is harder.

I'm actually thinking we're better off spending our effort elsewhere and tweaking the binus distrubution in a map-post-script.
 
I'll go the fast way.
Allow scaling with area size (that one is cheap).
While going through all plots for all spawn rules (that is done already), enumerate all valid spawn locations for each rule first.
Then go through the areas and spawn for each.
That is not really more expensive and rather easy to program.

So the formula can take into account area size, spawn plot num in area and local density.
 
With spawning, I tried to specify river crocodiles spawning only on flood plains in the tropics and seem to have gotten spawn on flood plains and in the tropics. Is that so or am I imagining those crocs in the deserts?
 
Right now Neanderthals spawn from Bison, Ivory, and Deer only. The issue I ran into was that those resources are not always distributed evenly. So some players will get SWARMED,while others get completely left alone. I figured spawning them from forest, (combined with a low density setting) which is found all over the map, would encourage a more even distribution.

One bad thing about a certain animal spawning from only a specific resource is that it means not only does the nearby player have access to that bonus, but they have access to the animal spawning from it.

Modifying the map scripts could work to even out bonus placement, but I figured since the spawn from terrain was already present, that could provide more varied spawn sites.
 
One bad thing about a certain animal spawning from only a specific resource is that it means not only does the nearby player have access to that bonus, but they have access to the animal spawning from it.

Actually, that is the point. If there are no pig resources on you continent then there will be no pigs spawned. Therefore you will have to trade for them later in the game.

Almost every thing that gets done has the effect of destroying the trade system making it irrelevant. I decided it was about time to do something that helped it instead.
 
With spawning, I tried to specify river crocodiles spawning only on flood plains in the tropics and seem to have gotten spawn on flood plains and in the tropics. Is that so or am I imagining those crocs in the deserts?
Can you post the xml code or is it already on the SVN?
 
Right now Neanderthals spawn from Bison, Ivory, and Deer only. The issue I ran into was that those resources are not always distributed evenly. So some players will get SWARMED,while others get completely left alone. I figured spawning them from forest, (combined with a low density setting) which is found all over the map, would encourage a more even distribution.

One bad thing about a certain animal spawning from only a specific resource is that it means not only does the nearby player have access to that bonus, but they have access to the animal spawning from it.

Modifying the map scripts could work to even out bonus placement, but I figured since the spawn from terrain was already present, that could provide more varied spawn sites.

Problem is that it removes the small number of spawn points, so you lose the strategic ability to garrison units near the spawns to keep them in check.
 
Top Bottom