[MOD] MagisterModmod

you'd have to find a way that the "boss" is not held on a tile NEXT to the lair, instead of the lair.

That part is easy. A long time ago I changed things so that the barbarian units spawned from exploring lairs are placed on the improvement's tile, and the caster is ejected to an adjacent plot.

I realized recently that it seems I forgot to delete the code that added the unit the old way though, which probably means that there have been twice as many "bosses" created as there should be. Instead of a pair of Ogres, there should just be one.

I have to agree on this something has changed, midgame turn time is > 10 seconds not good

This is almost certainly due to def unitCannotMoveInto(self,argsList): being used.

You can disable this by editing PythonCallbackDefines.xml to change this 1 to 0.
Code:
	<Define>
		<DefineName>USE_UNIT_CANNOT_MOVE_INTO_CALLBACK</DefineName>
		<iDefineIntVal>[B]1[/B]</iDefineIntVal>
	</Define>

Note that this would effect gameplay:

It would allow Balors and the Seven Demon Lords to enter non-hell terrain beyond their territory.

It would allow workers and engineers to enter Peak tiles even without the Arete civic.

It would eliminate the main benefit of the Ring of Warding spell building, as it could no longer block hostile summons from entering/attacking the city.

It would allow allow bAlwaysHostile units (Dragon Fanatics) to capture cities without war. They could also enter rival cities peacefully, and then keep the city's owner's units from doing so. (Tholal is supposed to fix that for the next release, but I thought it was worth blocking in python in the meantime.)



I just rewrote the code to be somewhat more efficient. I expect this to make the game a bit faster, but I can't be sure until I test it on a larger map.
Spoiler :

Code:
	def unitCannotMoveInto(self,argsList):
		pPlot = CyMap().plot(argsList[2], argsList[3])
		if pPlot.at(0, 0):#I do not want any units entering the Sluagh's tile
			return True

		ePlayer = argsList[0]
		pPlayer = gc.getPlayer(ePlayer)

		iUnitId = argsList[1]
		pUnit = pPlayer.getUnit(iUnitId)


		if pPlot.getTeam() == pUnit.getTeam():
			#Workers and Great Engineers should only be able to enter Peaks while their owners are running Arete
			if pPlot.isPeak():
				if pUnit.getUnitCombatType() == gc.getInfoTypeForString('UNITCOMBAT_CIVILIAN'):
					if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_LABOR')) != gc.getInfoTypeForString('CIVIC_ARETE'):
						return True

		else:
			#Workers and Great Engineers should only be able to enter Peaks within their own teritory
			if pPlot.isPeak():
				if pUnit.getUnitCombatType() == gc.getInfoTypeForString('UNITCOMBAT_CIVILIAN'):
					return True

			#The compact requires that the gods' prevent their greater servants from directly harming those whose souls they don't already own
			if pUnit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_BOUND_BY_COMPACT')):#Balors and the avatar units of each Infernal leader
				if gc.getTerrainInfo(pPlot.getTerrainType()).getTerrainDown() == -1:#i.e., is not Hell terrain
					return True
				if pPlot.getImprovementType() == gc.getInfoTypeForString('IMPROVEMENT_HALLOWED_GROUND'):
					return True


			#The Ring of Warding spell-building prevents hostile summons from entering/attacking the city
			if pPlot.isEnemyCity(pUnit):#plot is a city and unit is at war with city's owner
				if not pUnit.isImmuneToMagic(): #Runewyns are immune
					if pPlot.getPlotCity().getNumBuilding(gc.getInfoTypeForString('BUILDING_RING_OF_WARDING')):
						if pUnit.getSummoner() != -1:#quickest way to find a summon
							return True
						if pUnit.getDuration() > 0 and not pUnit.isAlive():#Summons who have lost their summoners
							return True

			#This prevents bAlwaysHostile units entering rival cities peacefully and then blocking units belonging to the city's owner from entering the city.
			elif gc.getUnitInfo(pUnit.getUnitType()).isAlwaysHostile():
				if pPlot.isCity():
					return True
				#bAlwaysHostile units shouldn't be able to peacefully capture Superforts either
				if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_TACTICS):
					if pPlot.isOwned():
						if not gc.getTeam(pPlot.getTeam()).isAtWar(pUnit.getTeam()):
							iImp = pPlot.getImprovementType()
							if iImp != -1:
								if gc.getImprovementInfo(iImp).isActsAsCity():
									return True

		return False[/spoiler]
 
T
It would allow allow bAlwaysHostile units (Dragon Fanatics) to capture cities without war. They could also enter rival cities peacefully, and then keep the city's owner's units from doing so. (Tholal is supposed to fix that for the next release, but I thought it was worth blocking in python in the meantime.)

As long as you mentioned Dragon Fanatics, what exactly is this unit supposed to do? The ones in previous mods could explore rival territory and convert units and cities.

Now what are they supposed to be for? I can't really see any point in building one. Right now if you use the Kuriotates world spell you get some that pop up all over the world. Usually they die the next round, but it showed you more of the map I guess. I got one that was close enough to get home, so I had him protect an enclave.
 
due to lack of temples - cassiel usually can't build the unmarred martyrs religion wonder.

Also this game needs one minor building against of war weariness- late game WW kills more than enemies, +1 :mad: and - 20% WW is worth of testing, available building at rage tech or whatever...

do not want to play late game only with nationhood civic.
 
Hi there!
I wonder how hard would it be to split barbarian civs in three parts (barbarians, animals and demons), as it is done in RifE and other modmods. I think it is great addition that adds much depth and flavor. As it is now, Hyborem avoids barbarian cities, spectres and other demons avoid Clan and Doviello units, and animals avoid other barbarians, which is lame.
Would you be willing to introduce the split sometime in the future?

Other question. Could you balance revolts so that they are more related to actual happiness in the city? I can have my core cities unhappy for hundred turns without any rebellion, while some conquered cities revolt constantly even though they have 10+ excess happiness. I suggest that different religion and different culture add less instability, but more direct unhappiness. In fact, even distance from palace could add slight unhappiness, to further connect rebellions with happiness.
 
Splitting the barbarian factions would require an SDK change. Since I don't want to bother with compiling a custom DLL, that would require convincing Tholal to add it to MNAI.

I believe that splitting the factions was actually my idea originally, which other modders borrowed before I had a clue about out how it could be implemented. I don't recall being particularly impressed with how it turned out when I tested those mods though.


Most of the revolutions stuff would require Tholal's involvement too. I'm not an expert on the mechanic which he added, although I have adjusted some of the xml values for buildings and civics.

I believe that adding unhappiness based on distance from the capital would require SDK changes.
 
Other question. Could you balance revolts so that they are more related to actual happiness in the city? I can have my core cities unhappy for hundred turns without any rebellion, while some conquered cities revolt constantly even though they have 10+ excess happiness. I suggest that different religion and different culture add less instability, but more direct unhappiness.
Sounds like a good idea; you can control happiness much better than cultural influence, and it would come at the cost of relatively small cities.
In fact, even distance from palace could add slight unhappiness, to further connect rebellions with happiness.
Distance from palace already has a major influence on instability.
 
Yes, distance has effect on instability but not on unhappiness, which causes kinnda weird situations where small and apparently happy cities rebel... Anyway, thanks for answer, Magister. Why were you not satisfied with implementation of splitting in other modmods?
 
I believe that splitting the factions was actually my idea originally, which other modders borrowed before I had a clue about out how it could be implemented. I don't recall being particularly impressed with how it turned out when I tested those mods though.
.

I dont think that the actual splitting was done that well in Rife but the barbarian spawn groups for different types of barbarian forts that could grow and produce different types of units was pretty neat, and they helped to give the world a very wild feel to it rather than simply being dominated by uniform orcs it instead had many different groups.
 
Few more suggestions:

How hard would it be to make Aqueducts provide fresh water to cities, in addition to health bonus, as in RifE? It is nice flavor and makes aqueducts more important to cities far away from rivers, while still keeping them worthwhile for cities with access to fresh water. Then you can make some buildings (public baths, or maybe sewers) require fresh water to be built.

Second thing from RifE, there is a cool thing about republic civic - it triggers election events, where you choose between two different 'factions', basically choosing extra trait. It really makes Republic interesting choice, and provides fun and flavor.
 
Few more suggestions:

How hard would it be to make Aqueducts provide fresh water to cities, in addition to health bonus, as in RifE? It is nice flavor and makes aqueducts more important to cities far away from rivers, while still keeping them worthwhile for cities with access to fresh water. Then you can make some buildings (public baths, or maybe sewers) require fresh water to be built.

I kinda dig this.
 
Magister, what exactly is it that makes Freya's CityStyle modmod incompatible with yours? Is it simply that all the info regarding the unique buildings you've added (Lizardmen Cages, the Wyrmholds, etc.) gets overwritten when one copies the CityStyle's files into your directory, or is there something more to it?

I'd offer a small suggestion in making Eurabartres an avatar unit for Cardith Lorda, along with Auric and the Seven Demon Lords. On a similar note, I've noticed that given how Eurabartres is so monstrously powerful compared to the other dragons, Sheaim / Illian / OO players have very little incentive to complete Stir From Slumber when Cardith is present.

I recall you mentioning that the Gold Dragon was designed as a brilliant lieutenant/commander for the Godswar, as opposed to a glorified weapon like so many other dragons were. Given this, I can't help but feel that it might be conducive to both game balance and thematic concerns to lower Eurabartres' base strength but give him other abilities to compensate. May I humbly suggest giving him Channeling III and Govannon's ability to pass on spells, or perhaps bonus traits for the Kuriotates Civ as long as he's alive, similar to how Orthus passively aids the Barbarian Civilization. Would something like this fit the Creation Sphere?

I was fiddling away with some of your Python and XML files, and to my great surprise I came across TXT_KEY_PROJECT_RISE_OF_LAROTH and TXT_KEY_UNIT_LAROTH :eek:

Is this a leftover from an abandoned project, or do you have something big planned in the days ahead?
 
I've gone over the thread and haven't seen any mention of this, so I'm wondering if it's an oddity only I'm having:

Many buildings appear to have no build requirements, even when their tooltips and pedia descriptions state they should. For instance, on a newly started game in the Classical age, I can immediately build the Grand Menagerie on turn 1, despite my city having none of the captured cages it claims to require. Similarly, I can build the Shrine of the Champion, even though the description in the pedia says it can only be built after the civilization's hero is killed.

I've tested this with various options enabled and with none enabled (game options list 'no espionage' as the only enabled option, although I have no options checked; no idea if this is normal or related in any way). I've also completely deleted the mod and the base FFH mod, reinstalled them from their installers to ensure a clean install - still persists.

I believe this is also related to other oddities I've seen lately, such as non-illians using the White Hand ritual and other illian rituals - in my last game, Garrim Gyr completed the Deepening. I think I've seen non-Illians or Doviello do the White Hand, but I can't be certain. I am certain about Garrim Gyr completing the Deepening, though. Also, in two games I tried with the 'compact enforced' option, infernals were still being summoned into the game with no apparent explanation.

As an additional (probably unrelated?) note, even when playing with 'all unique features' enabled, I cannot find the Ring of Carcer anywhere, even when I've gone into worldbuilder and carefully looked over the entire map searching for it.

Edit: To confirm, while I am still not certain I have seen an AI use it thus far, I can say for certain that the White Hand ritual is available for me to build as the Kuriotates.
Edit again: In the same game I've been playing as the Kuriotates, Duke Sallos just completed the White Hand.
 
Magister,

Have something that maybe causing an infinite loop. I have had to abandon two games due to this happening. I have been saving in increments the entire game so I have these last three save files for you.

On turn 586, I end my turn and it goes into the loop. I have reloaded this game three times with the same result.

I have also got a save at the end of turn 585 and 581. Not sure if this would help you find something, but it maybe worth a shot.

I'll hang onto all the saves I have in case you need earlier ones.

Good Luck and hope this helps.
 

Attachments

Almost all of the Revolutions code is done in python.

Cool, I'll check it out. How hard would it be to implement proposed changes (linking unhappiness to revolutions a bit more, making small and happy cities harder to revolt, and maybe even adding unhappiness in every city based on total 'empire stability')
 
Ok, so I changed this
# Garrison
garIdx = 0
if( hasLiberalism ) :
garIdx = -int( 2*pow(pCity.plot().getNumDefenders(iPlayer)/2.0, .5) - .5 )
else :
if( pCity.getBuildingDefense() > 75 ) :
garIdx = -int( 8*pow(pCity.plot().getNumDefenders(iPlayer)/2.0, .6) + .5 )
elif( pCity.getBuildingDefense() > 25 ) :
garIdx = -int( 7*pow(pCity.plot().getNumDefenders(iPlayer)/2.0, .6) )
else :
garIdx = -int( 6*pow(pCity.plot().getNumDefenders(iPlayer)/2.0, .6) - .5 )

garIdx = int(math.floor( self.garrisonModifier*garIdx + .5 ))

if( natIdx > 0 ) :
garIdx = max([garIdx,-10])
else :
garIdx = max([garIdx,-15])
Ok, so if I understand correctly, I have changed the bold numbers in revolution.py and that increased effect that garrison has on quelling rebellions, depending on cultural and building defense city has. Also, on the bottom, this changed max. effect that garrison can possibly have on rebellion prevention (from -8 to -10 and -10->-15)

# Happiness
numUnhappy = RevUtils.getModNumUnhappy( pCity, self.warWearinessMod )
happyIdx = 0
if( numUnhappy > 0 ) :

numUnhappy = max([numUnhappy - (pCity.getRevIndexPercentAnger()*pCity.getPopulation())/1000, 0])

if( pCity.getOccupationTimer() > 0 ) :
# Resistance is counted below ...
numUnhappy = min([numUnhappy/3.0,0.5])
elif( recentlyAcquired ) :
numUnhappy = min([numUnhappy/2.0,0.75])
# lfgr: UnhappyProduction
elif( pCity.isUnhappyProduction() ) :
numUnhappy = numUnhappy / 2.0
# lfgr end

happyIdx = int(math.floor( (15 + 15*(min([numUnhappy,pCity.getPopulation()])/min([pCity.getPopulation(),12])))*pow(numUnhappy, .8) + .5 ))

if( pCity.getEspionageHappinessCounter() > 0 ) :
# Reduce effect if unhappiness is from spy mission
happyIdx = happyIdx/3.0

if( numUnhappy > 0 ) :
happyIdx = int(math.floor( self.happinessModifier*happyIdx + .5 ))
if( bIsRevWatch ) : negList.append( (happyIdx, localText.getText("TXT_KEY_REV_WATCH_HAPPINESS",())) )


elif( numUnhappy < 0 ) :
numHappy = min([abs(numUnhappy),10,pCity.getPopulation()])
happyIdx = -int( (1.2 + numHappy/pCity.getPopulation())*pow(numHappy, .6) + 0.5 )
if( bWarWithMaxCult and not pPlayer.isRebel() ) :
happyIdx /= 2
happyIdx = int(math.floor( self.happinessModifier*happyIdx + .5 ))
if( bIsRevWatch ) : posList.append( (happyIdx, localText.getText("TXT_KEY_REV_WATCH_HAPPINESS",())) )

localRevIdx += happyIdx
revIdxHist['Happiness'] = [happyIdx] + revIdxHist['Happiness'][0:RevDefs.revIdxHistLen-1]

ww = pCity.getWarWearinessPercentAnger()
if( ww > 0 and self.LOG_DEBUG and iGameTurn%25 == 0 ) : CvUtil.pyPrint(" Revolt - %s has ww %d"%(pCity.getName(),ww))

#if( self.LOG_DEBUG and iGameTurn%25 == 0 ) : CvUtil.pyPrint(" Revolt - %s happiness index: %d"%(pCity.getName(),localRevIdx))

And here, changing 15 to 30 would double effect of unhappy citizens on revolution?
And here, changing this
happyIdx = -int( (1.2 + numHappy/pCity.getPopulation())*pow(numHappy, .6) + 0.5 )
to this
happyIdx = -int( (1.2 + 2*numHappy/pCity.getPopulation())*pow(numHappy, .6) + 0.5 )
would double effect of happy citizens?
 
Few more suggestions:

How hard would it be to make Aqueducts provide fresh water to cities, in addition to health bonus, as in RifE? It is nice flavor and makes aqueducts more important to cities far away from rivers, while still keeping them worthwhile for cities with access to fresh water. Then you can make some buildings (public baths, or maybe sewers) require fresh water to be built.

Second thing from RifE, there is a cool thing about republic civic - it triggers election events, where you choose between two different 'factions', basically choosing extra trait. It really makes Republic interesting choice, and provides fun and flavor.

I did not realize that Aqueducts in RifE did that, and do not know how it is done. I don't see any hint towards it in the code of the old version of RifE I had on my computer.

I was about to say that I thought it would be impossible without an SDK change, but then I thought of a fairly simple workaround. Fresh water can be added by a feature (like Oasis), and python can be used to place such a dummy feature on the city's tile once the building is finished.

I'll consider this.


I'm not a big fan of the election events. It seems like a hassle to keep up with which traits should be kept or removed, particularly when you have to consider the loss and gain of traits due to the death and resurrection of Avatar units.


Magister, what exactly is it that makes Freya's CityStyle modmod incompatible with yours? Is it simply that all the info regarding the unique buildings you've added (Lizardmen Cages, the Wyrmholds, etc.) gets overwritten when one copies the CityStyle's files into your directory, or is there something more to it?

I'd offer a small suggestion in making Eurabartres an avatar unit for Cardith Lorda, along with Auric and the Seven Demon Lords. On a similar note, I've noticed that given how Eurabartres is so monstrously powerful compared to the other dragons, Sheaim / Illian / OO players have very little incentive to complete Stir From Slumber when Cardith is present.

I recall you mentioning that the Gold Dragon was designed as a brilliant lieutenant/commander for the Godswar, as opposed to a glorified weapon like so many other dragons were. Given this, I can't help but feel that it might be conducive to both game balance and thematic concerns to lower Eurabartres' base strength but give him other abilities to compensate. May I humbly suggest giving him Channeling III and Govannon's ability to pass on spells, or perhaps bonus traits for the Kuriotates Civ as long as he's alive, similar to how Orthus passively aids the Barbarian Civilization. Would something like this fit the Creation Sphere?

I was fiddling away with some of your Python and XML files, and to my great surprise I came across TXT_KEY_PROJECT_RISE_OF_LAROTH and TXT_KEY_UNIT_LAROTH :eek:

Is this a leftover from an abandoned project, or do you have something big planned in the days ahead?
I'm not familiar with Freya's CityStyle modmod so I cannot say for sure, but overwriting the references to the new buildings is likely the cause.

I guess I'll go ahead and make Eurabatres an Avatar of Cardith Lorda.

Eurabatres was still the greatest weapon of mass destruction, even if he was also a genius whose master did not like to have any personal involvement in the war.

I cannot say that I particularly like your ideas about changing Eurabatres. I just thought of one of my own that might be quite nice though: so long as the Golden Dragon is fighting on your side, it is always a Golden Age.


I added PROJECT_RISE_OF_LAROTH and UNIT_LAROTH a long time ago, but was not particularly pleased with the implementation and so soon removed them. I wasn't really planning to add it back, although I guess I could if there is a demand.

The project had Ascension as a prereq and could not be performed unless Auric Ascended had been killed with the Netherblade. It caused all of the units that had been killed by the Netherblade to be resurrected as Undead Barbarians. It would also create several Demons of Death, which are like Angels of Death but with the demon race and with the ability to take control of the undead rather than destroy them. Laroth Ascended would appear as an extremely powerful barbarian hero with the Avatar race, who was unable to die by any means but the Godslayer. (Since the barbarian state has no capital, he would instead be resurrected on a random tile through python.) Until he is vanquished, every single living unit that dies without meeting the criteria to return as Manes or Angels would instead return as an undead barbarian.



I've gone over the thread and haven't seen any mention of this, so I'm wondering if it's an oddity only I'm having:

Many buildings appear to have no build requirements, even when their tooltips and pedia descriptions state they should. For instance, on a newly started game in the Classical age, I can immediately build the Grand Menagerie on turn 1, despite my city having none of the captured cages it claims to require. Similarly, I can build the Shrine of the Champion, even though the description in the pedia says it can only be built after the civilization's hero is killed.

I've tested this with various options enabled and with none enabled (game options list 'no espionage' as the only enabled option, although I have no options checked; no idea if this is normal or related in any way). I've also completely deleted the mod and the base FFH mod, reinstalled them from their installers to ensure a clean install - still persists.

I believe this is also related to other oddities I've seen lately, such as non-illians using the White Hand ritual and other illian rituals - in my last game, Garrim Gyr completed the Deepening. I think I've seen non-Illians or Doviello do the White Hand, but I can't be certain. I am certain about Garrim Gyr completing the Deepening, though. Also, in two games I tried with the 'compact enforced' option, infernals were still being summoned into the game with no apparent explanation.

As an additional (probably unrelated?) note, even when playing with 'all unique features' enabled, I cannot find the Ring of Carcer anywhere, even when I've gone into worldbuilder and carefully looked over the entire map searching for it.

Edit: To confirm, while I am still not certain I have seen an AI use it thus far, I can say for certain that the White Hand ritual is available for me to build as the Kuriotates.
Edit again: In the same game I've been playing as the Kuriotates, Duke Sallos just completed the White Hand.


It sounds like your computer is not loading python files for some reason. Most of the things you mention should be dealt with in C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Magister Modmod for FfH2\Assets\python\CvGameUtils.py

I am not having those problems, and I think I would have heard if anyone else was.
Magister,

Have something that maybe causing an infinite loop. I have had to abandon two games due to this happening. I have been saving in increments the entire game so I have these last three save files for you.

On turn 586, I end my turn and it goes into the loop. I have reloaded this game three times with the same result.

I have also got a save at the end of turn 585 and 581. Not sure if this would help you find something, but it maybe worth a shot.

I'll hang onto all the saves I have in case you need earlier ones.

Good Luck and hope this helps.

As I've said before, the logs (for WoC issues, BBAI.log in particular) tend to be more useful than the saved games, but by now have almost certainly been overwritten.

I'm afraid I never really figure out the cause of most such issues.

I've made enough changes since the last release that I don't feel like rolling back just to see if I could solve this.

Ok, so I changed this

Ok, so if I understand correctly, I have changed the bold numbers in revolution.py and that increased effect that garrison has on quelling rebellions, depending on cultural and building defense city has. Also, on the bottom, this changed max. effect that garrison can possibly have on rebellion prevention (from -8 to -10 and -10->-15)



And here, changing 15 to 30 would double effect of unhappy citizens on revolution?
And here, changing this
happyIdx = -int( (1.2 + numHappy/pCity.getPopulation())*pow(numHappy, .6) + 0.5 )
to this
happyIdx = -int( (1.2 + 2*numHappy/pCity.getPopulation())*pow(numHappy, .6) + 0.5 )
would double effect of happy citizens?

Whenever you post code, I would appreciate it if you included some info on where the code is found, and also used the [code][/code] rather than the [quote][/quote] tags so that the proper indentation is not lost.
 
Wow, that Rise of Laroth project sounds like a doozie! It sounds like it sure has some esoteric requirements, but it would certainly make one hell of a hypothetical future, "what if?" type custom scenario if nothing else. Not that it'd necessarily happen, but one can always dream. In what ways did your implementation fall short? (And for that matter, why would Auric have to Ascend before being slain by the Netherblade? I thought that Rhoanna stabbed him mid-ritual, before he had fully Ascended).

I personally am a huge fan of Freya's CityStyle modmod, and I'll see if I can integrate it into the tweaked-out version of your modmod that I'm currently running. That said, the thing I'd most love to see in a new patch would be a proper integration of the two modmods. And if graphical flavor is a priority for you, you could even look into borrowing the civ-specific towns/workshops/lumbermills/mines/quarries that Master of Mana uses.

If it's not a bother, might I ask for a rough estimate on the next patch's release date? Looking forward to your work as always.
 
Back
Top Bottom