1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Spawn system

Discussion in 'Civ4 - Caveman 2 Cosmos' started by AIAndy, Sep 19, 2011.

  1. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,351
    I have started to extend the unit spawning system governed by CIV4SpawnInfos.xml.
    It is now possible to specify terrains and features for units to spawn from in addition to the previous possibility to spawn them from resources.

    Some further ideas are:
    • Change feature/terrain as result of the spawn rule
    • Add bonus as result
    • Spawn units with a special mission AI
    • Spawn units for a neutral player (that is only hostile with barbarians)
    • Spawn in and outside cultural borders
    • Restrictions by civic/game option/technology
    • Despawn
    • Spawn a whole group
    • Display a message to players on execution of the spawn rule

    What do you think would be useful to add?
     
  2. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    924
    This is great news!

    There was a discussion awhile back regarding Neanderthals spawning from Caves or some other kind of location (feature, tile improvement, etc.) which could be destroyed to stop the spawning. Same for animals coming from dens. Might be something to revisit.

    DH also had an issue figuring out how to get rats to spawn within cultural borders for his disease mod. Looks like that path has opened up.

    I had also suggested some kind of spawn based on the Crime stuff Hydro did: a criminal of some type spawning and running to a nearby city to loot, or pillage, etc.

    Wow, lots of ideas kicked around in the past few months may resurface again! :cool:
     
  3. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,244
    Location:
    California, USA
    @AIAndy

    Can bonuses be removed as well? Such as loosing a mine or farm.

    One cool idea would be animal migration via bonuses such as a bison resource disappearing in on tile but then appearing a few tiles away.
     
  4. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    21,195
    Gender:
    Male
    Location:
    Canberra, Australia
    Is this change responsible for this?

    No, the problem is The Great Wall! If a barbarian rat plague, slave revolt or similar happens in the civ that has The Great Wall those units are expelled!
     
  5. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    924
    I like that idea. It would be cool to possibly consider animal migrations and give
    them more life than simply wandering.

    Even Neutral units that are hostile to barbs only???
     
  6. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,351
    I guess for the rats or slaves you would want them to spawn for a non barbarian but hostile to all player.

    Yes, but the question is why. That looks like it misses the bonustypes tag in the new example spawn rule but I made that optional in the new scheme.
     
  7. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    21,195
    Gender:
    Male
    Location:
    Canberra, Australia
    You can only have civs and barbarians.

    Probably because not every copy of the unit schema was updated everywhere and somewhere there is one called Afforess_... which is overriding the default one. We had a great push to have those outside the main files called something else to stop this sort of thing.
     
  8. climat

    climat Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    709
    Yes, that was the source of problem. My fault. :mischief:
     
  9. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,351
    I think that is only a matter of changing the respective parts of the code (like checking all parts of the code that references the barbarian property and then splitting that up into separate properties).
    Or is there any fundamental limit that prevents that?
     
  10. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    15,966
    Location:
    Baden-W├╝rttemberg, Germany
    RiFe has three barb factions (demons, barbs, animals, i might miss one :mischief:) so I doubt its a fundamental limit...
     
  11. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,022
    Its doable. However, search for isBarbarian() in the source - theer are 258 occurances, so that's 258 places you need to chnage the code and consider what you are doing. Largely mechanical but a fair amount of destabilization risk.
     
  12. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    21,195
    Gender:
    Male
    Location:
    Canberra, Australia
    It is possible, but it may just be simpler to re-write what the Great Wall does. My idea was to have it provide a string of forts along your borders taking into consideration terrain. Then placing a defensive unit in those forts to get ZoC.

    This will only defend the area of your civ at the time it is built so extra wonders/buildings to extend it to your new borders in later eras could be made.
     
  13. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,351
    That sounds like a very interesting effect.

    I'll look at the players anyway because I'd like a neutral player as well that can be used for spawning automatic religion spreading units and the like that are still vulnerable to barbarians. And the isBarbarian is a good spot to look at to find out what a non standard player should be considering in the code.
     
  14. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,022
    IMO this would be MASSIVELY OP. Fort Zocs + defensive bonus make them HUGE HUGE advantages (which the AI doesn't use properly but that's not the point here). This is why forts are so expensive to build - having a wonmder give you a whole ring like this would pretty much make a human player impregnable - it's just too powerful.
     
  15. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    924
    What about a new boolean tag added to units that sets whether they are affected by the Great Wall (or some general concept) and then just have the Great Wall check for that and the barbarian tag to boot units out?


    I think HOSTILE to all. So potentially a disease-carrying rat could even infect a barbarian unit. There may also be, at some point, a need to create some other military unit, like a warlord or something, that spawns via event and goes after the nearest civ, killing everything in his way. Maybe that could be a means to a new Civ appearing in the game? Or slave revolts, prisoner escapes, criminals, zombie outbreaks and what have you. :mischief:
     
  16. Nevets_

    Nevets_ Chieftain

    Joined:
    Jan 20, 2011
    Messages:
    281
    If you plan on splitting neanderthals / animals / rebels into different factions I have a couple suggestions:

    Reduce Neanderthal spawn rates, but make them hostile to animals so they hunt them too. That way there is an incentive for players to hunt down and exterminate them, as they are competing for the same resources.

    If neanderthals spawn from caves, and so do other animals (cave bear for example), killing all the neanderthals but not destroying the cave could let either a neanderthal or a bear spawn there, so there is a choice in whether you want to take that risk and possibly get a bear. I'm not sure but I would assume the spawning code doesn't let a spawn occur on top of a hostile unit so once an animal re-occupies the den a neanderthal won't spawn anymore.

    If animals spawn on and guard 'dens' then if possible, make animal spawning inside cultural borders possible if on a den improvement. And if possible code the AI to not destroy den improvements if they are within 3 or 4 tiles of one of their cities. That way the AI can 'farm' the dens for animals too. Once a player has researched a certain tech (livestock domestication or agriculture or something) dens are auto destroyed inside his cultural borders.

    Also, it may just be me, but I think neanderthals are too tough. I can't kill them until I get a master hunter & tracker with forestry 1 and tempt them into a attacking me on a forest/jungle square; and then only about 60% of the time).

    I think neanderthal spawning should stop earlier, and maybe change them to 2:str: and give them Woodsman 3. That would make them just as tough attacking in the woods, but not invincible on the defense. Historically, neanderthals kept more to the wooded terrain, and humans kept more towards the open plains.
     
  17. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    924
    I haven't played a ton of maps with the newest version yet, but the ones I have I didn't think the Neanderthal Spawn rate was too much. In fact, with the non-Raging Barb map, I thought it was a tad low. But I think people who don't use Raging, which is probably the majority, don't want to deal with them much, so it's probably a good setting.

    Str 2 seems a little weak to me. With Woodsman, I believe just the Defense goes up in Forest/Jungle right? So with your +50% bonus to defense in Forest, your Slinger is now Str 3 vs the Neanderthal Str 2 and will win most of the time, which basically reverses things. I think in the early game Neanderthals are supposed to be frightening-- like Prehistoric roving brigands. I lowered their City Attack to help the AI out, but I don't want them to become a non-issue.
     
  18. Nevets_

    Nevets_ Chieftain

    Joined:
    Jan 20, 2011
    Messages:
    281
    Woodsman 3 is +50% forest/jungle attack. So Str 2 Neanderthal is effectively 3 Str defending in forest (from natural +50% tile defense) and Str 3 attacking in forests (from Woodsman 3 +50% attack). So slinger in the forest on defense would be 3 vs 3, and on offense would be 2 vs 3. Right now it's defense 3 vs 3, offense 2 vs 4.5. This means that Neanderthals on defensive terrain (and the AI loves to keep to the forests/hills) can't be attacked until you get tomahawk throwers or other Str 4 units, the only way to kill them is to lure them into attacking you. Plus if you are on open ground, there is no way you are going to survive.
     
  19. EldrinFal

    EldrinFal Chieftain

    Joined:
    Mar 22, 2011
    Messages:
    924
    As you can see, I don't get Woodsman 3 often! :lol: Is that the only bonus it confers?

    It might be worth testing. I always considered barbarians as auto-death for my early game units anyway-- across ALL civilization games-- so that was the standard I've been measuring them up against.
     
  20. Nevets_

    Nevets_ Chieftain

    Joined:
    Jan 20, 2011
    Messages:
    281
    That's it. The speed bonus is Woodsman 2. I guess the other option is to make the not get any defensive bonuses, but they would still be deadly on open ground, and it wouldn't make any sense. I think Neandethals should be dangerous, but that you should be able to kill them with a one two punch by sacrificing a unit and finishing them off with another. Right now that's not workable until you get str 3 units (and even then it's hard).
     

Share This Page