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

FlavourMod - Mapscript Module

Discussion in 'FfH2 Modmods, Scenarios, and Maps' started by Jean Elcard, Apr 26, 2008.

  1. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    FlavourMod v1.1.2 Outdated! Has been replaced by FlavourMod 2

    Purpose: Have civilizations start in regions matching their 'flavour', but interfere only as minimally as necessary with the stuff the base mapscript is doing. 'Flavour' in this context means everything you may associate with a certain civ and its typical landscape. Let it be based on its historical background or something like 'Elves -> treehugging -> forest' or 'Egypt -> sand -> desert'. These choices can be very subjective, so feel free to modify them to your liking.

    Flavoured Civilizations:

    • Amurites: mana nodes and reagents nearby
    • Bannor: prefer incense to support their religious fanatism
    • Calabim: prefer an area with high food potential to keep the human stock well-fed
    • Clan of Embers: edge of the jungle, Pyre of the Seraphic
    • Doviello: tundra start - for some reason they like it cold
    • Elohim: unique features (not the sepulcher) and incense nearby
    • Hippus: flat and featureless land to ride without hindrances
    • Illians: tundra start with Letum Frigus at hand - don't ask why, stupid winter god worshippers ...
    • Khazad: hills, hills and hills again to dig nice little holes in
    • Kuriotates: lots of workable land around to support their super city capital
    • Lanun: coastal start with pearls and as much water around as possible
    • Ljosalfar: forest for the good treehuggers
    • Luchuirp: prefer areas with high hammer potential with some hills
    • Malakim: hot desert, preferably with oases
    • Sheaim: mana nodes and reagents nearby
    • Svartalfar: forest for the evil treehuggers as well, but with some mana in it
    • Archos: food resources to breed some more eight-legged pets.
    • Cualli: jungle! forest in case there is no jungle around, tundra eeks!
    • Mazatl: lizard stays lizard - the same for them like for the Cualli.
    • Chislev: plains, pampa, steppe, you name it
    • Dural: marble in the vicinity
    • Kahdi: mana nodes and reagents nearby

    Installation: The download is a zip file containing the FlavourMod itself, a readme.txt with theses install instructions and the last version of Cephalo's excellent PerfectWorld mapscript, which I've already modified to take advantage of the FlavourMod mapscript module.
    Unpack the files and put FlavourMod.py and PerfectWorld_Flavoured.py in your <civ4>\PublicMaps folder. Next time you go for a game of Fall from Heaven or Fall Further select "PerfectWorld_Flavoured" as map type for this game (Do not select FlavourMod!).

    Attention: If you start a new game and you end up with an all-grassland-map, instead of the expected result, this may have various reasons. Check, if you put the files in the right PublicMaps directory (there are more than one in civ4's file structure) and that you did not select FlavourMod as your map of choice instead of a real mapscript modified to use FlavourMod (like PerfectWorld_Flavoured, which came with the mod as an example).


    Download: Outdated. Please use FlavourMod 2 instead of this version! You can get it here: FlavourMod 2 Thread

    If you should still want the old version: FlavourMod v1.1.2 (23.05.2008)


    Change Log:
    Spoiler :
    Version 1.1.0:
    • Add: flavour information for Dural and Sheaim
    • Add: new flavour parameter: FoodFocus (high food yield of starting location)
    • Add: new flavour parameter: ProductionFocus (like food focus, but for hammers)
    • Add: new flavour parameter: CommerceFocus (like food focus, but for commerce)
    • Add: new flavour parameter: MobilityFocus (prefer flat land without features)
    • Add: allow different shaped search areas (fatcross or square)
    • Change: moved FlavourMod to a later stage of the map generation process
    • Change: allow some of the normalization functions for buffing dull starts
    • Change: fine tuning of the flavour info of all civs (see the current list)
    • Fix: civ-specific search areas will take effect now
    • Other: many code improvements, some more docu
    Version 1.1.1



    • Fix: no python exceptions any more if flavour parameter "improvements" is set
    • Add: flavour Info for Bannor (incense)
    • Add: flavour Info for Clan of Embers (jungle, plains, desert, Pyre of the Seraphic)
    • Add: additional flavour info for Illians (Letum Frigus)
    • Add: additional flavour info for Elohim (sacred sites except Brocken Sepulcher)
    Version 1.1.2
    • Fix: a starting loction near world's end (map boarder) could break FlavourMod
    • Add: flavour Info for Kahdi (same for the renegades as for the Amurites)
    How to: "Flavour up other mapscripts":
    To let other mapscripts take advantage of the FlavourMod is easy, but you'll have to add the following lines of code to the mapscript you want to use first (preferably at the top):
    Spoiler :
    Code:
    ###############################################################################
    ## This mapscript is modified to always use the "FlavourMod" mapscript module. 
    ## See "FlavourMod.py" under your <civ4>\PublicMaps\ directory for details.    
    ###############################################################################
    from FlavourMod import *                                                       
    ###############################################################################
    If you are still not sure how to do it, then take a look in the PerfectWorld_Flavoured mapscript I bundled with the mod for an example. Of course you're advised to make a backup of the original mapscript before changing anything and rename your modified version to something like "Continents_Flavoured.py" so that you don't confuse the various versions. It's unimportant by the way if you put your modified mapscript into <civ4>\PublicMaps, <civ4>\Warlords\PublicMaps or <civ4>\Beyond the Sword\PublicMaps as long as FlavourMod.py is located at <civ4>\PublicMaps.

    How to: "Change or add more flavoured civs":
    Please take a look at the intestines of the FlavourMod.py file itself. Should be self-explanatory or you have to learn some more Python. I really tried to keep it simple, but you can simplify it only so far.

    Notes: FlavorMod does not change the map itself, it only uses the starting locations already provided by the base mapscript and redistributes them. Hence, if there is no suitable place for a particular civ, it will be set to start somewhere, but probably in a rather ill-fitting area. Albeit there will be a clear tendency, no guarantees can be made, that all starts will be 'flavoury' for everybody. This also means that the mod is usually working better on bigger maps with more players than on smaller ones with fewer players, because of the higher number of available starting locations avaiable for redistribution. And another small drawback: Teams won't start near each other in many cases. Would be pretty complex to assure flavour and close team members at the same time.

    Credits: If you think you've seen something like this before, you are right. This mod is an adaption of one of Dreiche2's mods. First I only wanted to change and add some minor things, but now I've changed almost everything of its inner workings and added a lot of stuff. Most noticeably I've reworked the optimization algorithm completely. It's much more complex now, but the results are a lot better too. Furthermore I fixed a major bug and some minor bugs and tried to make the adding of new civs to the flavoured civs a bit easier. However, nothing of this would have happened without Dreiche2's work in the first place. Thanks.

    Screenshots: The four screenshots below I took all from the same map and game. As you can see, the placing of civs to their preferred terrains is pretty good.
     
  2. Milosrdenstvi

    Milosrdenstvi Chieftain

    Joined:
    Mar 24, 2008
    Messages:
    96
    Will it work if one does not have Fall Further?
     
  3. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    You don't need Fall Further to use FlavourMod. It's working with only Fall from Heaven installed too. Even better, it's totally version independent.

    It's actually also working with Vanilla Civilization 4, Warlords or Beyond the Sword but then it's simply doing nothing. At least as long as nobody implements the Egypts in it or so ... ;)
     
  4. Tarquelne

    Tarquelne Follower of Tytalus

    Joined:
    Dec 8, 2001
    Messages:
    3,715
    Good show! I look forward to trying it.
     
  5. Kasdar

    Kasdar Chieftain

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    You didn't mention the Sheaim. What have you done for them?
     
  6. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    You make a small modder very happy. :)

    They are not on the list, that's right, and they are not the only ones. Every civilization I couldn't find out any preferences are getting tagged as "ordinary" and have to take what's left after the flavoured ones made their pick. That doesn't necessarily mean that these locations are bad, it just means they didn't fit exactly or as much the flavours the others would prefer, like Tundra, Forest, Desert etc. Usually these locations are quite good because they have something of everything.

    The 7 Civilizations not on the list are the Bannor, the Elohim, the Sidar, the Balseraphs, the Clan of Embers, the Sheaim and the Dural. If anybody finds a reference to which kind of landscape they prefer I would be happy to add some flavour to them too.
     
  7. Kasdar

    Kasdar Chieftain

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    The Sheaim should start near some mana nodes as both leaders have the summoner trait. and one has arcane.

    it stinks not starting anywhere near a mana node.
     
  8. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    the clan should be in jungle or near the pyre if it is present. dural should be present near marble if at all posible.

    EDIT:

    Would this be easy to mod to make it work with Warhammer as well?
     
  9. Vehem

    Vehem Modmod Monkey

    Joined:
    Nov 22, 2005
    Messages:
    3,219
    Just had a look and this looks very nicely done - good work :goodjob:

    Thanks for including the Fall Further civilizations in there too - some of those (the Lizards especially) really benefit from a "flavour-start" and this does that perfectly.
     
  10. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    i had a play with this map script to try make it work for WH civs, but every time i load a game with it, the entire map is grasslands, nothing else, no hills, peaks etc at all. any idea what i did wrong? all i did was rename the civs and added a couple extra civs in :(
     
  11. Vehem

    Vehem Modmod Monkey

    Joined:
    Nov 22, 2005
    Messages:
    3,219
    Are you loading the "FlavourMod" or a mapscript adapted to use it?

    The FlavourMod itself isn't a map-script, it just overrides some functions of other map scripts to make them give suitable starts. If you run that, odds are the map will be a little dull.

    The "PerfectWorld" script in the download is an example of a script using the FlavourModule...
     
  12. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    i dont get it. does that mean i can run a contientns or pangaea or even creation map as normal and the civs will be placed according to flavour mod? how does that work?
     
  13. Vehem

    Vehem Modmod Monkey

    Joined:
    Nov 22, 2005
    Messages:
    3,219
    Right at the top of the PerfectWorld.py script there is

    Code:
    ###########################################################
    ## This mapscript is modified to use the "FlavorMod".      
    ## See "FlavourMod.py" in the same directory for details.  
    ###########################################################
    from FlavourMod import *                                 
    ###########################################################
    
    ## File: PerfectWorld.py version 1.12
    ## Author: Rich Marinaccio
    ## Copyright 2007 Rich Marinaccio
    
    The important line is

    Code:
    from FlavourMod import *    
    All the rest are just comments. If you import FlavourMod into any script, it will use the functions in FlavourMod instead of the default ones when selecting start locations.
     
  14. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    Ah ha! thanks Vehem that makes sense. ill see if it works :D

    is it possible to make a certain civ always start near a certain Unique Feature (such as Ljosalfar always near yggdrasil?)
     
  15. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    I'm collecting. Keep it coming. I was thinking about putting the Clan into the jungle earlier too. It's all about flavour here, I know, but they are very likely to get crippled there, without any real bonusus for jungle dwelling. Jungle in the beginning is even worse than tundra for most civs.

    I never played the Warhammer mod, but I just tried it with the "PerfectWorld_Flavoured" Mapscript I bundled with the FlavorMod and it worked fine for me. It can't really do anything, as long as the Warhammer Civs aren't implemented in FlavourMod.py but if someone does implement them, it should.

    Concerning the everything is flat and green problem: Vehem is right, you probably tried to use FlavourMod itself as a mapscript instead of a mapscript modded to use FlavourMod. The result with using FlavourMod as a mapscript is usually a lot of grass to mow.

    Follow Vehems instructions he gave in his last post and the FlavourMod should work for any mapscript you choose. But be sure to keep the original mapsript as welll, just in case. In the end you should have something like a Continents.py mapscript and a second one called Continents_Flavoured.py for example.

    Thanks. No problem, Fall Further was for me the spark to start programming this. :)
     
  16. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    yep :) thanks jean and Vehem, i think it works now, though some of the starts are alsmot opposite what should be expected (my desert dwelling civ ended up in jungle once and my forest dwelling elves got plonked in desert :confused:
     
  17. Kasdar

    Kasdar Chieftain

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    If I wanted to adjust something I just do it in the FlavourMod.py file and it will work right? I dont have to change the perfectworld file do I?
     
  18. Vehem

    Vehem Modmod Monkey

    Joined:
    Nov 22, 2005
    Messages:
    3,219
    That's right - all the scripts contain is the "import" line - any changes you make to the FlavourModule will also be imported into the other scripts when when it loads.
     
  19. Kasdar

    Kasdar Chieftain

    Joined:
    Jul 29, 2006
    Messages:
    268
    Location:
    Minnesota
    Thanks Vehem,

    Now just to figure out how to get this to work with Creation.py as I like how the terrain is laid out much better there.

    But I like the ability to specify what resources you start by. I.E. MANA
     
  20. Jean Elcard

    Jean Elcard The Flavournator

    Joined:
    Feb 26, 2006
    Messages:
    1,008
    Location:
    Leipzig, Germany
    Impossible with the current version, because the unique features are technically improvements. Since improvements usually aren't around at the beginning of a game, I didn't include them as a flavour parameter.

    To be honest, I'm not sure, when FfH is setting up the unique features. If they are getting added after the starting locations assignment, I can't do anything about it. FlavourMod wouldn't be able to find them. I will check it out.

    Edit: Another problem: Naturally Unique features are unique. That would restrict possible starting locations for a civ flavoured for one of them immensly. Maybe I'll code in something like: "If something is on the same continent like Civ ..." or so in the future to reduce this problem, but there are some other things on the list first.
     

Share This Page