I'm developing a small sandbox RPG, and one procedural element I'd like to have is fairly realistic trade between cities. I'm curious if anyone here has experience with this sort of thing, or at least knowledge about European trade practices in the 1300's to 1500's. I'm especially interested in algorithms people may have that would help this simulation.
My simulation must serve multiple goals. The first goal is to determine how important each city in the world is, since in the real world city population size was highly linked with how much of a hub of trade a city was. Initially, I want to procedurally determine the population level of each city before the game starts. As the game progresses, I'd like cities to slowly wax or wane in power based partially on how involved they are in the flow of trade. Finally if the player wants to be a merchant I want to allow that, so the simulation needs to be able to handle local prices.
So, how do I determine which cities prosper due to trade? How do I determine which nations (groups of cities) prosper due to trade? How can cities or merchant organizations attempt to control trade to their advantage (naval power)?
Here's the basic framework I'm planning on using, though I'm willing to consider changing anything if someone has a good idea:
I have approximately 250 cities placed across my map. Each city is the center of trade of its own surroundings, which include 6-10 market towns and up to 1000 villages. For the purposes of my simulation, each province (city + satellite settlements) is considered a single unit.
Each city supplies certain luxury or manufactured goods for export, such as alcohol (wine, rum, beer), weapons and armor, jewelry, textiles (wool, cotton, silk), perfume, dyes, spices, incense, glass, ceramics/porcelain, alchemical goods, furs, fine timber, opium, etc. Cities have demand for goods that they don't produce.
Cities are linked together in a web of trade connections. Land routes connect cities to each other as long as they're quite close or inaccessible by water. Sea routes connect ports to each other in chains along the coast. River routes allow barge traffic to move along the slow, wide rivers in the lowlands.
Each trade connection is assigned a cost which represents time and risk involved in using it. Connection length and type are the primary cost factors, but other modifiers such as a mountain pass or areas of known pirate/bandit activity also apply. This network of connections can be searched using a search algorithm like A* to allow AI agents to make rational decisions about which trade routes should be taken.