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

Nomadic Civilization ModMod Development (FFH2+FF)

Discussion in 'FfH2 Modmods, Scenarios, and Maps' started by Ingvar, Jul 25, 2008.

  1. Ingvar

    Ingvar Chieftain

    Joined:
    Jun 15, 2008
    Messages:
    62
    Putting my feeble modding skill to use I am designing a truly nomadic civilization for FFH2/FF. Since most of what I am hoping for is very doable, I've decided to share the development plan and pieces of code here - maybe it will help someone trying to achieve the same goal.

    Overall changes in the game:
    1. Cities are no longer permanent at least for one civilization. They can be packed up into a unit and moved.
    2. Buildings that sound like they could be moved - either dependent on skilled people (Forge, Command Post), or small transportable thing (Religious Altar) - are moved either by promotion or by a unit.
    3. All land resources become movable, some as promotions, some as units.
    4. Movable resources can be sold, traded, used up and spoil.

    Where I am at:
    Added a civilization "Ambulnati" - butchered Latin for "People of the Walk". At this point the changes are in:
    Assets\python\CvEventManger.py
    Assets\python\entrypoints\CvSpellInterface.py
    Assets\Modules\Ambulnati\
    Assets\XML\Units\CIV4PromotionInfos.xml

    Got "Establish Settlement" for building city, and "Abandon Settlement" for converting a city into a unit spells working. There is a catch for not having any cities at all - tied to determination of whether the player is alive. Right now I am just making sure that civ cannot commit suicide by abandoning last city. In the future I am hoping to enable COMPLETE_KILLS just for one civ in SDK.

    Got Movable Resource working for livestock. Unit picks up resources and carries them as promotions, and drops them where needed. Both spells are working well. Thanks to Lutefisk_Mafia for the code and idea.

    Got buildings to turn into promotions - right now only one does, but the mechanic works.

    Got culture spreading improvements to work - based on Lutefisk_Mafia's code.

    I'll post updates of where I am at by editing this post :)

    Xienwolf, Marnok, Vehem, Lutefisk_Mafia, MagisterCultuum, Arctic_Circle - thanks for answering my endless questions tirelessly :)
    Arctic_Circle - thanks for getting my interest up on this modding lark - it's fun.
     
  2. Ingvar

    Ingvar Chieftain

    Joined:
    Jun 15, 2008
    Messages:
    62
    Reserved for future use.
     
  3. Ingvar

    Ingvar Chieftain

    Joined:
    Jun 15, 2008
    Messages:
    62
    Game Concepts & Lore:
    Background info:
    Ambulnati are traveling and trading people not anchored to any one place. They have no capital city or central governing authority, instead the most respected elder is selected to carry the burden of resolving disputes between treibs. A treib is a community that travels together in a Wagon There is no distance from capital maintenance costs, instead many of their "building" and equipment units are of a higher maintenance.

    They do not form elaborate trade networks to connect cities with roads, rather they are able to retain resources in movable form. Movable resources have some disadvantages - they tend to spoil or be used up. Some buildings help decrease the rate of spoiling, some increase the rate at which resource is used up. They can be sneaky and gain resources from other lands, bypassing "no trade" agreements. While stealing resources results in attitude modifications, it is a way to make a living, as Ambulnati say. They can also gain resources from unused improvements from long lost civilization territories or in barbarian lands.

    The Palace is replaced by The Elder's Tent. It provides mana and resources to Ambulnati civilization. This special building also works together with The Elder unit for some surprising spells. The Elder unit is not built, but any alive unit over 100 turns of age, with high level can take Elder Trials. The Elder starts with a small base strength, but retains all his promotions, and has Air mana affinity.

    Their Hunter replacement Herder comes at Animal Husbandry. Herders do not have a Subdue Animal promotion, nor can they learn it. Instead they gain an ability to herd livestock, moving livestock bonus resources from one place to another. Any Sentry can be upgraded to a Herder. While Herders cannot subdue animals, they can lay out traps, a special improvement that has a chance to convert the animal to your cause. Herders also have an ability to create Herding Dogs from Wolves. These units also gain ability to capture herds and increase the number of resources that can be moved.

    Ranger is also replaced by a Tamer. Tamer comes at the same tech, but he can be joined with animals to create a stronger unit.

    Hawk is replaced by a Falcon unit, its main advantage is that he can re-base from city directly to a unit. He is only built in cities that have Falconer improvement. He has a smaller range of flight.

    Alignment:
    Nomads are Neutral. But they as others can go bad, and become unwelcome in lands of Good and Neutral civilizations. They can be messengers of Good as well, and thus have Evil civilizations hunt them down.

    Diplomacy:
    Open Borders is the magic. In order to sell movable resources and run away from enemies nomads need friends. Lots of friends. And, you will have bonuses for providing temporary trade resources - while the building exists in the city it provides you with bonus in relationship with the civilization. There are special events that give you extra boosts in relationships - quests from your sedentary friends to deliver them rare resource for very little pay. Gratitude from them often gives you extreme benefit of using that leader's land as your own for producing resources for sale. When nomads steal and coerce citizens and units of other civilizations to join them they get an attitude penalty as a result or all out war.

    Commerce:
    Commerce is the second nature of nomads, they are suited better than anyone to conduct trading operations. Normal trade is somewhat restrictive to them, but they make great use of movable resources. Selling those to other civilizations for a flat rate, exchanging rare resources for technologies, plus those resources are not permanent, so nomads can be sure of repeat
    business.

    To gain gold they can also sell animals, slaves, and equipment. A long gone Luchuirp's Golden Hammer is in Barbarian hands? Khazad might pay a good coin for it. Pieces of Barnaux are stolen? Nomads could return it.

    Nomads can also construct Caravans from Great Merchants. These provide small amounts of gold for trade missions. They can be raided by almost anyone for they are a hefty prize - they will need Caravan Guard to accompany them.

    What other civilizations treat mostly as culture buildings for nomads turns into mobile money making machine. Traveling Fairs and Traveling Theaters are yet another way to improve relationships with civilizations and get some gold.

    Now all this gold has gotten new ways to spend it. Travelers have always used foreign cities as supply points leaving their gold behind. Nomads are no exception - lacking their own established training centers for warriors their people learn all they can in lands they pass. In friendly lands you can get new promotions, new equipment, spells and new units all for gold.

    Technology:
    Mainly by stealing and spying, but also by a special Treib Council building - it is their Elders Council, Library and Mage Guild combined. They may not have large cities and great academies, but they learn by seeing and they see a lot.

    Religion:
    Nomads pray to all gods, but hold Tali closer to their hearts. Each Wagon can acquire religion if built by a unit with religion. It can also gain religion while staying at a holy city. They can adopt religion as state religion, but since they do not build temples they won't build advanced disciple units. They can however try a game of chance and try to upgrade their medic/disciple unit - Windfinder - to a dicsciple of the religion and then to a priest in other civilizations' cities. They risk that he may leave his wagon to stay with his religious teachers. A Windfinder that keeps close to Tali rather than converting to other gods can become a Windchanger. They do have one Pagan Temple UB - Tali's Shrine. Each Wagon no matter what other gods they pray to will have a shrine of the god who is most useful on the road.

    Culture:
    They are like wind - today they are here, tomorrow another place, scattered across the vast expanses of the world. But once in a great while they will gather as one, and then their cultural influence will shame the most cultured empires. All the tales of adventure, the spirit of the road, and things seen in long journeys might convert the nearest towns to get on wagons themselves. With their moving ocean raft cities they can form cultural bridges across deep waters.

    Wonders:
    They can build all of the wonders... But unfortunately they cannot take a lot of them with. Tablets of Bambur is a relic that can fit in a wagon, Tower of Alteration - perhaps not. Song of Autumn - can be sung anywhere, but Great Library will be left behind. This will make you think twice before building wonders. You would be much better off raiding those cities that have built it and capturing them. Maybe someday they will be able to figure out how to take big things apart and carry it in many wagons, but that day has not come. There are however Wonders that not only can be built, but will provide Nomads with some extra benefits. The Eyes and Ears Network is
    their most coveted creation. If it is ever built - each Wagon gains some spy abilities, and each Recon unit gets a promotion that lets them explore rival territory in complete invisibility. Combined with Council of Esus - that also can be founded in a Wagon - they can become the nation of spies.

    More to come...
     
  4. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Ya know... the time, thought and detail placed in the "Extra Civ Mods" by FfH people absolutely blows anything I have seen by modders in the Vanilla threads OUT OF THE WATER. And those guys don't even have to struggle to make things up on the fly while still making it seem an integrated part of the whole. They have droves of history telling them already what units to have and where/when to put them...

    Looking great, and I can't wait to see an artist fall in love with your work and spice up what you have at that point :) (Always the most exciting part of any Mod, sadly enough for us Code-Monkeys ;))
     
  5. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    this is absolutely amazing... ingvar seriously if its ok with you once you finish this mod id love to steal it :) its exactly what i want for the Chaos in Warhammer.

    one concern though... how do the ai handle the movable cities and resources???
     
  6. LetsBoogeyUp

    LetsBoogeyUp Chieftain

    Joined:
    Aug 3, 2007
    Messages:
    18
    They won't, I guess >.> Some Civ's are meant for players, really.
     
  7. Ingvar

    Ingvar Chieftain

    Joined:
    Jun 15, 2008
    Messages:
    62
    I think the magical world gives more to imagination, so it attracts those who like to do that. I like telling a story - so to me that is what keeps the other things moving - coding, messing about stuff that I know very little about, just to be able to tell that story.

    Thanks! I am hoping to get the proof of concept with whatever art is available done in under a month, circumstances permitting. Then I would be really great to see some artists create a style for it. There will be plenty to do: Sea Rafts, Ocean Platform cities, improvements, equipment, Wagons - all sorts of things. It even works now - Wagon is a Gypsy Wagon for now ;) Campsite is a Camp :) And so on. But yeah, it will be exciting to see art for this.

    Take anything you'd like - I'll post snipplets of code here for review. If you see a better way of doing something - please tell me - I've been away from coding of any kind for a long time, my code maybe very inefficient at times.

    AI will have to come at the end. I am sure it can be taught what to do - it's pretty simple in theory - if this is true - use this spell, if this this is true - move here. I mean - I actually loose to AI on higher levels of play ;)
     
  8. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    excelent :D well you've definatly perked my interest so id be happy to work on static graphics for you (ie buildings and such, probably even the floating cities and rafts :D) once my other stuff on my to do list is complete that is...
     
  9. Vehem

    Vehem Modmod Monkey

    Joined:
    Nov 22, 2005
    Messages:
    3,219
    Looking forward to seeing this one too - definitely a unique mechanic and some nice solid lore behind it.
     
  10. seZereth

    seZereth FfH´s art monk(ey)

    Joined:
    Feb 3, 2006
    Messages:
    3,900
    Location:
    Bayreuth
    sounds awesome,
    i really wished for more time to help all you guys and award your creativity and work with beautiful artwork.

    lets see where I can spare some time for you, when you actually managed to make it playable.
    keep it up
     
  11. Broken Hawk

    Broken Hawk Chieftain

    Joined:
    Jan 20, 2006
    Messages:
    1,227
    Location:
    On a hill
    Darn! You beat me to it Ingvar. I was planning on making a ModMod very similar to this. I will be following your progress closely. Best wishes.
     
  12. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,016
    Location:
    Kael's head
    I just noticed that Nomadic civs are planned in Dom Pedro II's Conquerors Delight modcomp. Maybe you should work together with him on that. And convince Xienwolf and Vehem to include the modcomp in their modcomp/Fall Further.


    p.s. There is no underscore between the two words of my screen name.
     
  13. thomas.berubeg

    thomas.berubeg Wandering the World

    Joined:
    Aug 21, 2006
    Messages:
    8,969
    Location:
    Ft. Lauderdale
    this look good... i'll try to steal this from you when you finish (at least the raft cities... i want to add a feature like that to the lanun)
     
  14. Arctic Circle

    Arctic Circle Chieftain

    Joined:
    Apr 24, 2008
    Messages:
    473
    This is really something else. I will play it.
     
  15. Aoleleb

    Aoleleb Chieftain

    Joined:
    Jun 30, 2007
    Messages:
    160
    This sounds like so much fun to play. I can't wait
     
  16. Ingvar

    Ingvar Chieftain

    Joined:
    Jun 15, 2008
    Messages:
    62
    Thanks everyone! I'm still alive and working on this. Though FF041 put a good 8 hour dent in time put in it ;)

    On Movable Resources:

    A Wagon or a Wagon Driver unit and their maritime counterparts ("Settler" & "Worker"), can use a spell with delay on top of a tile with both resource and improvement to gain a "movable resource" unit. The resource unit is much like equipment - 0/0/0. It would have to be moved by a unit with cargo capacity. I am creating a unit for each type of resource in the game. Each one of these units will have a "duration" set in it's XML definition.
    Durations have not been tested yet for play functionality.
    - Sea Resources (Fish, Clams, Crabs, Whale) - spoil in 30 turns (maybe less)
    - Grain Resources (Wheat, Rice, Corn) - spoil in 50 turns
    - Goods Resources (Cotton, Silk, Reagents, Dyes, etc) - spoil in 100 turns
    - Metal & Stone Resources (Gems, Marble, Gold, Copper, Iron, Mithril) - never spoil.
    This takes care of transporting resources to other places in time.
    Once in a city, the resource unit can create a building providing this resource to the owner of the city only while the unit is in the city. The spell creating the building also sets the "duration" modifier to emulate use of the resource. So metals and stones will get used up eventually. Some resources will get better rate - as you could probably preserve them better in a city than on the road.

    Tie in with trade:
    It would be nice to figure out a way to tie in these trades with trade screen. If anyone has any ideas on how to do that - please post here.

    On movable cities:
    The trickiest parts of this will be to preserve culture levels and population of moving entities. I do not know much about how data is saved in save files, but the most obvious way would be to create an independent data array for each city/unit and update it within game and keep it saved. It would be a clean way without tons of promotions and tricks to know everything about a moving city that there's to know: culture, buildings, population, production queue. That might be something to mod in SDK. I am not sure - if anyone has any ideas - please post here.

    If anyone has any samples of multi-dimensional arrays used in civ4 python code - please share here.

    Right now I am discarding culture completely every time the settlement is abandoned and setting it based on unit's age every time the unit "settles". If there's a way to get Building's age I might be able to preserve culture to some degree by calculating when a culture producing building has been built and assigning the proper culture value when unit is "settled".

    Population is "controlled", a "treib" can be only at size 5. If settlement population is larger than that when it abandons settlement an additional wagon is created. Flavor wise it makes sense, since a there's a tradition of excess population of a tribe to create a new tribe. Population is carried as a promotion - Treib I through V. Some other promotions will extend it up to 10, but not much more than that.

    I am streamlining buildings for the the nomads - they won't have as many buildings, but will have more other ways of gaining same effects in other civilization cities. I've separated the buildings into these categories:
    - Culture Generators
    - Research Generators
    - Gold Generators
    - Unit Building/Enhancement
    and in the process of weeding out everything that I can that could be replaced by some other effect, trying to come up with the least number of promotion based buildings.

    All of this is turning out to be lots of work :) So it will be a while before a playable modmod is made. I'd say about a month if all is well.

    If anyone would like to help with converting lists of stuff to XML files - it would be most welcome. I am writing out Spells, Promotions, Units, Buildings as text files first listing abilities and values.

    If anyone knows of a good gui editor for XML specifically for Civ4 files - it would be a lot of help too I think. Half of my time goes into scrolling up and down XML files to replace values.
     
  17. Arctic Circle

    Arctic Circle Chieftain

    Joined:
    Apr 24, 2008
    Messages:
    473
  18. Broken Hawk

    Broken Hawk Chieftain

    Joined:
    Jan 20, 2006
    Messages:
    1,227
    Location:
    On a hill
    @Ingvar,

    While having resources spoil or used up makes sense, doesn't that put your nomads at a disadvantage compared to the sedentary civs where there is no spoilage, etc. of commodities.
     
  19. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    So the "resource unit" has to stay alive and stationed on the city (like Hope), or they found a building (like Create Temple...)? The latter is what I thought you would do (and have those buildings be Equipment flagged so when the city disappears you have the resource units again), but spoiling only makes sense on the former. Unless you set it up in Python to spoil as a promotion as well.


    Overall, I think it'd be nice to do a lot of what you want in C++ so you can really customize it how you want. But a nice trick you can use instead of promotions is to find an INT value which can be modified by Python and means nothing much for your Settlers to store the Culture value in (and Gold Value might need stored too... how does it handle Gold when you uproot a city right now?). Thus if the city has a culture of 500, the Unit to reflect the City will be created with an iAIWeight, iAirRange, iAdvancedStartCost or iHurryModifier value of 500 (just find something equally useless which has a "Set..." value exposed to Python. Not sure offhand which one that would be)
     
  20. Ingvar

    Ingvar Chieftain

    Joined:
    Jun 15, 2008
    Messages:
    62
    It does put them at a disadvantage somewhat intentionally - while they get ability to get virtually any resource for themselves and for trade, they are limited as to how long they can have that resource. They would have to go back to the tiles that have the actual resource and the improvement in order to get more. Livestock resources they just pick up of the tile - it disappears from the map, goods they "harvest", original resource is left where it was, and they move on with a "portion" of a resource. This mechanic would keep them on the move and looking for resources they can use.
     

Share This Page