1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Animal Spawning on non-random maps

Discussion in 'Maps & Scenarios' started by Dancing Hoskuld, Jun 18, 2014.

  1. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,515
    Gender:
    Male
    Location:
    Canberra, Australia
    Coming soon

    Where and when animals spawn on the map is defined in the Civ4SpawnInfos file. The default spawn locations match the BtS default latitude and longitude definitions and will need to be shifted to match specific maps and scenarios.

    By default in BtS the left edge of the mini map is defined as 180 degrees West and the right is 180 degrees East. The top is 90 degrees North and the bottom is 90 degrees South.

    When defining a map you can change the top and bottom latitude but you can not change the east-west longitude. This means that while the latitude for animal spawns will work the longitude will be off if your map is not 180 W to 180 E. You will need to move the spawns, for example GEM needed to move/rotate the spawn locations by about -60 degrees so that African spawns happen where Africa is on the GEM map but which is occupies the longitude of the Americas as far as BtS is concerned.

    Originally the map and it's spawn file were provided in a download and the player would need to overwrite the core spawn file with the downloaded one. Now all they need to do is edit the MLF in the Modules/AnimalSpawns folder to access the one they want to use.
     
  2. Harrier

    Harrier Deity

    Joined:
    Feb 19, 2002
    Messages:
    2,411
    Location:
    UK
    Sorry for the necromancy - but as I am adjusting spawn areas for my maps, I finally thought a new or old thread would be more appropiate. Rather than just posting in the discussions thread, as I am sure to have more questions later on.

    So here goes.

    DH can you explain this for me. Is it 1 unit each on 5 tiles, or only 1 unit for every 5 tiles?

    What does locally mean? Is it the surrounding 8 tiles or larger (maybe the defined range.) ?.
     
  3. Harrier

    Harrier Deity

    Joined:
    Feb 19, 2002
    Messages:
    2,411
    Location:
    UK
    I have tried searching the forum for an explanation on what these 2 entries in the spawn file mean.

    <iTurns>400</iTurns>
    <iMaxLocalDensity>5</iMaxLocalDensity>

    Can you please explain them to me.

    <iTurns>400</iTurns>

    Does this mean the animal only stays on the map for 400 turns and is then deleted? (a guess)

    <iMaxLocalDensity>5</iMaxLocalDensity>

    From my above post - I am still confused about the explanation.

    I am asking because some animals do not seem to be spawning and at the moment I do not understand why.

    To increase spawning in a small area, do I increase or decrease this value?

    For example - to restrict the "Tasmanian Devil" to a 3 tile plot and have say 12 units spawned.

    What value should I set this to?

    On my SEM+ map, I have adjusted Lat. and Long. values to be almost realistic - but still some animals do not seem to spawn.

    So any help will be appreciated.
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,373
    Gender:
    Male
    Location:
    Las Vegas
    Max Local Density refers to how many of the same type of unit are in the local vicinity and past that point it won't further spawn them. What the local vicinity amounts to I'm not sure without looking deeper in the code but I would suspect it's the 'area' or continent rather.

    As for iTurns, I'd have to look further into the code to get an idea and I've not got the time to look at that right now so I'll try to remember to soon for you (but remind me if I forget.)
     
  5. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,515
    Gender:
    Male
    Location:
    Canberra, Australia
    I have no idea what many of the tags are. I use iTurns to balance, increasing it if I want less and decreasing it if I want more.
     
  6. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,373
    Gender:
    Male
    Location:
    Las Vegas
    Ok, although there are modification causes a plenty, in short, iTurns is what sets the basic chance of spawning: The chance is generally speaking (one out of iTurns) per valid plot to spawn in. So yes, lower is going to spawn more.

    Max Local Density is an established limit (and I think it reduces the chance as the amount is closed in on) on how many of this given unit can currently exist and continue to spawn on a given continent or contiguous land or ocean section (defined in the code as an 'area'.) I'm sure this can again be modified by the size of the continent within the spawning code so it's really just setting up a baseline expectation.

    I would call controls like these 'dials'. As long as you know which way to turn them to go in the direction of the results you're looking for you should be able to dial in to the rates you want after some trial and error eventually. I wish the AI had been setup with more 'dials'. lol. This is why I've established a few in trouble spots.
     
  7. Harrier

    Harrier Deity

    Joined:
    Feb 19, 2002
    Messages:
    2,411
    Location:
    UK
    Thanks for the reply. :)

    I have done a bit more digging through old posts and have come up with the following from 2011. (Although it may have changed since then.)

    iTurns

    Average number of turns between Spawns for this animal for each resource. This is adjusted for game speed.

    So as you said, decreasing it means it attempts to spawn more often.

    Max Local Density

    Again only applies to this animal.

    For each attempted spawn tile, it checks a 3 tile radius (may have changed since2011): thus 49 tiles are checked. This is the local range. It may include water tiles if a coastal tile is selected.

    So its 49/(#units), if 5 (5 is default) it is 49/5 (rounded up) equals 10 tiles allowed for this animal in the 49 tile range.

    If set to 4, the spawn will stop if the there is more than 1 animal per 4 tiles locally. (49/4 = 13 animals in the 7X7 square.).

    If set to 6, the spawn will stop if the there is more than 1 animal per 6 tiles locally. (49/6 = 9 animals in the 7X7 square.).
     
  8. climat

    climat King

    Joined:
    Mar 29, 2009
    Messages:
    734
    My guess is that longitudes need to be changed like below for GEM.

    Column 1 Column 2 Column 3
    Continent Current GEM
    America -180~-60 60~180
    Africa/Europe/Middle East -60~60 -180~-60
    Asia/Oceania 60~180 -60~60


    I briefly tested this and it seems to work. I didn't see jaguar/capybara/tapir in Africa and Nile monitor in America at least.
    I will test it more.
     
  9. Harrier

    Harrier Deity

    Joined:
    Feb 19, 2002
    Messages:
    2,411
    Location:
    UK
    Most spawns will always be based on -180 to 180. Regardless of the map you use.

    But -yes you are right. If using a pre-made map, you need to alter spawn areas.

    Allthough, they will be different for every pre-made map. For example my Australia may be using different co-ordinates to yours.

    If as you imply "I briefly tested this and it seems to work.", you have made a spawn file for GEM, let the map modders (currently Redwallzyl ) know about it.
     
  10. Harrier

    Harrier Deity

    Joined:
    Feb 19, 2002
    Messages:
    2,411
    Location:
    UK
    DH.

    Have you added the code to stop sea animals spawning on Lake tiles?

    Or is that still on your to do list?

    Asking as I am now adding Lake tiles to SEM+.
     
  11. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,515
    Gender:
    Male
    Location:
    Canberra, Australia
    They only spawn on sea terrains. One of the reasons we added lakes;). So yes is the answer.

    I discovered last week that the random map code does not replace fresh water seas with lakes at all. Somehow I must have removed that bit of code:blush:.
     

Share This Page