• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Town Economies

In Locations_loader.c
Find:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//Loading always models================================================================<!--c2--></div><!--ec2-->
The following code handles the loading of models per attributes of the location.
What' we're interested in is the function it calls,
bool LocLoadModel(aref loc, string sat, string addition)
(which is down the file from the above).

There are a string of if(CheckAttribute) blocks, checking for various things to do to the added model.
Scroll down until //uvslide for that block.

Edit: Argh, but my laziness!
Had I but grep'd for uvslide, I would have found:
Used for the waterfall at Douwesen.
Used for "l2" and "blue" at KR
And there's Russian documentation for it in Location_init.txt

So yeah, I guess it _is_ for moving textures.

{Looking at that TXT file, it seems it really ought to be Babelfished--it explains a ton of stuff, unless I miss my guess...}
 
This efekt makes it possible to continuously move textural coordinates on model'ki. Speed of displacement to zadayet'sya as the complete revolution per second.
Locations[.n]..models..(lhboe unique imya)..uvslide.u0 = speed on u for 0 stage (first texture) Locations[.n]..models..(lhboe unique imya)..uvslide.v0 = speed on v for 0 stage (first texture) Locations[.n]..models..(lhboe unique imya)..uvslide.uy = speed on u for 1 stage (second texture) Locations[.n]..models..(lhboe unique imya)..uvslide.vy = speed on v for 1 stage (second texture)
Code:
Locations[n].models.always.somemodel = "my_model";
Locations[n].models.always.somemodel.u0 = 0.5;
Locations[n].models.always.somemodel.v0 = 0.1;
Locations[n].models.always.somemodel.u1 = 0.01;
Locations[n].models.always.somemodel.v1 = 0.07;/code]
 
Well, if it's called uv*slide* it will most certainly be just that: A means to "slide" texture along the model surface.
Will try it ASAP.
 
OOps, this editing is confusing. But that's what I meant. A Waterfall is something of a classical example for it. But we could also use it for sliding doors and panels and such things.

Re the babelfish translation: LOL , that'll need some meditation before I even begin to understand this.

AlexusB, you're still around ? Help! What's "zadayet'sya" ? "lhboe"?
 
How bout an economy update:

-introduce a new type of national convoys, trading convoys
-they would be marked otherwise on the map
-the transport ship would have a different model (giant hull, no guns?)
-would be _heavily_ escorted (well depends on cargo value)
-should it be sunk or captiured by player, the nation's economy would worsen (again, depends on cargo value, could worsen only the outgoing colony's economy)

So there would be real piracy, searching the seas for fat merchant transports and banging the hell out of their escorts.

One more could be slave ships, just like before just with slaves, you could kill of the whole ship crew, but there would still be slaves willing to join your crew (of course they'd take a penalty at ship bombarding)



My 5 cents <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
 
j0

while since i been here <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/ohmy.gif" style="vertical-align:middle" emoid=":eek:" border="0" alt="ohmy.gif" /> not had the best time of my life since i was last busy posting here... hopefully this summer will be like the last one where i spent 99% of my free time modding <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />

well i came back for a quick look on the boards and i couldn't resist putting my fourpenneth in this topic <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" /> shame it went `off-topic` like lol

anywayz

i've been studying contemporary economics, taught from a historical point of view, at the university of barcelona... so i'm <b>not the expert!!!</b> but i've got some input <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />

a lot of the ideas are very good from a modern economic point of view, but not from a `pre-1750` point of view.

`pre-1750` economies' populations were more or less stable; they didn't grow because they could only live off what they produced on the land, and until the agricultural and industrial revolutions in the `north-west` of england (my homeland <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" /> ), they had no way of increasing the productivity of the land.

sometimes there were agricultural booms, and the population did rise. but to feed that extra population, they had to use land that was previously used for grazing animals to grow more crops, which meant they didn't have as much meat and dairy and not as much dung to fertilise the fields, which resulted in a lower food production, which resulted in an agricultural recession... and the cycle continued up until the agricultural revolution.

also the low level of medical care kept death rates high and populations low, etc etc

also we have to remember that the majority of the populace were peasant farmers, producing just enough to eat, pay the local nobles and sell a bit at the market, and that the "wealth of nations" didn't really touch them; most of the wealth was possessed by the nobility and the church, and a (much smaller) portion of it by merchants, artesans etc. so to talk about 'gdp per capita' in those days would have been useless.

er, my point is that i don't think riches and population weren't really linked in those days. (what would population in the colonies be linked to then? immigration? i dunno)

also, i have to disagree fundamentally about what nathan said, that both imports and exports 'increase' the economy. if a colony imports everything and exports nothing, then all the capital in the colony will fly outwards (like to pay for the imports) and the country's economy will collapse. similarly, if a colony produces everything it needs internally and can even export some in some areas, it will become very rich indeed. a successful economy must export goods (nowadays 'goods and services,' but `pre-1750` mostly just 'goods') of a higher value than the goods it imports.

so for example, to use nathan's example, maybe there would be a colony with a gold mine, so obviously producing goods of a fantastic value, but maybe not enough fertile land to be able to produce cotton, so they have to import all their cloth. maybe there's so little fertile land they have to import some food? the other colonies would therefore benefit economically too, cos they can export their cloth and food etc. to that colony. (actually, i'm really not sure whether food exports/imports ever happened in that period...)

it would be interesting to add in europe into the economy model. which goods would be exclusively imported from the mother country, and which exclusively exported there? the colonial powers certainly weren't in the business of setting colonies up only to allow all their produce to be freely distributed around the world; a chunky amount of exotic caribbean produce (and/or gold) would have to go back to the mainland from each colony. however, some things would have to be imported from the mainland - luxury goods maybe?

so to set up a 17th/18th century caribbean economy, the first task has to be to decide what each island produces, in what ratio to one another, what they have to send to europe (usually gold, and specifically caribbean things like spices) and what they can import from europe (`non-rottable` things!). also perhaps we could say that if a town has an excess of something it wants to export but there is no demand within the caribbean, then that could be exported to europe (and the town would still get an income from those exports).

maybe also to be decided is how much fertile land there is around each colony, and how much is used. spare fertile land means more available for producing cotton (and other things that have to be grown but aren't food). if immigrants come in they would go to work on the land to produce food; if there was no spare land, food would have to be brought in from somewhere to feed them; if no food could be imported (if none of the other colonies has an excess), then the population would recede back down to the original level, but if food could be brought in for them, then those new immigrants would be able to give a boost to other `non-agricultural` industries and the town would have more goods to export etc etc

finally random events, such as plagues, mining collapse, shipments not making it across the atlantic etc etc would have to be programmed in to give the whole thing some randomness.

like, well done if you've read all the way to the end of that hehe <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />
 
I should know those two words but I don't... the second just looks like nonsense. The other untranslated word, "imya," means name, so it's about the name of the model/texture I guess.

Can we use those prospective sliding doors with a (`Star-Trekish`) "whoosh" sound effect?
 
by the way, why have and been turned off in sigs? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
KIERON!!!!
Welcome back! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
Nice to here you're still around, even if busy.<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
(response lower)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Inez: It means, I think:
By adding these attributes you tell the engine to continuously move the texture over the object. The value of each is the magnitude of the change per second in U or V (and since textures tile, values of U or V above 1.0 have 1.0 subtracted from them, i.e. the range is 0<=u/v<=1.0). Now I may be misunderstanding and they may mean the inverse (number of seconds per 1.0 u/v displacement).
The u/v 0 and 1 are because of multitexturing; some objects have more than one texture layer (i.e. for water I assume they mean diffuse layer and specular or bump layer, or diffuse layer and lightmap layer--but they use vertex lighting, never mind).
The reason the speeds are different is to suggest greater complexity to the water (i.e. bump and diffuse moving at different speeds makes it look like there is more to the water than just if the two moved at the same speed).

Note this is not from any knowledge of Russian (just interpolation from what I know of 3D work), so I may be quite wrong.

I don't think it will be terribly helpful for sliding doors--well, possibly; but better to do that with a looping `postevent-called` teleport for a `door-shaped` character--because this make no difference to the character patch. And if you took the time to set up a function to set the sliding, wait the amount of time for the sliding to finish, turn the sliding off again, and exchange characterpatch...you might as well do it the other way.
 
Kieron: Ah! Insight and education arrives. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
Which I certainly admit I lack. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
{But hardly ever has the lack of knowledge prevented me from conversation or even dispute, so, onward!.... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />}

While I agree with you in most or all of what you say, I'm not sure that your beginning background applies to colonies.
In that unlike Europe, inhabited (strenously) for centuries, there was a goodly amount of uncleared--or at least unused*--land on the islands. And that, combined with immigration as you say, is my reason for suggesting such an increase in population (and also my idea about land as an attribute that increased; that the land there was not necessarily instantly ready for agriculture, and thus the clearing and readying would take time).

Now it also may well be that death rates of such a climate outstripped any gain from births...

*This is not to say it was never used, but that from epidemic and force many of those who had previously used it had died.

And in regards Wealth.
I take some issue with your statement "wealth was possessed by the nobility and the church..." and so forth; in that the people then certainly _saw_ it that way; but true wealth is not a case of what is believed to be true, but what _is_ true; and true wealth is not in gold (or any other money), but in goods and people and what and the rate of the former the latter produce.

Hence, however jarring, my use of modern terms; in that we seek to simulate the economy, we should do our best to be accurate to what that economy actually was, not what that economy was thought to be.

{And here let it be said that we should not necessarily write our little national AIs to make _good_ choices; on the contrary, to make what choices those at the time _thought_ were good, but were often orthogonal if not detrimental to their nations' economies}

So I certainly agree with you that people at the time did not see things that way, but I think that seeing things that way gives us a truer picture, and better tools to simulate with, than to see it the way _they_ saw it.

Now, in regards to imports and exports.
Absolutely right. I was wrong, but also I mistated. By the attribute economy I mean not only net wealth, but also the _activity_ of the economy; and so in that guise while having a bad import/export ratio is detrimental to _net wealth_, it is pretty much orthogonal to activity (which only cares that something is happening). Jobs for those doing the physical importing, for example.

But again, I see your point; if there's no money for the importing, then no importing is done (except by order of the nation), and thus no activity on that side.

My reason for trying to use economy that way, i.e. as "the life of the colony" rather than just net wealth, is because to some degree I think, even if such a full simulation as we're going into is possible to _write_, I don't know that POTC will be able to execute it in a timely manner.

Thus my thought for shorthand, i.e. activity, and we could increase it based on the pchar's actions and based on other ships' actions trading with that town, and not worry so much about import/export balances.

In regards to random events, I agree totally. But also that there should be positive events (gold deposit, boon crop, etc.).
 
Hi Kieron, good to see you... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->Cat:
Re: founding of colonies, and colony/`mother-country` balances. Good idea, but I think it may be beyond the scope of this; while splitting exisisting colonies is a relatively simple thing, adding an entire backend devoted to nations making entirely new colonies is I think a bit too much work.[/quote]Well, I was speaking in a "set 'em up" direction - nothing necessarily VISIBLE, other than from time to time the colony gets an influx of money or immigrants or goods from the mother country - you wouldn't see it, except perhaps in a logfile entry, and you might notice a new good at the store or more town money - the economy perks up, or something like that... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

Hi Kieron, I welcomed you in another thread. Great to have ya back! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->but better to do that with a looping `postevent-called` teleport for a `door-shaped` character<!--QuoteEnd--></div><!--QuoteEEnd-->
I don't get you - if it is possible to make a door slide with a "looping `postevent-called` teleport" (I like that expression), why not run out a cannon the same way ? (Before you were asking if we'd figured out how to set geometry to a location without using locators: well *I* certainly don't know how to do it, but I wish I did.)
 
thanks cat and inez <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

nathan - not sure what you mean about the difference between what was believed to be true and what was true - either way, i still think that the vast majority of the population (peasant farmers) in a `pre-1750` economy had very little wealth, in whatever form; they lived off what they could produce themselves from the land and the little they had left to sell to the (small) artesan/merchant class, once they had given the best of their harvest to the noble (or church) who owned the land they worked. if there was an influx of wealth into the economy via trade, it would be the merchants/artesans and nobility/church who became wealthier; the peasants' standard of living would be little improved - they had no way of gaining access to any of that wealth (they were already producing all they knew how to, and that didn't increase until the agricultural revolution in europe). the `pre-1750` economy was all about this steady state; it was nothing like the `modern-day` situation where (in theory!!!!) a dynamic economy does indeed mean a higher standard of living for the common man.

you're probably right about me being too eurocentric - perhaps there was ample free fertile land in the colonies, so there would be no worries about producing enough food.

also you're probably right about this maybe being too `in-depth` for potc hehehe <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />

this is a very interesting idea:
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Maybe it's best to have some mix types as well.  
Or, perhaps even better, to have a single town and multiple "business types" under it, i.e. gold mine business, port business, plantation business, etc.  
And the town's max economy is the _sum_ of the max economies of those...  <!--QuoteEnd--></div><!--QuoteEEnd-->

there's a game called superpower 2 i've been a bit addicted to (which admittedly isn't <i>that</i> good, i just love it cos am a ruthless world conqueror at heart <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" /> ) which simulates economies in that way - it calculates the supply and demand in each industry in each sector of the economy (agriculture, energy/fossil fuels, raw materials, secondary materials, finished goods and services), and calculates what the country can import/export based on that. maybe the model could be `much-simplified` and adapted to the `pre-industrial` economy for potc?

another idea (much less elegant!) would be to simplify the model completely and simply have it based on a combination of `randomly-kicked`-off tendencies (such as 'rising prices in isla muelle' or 'population decline in douwesen'), which take effect over a long time, and random `one-off` events. again as i said in t'other thread, maybe there could be a very slow `long-term` tendency for certain powers to become slightly stronger and certain to become slightly weaker?

whatja fink? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->nathan - not sure what you mean about the difference between what was believed to be true and what was true - either way...<snip>...the `pre-1750` economy was all about this steady state; it was nothing like the `modern-day` situation where (in theory!!!!) a dynamic economy does indeed mean a higher standard of living for the common man.<!--QuoteEnd--></div><!--QuoteEEnd-->
Oh, I agree, {and not least on the !!! bit!...but I never brought up the betterment of the common man (which, sad as I am to say it, is immaterial to the modding side of our discussion)}.
My two points were:
In terms of the belief bit: Mercantilism.
That people did not "get" the fact that wealth is resources, human and otherwise, rather than gold and jewels; and the only other benchmark for wealth--beside "what it can do for you"--is how much others want it. (And let me note here that if you find the idea of me arguing for the validity of free market economics funny, you find it not half so funny as I do...but I note that we are discussing an Age of Piracy...)
Mercantilism is not only an incorrect description of economics, but an _actively_ wrong one (see Spain, Decline Of); especially in such an age of war and piracy when one was only as wealthy as one had weapons and men to defend said wealth; when wealth followed power and not the reverse, and Mercantilism was all about ignoring power--and real wealth--for simple coin.

My second point is in regards to land and the socioeconomic structure in the New World. If you are eurocentric I am at least equally guilty of being `NorAm-centric`; my view of the Caribbean colonies is to some degree shaped by what I know of the North American colonies.
But I think in the Caribbean such a staid structure was not in place because:
1. Death rates were very high, IIRC (illness of course, but also war and piracy). Especially among slaves.
2. Population density was very low compared to Europe, and I still believe (though I really ought to research further) below what the land could support (_certainly_ below what the land could support if it were devoted to food, not cash crops).
3. One could "get rich quick" in the Colonies, and that was as often as not the reason for going there, and so population _turnover_ was very high.

Basically, the peasant:middleclass:nobility ratios were far different from Europe proper, and to a certain extent there _wasn't_ really a class of traditional nobility because the land was not in the title of the nobility (or at least not controlled that way).

Please append an "I think" to most every sentence, BTW; Boy, I really do need to read up on this...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Regarding implementation.
I doing that--a `business-based` simulation--is indeed a very good idea; thus town types are not hardcoded, just a general mix of business (i.e. port business > x%, it's a port town).
We describe good inputs and outputs for businesses (at some base level); assign a level of each business to a town (and to Europe), and let her rip. Where also coin is both an input and an output, and once coin reaches a certain amount we up the business level.
Assuming there's either population to support it or there will be (some fudge factor here? As it's a chicken and egg problem, that...)

I _really_ don't like it being purely random. Even if intellectually I know we can get the same end effects by careful scripting of randomness, it just won't _feel_ right to not have it be a real simulation. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

Regarding random events.
I've been thinking a bit about the different ways P!G (that is to say, P!, since the gameplay is essentially unchanged in Gold) and SMP handle them.
In P!G, it's all behind the scenes--if the RNG kicks out a 10, we have an indian attack, say. In SMP in contrast, there are actual Indian villages that send out raiding parties, Jesuit missions that receive and send out immigrants, and small settlements that sound out governors (economic boosts).

I'm ordinarily a fan of the latter approach--that is to say, I like my events to have causes, especially `user-modifiable` ones--but I'm a bit put off by how deterministic that makes the random events.

So I think really we're talking about three things.
1. An economic system for towns (and nations, actually)
2. A fleet system, to handle the interaction between islands and to Europe and back
3. A random events handler, which does things to both of the above, but whose events can also be normally caused (i.e. a trade fleet may be sunk by a storm--or by the player! Or conversely rescued from the storm by the player).
 
<!--`QuoteBegin-Inez` Dias+--><div class='quotetop'>QUOTE(Inez Dias)</div><div class='quotemain'><!--QuoteEBegin-->
I don't get you - if it is possible to make a door slide with a "looping `postevent-called` teleport" (I like that expression), why not run out a cannon the same way ? (Before you were asking if we'd figured out how to set geometry to a location without using locators: well *I* certainly don't know how to do it, but I wish I did.)[/quote]

Ah, sorry, I left out an important word: _character_ teleporting (so it works only in locations).
What I mean is this:
{NB: I'm doing this using quest cases rather than postevent() because if the latter I'd need to set an event handler and write a function; this way I just call a quest case; but the postevent("moveobjects_event", delay) route is fine too, and allows for passing variables to the function rather than using pchar attributes. }
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    //whenever you want something to start moving:

    pchar.moveobjects = "";

    pchar.moveobjects.(id of character to move) = "";

    pchar.moveobjects.(id).final.x = final_x_coord;

    //likewise with y

    //z

    pchar.moveobjects.(id).rate.x = rate_in_units_per_sec_for_x;

    //y

    //z

    pchar.moveobjects.(id).active = true;

    Lai_QuestDelay("moveobjects", 0); // start the movement handler.<!--c2--></div><!--ec2-->
Note we could simplify this by assuming constant rate in all three axes and then just passing time til arrive at final, rather than rate.`x-z`. As it is, if you want to set a time rather than a rate, you have to do some math in those assignments.
There are times when one route is helpful, and times when the other is; we _could_ just write it both ways and check for the presence of either attribute to determine what to use.
then in q_reactions.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "moveobjects":

    //note some of these variables may already be declared; I know pchar is.

    aref tree; makearef(tree, pchar.moveobjects);

    aref attr;

    ref chr;

    float x,y,z;

    int i;

    bool done = true;

    bool alldone = true;

    for(i = 0; i < GetAttributesNum(tree); i++)

    {

 makearef(attr, GetAttributeN(tree, i));

 if(!sti(attr.active)) continue;

 chr = CharacterFromID(GetAttributeValue(attr));

 GetCharacterPos(&chr, &x, &y, &z);

 if(abs(stf(attr.final.x) - x) < stf(attr.rate.x)) x = stf(attr.final.x);

 else { x += stf(attr.rate.x); done = false; }

 //y

 //z

 TeleportCharacterToPos(&chr, x, y, z);

 if(!done) alldone = false;

    }

    if(!alldone) Lai_QuestDelay("moveobjects",100);

    else DeleteAttribute(&pchar,"moveobjects");

    break;<!--c2--></div><!--ec2-->
The 100 means 100ms, or 10x per second. We could decrease that and also decrease the rates proportionally to make for smoother movement.

I have not tested this, but my syntax highlighter isn't finding any errors, so it'll probably work (if you add in the Y and Z cases, and use a real ch id).
 
Um, if you go the time (rather than rate) route, you need to add an incrementing counter to the tree to say how many times you've done the questcase (and thus how much time has passed).
 
Once again, now in the correct thread:
I really like NKs improvements of th game economy model. It made trading and trying to influence the development of certain colonies much more interesting. After playing with A&M islands I was wondering if it is possible to change the model even more to a real colonial economy (including investment possiblities for Cat) once there are more islands available.
Finished goods from Europe (clothes, weapons, luxury items, tools) arrive at bigger colonial gateway towns (1 per nation) and distributed (at high prices) to smaller colonies (this could be strictly separated by nations - official traders only deal captains of their own flag,... Spanish tried to keep the English out, English passed the Navigation act to keep the Dutch out, therefore giving much more possibilities to ingame smuggling). Colonial products like tobacco or sugar go the same way back (cheap in the small colonies, expensive in the gateway ports). The new item "tools" could be used as a factor in the economic development of the colonies.
 
Arr...ye have another economist on board, now, and one with more than just a passin' familarity with market economics, which is really what we be dealin' with 'ere. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

I've sketched down a set o' rules an' assumptions fer how an economic model could be forged just from supply and demand, so I'll run it up the flagpole and see who shouts 'Avast!'. Plus, so's not to cause confusion, I'll get the local governer's daughter ter write it down, so ye don't have ter translate my nautical tongue. Arrrrr!

Economic Model: Carribean Colonies
------------------------------------------

First of all, this isn't necessarily going to be a perfect, exact replica of economics in the 1630s, not least because the important thing is that this must not detract from game balancing. What I'm writing will have two purposes: a) to make the economic situation more realistic, and b) to attempt to make interaction with the economic system more fun for the player.

Throughout, rates are described in terms of, for example, 1 gold per 10 population. Obviously, the matematical figure of the rate would be 0.1, but its far more easier to discuss the rates in context.

Fundamental Economics
----------------------------

Rule 1:

The underlying law of market economics is the supply-demand relationship. As the price of a good falls, demand for it increases (e.g, cheaper rum = people drink more rum) - vice versa, as the price of a good increases, demand for it falls.

Rule 2:

The market always seeks equilibrium. Price will always change to a level where demand and supply equal each other (e.g, the supplier always wants to sell everything they make, so if they make too much they will lower the price)

For the purposes of this model, price change to equilibrium can be assumed to be instantaneous.

Rule 3:

Demand is changeable. Supply is fixed (e.g. once you've planted your harvest, that is how much you will reap. You can't realistically increase it in the short-term). As a result, price changes only affect demand.

In reality, increased prices would lead, in time, to an increased supply as more entrepreneurs would be attracted to the industry. For simplicity's sake, this model ignores the impact of supply change due to competition.

Supply is also dependant upon population. This will be covered in greater detail in Rule 9.

Rule 4:

The change in demand due to a price change is not the same for all goods: this is called price elasticity. The general rule is that essential goods are price inelastic (demand is fairly static) and luxury goods are price inelastic (demand varies wildly with price).

An example of this is the difference between food and wine. The average person needs to consume a certain amount of food. If the price rises, they still need to eat the same (ie, demand doesn't change much). Likewise, even if it falls, they aren't driven to eat much more. Wine, on the other hand, if its price falls will cause much revelry in the governor's palace (demand rises significantly), but should its price rise, the governor will throw far less wild parties (demand falls significantly).

Elasticity is represented as the difference in ratios between the price change and the demand change. If the price rises by 10% and the demand falls by 1%, the good is price inelastic (ie, a necessity such as food). If the price rises by 1% and demand falls by 10%, the good is price elastic (ie, a luxury such as chocolate).

Rule 5:

All goods are consumables (at least, in this game they are), meaning that demand signifies the rate of depletion of that good from the town's stores (e.g, per week).

Supply represents the amount of the good that is produced (e.g, per week). It is NOT the amount of the good at the merchant's store - that is a separate amount which also takes into account the natural level of trade in the Caribbean.

If you wanted to be *really* technical, some of these goods would have a varied supply depending on the season. Using a weekly rate is not realistic, but is simpler for coding purposes. It could also be considered at a daily or monthly rate - the longer the time period, the more relative impact the player would have on trade.

A per week rate is assumed to be an average for the entire year. Again, unrealistic, but avoids the need to implement seasonal variations in supply and demand.

Rule 6:

There is no rule 6.

Rule 7:

For simplicity's sake, normal demand levels are assumed to be the same in every Caribbean town. Temporary demand shifts could occur as a result of random events. A demand shift is where demand rises or falls to a new level INDEPENDENTLY of price change. As a result, the return to equilibrium will cause the price to rise or drop sharply, depending on which way the shift went. This will then be the new equilibrium point for that colony.

For example, it becomes a fad amongst Portuguese high society to offer four different wines for every course in a meal. As a result, demand for wine increases dramatically in the Portuguese colonies. Because supply is unchanged, the price for wine will also increase dramatically. The new point reached, however, will be stable - and that will become the new 'normal' price for wine at that colony.

Rule 8:

Different towns have different supply capabilities, which are fixed (e.g. particuarly good sugar-growing terrain) and cannot be replicated as effectively elsewhere. These towns will have a comparative advantage over their rivals, being able to produce selected goods more efficiently. Likewise, towns may have naturally negative supply conditions (e.g. a lack of nearby forests = less efficient planks production).

These supply conditions are unlikely to change much, if at all, over time. For the purposes of this model, quality is assumed to be irrelevant.

Rule 9:

Larger populations create a greater supply. The total population (e.g. 100 men) is divided amongst the goods being produced by the colony. The weighting of that division (ie, what ratio produces sugar, what ratio produces grain) can be assumed to be static, although it will likely differ for different colonies for luxuries production. Essentials such as food, planks, etc. will probably be identical, or at least highly similar.

Each good's supply is defined by the production rate for that colony multiplied by the number of citizens producing the good. For example, both Redmond and Oxbay are capable of producing 2 Wheat for every 1 man (production rate of 2)assigned to wheat production. If 100 men work as farmers, both produce 200 Wheat per week (if that is the given time period).

However, if Redmond has a set of particularly good distillers, they would be capable of producing 5 Rum for every 1 man, compared to Oxbay's rather meagre 1 Rum for every 1 man. As a result, Redmond will always be a more efficient rum producer.

Also, Redmond will have a cheaper price for rum. Both Redmond and Oxbay demand rum in the same quantities (Rule 7: demand across all colonies is static). However, because Redmond's supply is greater, its demand-supply equilibrium will be at a lower price level than Oxbay's. No matter how depopulated Redmond gets, it will always produce cheaper rum (random factors ignored), therefore it will ALWAYS be a viable trading proposition, although perhaps not for large ships.

Rule 10:

Surprise surprise, larger populations also create larger demand. The ratio of demand is, again, weighted by the different goods in exactly the same way as supply.

For example, the demand for food is 1 Wheat for every 1 man. Note that if taken with the example in Rule 9, this would mean that the colony is producing twice as much food as it needs. As a result, the price of food would be VERY low, as food is an necessity (ie, price inelastic) and so it takes a proportionately larger decrease in price to increase demand.

These figures are, naturally, rather extreme - but serve to illustrate the workings of the economic model clearly.

Finally, and briefly, here is a division of the tradable goods in POTC to reflect Essential vs Luxury status:

Essentials:

Balls
Grapes
Knippels
Bombs
Sailcloth
Planks
Wheat
Rum

Luxuries:

Ebony
Chocolate
Sugar
Wine
Linen (?)
Tobacco
Coffee
Mahogany
Cinnamon
Copra
Paprika
Fruits
Ale
Silk
Clothes (?)
Cotton
Sandal
Leather
Oil

Due to the reliance on the navies (and for game balancing) all naval goods are assumed to be treated as essentials. Cheaper rum would not, for example, result in Captains giving much larger amounts of rum to their crew - nor would it cause the production of more ships!

Goods such as Linen and Clothes could be argued to be treated as essentials, although it depends on what 'kind' of clothes, for example. Its important to note that, as the description of trade will point out later on, that essentials with their low price elasticity generally make poor choices for trade goods. Therefore all goods that were meant to be 'traded' rather than used are considered luxuries.

The only essentials are essentials to the player. The only essential of a town is Wheat.

The Unique Price Role of Essentials (particularly Wheat)
----------------------------------------

If a town is starving, its population can realistically be assumed to be paying hand over fist for food. When a colony is suffering from starvation, the price of Wheat would be expected to at least treble.

If it is desriable to have governor's be far sighted, as Wheat storage falls below a certain threshold of distance between stored vs. demanded, the governor might offer to temporarily pay a higher than normal price to ensure that the stores of wheat in the town are kept at a safe level. This, if implemented, would stand true for all other essentials, as well.

This price rise would be caused by the governor, on behalf of the town, buying food (ie, a demand shift). As a result, the price would rise to form a new equilibrium point. When enough food had been bought, the governor would stop, the price would return to normal.

From a coding point of view, it is important that this demand shift doesn't cause the governor to then say "Arrgh! Now demand-supply is even closer to the danger levels! I'd better buy even MORE food..." and cause a vicious circle that would lead swiftly to starvation.

----------------------------------------------------------------------------------
==============================================
----------------------------------------------------------------------------------

The above set of rules deals with the natural economic interaction of supply and demand in an individual colony. The following section deals with linking market economics to population growth, population wealth and trade.

Rule 11:

Population growth is a set rate of population increase/decrease for every colony. Its natural level will be positive, representing the fact that a) birth rate is likely to be higher than death rate, and b) immigration to the area is steady.

Population growth rate may be affected by several factors:

a) A colony suffering from disease will lower the rate of growth as death rate rises.

b) Less immigrants / more immigrants in a particular time period will affect population growth. For example, a particularly good Jesuit preacher might attract immigrants to the town, where rumours about a repressive, uncaring governor might lower the amount of wealth-seeking immigrants.

c) A wealthy colony will attract a larger number of immigrants than a poorer one. One way of representing this would be to have a set number of immigrants per month and distribute them according to the different ratios of wealth of the different towns, with a flat 2% to each town irrespective of wealth.

Note that the effect of c) will be small, as the majority of 'wealth' is held by the merchant and noble classes. The average peasant will be no more nor less wealthy - indeed, they might view their opportunities as being better in a poorer town.

d) A colony's stored Wheat is less than demand. A portion of the colony's population will starve: this is calculated by the shortfall in supply multiplied by the rate of demand for Wheat. For example, if Oxbay demands 1 Wheat per 1 man and has a shortfall of 50 Wheat, then 50 men would starve.

In addition, a colony suffering from starvation would have NO population increase. No new immigrants would arrive, and the population growth rate may be temporarily set to negative to represent emigration from the colony. Also, the demand for luxuries would most likely shift down (ie, fall) and not return back to normal until starvation had ended. This would result in lower prices for all goods.

Rule 12:

Population wealth is defined as the amount of gold that a colony possesses. This is a representation of the colony's total potential buying power, including all peasants, merchants and nobility. The proportions would, naturally, be weighted in favour of nobility, then merchants, then peasants, but these are largely irrelevant for this model, which assumes that the ratio between the three classes' sizes remains static.

To a certain extent, population wealth also includes the goods stored in a colony, and the capital investment of that colony (buildings, infrastructure, etc.). This will be considered in Rule 15.

Population wealth naturally rises over time. This is determined by four major factors: a) the creation of wealth and items of value by the colony population, b) trade and other economic activities - e.g. governor, blacksmith, shipwright, loan shark, tailor, tattooist, etc.

The next three rules deal with a) and b) in greater detail.

Rule 13:

Internal wealth creation a) is a variable rate. This represents that colonists, left to their own devices, will attempt to better themselves. They will earn money, acquire possessions and add to the value of the colony through taxes, labour, etc. No matter how rich or poor the colony, these activities will continue.

This represents the return of investment into the colony by its inhabitants, its mother country, etc. As a result, it may never fall below a certain level (e.g. 1 gold per 10 population).

The rate may increase above this level as a result of increased investment in the colony, whether directly or indirectly. Sensibly, an upper limit on the rate should be defined as well to prevent the creation of runaway boom towns.

The amount of gold added to the population wealth is defined by population size. For example, the rate may be 1 gold per 10 population, therefore a larger town will generate more internal wealth than a smaller one.

Rule 14:

b) represents the added wealth that is generated through successful trade. The situation up to this point describes several colonies who are self-sufficient in all essential goods, produce a notable excess of some luxury goods and have a notable shortfall of others.

When a player sells an item or a good in the town, the gold is transferred from the town's wealth to the player's wealth. In order to prevent 'cleaning out' of a town's wealth, and to represent that the merchants don't own have the rights to all the gold in the town, the town's wealth should be divided between the street merchant, the storeowner, the shipwright, the loan shark and the governor (ie, those who give the player money from what could ultimately be considered the town's wealth)

NB: This would need quite a few lines of code to 'check' whether or not the town can afford to allow the player to sell (x) to them. It would also create the interesting and amusing situation of, for example, a governor delaying payment to the player until a more convenient time...cheeky bugger!

In reverse, all gold given by the player to anyone in the town (except illegal types, such as the smugglers!) is added to the town's wealth.

Also, to represent the knock-on effect of commission on sales, import duties and the generation of wealth along the supply chain from the producer to the merchant and from the merchant to the end buyer who consumes the object, 10% of the value of everything bought or sold is added to the town's wealth.

For example, if the player buys silks worth 600 gold, the town has generated 60 gold of wealth in the production and sale of those silks. Likewise, if another town buys those silks for 1000 gold, they can expect to gain at least a further 100 gold from their resale and use.

The money added to the town's wealth in this manner (ie, through selling things to the town) should not be added instantaneously, to avoid the eerie situation of a merchant magically creating more money in his pockets as you're selling to him. It should wait until the next economic 'cycle' is calculated to be added.

Its a long rule, but its purpose is to ensure that the player's trading makes a town more wealthy in the long term. Also, the more valuable a good is, generally the more valuable the associated industry; hence trading diamonds or wine will bring greater wealth to a town than trading rum, which stands to reason. Also, trading in larger volumes will generate greater wealth.

Rule 15:

To represent that not all of the gold available in the colony is in circulation, 20% of the town's wealth is completely untouchable for any purpose (including if the town is plundered). This should prevent any economy from every becoming destroyed.

In implementation terms, this means that 20% is ignored, and then the remainder is divided between the governor, merchants, etc.

Rule 16:

Exceptions to the above rule include the provision of services. The governor pays the player for privateering work, etc. out of the town's wealth and no 10% is added to wealth. The loan shark, likewise, does not gain 10% by loaning money to the player. The loan shark's profit for the town is represented by the additional money given back by the player as interest.

The governor is an interesting exception. As privateering work makes the trade lanes safer and increases the colony's strategic position, the rate of wealth increase, a), goes up slightly.

It would also be sensible to ensure that there were ways implemented of lowering the rate of increase as well.

Rule 17:

As a side note, the rate of wealth increase a) is also, as you might have worked out, the rate of inflation. In this model, the effect of inflation on the prices of goods is ignored for simplicity. However, to stop colonies amassing truly vast sums of money over time, some means of removing money from the system needs to be included.

One method would be to introduce the idea of ships returning to the mother country with taxes. Depending on the wealthiness of the colony, different amounts would be removed every so often (six months, perhaps?). At the wealthiest level a colony will be allowed to reach, the colony should send everything above (x) figure of wealth as tax, to cap a sensible maximum on the amount of gold available in the Caribbean.

Rule 18:

Stealing shamelessly from Sid Meier, colonies are divided into discrete categories of wealthiness depending on their wealth. As their wealth passes certain lines, the colony will change its status. The effect of piracy on incoming / outgoing trade, of colonies being sacked, disease and disaster, etc. could result in large amounts of wealth being lost (ie, lowering the status of the colony).

Wealthier colonies would be expected to pay higher prices for luxury goods (representing the fact that the richer classes would have the money to pay the far higher prices to import goods from Europe, etc.) As a result, colonies above an arbitrary average would have positive demand shifts for luxuries for every level. Vice versa, colonies poorer than average wouuld have negative demand shifts and consequently lower prices for luxuries due to lack of free income.

Rule 19:

Related to wealthiness, poorer colonies would have a proportionately larger number of potential pirates lurking in their taverns, eager to risk anything to get away from their current situation. Richer colonies, with a wider set of opportunities, would have proportionately less men willing to turn to piracy.

Population size is also a major influence on recruitment, with a fixed percentage of the population being the maximum amount recruitable (e.g. 2%), then modified by the town's wealth.

====================================================

Offhand, I think that be a darn straight outline o' how ye could write in a true market economy model into POTC. All the remainder would be yer random factors. Maths no' bein' my strongest point, I've not a given ye any actual equations for relatin' demand to supply, or used too many hard-and-fast figures in my examples.

I think its all fair' straightfor'ard, and ye can at least see where I'm a' comin' from. Just don' ask me ter try ter implement that into th' code!

This certainly isn't a completely workin' model - Jim Hawkins' suggestion is a good 'un - this model assumes that every colony consumes all the goods itself, where in reality some would have been exported to Europe.

Again, the self-sufficiency of the colonies is very robust in this model. Starvation would only last for a single economic cycle, as would depletion of any essential good. Good? Bad? Hard to say...

Finally, this model was based primarily on the original mapset, with each country only having one colony which must, at all costs, be kept in working order. Again, that could be good or bad.

Comments, thoughts, criticisms...all 'll be 'ppreciated.
 
Back
Top