[MOD] MagisterModmod

Hullo, I recently upgraded to "mod-mod" after years of thinking they all betrayed the one-one relation between civilizations and precepts; I am thrilled to see this one holding true to the fantasy I fell in love with more tenaciously than the original. :P

Anyways, I just played through "Gift of Kylorin". But when I started, I found that I couldn't find out how to proceed. I had to go into world-builder (which makes me feel all yucky inside) and give Dain "perfect sight" so he could see all the relics. So, was that just me incompetently missing something I should have noticed?
Now, I seem to recall reading something saying that treasure chests now had a more complete invisibility than in base FFH2, but I can't find it in this thread. Perhaps it was in MNAI, which I upgraded to just before upgrading to this mod-mod? And maybe it was a relatively recent update, which would explain why no one has commented on it before? Or it was just me incompetently missing something I should have noticed... :P
 
@A Moon:
I just reduced the base strength of Crossbowmen to 7/9, and granted them the ability to attack at range (but with less damage and a lower damage cap than Longbowmen have). Does that sound good?

@Jecado:
I actually discovered that bug in "The Gift of Kylorin" myself only about 12 hours ago, and then immediately fixed it by adding a few lines of code to run at the start of that scenario and remove he Invisibility promotion from all the treasure chests.

It is probably due to a change Tholal made to MNAI which carried over to my modmod. Whether you installed MNAI first would not matter, as my modmod contains all MNAI files. MNAI issues almost all apply to my modmod too, although I do make some changes to the python files and often include fixes that Tholal will then borrow for the next release. (The most obvious case of Magister Modmod being more up to date than MNAI is in the world builder code, as I'm the one merging Platyping's modcomp with MNAI for Tholal. He was using an outdated version when he first released MNAI v2.5, and I've provided several updates since.)


I've often come across Scenario-related bugs before anyone else posted about them. I'd guess that most players stick to random maps most of the time.

There were a couple of other bugs I recently found and corrected which I'm not sure how no one ever managed to notice.


I'll probably be releasing a new version within the next few days.

Edit: I just realized that the treasure chests being invisible was probably my fault. There were lines under def onUnitCreated(self, pUnit): within an elif gc.getGame().isOption(GameOptionTypes.GAMEOPTION_WB_GIFT_OF_KYLORIN): conditional which removed the lines. I had added another elif gc.getGame().isOption(GameOptionTypes.GAMEOPTION_WB_GIFT_OF_KYLORIN): conditional conditional to set the archmage as the avatar of the leader. This elif stament ran sooner and had the same conditions, so the elif statement that removed invisibility never actually run. I just now consolidated these conditionals and removed other unnecessary code.
 
Sadly I have little-to-no knowledge of game-balance, but anything that helps issue of cities being surrounded by an impenetrable wall of crossbow-bolts is welcome.
 
@A Moon:
I just reduced the base strength of Crossbowmen to 7/9, and granted them the ability to attack at range (but with less damage and a lower damage cap than Longbowmen have). Does that sound good?

The Crossbowmen are too strong, but if you make this change, why would anyone build them as opposed to Longbowmen?

I haven't seen more than a couple games where the AI had Crossbowmen. I've only seen one (I think) where the AI built Marksmen. Maybe the Ljolsalfar get something out of it, I dunno.

Just saying it's kind of a catch-22. I think Machinery is the tech for Crossbowmen. What does that do directly? 1 hammer to windmills or something?

Not sure anyone will ever bother going up that path. Well human players that is. I'm continually mystified by what the AI researches, and why it thinks a stack with 20 scouts is a good idea.
 
As currently stands in the unreleased version, Crossbowmen still have one more base strength than Longbowmen, they can get weapons promotions while Longbowmen cannot, and they cost less than half as much. In the time it takes to train 5 Longbowmen, you could instead train 12 Crossbowmen. (Longbowmen can still deal more damage at range and get Drill promotions for free, so they can get Blitz faster.)

Machinery grants +1 :hammers: and +1 :commerce: to Windmills, but that is perhaps its least important advantage.

Machinery also grants a free Great Engineer to the first player to research it. It allows Great Engineers to build Railroads, linking your cities much faster than ordinary roads can. It allows the Golem Slaying promotion. It is a prereq for a random event that can give you a free Clockwork Golem. It allows your workers and great engineers to upgrade Castles to Citadels without having to wait for them to upgrade naturally.

(I'm wondering whether I should keep or change the workings of that last one though. Sometimes the time it takes for workers/engineers to upgrade such an improvement is slower than its natural upgrade, so the units' effort is wasted. I don't think I've ever seen the AI use the ability. Python is currently used to prevent the "Upgrade Fort to Castle" and "Upgrade Castle to Citadel" build orders from being used where the prerequisite improvement is not already present, and I suspect that this is not very efficient.

If I remove those lines of python, then you would be able to build Castles and Citadels directly but would not be able to build them on tiles currently containing Forts or Citadels.

I'm thinking I may change it so that workers can only build Forts, but Great Engineers can also build Castles or Citadels if they have the prerequisite technologies.)
 
A new version has been released.

You may download the Installer here or the Archive here.

This version will certainly break saved games.

Reviewing how the werewolf code in the Splintered Court scenario works, I realized that there is a much better alternative to how I had been handling Sluaghs and Resurrections. Instead of having a different version of a Sluagh for each unit class, I instead have only a single type of Sluagh and use the unit's Scenario Counter to save the unit type of the deceased units. This means that any unit that dies can be brought back as the exact same type of unit. Adventurers are resurrected in whatever form they died. There are now a variety of unit types that can be randomly chosen when Resurrection is cast on a Graveyard.


I have updated to the latest version of Platy's World Builder, and added a few more improvements of my own to it.

Various minor bugs (mostly in scenarios) have been fixed, and several bit of code have been rewritten to run more efficiently.
 
I just found an issue that should be corrected.

I had changed the XML defines of the Skeleton unit to let it upgrade to a Spectre and of the Spectre to let ti upgrade to a Wraith. I believe that when I did so I was thinking that, since the units cannot be built anyway due to a cost of -1, this would have no effect except to make the 'pedia show the upgrade path, thus reminding players that the Barbarians do indeed have the ability to upgrade these units once they reach a high enough level.

In my first real game after the last release (as opposed to quick runs to test specific changes), I noticed that the barbarian state had a lot of Wraiths. BBAI revealed that these were upgraded from Skeletons.

I assumed at first that perhaps the barbarian state can ignore those costs, and that I could eliminate the special upgrade spells (and thus make the game run more efficiently) if I simply gave Spectres and Wraiths the minimum level requirements that those spells had.

That did not work either though. I found that it allowed me to upgrade my own Skeletons to Wraiths, regardless of level.

I have since removed these lines from CIV4UnitInfos.xml, and suggest you do the same.
Code:
				<UnitClassUpgrade>
					<UnitClassUpgradeType>UNITCLASS_WRAITH</UnitClassUpgradeType>
					<bUnitClassUpgrade>1</bUnitClassUpgrade>
				</UnitClassUpgrade>
				
				---
				
				<UnitClassUpgrade>
					<UnitClassUpgradeType>UNITCLASS_SPECTRE</UnitClassUpgradeType>
					<bUnitClassUpgrade>1</bUnitClassUpgrade>
				</UnitClassUpgrade>

This issue alone is not enough to make me want to release a new version immediately, but I may do so if someone soon finds more issues that need fixing.

Edit: I just realized that the reason my changes were having no effect is because I was accidentally editing the file in Magister Modmod for FfH2 August 8 2013 Changes rather than the Magister Modmod for FfH2 directory in which the mod is installed.

You should still just delete those lines though.

Edit2:
I also just found a python bug in line 3630 of CvEventManager.py, where iUnitCombat is not defined. I think I accidentally changed unit.getUnitCombatType() to iUnitCombat here when I was purposefully replacing such expressions higher up in the document under def onUnitCreated, where it was previously and inefficiently called many times.
 
Let me ask a question: how can we get a properly challenging game? I always play in deity level, and AI can never do well in economy nor war.
 
I don't seem to have gotten any actual feedback on the recent changes. How are people liking them? Do you have any suggestions to make, or bugs that need fixing.


I myself have come across a few more python bugs that I introduced while trying to make things run more efficiently. They have been fixed, but there still might be some I missed.


Since the release, I changed the way that werewolves work somewhat. Instead of having the XML generate a new Ravenous Werewolf, I instead handle it in python. No longer will it generate werewolves from units that were captured instead of killed. It will not generate such beasts from either animals or beasts either. The odds of generating a werewolf now equal the difference between the attacker and defender's respective levels, plus those odds that Duin and the three types of werewolves had already. The ravenous werewolf generated gets the name, promotions, level, experience, etc, of the vanquished unit, and said unit does not generate a Sluagh until the werewolf is killed. I did not really want a archmage hero turned werewolf to use his magic, so I made the werewolf promotion block casting.

I made it so that the Pool of Tears can cure Lycanthropy, restoring the werewolf to the unit it was before it got infected. (The Baron Duin Halfmorn himself is unaffected.) I'm still trying to think of a way to make units healed of lycanthropy be returned to their previous owners when this happens.

I'm also considering making the Spirit III have a chance to cure lycanthopy (possibly instead of the Pool of Tears, or possibly in addition to it), and making the former werewolfs belong to the player that cured them.



I never really understood why Kael made Gibbon Goetia an archmage hero. There is nothing in his backstory that points towards him having any arcane talent. His abilities are clear those of a shapeshifter.

Now that I use the scenario counter to store a Sluagh's alternate unit type, I discovered that it is fairly simply to make Gibbon actually act as a shapeshifter. I have given him (and technically any unit with the new Changeling promotion) the ability to turn into whatever unit it kills. (It copies the unit type, promotions, and artstyle, but keeps Gibbon's own promotions, experience, level, and religion.) His Assume True Form ability lets him turn back into his original unit type, in case that is stronger than whatever he duplicated.

I blocked it from duplicating those units that can abandon you for having the wrong religion or civic, and made the promotion's per turn effect kill Gibbon if you leave the Council of Esus. I also blocked him from duplicating heroes, although now that I think of it I may change that. I was thinking that Gibbon becoming a hero could stop the proper player from training that hero, but obviously they would have had to already trained him before Gibbon could have killed him. Gibbon still could prevent a player from building the Shrine to the Champion, but it seems reasonable that people would not build a shrine to someone they think betrayed them instead of dying. I suppose it could be alright to have Gibbon masquerading as a national hero, maybe even a dragon.

(Edit: I just noticed that Gibbon gets duplicated when he is a baby spider that upgrades to a baby spider, which seems odd as things seemed fine as werewolf. Maybe I should block him from becoming any animal though.

I have thought of a way to make Impersonate Leader switch you back and forth between civs like the Control Whole Team option allows, but I don't see how the two mechanics could be compatible with each other. The impersonate leader code would be more awkward and less commonly used, so I don't know if I want to include it.


Whats the requirements to get Mary Morbus? Is there a way to build her instead of a random event?

The Event requires only that you have an Alchemy Lab in some city.

In early versions of my modmod I made her buildable, but recently she can only appear through the event. (In those versions it was possible to for the event to create a second Mary, as it did not have a callback to prevent that like the Great Beast events do.)

Let me ask a question: how can we get a properly challenging game? I always play in deity level, and AI can never do well in economy nor war.
I'm no expert on the AI. Those issues are really more up to Tholal.

Sometimes I wonder if the AI is actually better at lower difficulties (like Prince or Monarch, not Chieftain), because the advantages it is given on higher levels can encourage it to build more units than it can really afford.
 
I really like the idea of the Pool of Tears curing lycanthropy. Anything that resembles a "quest" (versus just casting a spell) is a definite plus.

Changeling sounds intriguing, and brings up several questions. Is it implemented as a chance to change form, or does the change take place each time an enemy is killed? Also, is the player allowed to reject the promotion if the current form is preferred (e.g. instead of the True Form or the new form)? Does the shape change have the ability to occur on defense? Would Gibbon be the only shape changer; does this promotion align with other unit types (maybe druid)?

I agree that masquerading as a National/Religious hero sounds like a good use of the promotion. I'm not sure about dragon, though, or other large beasts. Unless, perhaps a unit level restriction is in place, such as that dragon form can only be copied at level 10+.
 
The problem with the Pool of Tears curing Lycanthropy is that it does not make sense for a former werewolf to continue to serve those who infected him with lycantrhopy once he is free of that curse. It would make most sense for him to try to return to his former civ, but I don't know of a way I could store that information. (I could use the scenario counter, if I weren't using that the store the unit type.) I guess I could make national heroes and UUs that are available to only one civ go to that civ, but even that can be problematic when there are multiple copies of one civ.

If I make it an effect of Assuage, it could at least be explained that a former werewolf would be grateful to those who freed him.


If I do go with a unique feature curing Lycanthropy, it is possible that the Mirror of Heaven might be a better choice. The Lore seems to imply that Lycanthropy in Erebus is governed by The Sun rather than The Moon. Rays of direct sunlight carry the power of Lugus, reminding the victims of this affliction of who they really are and allowing them to resist the beast within. Sunlight causes unrepentant vampires to panic from guilt and suffer the pain they have inflicted on others, but the same sunlight soothes werewolves and reminds them that they do not bare the guilt of crimes that their bodies committed while they lacked the agency to do otherwise.

The Pool of Tears may seem more intuitive to players though, as it is what cures other diseases, plagues, poisons, mental illnesses, etc.
--------

It would not be a good idea to let a changeling masquerade as a religious hero, as all of the religious heroes abandon their owner if they do not have the right state religion. The Changeling would simply die within one turn. Some other modmods have the capacity to let a promotion prevent such abandonment, but I am pretty sure that MNAI's DLL does not. There is no such problem with any national heroes, but I may need to add a check in effectDefectSelf to prevent a changeling from abandoning you to become another leader' avatar.

As is currently implemented, the promotion makes the unit change form whenever it wins in combat. I don't think the code in onCombatResult can distinguish between the attacker and defender, only the winner and loser, so it does occur on the defense the same as on offense. (I so realize it make the Gibbon a whole lot weaker if the enemy can throw away a goblin against it before beginning an attack in earnest.)


The easiest way to let a changeling retain its current form if desired would be to simplify the mechanic and only allow shape shifting to happen when Gibbon is in his true form. The changeling promotion would be completely unnecessary then, as I could just use Gibbon's PythonPostCombatWon callback. (This is actually the way I first tested the code.)

I could also choose to make the scenario counter store the previous form and let the unit return to that, but then I'd pretty much have to hardcode any unit with the Changeling promotion to be treated as Gibbon.

One way to give you the choice of when to shape shift after combat would be to make there be a dummy promotion that only grants the ability to add or remove the promotion that causes the actual effect. This is similar to how Marksman and Targeting Weakest work in my modmod.

I could also choose to change the mechanic completely, making it depend on a spell rather than combat. It would be relatively simple to make a Shape Shift spell that causes the changeling to assume the form of the strongest unit in an adjacent tile (whether based on base strength, base defensive strength, level, xp, tier, or some combination of those). That could easily be made to ignore dragons, magic immune units, units ta abandon you for the wrong civic/religion, etc.

I could also set up the onCombatResult code to only shape shift if the defeated unit is considered "better" based on some criteria.


As it currently works, there is no reason why I could not allow other units to use the promotion too, although Assume True Form would not work unless we set them as having a scenario counter. (It would be easy enough to set that whenever a unit purchases the promotion with xp, when the promotion is gained through a spell, or when a unit is initialized already having that promotion. I already made all world units, except for illusions and dark reflections, have their unit types set as their scenario counters when they are initialized. )

Before I started writing this post, the per turn effect would only make the unit abandon you if its true form was Gibbon and you had left the Council of Esus state religion. I have however since changed that code to make it abandon you if its true form is a bAbandon unit and you do not have its religion or civic prereqs anymore. This more versatile code seems to be working just fine.

Still, it does not make much sense for a Changeling to serve any god but Esus, or thus any religion but the Council of Esus.

I'm thinking it would make sense for Revelation, the Empyrean Priest spell, to force a Changeling to Assume its True Form.


I'm not sure why, but tonight when I tested it Gibbon seemed to be generating a Slaugh whenever he changed form. (It did not seem to be acting that way before I removed the lines preventing it from working on world units.) I tried multiple things that should stop this, but it has not been working yet. I'm going to have to work this out before releasing a version with this feature. I'll also have to figure out why he gets duplicated when he upgrades from a baby spider to a great spider, although that could be easily avoided if I just did not let him become an animal/beast.

The thought came to mind while I was making this post that a Gibbon who masqueraded as an Adventurer and then died would be able to be resurrected by the Grigori. His scenario counter would make him return as Gibbon though, and he would promptly abandon the new owner. I'll have to work around this too. (The easiest way is probably just by making def reqResurrectAdventurer(pCaster) and def spellResurrectAdventurer(pCaster) treat PROMOTION_CHANGELING the same way they treat PROMOTION_NETHERBIND etc.)

Edit: It now appears that the way I originally stopped the Sluagh's from being granted, by adding and then removing the Illusion promotion, is now working just fine again. I do not know why it wasn't for a while.
Edit2: Ok, it seems like the problem still occurs when the defeated unit starts with a race, like Orc. I think I'll look into this tomorrow, after I get some sleep.
Edit3: I just tried making both the Changeling and the copy of the unit it defeated (to which the changeling will soon convert) temporarily have the Illusion promotion. This seems to work fine, although I'm not sure why.
 
I haven't installed the new version yet because I have a few more things to do with my saves before breaking them. Once I do install it and play some games, I'll be sure to post feedback. :)
 
I just got around to installing the new version, since it broke save games. Starting up a Large map as Amurites. Looking forward to trying out the Lycanthropy and Crossbowmen changes. It will be nice to have cities not be impregnable late game.

One thing I noticed is that there is a significant increase in the time for the AI turns. I don't know if its the new patch or some of the edits I made on your advice from this thread. I used to add in the code that allowed demons to go anywhere/disabled ring of warding which I didn't put in this time. I also used to run (challenge) AI no building requirements but disabled that for my current map. Don't think I changed anything else between last patch and this one. Would any of the aforementioned causes be the culprit, or would something else in the new patch cause the marked increase in turn times?

Also, the world builder is much better than before.
 
The game is lagging more in the late rounds. No idea why. I have also had a couple of lock-ups that I had use task manager for.
 
I was pretty sure that many of the changes I made lately should have made the game faster rather than slower.

There are some python bugs I have uncovered. Maybe running into those slows the game down?


I think I'm going to go with Shape Shift being a spell rather than a have it trigger through combat. It seems to be working fine that way right now, but I want to test a few more things to make sure that shape shifting into a hero does not permanently prevent that hero from being resurrected.
 
I wish I could tell you more. Your mod was was probably the smoothest running, fastest one I've played a lot till about four months or something ago. I'm not sure of the exact mod where I saw the slowdowns start.

Then too I play the Erebus map on purpose. You tend to get larger empires than the other maps I've seen. I've looked at some of the other maps, and everyone seems to start close together and also don't have a lot of expansion room.

It's pretty normal for me to see 20+ city civs by round 400, sometimes in the 300's. I can only imagine how many cities the Khazad and Ljolsalfar could have if I finished games. Usually I win by Tower, or say Ok, I'll win if I keep on playing. The rounds get too long to finish.

I don't know how typical my experiences are. I keep seeing that you are supposed to build warriors and win the game with that and Aristocracy. In my games you can throw tons of warriors at something and not do anything unless you have siege or mages with you.

Of course from what I gather you are supposed to win by round 200 or something. But if the civs have time to tech up, that approach isn't going to work.

So I don't know how typical my experience is.
 
Yes, I've noticed the slowdown also, especially since the May release. Last week's release has improved somewhat, but AI turns are still noticeably slower.
 
I've noticed the slowdown too. One game became unplayable by around halfway through (which no FFH game has been for me for years).

Another thing is that Blight doesn't seem to be applying damage or unhealthiness.
 
If you are talking about slowdowns since May, as opposed to something tat got worse in the latest release, then the problem is probably just that I had to use def unitCannotMoveInto(self,argsList): for some mechanics.


There are a couple of bugs that I accidentally introduced to the Blight code when I was trying to make it run more efficiently. I fixed those in my end right after the last release.


I'm going to release another update soon, but I want to double check a few more thing first. (There are some complications based on my attempt to let Auric's disciples upgrade normally rather than through spells. I think I may have to go back to the old method.)

I'm also thinking of looking into using the SdToolKitCustom.py to store unit data instead of Sluaghs, as I think I may be able to include extra data like the unit's former owners. I'm really not an expert on this though, so I think I'll probably release a more modest update focused on bug fixes first.
 
Back
Top Bottom