Tweak Mod for Xtended

16. I'm playing now as Charadon with the Doviello. Whenever there is a barbarian uprising it forces me to sell slaves. It says 10% of my population in all cities, but it rounds up, so every couple turns I lose one population in each city. That is a pretty severe penalty, especially early on (going from 3 population to 2). And the more I expand, the more barbarian forts I'm in contact with and the more frequent this will happen. It would be nice to either turn off the uprisings for those with the barbarian trait, or to give another option that lets you ignore it. (or maybe even an option to just buy units from the barbarians)

17. The Bard class gives culture when you kill an animal, but it looks like Bounty Hunter doesn't give gold for killing animals. I think that should be consistent.

18. Can someone explain what is going on here? It says I have -9 faith income, but when I mouse over it says I should have 21 faith income, and then has something about sacred knowledge which I don't understand.

19. Is it just me, or is the Doviello trophy hall a downgrade compared to the Huntsman's cabin? If they have a lot of fur & deer, the huntsman's cabin could actually yield some decent income. The trophy hall is just a flat bonus.

20. It looks like when you destroy a civ, you can keep the Centralized Empire building. Even if you have more than one city. Is that intended or a bug?
 
Last edited:
Hi all, glad to see that this mod is still followed up! A couple of months ago I resume to play it with my brother, but due to OOS issue we started to loose some interest. That said, I started to make some bugfix and oos fix without realizing the existence of this thread!
So far after merging AIAutoplay and OOSLogger I think I fix the following OOS:
- [AMURITES] Fix OOS due to Arcane Lacuna promotion not always be removed (canCast triggered in async context)
- [SPELL] reqStunned cause OOS (canCast triggered in async context)
- [EVENTS] Corrected random OOS due to event EVENT_YOUNGER_COUNCIL_1 in which (I assume) <iHappyTurns></iHappyTurns> was returning a random (uninitialized) value. By changing it to <iHappyTurns>0</iHappyTurns> no more on OOS on this event.

I am trying now to debug other OOS but those are more random and could be a little bit more difficult to track down. So I am trying to add more logging and I have also disabled AIAttitude cache (which I see Sephi added) as I saw in logging some small discrepancies and I am not sure if can be tied for some of them.

Eventually I would like to be able to share with you all (if interested of course :D) the outcome of such work... once I find where to upload and time to merge with v1.09 of latest Sephi fix.
Very glad that this mod is still followed up, big thanks to everyone who worked really hard on it and big thanks to Sephi still working on it. Still giving after many years a lot of hours of enjoyment!
 
The Summon Circle is not buildable. Whenever one of my cities completes it, no such building is in there. It can be chosen again in the City Build Menu and Summons are still spawning in the capital city...
 
Just upload a savefile next time and I can take a look at it.
Hey ! dunno why I missed you being back after 2021... that's great news
 
Hi all, glad to see that this mod is still followed up! A couple of months ago I resume to play it with my brother, but due to OOS issue we started to loose some interest. That said, I started to make some bugfix and oos fix without realizing the existence of this thread!
So far after merging AIAutoplay and OOSLogger I think I fix the following OOS:
- [AMURITES] Fix OOS due to Arcane Lacuna promotion not always be removed (canCast triggered in async context)
- [SPELL] reqStunned cause OOS (canCast triggered in async context)
- [EVENTS] Corrected random OOS due to event EVENT_YOUNGER_COUNCIL_1 in which (I assume) <iHappyTurns></iHappyTurns> was returning a random (uninitialized) value. By changing it to <iHappyTurns>0</iHappyTurns> no more on OOS on this event.

I am trying now to debug other OOS but those are more random and could be a little bit more difficult to track down. So I am trying to add more logging and I have also disabled AIAttitude cache (which I see Sephi added) as I saw in logging some small discrepancies and I am not sure if can be tied for some of them.

Eventually I would like to be able to share with you all (if interested of course :D) the outcome of such work... once I find where to upload and time to merge with v1.09 of latest Sephi fix.
Very glad that this mod is still followed up, big thanks to everyone who worked really hard on it and big thanks to Sephi still working on it. Still giving after many years a lot of hours of enjoyment!
Thanks for posting, that pyreq code is definetly wrong and will cause OOS. I guess it was some workaround because Xtended was not using a modified dll initially.
 
Hey ! dunno why I missed you being back after 2021... that's great news
Hey Calavente, good to see you around. The not so great new is that my graphics card died after 9 years. So I will move to a new system and probably not do civ4 modding for a while atleast. There is tons of old stuff I would have to install just to compile a dll.
 
Fixed another OOS caused inside update_Reserve_PickupEquipment in AIGroup:

Code:
if(!pBestUnit->atPlot(pEquipment->plot()))
{
pBestUnit->getGroup()->pushMission(MISSION_MOVE_TO, pMove->getX_INLINE(), pMove->getY_INLINE(),MOVE_DIRECT_ATTACK);
}

//SpyFanatic: there seems to be some async in pushmission as the below code is only run on activeplayer. The other player(s) will run the below code only 1 turn later.
//So to remove an annoying oos let's just put it inside an else statement
else
//if(pBestUnit->atPlot(pEquipment->plot()))
{

I do not understand why the commented if is generating the OOS, I assume maybe pushMission is executing asynchronously among different PC? Replacing it with an else should delay the pickup of the equipment by the AI of 1 turn (at least this is what I saw during test sessions).

After this last modification, run around 20 sessions with 10-12 AIs battling for 400 - 600 turns without any OOS. Maybe there could be some more will see by further testing with Human players.
 
Another set of modifications are related to functional changes:

- [GUILD] Added option to look at the big picture at guild selection (but disabled possibility to acquire new guild/traits with culture)
- [AI] Allowed Illians AI to create Frozen
- [GAMEOPTION] Added gameoption to disable World Wonder and World Units
- [AI] forced AI to build Raise of a Legend
- [AI] trying to improve tech research (expecially on tech that gives +2 warrior strenght) by:
- reduce minimum amount of money that is forced to keep (from original 500 to 50 if 1 city, 100 if 2 city, 150 if more). Otherwise this caused AI to always research 50%
- forced to build sage district in capital
- forced to build district in city when turn for production is reasonable based on city specialization (gold = merchant, research = sage, production = noble)
- forced to research a tech that either gives +2 to unit or unblock a new unit tier if cost is less than 30 + number of civ with greater power + number of barbarian villages AI is trying to destroy
- Merged Kozar Master of Mana updates 1.4 from https://forums.civfanatics.com/threads/master-of-mana-updates.671192/
- Fixed CTD when casting spell from a selection group but not enough mana available for all spells.
- Fixed a systematic OOS when launching a spell
- Added a small stacktrace to FAssertDlg for who does not have a debugger like me ;-)

AND:
- Scaled down initial Trait Acquisition cost
- Scaled equipment cost based on gamespeed also for MANA/FAITH/GOLD

Now, open question to active users of this forum and especially Sephi: how do you want me to share the outcome of such work? Should I create a separate thread and upload it there? Should I create 2 separate releases?
Waiting to hear your opinions!
 
Last edited:
Personally, I'd prefer to have one latest release, so if Sephi condones the changes I think he should put the link in the first post of this thread (or some other official, pinned thread). When I first came across this mod a few months back I was rather confused about which was the most recent, most official version. I understand that various people have worked on various modmods and taken the concept in different directions, but it was rather confusing to wander into it with fresh eyes.
 
Now, open question to active users of this forum and especially Sephi: how do you want me to share the outcome of such work? Should I create a separate thread and upload it there? Should I create 2 separate releases?
Waiting to hear your opinions!
Thank you for sharing your work. Please open a new thread and upload it there. Confusion will be minimized if you mention the version number of sephi's tweak that you based on.

I have a question.
- forced to build sage district in capital
Can AI build only Sage district in the capital? Cannot build Noble or Merchant district?
 
Thank you for sharing your work. Please open a new thread and upload it there. Confusion will be minimized if you mention the version number of sephi's tweak that you based on.

I have a question.

Can AI build only Sage district in the capital? Cannot build Noble or Merchant district?
Maybe changelog was not so quite self descriptive... it is not that it cannot... I simply tried to find a way to increase research and this was the easiest and simple way to do it. I do not have such programming skills or time to improve the algorithm on the whole, but with some logging enabled during different play I notice that AI general does not build a lot of district and keep research rate to 50% as it is coded to keep always 500 gold on stash. So the general idea was to keep to somehow force the AI to build district based on city specialization, but to force Sage District in Capital so to maximize reasearch. The original code allows AI to build whatever district, but it seems that it does not prioritize it.
I do understand that it is not the most ideal of flexible algorithm :D but now in our lan games AI is not anymore far behind us and researching military technologies and overall we perceive it more fun and challanging.
 
I do not understand why the commented if is generating the OOS, I assume maybe pushMission is executing asynchronously among different PC? Replacing it with an else should delay the pickup of the equipment by the AI of 1 turn (at least this is what I saw during test sessions).
oh, nice catch. Either pushMission triggers a command which are executed asynchronously or there is a bug in it and it uses an activeplayer check. civ4 uses c++ but is coded more like basic, making the simple easy but the complex very unintuitive.

Feel free to make a new thread. I can add a link to the first post of this thread as well. I can also give you access to the sourceforge MoM repo if you need a place to upload.
 
One thought about Gaping Wound. As I can see in different thread more than one poster noticed that it actually never get removed (and soooo much annoying while fighting with Lanun, as all your troops will be doomed) - even if Civilopedia says so.
This is due to the fact that that in CvUnit doTurn the steps are actually: 1) heal, 2) perform the effect of the promotion - in this case take damage, 3) check if promotion are removed once fully healed.
Is there a reason why it never got fixed, I mean maybe the intention is to have it stick forever on the unit (and so maybe civilopedia text should be corrected)?
Otherwise, I think a possible workaround could be to add an additional check in effectBleeding (that is the damage effect of the gaping wound) to never apply damage to a fully healed unit, as anyhow the promotion is received upon damage it should be triggered at least the first turn - but beware I did not test yet:

Code:
def effectBleeding(caster):
    if caster.getDamage() > 0:
    caster.doDamageNoCaster(10, 100, gc.getInfoTypeForString('DAMAGE_PHYSICAL'), false)

Any ideas or opinion about that?
Should gaping wound stays or shall we remove it?

Thanks!
 
Top Bottom