[MOD] Medieval: Conquests

woah that Trading League bonus could really be huge :crazyeye: maybe just convert them to FF points or something at a lower than 1-to-1 conversion rate.

All I have is my game experience, which tells me if I land in an area good for tobacco and not much else for export, I end up exporting a lot and the price of tobacco and cigars drops noteworthy.
Fair enough lol, I just thought you might have found it in the DLL and directly know what the function does, I haven't been able to find where that's coded myself so am in the dark about specifically how that currently happens in vanilla :confused:. However I have seen in the vanilla game prices sometimes jump up or down randomly without any sales.

Anyway, if the goal is to improve on vanilla I guess what we need is to come up with a better price adjustment function that can balance local prices to prevent over-exploiting the market. One simple relationship could be the below:

iBuyPrice = iBuyPrice - (iUnitsBought - iDemand)/iPriceChangeThreshold
where iBuyPrice is the current buying price, iDemand is the local demand for that turn and iUnitsBought is the units bought by the Market that turn. Thus decreasing the BuyPrice when units bought exceed the demand, and allowing the change per excess unit sold ("price elasticity" in econ terms) to be adjusted as desired for any yield type using iPriceChangeThreshold.

But if iBuyPriceLow and iBuyPriceHigh are the min and max buying prices, ideally there could be some sort of asymptotic relationship when approaching these prices. Any suggestions about what a good supply/demand function would look like?
 
woah that Trading League bonus could really be huge :crazyeye: maybe just convert them to FF points or something at a lower than 1-to-1 conversion

Yes, I usually test and play on normal or average settings and forget most people use all but normal settings:) Trading League didnt seem too out of balance on normal and my play style.

The Prices are adjusted in the CvPlayer.cpp function :doprices(). I don't have access to that atm or I'd show you the formula they use there. It's pretty simple though.
 
k thanks. Here is the vanilla code chunk for anyone interested:
Spoiler :
Code:
void CvPlayer::doPrices()
{
	if (isEurope())
	{
		for (int iYield = 0; iYield < NUM_YIELD_TYPES; ++iYield)
		{
			YieldTypes eYield = (YieldTypes) iYield;
			CvYieldInfo& kYield = GC.getYieldInfo(eYield);

			if (kYield.isCargo())
			{
				int iBaseThreshold = kYield.getPriceChangeThreshold() * GC.getHandicapInfo(getHandicapType()).getEuropePriceThresholdMultiplier() * GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGrowthPercent() / 10000;
				int iNewPrice = kYield.getBuyPriceLow() + GC.getGameINLINE().getSorenRandNum(kYield.getBuyPriceHigh() - kYield.getBuyPriceLow() + 1, "Price selection");
				iNewPrice += getYieldBoughtTotal(eYield) / std::max(1, iBaseThreshold);

				if (GC.getGameINLINE().getSorenRandNum(100, "Price correction") < kYield.getPriceCorrectionPercent() * std::abs(iNewPrice - getYieldBuyPrice(eYield)))
				{
					iNewPrice = std::min(iNewPrice, getYieldBuyPrice(eYield) + 1);
					iNewPrice = std::max(iNewPrice, getYieldBuyPrice(eYield) - 1);
					setYieldBuyPrice(eYield, iNewPrice, true);
				}
			}
		}
	}
 
k thanks. Here is the vanilla code chunk for anyone interested:

Thanks orlanth for pointing that out. When I have the time I'll look into improving the current system but your suggestions are duly noted :goodjob:

So far these are the features and bugs that need to be adjusted or fixed in the immediate future (I share this as a consolidation and reminder for when I get back home). If I have missed something let me know please.

Bugs/Balance
-Fix, balance, or adjust animals so they are not imbalanced and no longer cause crashes
-check and balance the amount of money the player receives at end game on multiple game world configurations
-look into and fix the wagons disrupting production bug
-make it so when a player first discovers the Spice Routes ships wont sit idle when you tell them to Embark on Spice Route

Improvements

-add new trade route videos
-work on AI so they can take advantage of the new trade screens
-adjust AI to play smarter in building up and defending their empire

EDIT: One thing that keeps me motivated working on this mod is that it gets an average of about 10 or more downloads a week. That's pretty cool considering how old this game is!
 
In vanilla civ you always know where one ship transport zone is, because all civs arrive in one, in their first ship. It can be tough to even find one of them in this mod, for land-originating civs. I've played a couple of games where I never had the resources to find one. In other games, finding one took 115 turns or so. This slows the game down. I think the Spice Route button should send a ship off right to the closest transit zone, as Vanilla Civ works (I think.) Hunting for the Spice Route isn't fun.
 
Finding the high seas is the least of the problems with the spice route. Finding the shoreline has proven to be a much worse issue on big maps. Getting a city, which is able to build the boat can take quite a while. Even worse you risk starting in the middle of an island with foreign cities all around you making it impossible to get a port city without going to war.
 
In vanilla civ you always know where one ship transport zone is, because all civs arrive in one, in their first ship. It can be tough to even find one of them in this mod, for land-originating civs. I've played a couple of games where I never had the resources to find one. In other games, finding one took 115 turns or so. This slows the game down. I think the Spice Route button should send a ship off right to the closest transit zone, as Vanilla Civ works (I think.) Hunting for the Spice Route isn't fun.

Right, that's what I meant when I said...
-make it so when a player first discovers the Spice Routes ships wont sit idle when you tell them to Embark on Spice Route

The Spice Route works just like Europe Tiles in Vanilla. Just head out to sea east or west and you'll find it. They are colored tiles that range nearly the whole west or east side. But, certain maps do not configure Europe tiles very well so you have to remember that.

Finding the high seas is the least of the problems with the spice route. Finding the shoreline has proven to be a much worse issue on big maps. Getting a city, which is able to build the boat can take quite a while. Even worse you risk starting in the middle of an island with foreign cities all around you making it impossible to get a port city without going to war.

I agree, but this should be turned into a game feature where it adds to the sense of being in the dark, or Dark Ages when you are afraid and unawares of the world around you. It also adds to the randomness of it all where no two games play alike and encourages exploration. Even in vanilla Col and Civ4 you could have really bad starts that put you at a disadvantage. Some players enjoy overcoming these types of adversity. We could add a new diplomacy option when you are talking to barbarian villages where you can ask about oceans or neighbors and such, maybe pay a little gold to reveal some tiles.

I am also thinking of changing Bandits so they don't actually kill units but rather damage them and steal player gold. That would help your scouts move about without being so easy killed by bandits as mine are. Or maybe add the ability of scouts to be invisible in certain terrain maybe, like it would be kinda hard to spot a loan scout roaming the hills anyway. They could be like the first spy unit types.
 
I am also thinking of changing Bandits so they don't actually kill units but rather damage them and steal player gold. That would help your scouts move about without being so easy killed by bandits as mine are.
Yeah I'd be in favor of being damaged rather than destroyed by Bandits and Animals - maybe losing a fight with them usually makes you withdraw wounded & have to wait to recover rather than being killed; or could even consider using the existing Evasion mechanic to return to the nearest settlement to recuperate.
 
Yeah I'd be in favor of being damaged rather than destroyed by Bandits and Animals - maybe losing a fight with them usually makes you withdraw wounded & have to wait to recover rather than being killed; or could even consider using the existing Evasion mechanic to return to the nearest settlement to recuperate.
How about giving some wounded promotion, which will only go away if the unit rests in a settlement? Possibly wounded causes a bit of damage each turn, which would become a slow death unless treated. This would make it extra dangerous for scouts to explore very far from friendly settlements as it should be.

Maybe the promotion could be cured at native/allied settlements, possibly for a fee.
 
I'd like to tell you a little more about what I'm working on. I have an intellectual interest in database design and normalization, decision support systems, etc. I've talked about Access decision support databases for MC2 as well as Vanilla.

One area I'm addressing comes from the fact that I've found Founders/Dignitaries hard to work with. My idea is to track their status in the game and support you in scheming to get the ones you want. A snap is attached of a piece of the Founders table for Vanilla. I'd like to track your point production, and help you to optimize it to meet your goals, too.

I'd like to share a working system in progress--I have one that I can use--but my lack of knowledge of the presentation side of Access prevents me from producing a tool that would be useful to someone else (yet).

Getting more knowledge is my first priority. Unfortunately that is requiring me to read a 1,300-page, extremely...

Where was I? Dozed off. Ah yes, extremely boring, book. The book is so heavy that I had to cut it into four pieces. I'm finding it a hell of a lot more interesting to fiddle around making founders tables than to buckle down and learn how to cause panels to open and close, do lookup tables with left inner joins, etc.
 

Attachments

  • Part of Founders Table.jpg
    Part of Founders Table.jpg
    311.3 KB · Views: 60
That looks like something really easy to code inside the game, where it even updates automatically when the game changes. It might even be coded MOD independent meaning it could be a file, which could be moved to another mod and it would still do it's job. The question is if you want it to do more than in the screenshot.

I think I want it to do more than I can do without a relational database. Plus lots of I/O helps, error-handling, a high-level procedural language, etc. In any case, it's said that Access is a prototyping tool. I believe you never code anything right until the second iteration. As they say about Microsoft, "quality is job 1.1." I wouldn't rule out ultimately doing something inside.

Another reason for doing things my current way is that I don't know Python, or Colonization internals. Please bear in mind that I'm lazy. Or at least, when I'm not being paid, I am.

I used to write everything in machine code, quite a few years ago. I don't do it any more. (I use the simplest, highest-level code I can, to focus on the algorithms rather than the bit-twiddling.)
 
Another reason for doing things my current way is that I don't know Python, or Colonization internals. Please bear in mind that I'm lazy. Or at least, when I'm not being paid, I am.

Well, mastrude, I'd like to really encourage you. You can do it, cause I did. I was only a hobbyist that new nothing about C++, Python, Blender, or what a NIF was when I first started modding but I learned by doing and reading tutorials. Maybe there is a tutorial out there somewhere that does pretty close to what you want to do so you don't have to actually read the...

oh, where was I, oh yeah, read the whole boring book:lol:

Yeah I'd be in favor of being damaged rather than destroyed by Bandits and Animals - maybe losing a fight with them usually makes you withdraw wounded & have to wait to recover rather than being killed; or could even consider using the existing Evasion mechanic to return to the nearest settlement to recuperate.

Bandits that actually rob you instead of killing your units is something I wanted to add before I posted version 2 but there was tons of things I wanted to add before I uploaded version 2 so I had to draw the line somewhere so I could get help, ideas, and testing on what I had already come up with :) So, yeah, when I get the chance I'll code in some alternatives and we can test them out, keep the ideas coming!
 
I believe you never code anything right until the second iteration.
Sounds like an excuse for lack of planning.

Another reason for doing things my current way is that I don't know Python, or Colonization internals.
I had the same problem when I started modding. That didn't stop me and I rewrote the entire domestic advisor in RaRE. It turns out that making a new list is close to be a copy paste of existing code, which is fairly easy to read.
This may be a surprise to some people but it's less than two months ago that I started modding. While I don't agree with everything in the design, it is a fairly easy design to get started with.

I used to write everything in machine code, quite a few years ago. I don't do it any more. (I use the simplest, highest-level code I can, to focus on the algorithms rather than the bit-twiddling.)
That sounds like promoting python :)


Well, mastrude, I'd like to really encourage you. You can do it, cause I did. I was only a hobbyist that new nothing about C++, Python, Blender, or what a NIF was when I first started modding but I learned by doing and reading tutorials. Maybe there is a tutorial out there somewhere that does pretty close to what you want to do so you don't have to actually read the...
I'm still clueless about Blender and NIF. I did know C++ very well before I started though.
 
I'm still clueless about Blender and NIF. I did know C++ very well before I started though.

I'm still clueless about Blender too. I learned just enough to import and export Nif files, something you have to do in order to get some of the really cool custom Civ4 units into Col. I learned enough about Nifviewer to swap weapons around and also swap one unit to another unit's animation and a little about team color. I learned a lot about the free photo shop like Gimp program. I use it to make all the buttons and to edit unit graphics as well. Anyway, I have to be online a lot while I am on vacation cause I still have to do my school work so I keep checking in on the forums here:mischief:
 
Nightinggalee wrote:
How about giving some wounded promotion, which will only go away if the unit rests in a settlement? Possibly wounded causes a bit of damage each turn, which would become a slow death unless treated. This would make it extra dangerous for scouts to explore very far from friendly settlements as it should be. Maybe the promotion could be cured at native/allied settlements, possibly for a fee.
That sounds cool actually, but the AI might do really badly with it (in the FfH mod, similar "curse" type promotions often caused AI units to sit around vainly trying to "heal" while slowly dying :crazyeye:) If they could get a UNITAI script to return to the nearest city that might still work though.

mastrude wrote:
What I'm doing
I'd like to tell you a little more about what I'm working on. I have an intellectual interest in database design and normalization, decision support systems, etc. I've talked about Access decision support databases for MC2 as well as Vanilla.
As you may know Civ5 is based on SQL which was meant to help with modding; it did help somewhat if you want to make mods that slightly adjust the vanilla game (ie decrease all ranged combat unit strength by X with a sql query), but unfortunately it is very difficult to impossible to do many important things in Civ5 such as change building graphics or sound, which really crippled the potential for serious Civ5 conversion mods though there are still some valiantly trying.
Anyway I'd generally agree with Nightinggale, probably not many would use an external database for viewing stats; but there's always room to improve on the existing pedia screens and game interface to make it more informative. For example since local prices are now more important, it would be great to have a Prices tab on the Domestic Advisor that shows a table of the buy/sell prices for all cities.
 
Anyway I'd generally agree with Nightinggale, probably not many would use an external database for viewing stats; but there's always room to improve on the existing pedia screens and game interface to make it more informative. For example since local prices are now more important, it would be great to have a Prices tab on the Domestic Advisor that shows a table of the buy/sell prices for all cities.
Basically you are telling me to move my Domestic Advisor "engine" from RaRE to M:C. It's designed to look just like in RaR but with a design, which allows adding stuff without messing with existing pages. Also a number of features are autogenerated and autoconfigured, such as left/right arrows.

With this design adding the page(s) you propose would be adding a button (one line), add that button to the list of pages with yield columns (add one name to a line) and then how to fill a cell (possibly just a few lines). That's it. The generic code will handle everything else. I designed this with expansion in mind as well as maintainfree code generation. Removing info about say number of yields from page generation mean they don't care if the number of yields change.

I wonder what would happen if I just copied the file. With a bit of luck I only need to remove the traderoute screen and do something about new warehouse capacity. The latter has an on/off switch, which can be forced to off. I guess I can implement an on/off for traderoutes, leaving the files identical except for maybe 2 lines. Alternatively they ask for the on/off state in the DLL, which mean 100% identical files could be used.

Having nearly identical files mean it would be possible to write new pages for both M:C and RaRE at once, providing they make sense in both.
 
O, ye of little faith!

The issue with modelling software is whether the benefit is worth the hassle of putting data into it. I've been using the scratchpad function to keep track of units and goods needed, where. I usually don't bother till turn 110 or so. Then so many needs are involved I can't keep track of them without it.

I can't keep track of Dignitaries either, to get the ones I want.

Those are the main things I have trouble managing.

I didn't know Civ V had SQL. That's cool, I guess. That might make it easier to do what I'm doing.
 
Back
Top Bottom