Tweak Mod for Xtended + Master of Mana Updates

1. Where is Orthus? I remember it used to spawn, but w
  1. Where is Orthus? I remember it used to spawn, but we just started to realize its a lot of games it does not appears... Maybe also before v.02...
I think it depends of the map script.
Acheron the dragon spawn in MoM_Wilderebus but not in MoM_Erebus mapscript.
For Orthus, He may spawn but not in the mapscript I usually play with.
 
The DevSource folder has an Orthus block commented out in CvBarbarian.cpp. The Source folder doesn't have it commented. Unsure which is the release/build branch for the mod at the moment.

Code:
void CvPlayer::init_BarbPlayer()
{  
    ///** disable for now
    //int Index;
    //UnitTypes eUnit;


    switch(getID()) {
        case BARBARIAN_PLAYER:
            GC.getGameINLINE().createBarbarianCities();
            //Time to Create Orthus
            //eUnit = (UnitTypes)GC.getInfoTypeForString("UNIT_ORTHUS");
            //if(eUnit != NO_UNIT && getNumCities() > 0) {
            //    FAssert(getNumCities() > 0);
            //    CvCity* pCity = firstCity(&Index);
            //    initUnit(eUnit, pCity->getX(), pCity->getY());
            //}          
            break;
        default:
            break;
    }
    //**/

    createInitialLairs();
}

There is an event that mentions Orthus. I have chosen it but it never seems to do anything. Unsure if it is percent or some other trigger. Usually happens on a skeleton barrow near my borders every 50 turns or so.

Code:
    <TEXT>
        <Tag>TXT_KEY_DUNGEONEVENT_TAUNT</Tag>
        <English>Orthus, you smash like a little girl. Your father was the size of a dwarf and your mother had the beauty of an elf. [TAUNT ORTHUS]</English>
 
Last edited:
I think the difference game type and resource spawn can be due to the type of game. When first we had a game with the modified dll, we got barely 3-4 resources each in 250 turns. But then, on last game, we started to use cottages and trade post and yeah, we ended up on turn 250 with a lot of spawned resources. Please also note that in the kind of game of used to play we focus more on battles as we have roughly 3 hours to play... So we do not improve the land a lot after the initial 3 cities... additionally it is probably tricky for me to reproduce with AIs as they are not using improvements as human does.
I will check on Sephi implementation and I am considering maybe to add a game option for that... I do want to keep you satisfied with the resource spawning... But I am also selfish and I want to improve also our gaming experience :lol:!
Will check and let you know...
I understand MP game experience can be very different from Single Player games. I would appreciate a lot if you add that game option. :thanx:

On the GE you reported, can you maybe provide a savegame? I have noticed that in CvPlayer RemoveGlobalEnchantment the "Your use of magic influences our relation!" is not explicitly removed, but I am wondering if maybe those has a 'remove after xx turns' or something like that...
Attached a savefile. Pedia says 'The effect lasts until the GE is cancelled'. It never disappears till the end of the game.

  • Where is Orthus? I remember it used to spawn, but we just started to realize its a lot of games it does not appears... Maybe also before v.02...
  • We noticed a decrease of Lair demanding tribute... Did someone notice the same? Or maybe can it be due to the type of map, as we have now switched to MoM_Lakes_Climate (before we were used to play MoM_Erebus)?
You are right. Orthus and barbarian intimidation has gone since some version though I did not realize the change before you asked. 'Barbarian threat' is fun from early to mid phase of the games. I usually play with MoM_Lakes or MoM_Lakes_Climate.
By the way, MoM_Lakes_Climate mapsrcipt spawns Balseraphs' starting settler on Plain terrain, on which we cannot build Cottages-their favorate improvement.

And a suggestion : Improvements other than Lumbermills and Camps cannot be built on AFs until the tech Engineering now.(I remember that this feature was implemented into sephi's tweak version sometime ago) So if a civ adopt FoL or capture AF territory, they have hard times utilizing resources for a long time unless they are elves. How about enabling chopping of AF without Engineering just like before? If necessary(and possible), no lumber from chopping in that case.
 

Attachments

  • stone AD-0225.CivBeyondSwordSave
    440.4 KB · Views: 3
Last edited:
Hello ! Gibbon Goetia is guilty !
in my new game, Laggs (AI) build him and next turn --> stall on end of turn.:cry:
 
Had a new failure mode where the game stalled going to "Next Turn". What was odd is the save game file was just going up-and-up in size the longer I waited. I opened the file in a binary editor and kept seeing the same sequence repeated but have no idea how to parse the formatting. Upon reloading and playing again it did not stall a second time. I have a copy of the save game if that is helpful.

1708707050420.png
 
Had a new failure mode where the game stalled going to "Next Turn". What was odd is the save game file was just going up-and-up in size the longer I waited. I opened the file in a binary editor and kept seeing the same sequence repeated but have no idea how to parse the formatting. Upon reloading and playing again it did not stall a second time. I have a copy of the save game if that is helpful.

View attachment 685173
Strange... Happen once time due to a bug (introduced by me 😅) i think that savegame for turn 348 will be unusable as is probably corrupt... Do you play with random seed on reload? If no you can pass me the turn 344. Or better reproduce what to did up to turn 347, save and then see if passing turn you get same bug
 
I think Dungeon demand disappearance is from 0.2 and due to this
Which basically remove all dungeon if they are not graveyard, dungeon or barrow.
Maybe a better implementation that I will add is this:

C++:
CvPlot* pPlot = plot();
if(pPlot == NULL
   || pPlot->getImprovementType() == NO_IMPROVEMENT
        || GC.getImprovementInfo(pPlot->getImprovementType()).getSpawnUnitCiv() == NO_CIVILIZATION
        || (pPlot->getPlotCity() != NULL && pPlot->getPlotCity()->getOwnerINLINE() < BARBARIAN_PLAYER)
  )
{
    kill(); // Destroy the object which is probably a leftover and can cause CTD
    return;
}
 
And Orthus not spawning fixed... Due to AIAutoplay overriding events that in vanilla are only meant for spawning popup to the player but that in master of mana have been used for other stuff... Will have a better look if other functionalities has been impacted
 
Units that are garrisoned are sleeping (not in que that goes to next unit with space) when they have a promotion they could get.
Is there a world spell that makes you not produce anything for certain amount of turns (similar to anarchy) or is it a bug ?
 

Attachments

  • steamuser AD-0282.CivBeyondSwordSave
    1.5 MB · Views: 4
Units that are garrisoned are sleeping (not in que that goes to next unit with space) when they have a promotion they could get.
Is there a world spell that makes you not produce anything for certain amount of turns (similar to anarchy) or is it a bug ?
The Stasis Worldspell from the Illians stops all production for several turns (length depends on gamespeed)
 
I think the difference game type and resource spawn can be due to the type of game. When first we had a game with the modified dll, we got barely 3-4 resources each in 250 turns. But then, on last game, we started to use cottages and trade post and yeah, we ended up on turn 250 with a lot of spawned resources. Please also note that in the kind of game of used to play we focus more on battles as we have roughly 3 hours to play... So we do not improve the land a lot after the initial 3 cities... additionally it is probably tricky for me to reproduce with AIs as they are not using improvements as human does.
I will check on Sephi implementation and I am considering maybe to add a game option for that... I do want to keep you satisfied with the resource spawning... But I am also selfish and I want to improve also our gaming experience :lol:!
Will check and let you know...
Did you fix the resource spawnchance bug related to merchant districts (where they reduce the chance instead of increasing it)? Fixing that bug and using the original values for iAdjacentFindResourceModify (1/2/3) might do the trick. The issue with high values of iAdjacentFindResourceModify is that some leaders can really spam cottages and then they will end up with lots of resources. An alternative to increasing iAdjacentFindResourceModify might be to give a few great merchant points to merchant district buildings, then you spawn a few more great merchants and can get more resources that way.
 
Found out the Grigori have a spell to "Discover a Dungeon". It was pretty deep on the merchant guilds. Just letting folks know if they are searching.

Also, is there any easy way to debug the "failed to compress game data" error? I assume it is due to failed serialization of an asset based on a few minutes of searching. So there may be an error statement or logging that can simply spit out what it was working on at the time.

It seems to come and go in my games but have no way of brute force finding I cannot restart and see when the error goes away.
 
Debugging a game where turns were taking 15+ seconds. It seems to be related to a single barbarian city Uga just north of my cities. It was built on Patrian artifacts, right next to the Remants of Patria and links my area to the rest of the map. Unsure if is related to any of these or something else with the city.

Attached is the save game file:
  1. If you proceed to the next turn it will take the 15+ seconds to progress.
  2. If you take the city Uga it will lock the game for about 30 seconds. Then turns progress normally.
  3. If you remove Uga with the worldbuilder it will lock the game for 30 seconds. Then turns progress normally.
 

Attachments

  • Speedy AD-0072 - barbarian city stall.CivBeyondSwordSave
    283.1 KB · Views: 2
Did you fix the resource spawnchance bug related to merchant districts (where they reduce the chance instead of increasing it)? Fixing that bug and using the original values for iAdjacentFindResourceModify (1/2/3) might do the trick. The issue with high values of iAdjacentFindResourceModify is that some leaders can really spam cottages and then they will end up with lots of resources. An alternative to increasing iAdjacentFindResourceModify might be to give a few great merchant points to merchant district buildings, then you spawn a few more great merchants and can get more resources that way.
Should I pick the '1.09' spawning algorithm from Dev Source folder (this file: https://sourceforge.net/p/masterofmana/code/HEAD/tree/Dev Source/CvPlot.cpp) or from Source folder (https://sourceforge.net/p/masterofmana/code/HEAD/tree/Source/CvPlot.cpp#l786)
My understanding is that Source folder is the original Extended algorithm while Dev Source is 1.09... And the bug related to merchant district is only on Source folder....
 
Should I pick the '1.09' spawning algorithm from Dev Source folder (this file: https://sourceforge.net/p/masterofmana/code/HEAD/tree/Dev Source/CvPlot.cpp) or from Source folder (https://sourceforge.net/p/masterofmana/code/HEAD/tree/Source/CvPlot.cpp#l786)
My understanding is that Source folder is the original Extended algorithm while Dev Source is 1.09... And the bug related to merchant district is only on Source folder....
Oh I see, I looked at the old formula. Well here are some ideas:
For water
- currently each resource increases the chance to find another resource in a neighbour tile by 100%. That seems way too much and creates a huge snowball effect. Maybe instead of doubling basechance it should just increase the modifier by 10 points.
For land
the modifier is added rather than multiplied. So corn for example has a basechance of 3 to spawn on a farm and an adjacent enclave will increase that basechance to 24 which is a 700% increase from just a single improvement. Maybe change it so that only the highest adjacency bonus counts? So three adjacent towns give the same bonus as one adjacent town.
 
Debugging a game where turns were taking 15+ seconds. It seems to be related to a single barbarian city Uga just north of my cities. It was built on Patrian artifacts, right next to the Remants of Patria and links my area to the rest of the map. Unsure if is related to any of these or something else with the city.

Attached is the save game file:
  1. If you proceed to the next turn it will take the 15+ seconds to progress.
  2. If you take the city Uga it will lock the game for about 30 seconds. Then turns progress normally.
  3. If you remove Uga with the worldbuilder it will lock the game for 30 seconds. Then turns progress normally.
i think its due to the 'infinite specialist effect' which should be fixed in 0.4... I can see that the city once razed is looping 800.000 times on a while cycle trying to remove specialist...
 
Oh I see, I looked at the old formula. Well here are some ideas:
For water
- currently each resource increases the chance to find another resource in a neighbour tile by 100%. That seems way too much and creates a huge snowball effect. Maybe instead of doubling basechance it should just increase the modifier by 10 points.
For land
the modifier is added rather than multiplied. So corn for example has a basechance of 3 to spawn on a farm and an adjacent enclave will increase that basechance to 24 which is a 700% increase from just a single improvement. Maybe change it so that only the highest adjacency bonus counts? So three adjacent towns give the same bonus as one adjacent town.
Those are nice ideas! I think should help the cases for human exploiting this mechanism.
As a reference, Human size map on epic speed, MoM_Lakes_Climate I have for 400 turns the following land + water resources spawned:
- 119 resources using 1.09 code (which will be the gameoption for normal spawn) - but reducing iAdjacentFindResourceModify to 0,1,2,3
- 305 resources using 0.3
- 204 resources using 0.3 but reducing iAdjacentFindResourceModify to 0,1,2,3

I will compare the 2 algorithm to understand what else is changing the results
 
I think the main difference between the two algorithm is that in 1.09 iAdjacentFindResourceModify and Merchant district are applied only if there is the same resource in a nearby plot... That's probably why the big spawn increase with Trade Post was not really visible before. Check here.
C++:
if(bNearSameBonus)
        iBase += iModifier;

So I have added a GameOption to allow to 'Increase Resource Spawning' if it is not selected then original spawning percentage is used, I hope in this way everyone can enjoy different playstyle.
But anyhow I have changed the iAdjacentFindResourceModify for the different improvement like that thus spawning should be reduced for both options:
IMPROVEMENT_COTTAGE
IMPROVEMENT_FROZEN_COTTAGE
IMPROVEMENT_INFERNAL_COTTAGE
1
IMPROVEMENT_HAMLET2
IMPROVEMENT_VILLAGE3
IMPROVEMENT_TOWN4
IMPROVEMENT_ENCLAVE5
IMPROVEMENT_TRADE11
IMPROVEMENT_TRADE22
IMPROVEMENT_TRADE33
IMPROVEMENT_CARAVAN_CENTER
IMPROVEMENT_CARAVANSARY
4

Beta DLL is here, maybe you can test it with 0.3 code before releasing 0.4 (there are still some fixing on the way for that)?
 
Top Bottom