online games, multiplayer games
Simcountry is an Online Digital World where you are the President of a country.
No download needed!
What is Simcountry?
Beginners Info
What is Simcountry?

Global weather affects on markets. (Golden Rainbow)

Simcountry: Simcountry Bulletin Board  Global weather affects on markets. (Golden Rainbow)

Imprudent Spender (Kebir Blue)

Friday, November 05, 2004 - 04:30 am Click here to edit this post
The trick would be how to do this without excess computing power slowing down processing.


So what you'd want is some "flag" or "value" to check against, rather than something to have to recompute.


How about generating, for each country, "zone" and "land type" values. The map already gives the countries locations and land elevations, so it would be simple to come up with a formula, add fields to the country data structure, and use the formula to fill up the fields.


Then, give each commodity a "zone preference". Manufactured goods would have a '0', meaning no preference. But zone-dependent goods, such as foods, would have one. To the cost of production for a corp, add a "zoning cost", computed by comparing the commodity's zone preference to the country's actual zone. Some formula (best would be geometric or exponential) would generate a "cost" based on the deviation from the ideal zone, and when the corp's costs are calculated each month, this penalty is included as an additional cost.


In similar fashion, each commodity could have a terrain requirement. After all, a mountainous country shouldn't have lots of corn fields; a grasslands shouldn't have lots of gold, etc.

So give each relevant commodity a "required terrain type" and calculate for the country the "available space" of each terrain type. E.g. a country has space for 30 field-type industries and 12 mountain-type industries, etc. Again, a value simply set by a one-time pass through the map.

When a new corp is requested, add a check of existing industries against these limits. If a country has already "maxed out" on its use -- e.g. already has 12 mountain-type industries -- then the new corp can't be formed.


This ought not to use up much processor time: you have a one-time set up to fill in the new fields for each country, and then simply an additional check in the make-corp and calculate-monthly-costs routines which won't add to algorhythmic complexity.

Simcountry Introduction