1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

FfH2 Bug Thread

Discussion in 'Civ4 - Fall from Heaven' started by Kael, Jan 26, 2009.

  1. Tholal

    Tholal Chieftain

    Joined:
    May 19, 2009
    Messages:
    1,657
    Install my modmod (see link in signature) and try again (you'll have to start a new game). If you still see this issue, post a savegame in the forum and I'll look into it.
     
  2. KeeperOT7Keys

    KeeperOT7Keys Chieftain

    Joined:
    Jul 10, 2013
    Messages:
    159
    Location:
    Mugla, Turkey
    doviello's worker to beastman upgrade is causing problem in agresssive ai scenarios, (blood of angels) they don't make any improvements and losing battles in long term
    how can I disable worker to beastman upgrade for doviello?
    it is realistic but not important for gameplay imo
     
  3. Lone Wolf

    Lone Wolf Chieftain

    Joined:
    Dec 4, 2006
    Messages:
    9,830
    Just play a modmod like Better Naval AI (it's not only naval stuff it improves).
     
  4. KeeperOT7Keys

    KeeperOT7Keys Chieftain

    Joined:
    Jul 10, 2013
    Messages:
    159
    Location:
    Mugla, Turkey
    I'm playing with naval ai modmod already; but still doviello upgrades his workers to beastman always, and adopting conquest at start, and stay with 5-size cities all game, because of ''agressive ai option'' in scenario
     
  5. Folket

    Folket Chieftain

    Joined:
    Jan 7, 2010
    Messages:
    3,567
    Location:
    Sweden
    If that is the case you should report that in the more naval AI bug thread. I'm sure Tholal is willing to make the AI better by having them keep some workers as workers.
     
  6. Terkhen

    Terkhen Chieftain

    Joined:
    Aug 1, 2011
    Messages:
    875
    Gender:
    Male
    Location:
    Spain
  7. Folket

    Folket Chieftain

    Joined:
    Jan 7, 2010
    Messages:
    3,567
    Location:
    Sweden
    Reading his fix it seems unlikely that the AI would ever transform all his workers to beastmen unless gc.getInfoTypeForString('UNITCLASS_WORKER') is not updated when the spell is cast. If it is only updated once a turn they will still transform all workers to beastmen.

    An other possibility is that the Doviello KeeprOT7Keys was playing against only had one city. In that case the fix would help. Still two workers per city as minimum seems a lot. I would rather change it to pPlayer.getNumCities() >= pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNITCLASS_WORKER')) to solve that problem.
     
  8. [to_xp]Gekko

    [to_xp]Gekko WM junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,790
    Location:
    Seyda Neen, Vvardenfell
    you should be able to open the scenario file in a text editor and remove the aggressive AI option.
     
  9. KeeperOT7Keys

    KeeperOT7Keys Chieftain

    Joined:
    Jul 10, 2013
    Messages:
    159
    Location:
    Mugla, Turkey
    thanks guys for previous question :D
    not a bug, but I don't want to start a thread for that:
    I'm making an eurasia map for ffh2. indonesia and iceland is the corners of the map. (84X44)
    but I have a question, what's the mechanic of goblin forts? soldiers in them I mean;
    when I finished the terrain part of map I added some goblin forts around the map, and 5 barbarian city, but while I testing game I saw a goblin fort with 6-7 goblin archer (in turn 10 or 15).And I didn't add any unit to these forts in worldbuilder.Is it calculating on barbarian city count?
    or any assosication with it? or total goblin fort number?
    All goblin forts have same soldiers, with same numbers; too.
     
  10. Lone Wolf

    Lone Wolf Chieftain

    Joined:
    Dec 4, 2006
    Messages:
    9,830
    Yeah, it's a known mapmaker problem. I believe that each time you load a map, it places a goblin on a fort. You have to remove them manually when editing/creating maps.
     
  11. KeeperOT7Keys

    KeeperOT7Keys Chieftain

    Joined:
    Jul 10, 2013
    Messages:
    159
    Location:
    Mugla, Turkey
    oh thanks lone wolf :D
     
  12. Tasunke

    Tasunke Crazy Horse

    Joined:
    Mar 20, 2009
    Messages:
    2,752
    Location:
    the 1800s
    I tried

    iAC = CyGame().getGlobalCounter()
    iMax = 1.1 + 0.03 * iAC + ( iAC / 70 )**3.1
    iMult = math.log10( ( 2 + iAC ) / 16 ) + ( iAC / 90 )**6
    iMultB = iMult * gc.getDefineINT('PLANAR_GATE_CHANCE') + 822

    if CyGame().getSorenRandNum(10000, "Planar Gate") < iMultB:

    In python, but its just breaking the CivEventsManager code ... any knowledge as to why?

    I was certain A**B could be an exponent function in python, and I was vaguely certain that math.log10 would work in python.

    Anyone know what I'm missing?


    Edit: I even tried import math, and it didn't seem to work

    Edit: Exponent is fine, the only thing that BREAKS the code is math.log10 ....

    Anyone know a more appropriate way to perform logarithms in FFH2 python? Or is it impossible even with import math?

    Edit: I downloaded Python27, thinking I could isolate math.py and add it to the folder ... but I couldn't find it.
     
  13. Folket

    Folket Chieftain

    Joined:
    Jan 7, 2010
    Messages:
    3,567
    Location:
    Sweden
    Why make it so complicated? Why not just remove the math.log10 part?
     
  14. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    549
    (2 + iAC) / 16 gives 0 if iAC < 14 (you're dividing integers and python rounds down always).
    log(0) is not defined.
    If you want a float division, try "x / 16.0". Like:
    Code:
    iMax = 1.1 + 0.03 * iAC + ( iAC / 70.0 )**3.1 
    iMult = math.log10( ( 2 + iAC ) / 16.0 ) + ( iAC / 90.0 )**6
    
    Just out of interest:
    You want to make a function for the chance of a planar gate spawning a unit, right?
    What kind of behaviour do you want to archieve? It may indeed be possible to get similar behaviour just with power functions.
     
  15. Tasunke

    Tasunke Crazy Horse

    Joined:
    Mar 20, 2009
    Messages:
    2,752
    Location:
    the 1800s
    I want it to start at 0 for 0 AC, then ramp up to around 9 - 12% at AC 30, then plateau, and start picking back up at around 60, 70, 75 ... taking a steep climb near 90, and reaching around 28-35% at AC 100
     
  16. Tasunke

    Tasunke Crazy Horse

    Joined:
    Mar 20, 2009
    Messages:
    2,752
    Location:
    the 1800s
    Thanks lfgr, adding .0 to the denominator fixed the problem :)


    now, one of my exponents is a 3.1 ... does that see it as 3 or 3.1?

    I hear if you want to get a fractional/floating exponent, u need to do Math.power? (math.pow(x,y))

    So maybe math.pow(x/70.0,3.1)?
     
  17. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    549
    What about that:
    if 0-30: AC/3 or alternatively non-linear 10 - ( 10 / (30^c) ) * (30 - x)^c
    if 30-60: 10
    if 60-100: 10 + ( 20 / 40^d ) * ( (AC - 60)^d )
    c and d is your choice, depends how steep you want the function at the beginning respectively the end.

    It's just stretched and moved power functions and linear functions concatenated. Something like that might me enough for what you want.
     
  18. Tasunke

    Tasunke Crazy Horse

    Joined:
    Mar 20, 2009
    Messages:
    2,752
    Location:
    the 1800s
    For some reason my modifications have caused UnitUtil from bug to not initialize.

    Now, since its Bug, it shouldn't matter right? But I DID see a massive amount of OOS errors in the mid to late game ... was this due to the Power Functions of iMult and iMax, or was it the UnitUtil error?

    I'd be prone to think it was the power functions of iMult specifically

    (I had switched to power functions because logs were slowing down the game too much)
     
  19. lfgr

    lfgr Chieftain

    Joined:
    Feb 6, 2010
    Messages:
    549
    I'd say try to fix the UnitUtil error first :)
    I remember getting misleading error reports from BUG several times, so the problem may not even directly have to do with UnitUtil. Did you get any python exceptions? Did you check your edits for syntax errors (I usually run "python x.py" before trying a modification in-game)?
     
  20. Tasunke

    Tasunke Crazy Horse

    Joined:
    Mar 20, 2009
    Messages:
    2,752
    Location:
    the 1800s
    python x.py?

    and that's the only error, and only when I start a game (once map is loaded)


    Edit:

    All I did was add

    if pCity.getNumBuilding(gc.getInfoTypeForString('BUILDING_DUNGEON_TORTURE')) > 0:
    if pUnit.isAlive():
    if CyGame().getSorenRandNum(100, "Asylum") < 50:
    pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_TORTURED_SOULS'), True)

    to CivGameUtils.py

    (between fixing planar gates and testing the game)

    ----

    I'm tempted to comment that part out and see if the error persists
     

Share This Page