[MOD] Medieval: Conquests

I played a few mods for Col, and this one seems best by far.To be better it only requires Civilopedia update and bugs correction.There are following bugs i noticed:
- can't build inventors workshop (someone mentioned it before) - HUGE problem
- can't train Tavern Keeper
- civilopedia for butchers -no mentioning of furs output
and some more, but i can't remember now.As soon as I do, sure will post it here.

Last question is how can i change max map size, since Huge is still pretty small?

Thanks for the bug reports. I have done some play testing myself and made note of several things. Glad you liked the mod though. I am not exactly sure about changing map size but you can ask in the modding forum or search for it. I hope to be able to work on this some more in a couple of weeks.

@ilduce349
Yeah, I don't like the fairgrounds screen either and its on the to do list of things to update.

About Tax Rate,
At some point I want to add other means for the Popes to punish the players other than raising the "Tax Rate" or as they all it "Tithe Rate". I could add in a player option where you can turn off or set a max to the tax rate. There may also be a means to do this in the xml, not sure on that but will look into it when I get the chance.

Thanks all you guys for your feedback. This is still my favorite mod and I am still planning on future updates so stay tuned :)
 
what script should we run for now? New world on huge is still small?
You can use any of the scripts that have been posted on the Col forums. A_New_World is the one I do my testing with and haven't branched out to others much yet. Thonnas posted a link to a Faireweather script (I couldn't find it again though) that worked pretty good. As mentioned above there are still issues with starting plots sometimes so I will have to completely rework the code at some point.

I looked into this and learned that neither A_New_World or Faireweather helps here. The reason is that map size is controlled elsewhere. More specifically it is defined in:
Assets/XML/GameInfo/CIV4WorldInfo.xml
and the extra text strings used for adding more map sizes are in:
Assets/XML/Text/CIV4GameTextInfos_Objects_Original.xml

(last file not currently present in Medeval Conquest yet. You will have to copy the standard one from the game itself)

I did a test run where I added a new map size, which I set to 150x150. I tried to sail a ship to each end and it took 38 turns to go from far right to far left. Since it had 3 movement points left it means it travelled (4*37)+1. Adding the tile it started from it ends up as 150 tiles.... yeah it worked :)
I wouldn't recommend this size though. The huge number of tiles is a drain on the CPU. Speed is nowhere near unplayable though.

Now the real question is how many map sizes to add and how big they should be. This would need some testing so I'm willing to make write a whole lot of new map sizes and post the files here. You guys just need to say which map sizes I should add. I think adding 2-3 would be right, but to find the right sizes for those I can add 20 or so to a test setup. Then people can post which they think are good and which ones aren't.

For the record, map sizes are currently:
  • 22x36 tiny
  • 26x42 small
  • 30x48 standard
  • 34x54 large
  • 38x60 huge
The game also offers the ability to set the number of players and natives for each map size. I haven't tried adding more though. Maybe huge uses a hardcoded max. (8 players and 8 natives). Super huge maps with even more natives could be interesting.


I will not take full credit for this find though. I looked in the files in "Dawn of a new era 2" because that one has extra map sizes. I will however take credit for figuring out how they did it and which files to edit in order to add it to Medieval Conquest.


Also I found my share of bugs, which I would like to mention.

Food
  • When a new page appears, the game sets luxury food to 0. It should substract 200. It sucks to unload 100 luxury food only to realize you just spent 280 on a single page.
  • Granary doesn't seem to leave food behind like it says it should.
  • Canals adds food production, but doesn't lower the food needed for a new unit.

Unable to build following buildings
  • Courthouse
  • Markedplace
  • Thinker's workshop (already mentioned)

Technology
  • Finding the technology, which is already being researched will not open the window to select a new technology to research. This means all research is wasted until the player manually open the technology window and selects a new technology.
  • Once I found Medieval Construction while researching it. Not only did it trigger the previous bug, it also made me unable to ever build canals in that game.

Marked fair
  • Unable to buy scouts. They show up as immigrants only.

Production
  • When a butcher produces nothing due to lack of salt, he still removes cattle.

Winning conditions
  • The game lasts 300 turns even when time is disabled as winning condition in custom games.

I say this mod is the best one. However being annoyed by all those bugs all the time is no fun. In fact I find it so important that I searched the source code to see if I can do anything about it and it turns out that I can.

In file CvCity.cpp void CvCity::doGrowth() is buggy.
Line 7019 says: setYieldStored(YIELD_GRAIN, 0);
It always sets YIELD_GRAIN to 0 when growing instead of subtracting 200.

I wouldn't mind digging more into this issue and possibly solving it, but.... you posted the code for version 1.1 (which likely explains why food and luxury food appears to be a bit mixed up in variable naming/possible bugs). Even if I fix it in those files, the fix will still be outdated. Would you mind posting newer code?

If you do then I will set up a compiler to compile for Colonization and try to solve this issue and maybe others issues after this one.
 
I looked at the city growth code and ended up modifying the uploaded SDK anyway. I have some problems getting the compiler to work which means this codechange is completely untested. Still I want to share my result in case anybody else decides to pick up on this.

I merged the growth code for both food and luxury food into a loop. This means one piece of code runs multiple times and handles both. This means there should no longer be any difference in growth based on those two food kinds. Also future codechanges are less likely to add unintended differences.

I fixed granaries. The vanilla code picks a number between 0 and max food stored based on some food production formula and this formula is unchanged in SDK 1.1. I changed this to max food stored to fit the ingame text.

I decided to exploit the fact that the growthcode is now a loop. It is now possible to get more than one new unit of the same type due to plenty of food. To avoid a serious population boom in a city with just one citizen I limited growth to 1 at size 1 and then +1 for every 4th additional citizen (2@5, 3@9 etc). When a city has enough food to violate this limit, then it produces new units according to the limit, starting with pages.

I looked into canals and ran into a mystery. doGrowth() calls growthThreshold(). This is supposed to return 200 without a canal and 175 if one is present (normal game speed). However in my testgame (with version 1.3) 186 food is not enough for growing even though the city has a canal. I can only see this as growthThreshold() returns 200.
growthThreshold() adds getMaxCityPop(), which is var m_iMaxCityPop for the city in question. This is set in processBuilding() where it is set to GC.getBuildingInfo(eBuilding).isIncreasesCityPopulation() if this value is different from 0. This one returns m_iIncreasesCityPopulation from CvInfos.cpp, which is set from CIV4BuildingInfos.xml. For canals this value is -25.

Everything looks fine.... it just doesn't work. Without a compiler and debugger I can't investigate this issue any further.

My code assumes the value for granaries is read correctly from the xml file. However the code looks quite similar to the canal code when it comes to reading this value. I wonder if this is also buggy.

I also wonder about some other stuff regarding canals. If a canal is destroyed, then m_iMaxCityPop should reset. However it isn't in version 1.1. If canals worked as intended, they would continue to provide the growth bonus even after being destroyed. I don't think they would add their food production bonus though.

m_iMaxCityPop is set to the value from the xml file regardless of what it was before. I think this should work, but only as long as only canals touches this variable. If say docks would be given the bonus -5, then having both in a city would provide either -5 or -25 food needed, not -30.

Canals reduces growth threshold by a fixed amount of food regardless of game speed. This makes it great in fast games while it's next to pointless in marathon games if it wasn't for the food production bonus. Granaries keeps a certain % of the food, which means it scales according to game speed. Maybe canals should do the same.

The codechange itself:
Spoiler :
Code:
void CvCity::doGrowth()
{
	int iDiff;

	CyCity* pyCity = new CyCity(this);
	CyArgsList argsList;
	argsList.add(gDLL->getPythonIFace()->makePythonObject(pyCity));	// pass in city class
	long lResult=0;
	gDLL->getPythonIFace()->callFunction(PYGameModule, "doGrowth", argsList.makeFunctionArgs(), &lResult);
	delete pyCity;	// python fxn must not hold on to this pointer
	if (lResult == 1)
	{
		return;
	}

	iDiff = foodDifference();

	changeFood(iDiff);

	// START CHANGE

	// Set the new population limit according to town size
	int num_new_population = 0;
	int max_new_population = 1 + ((getPopulation() - 1) / 4);
	
	int growth_threshold = growthThreshold(); // cache this unchanging value
	
	
	// Loop though food types to check for growth
	// first YIELD_GRAIN then YIELD_FOOD
	// run the loop again for the same food type when the town is growing to allow multiple new units of the same type
	// stop the loop once max new population is reached, even if YIELD_FOOD isn't even checked yet.
	for (YieldTypes food_type=YIELD_GRAIN; YIELD_FOOD <= food_type && num_new_population < max_new_population; food_type--) {
		bool noble_loop = food_type == YIELD_GRAIN;
		
		if (isNative() && noble_loop) continue; // natives do not use luxery food
		
		if (getYieldStored(food_type) >= growth_threshold)
		{
			if (AI_isEmphasizeAvoidGrowth())
			{
				setYieldStored(food_type, growth_threshold);
			}
			else
			{
				UnitTypes eUnit = NO_UNIT;
				
				if (noble_loop) {
					eUnit = (UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getDefineINT("DEFAULT_NOBLE_GROWTH_UNIT_CLASS"));
				}
				else 
				{
					bool bGetDefualtPopUnit = (GET_PLAYER(getOwnerINLINE()).getIdeasResearched((CivicTypes) GC.getDefineINT("FREE_PEASANT_CIVIC")) > 0);

					if (isNative() || GET_PLAYER(getOwnerINLINE()).isEurope() || bGetDefualtPopUnit)
					{
						eUnit = (UnitTypes)GET_PLAYER(getOwnerINLINE()).getDefaultPopUnit();
					}
					else
					{
						eUnit = (UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getDefineINT("DEFAULT_GRAIN_GROWTH_UNIT_CLASS"));
					}
				}
				
				if (NO_UNIT != eUnit)
				{
					// Actually make the unit
					CvUnit* pUnit = GET_PLAYER(getOwnerINLINE()).initUnit(eUnit, (ProfessionTypes) GC.getCivilizationInfo(GET_PLAYER(getOwnerINLINE()).getCivilizationType()).getDefaultProfession(), getX_INLINE(), getY_INLINE());
					
					// Calculate new unit discount based on buildings (such as granaries) 
					int growth_cost = growth_threshold - ((growth_threshold * getMaxFoodKeptPercent()) / 100));
					changeYieldStored(food_type, -growth_cost);
				}
				
				gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), gDLL->getText(noble_loop ? "TXT_KEY_CITY_NOBLE_GROWTH" : "TXT_KEY_CITY_GROWTH",
						getNameKey()), "AS2D_POSITIVE_DINK", MESSAGE_TYPE_INFO, GC.getYieldInfo(YIELD_FOOD).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(), getY_INLINE(), true, true);
				
				// ONEVENT - City growth
				gDLL->getEventReporterIFace()->cityGrowth(this, getOwnerINLINE());
				
				// add the new unit to the counter
				num_new_population++;
				
				// loop again for the same food type (++ even out the -- iteration)
				food_type++;
			}
		}
	}
	
	
	if (getFood() < 0)
	// END CHANGE
	{
		changeFood(-(getFood()));
		if (getPopulation() > 1)
		{
			if (!AI_removeWorstPopulationUnit(false))
			{
				AI_removeWorstPopulationUnit(true);
			}

			gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), gDLL->getText("TXT_KEY_CITY_STARVING", getNameKey()), "AS2D_DEAL_CANCELLED", MESSAGE_TYPE_INFO, GC.getYieldInfo(YIELD_FOOD).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(), getY_INLINE(), true, true);
		}
		else if (!isNative())
		{
			changeOccupationTimer(2);
		}
	}
}


About Nightinggale's message, I've been working on python map-scripts lately, so if you need a "custom" map-script, you can ask !
Great offer, but after I looked into this I figured out enough to cover my needs right now.
 
Hi Kailric,

I've seen your Autosell Goods feature is part of the Colonization: 2071 mod, does it exist as a modcomp ?
 
Only a few problems...

Citizens from europe arrive at too fast of a pace. i am getting more jobbers than i can use.

europe is ridiculous about adding troops to king army - ive seen over 200 troops, and this is in a normal game.

Besides how fast i get jobbers, its a great mod. i fixed it myself by making citizens consume 3 food (reasonable with all the cows and wheat your map generates) and changing REF to 200 which makes less citizens appear. all i need to do now is find out how to make it take more time for them to arrive.
 
also, cities grow and swallow nearby tiles, obscuring everything and making my city look like a 10sqm ghetto.

Sometimes, if you move your starting unit one sqm over to a peak you will be discovered by a barbarian who declares war on you (for not having a settled city, i presume. i tweaked my forced colonial peace turns to 3 to give a little exploration leeway.
 
Thanks thadian for the feedback and tweak suggestions. I'll make a note of them and in my tests and may do the same tweaks. Also, I am pretty sure you can change the travel time in an XML file somewhere. Some Civs immigrants appear on the map and then start to travel to your domain. Was you playing as one of those civs? How many turns are you suggestion it should take?
 
i play the land starters, so much fun. by too fast, i mean it seems like i always have 12 people on their way from europe, 8 citizens born and little to do with anybody i get. I copied the TAC model, and set the entire REF to 200 and i slowed it all down. it works nice, without having 300 king troops on average difficulty level but i learned why you set it up to get so much to happen so fast.

you did it because you intended most of those jobbers would become troops to fight barbarians! between the ref and the barbs, you need to get people fast or you wont survive. So, i slowed the barbarians immigration and i set food consumption to 3 (your cows and lux food give plenty of growth). this seems to have slowed everybody down to "controllable" terms. i like your immigration fixes a lot - it takes a little bit longer for them to walk to my nation which doesn't bother me, i wish converted natives would walk over to my city before converting but im just lazy and inept.

8 turns seems fair to travel in my opinion, and now im looking at sentiment to see what small changes i can make so that before trying to condesend you with solutions of any kind i can try to propose something.

your forts, luxury food, and land starts make a great game. you should download the colonization earth maps pack if you havent already - the earth map (rhyes) works well with your mod only that it always makes player start in russia - in 2071, player always starts in africa. a real europe TLC map would be great - i like this mod, and civ4col mod's arent dead as long as this is alive.
 
oh, here is a bug - when using mongol, and being told you are causing inflation, there is no exit button to get out of the gump. pushing "esc" works fine but there are a few civ's who have a king that does this.
 
This mod is excellent! ;) It gives a brand new game, and not simply advance it. The way you have changed immigration is very good.

Some ideas:
1 I would insert parchment maker. Monastery should consume parchment for invention. Parchment should also increase the efficiency of the administration and the church. Parchment was a vital resource in medieval times.

2 My favorite change is the insert of granary and well. I think this is very good way to change the game. Medieval towns and villages was self supporting. I would give more opportunities for this: farmers market (advance granary) in cities, majors (advance farm) on map. Carpenters should help in housing increasing the population.

3 I would use different icon for pedlar: icon of trade the circular arrows. It is difficult to realize what it is now :)

Anyway, the game is very great, Thank you very much, I rally enjoy it.
 
Food bug:

Maybe this is already known and i have to keep empty wagon on every settlement but when i have more than 200 food or luxury food, it just accumulates infinite - if you have 150 food in a city and unload 100 food from a wagon - you have 250 food in your city, it will never grow it will just get more food.

As i said, this normally doesn't happen - the only way it can is if you have 101+ food and deposit enough food to have 201+.
 
Maybe this is already known and i have to keep empty wagon on every settlement but when i have more than 200 food or luxury food, it just accumulates infinite - if you have 150 food in a city and unload 100 food from a wagon - you have 250 food in your city, it will never grow it will just get more food.
I never noticed this bug. Are you sure you didn't disable growth? (the red button in the upper left corner of the town screen). That could cause a problem like the one you mentioned.

Food is buggy though. I wrote about this earlier and posted some code to solve at least some of the issues but I still haven't actually tested it yet (lots of stuff happened and stole my time :( ).


This mod is excellent! ;) It gives a brand new game, and not simply advance it. The way you have changed immigration is very good.

Some ideas:
My general impression of those ideas is that they certainly aim at a more historical correct setup. However I wonder about the gameplay. Removing experts for certain productiontypes seems like a really bad idea from a gameplay point of view.

At first I was against the parchment idea but now that I think about it, I'm just uncertain about it. Starting with the ability to build monasteries is awesome because research is so hard to get in the beginning, which means making monastery research a bit harder to make would balance the game a bit more, which would be good. However slowing research to a crawl due to balance and historical reasons rather than gameplay reasons somehow seems wrong. I fear it can end up as an annoying feature because people stop researching as much as they would like.
 
@Nightinggale
Yeah, the beginning of the game is very hard, there are to many to choices and to few workforce. :) Parchment could only be a later way of science and administration increasing factor. And I would also decrease the monastery output without parchment. The scouts also find a lot of inventions if you play on big map, so it is not in vein.

Considering the beginning: the civilizations that do not have ship would need a pedlar or a caravan (soldier and worker). Civ Arab have huge advantage with their ship.

I had a problem with Tavern. It is selling the ale, but giving 0 gold for it. Maybe, because it is under boycott in Europe? :)
 
Is the download link on the first message the current mod? Should I download 1.2, 1.3, 1.3a, or Medieval SDK? Or am I not looking in the right place? Thanks ahead of time! This looks really cool!
 
Bugs
I did not have many troubles with bugs in the 1.2 version, everything is 100% playable. I can advice this nice game to anybody. Their was only few problems with founding Bailey or Castle: the resources that you carry to the building site are turns from 100 to -100, and if you give more workers after you started the construction they won't finish the city, so you can not add workers if the city is under construction. On the hole (like others) I have only big problem with the tax rate.

Some balancing advices:
1a The tax reaches the 60% at the half of the game play time, you can not avoid it with boycotts, and the barbarians do not have enough money. So the unlimited tax paralyzing the economy. It should be at least half of it, OR:
1b The tavern, the inn, the mint etc. building should not calculate with the tax.
For example:
- Now, if the ale is 10 gold, if the tax is 50% tax, tavern profit rate is 80%, you earn 10*0,5*0,8=4 gold for 1 ale.
- I think it should be 10*0,8=8 gold. Tax should be a custom in mother land.
And this way you could sell products that under boycott in Europe in your settlement!
2 The noble production is too fast. The bakers should produce 1 luxurious food from 2 ordinary. (On 100% independence rate it means 1,5 luxurious food from 2 ordinary).
3 The tech tree and the founding fathers are great. I would allow the cathedral form the first time (real), and I would add a new 4th level of cross factory the grand cathedral, or DOM.

Some general ideas:
1 City states. It would be very nice to have some advanced barbarian cities with 10-20 population with strong walls and many guards, that you could conquer, or trade with.
2 Work camp. This is nice think to have different kind of settlements. I advice an other one: work camp. You could found it width a veteran soldier. This have just one building a barrack where the veteran soldier is accommodated. And it would have only one very important feature: decreases the penalty of the slaves. This would be great help at the beginning of the game It would be also important that if you take all the people from the city it disappears. This way you can replace it with a city.
3 Parchment workshop and/or paper mill. This would converts sheep/wood to invention. Paper obsoleted parchment.
4 I would increase the peasants (or decrease the serf an criminal) food, barely, grape, and wood output. (I could not make it in the xml).
5 I would consider to add a new kind of victory: build a wounder. If you build a grand cathedral, (or else) specific for every civilization, you win the game, because you become the cultural center of your empire. This building should consume a lot of different kind of material etc.

Some ideas for Arab civilization
1 Monasticism is forbidden in the Islam culture, but they supported science very well. I would not allow them to make monasteries. I would take the library in the normal city. The Arab chemistry and astronomy was very advanced in medieval era. They should start their city with a chemistry lab or observatory (compensating the monastery).
2 Alcohol is not allowed by Islam, but they was the only people this era who had access to silk. Maybe alcohol should be changed to silk, and city states could buy it, or the lack of alcohol could be compensated with increased population, and science.
3 The names should be more Arabic, like dervish is missionary. ( I collect some other name).

Tip for players:
If you would like to increase your troops peasants, movement, take them into caravans. With the chain of caravans you can transport troops to any distance in one single round!

I would be glad to help you in other things.
 
Top Bottom