[MODCOMP] Resource planter modcomp

Joined
Mar 29, 2006
Messages
795
Bastian-Bux planter mod, based on gordonthewhale's agriculture mod Version 0.81

What it does:

1) The farmer and farmboat units do all the resource "planting"

2) you can plant all animal and plant resources that you have access to IF you have a fitting fertile land area. This isn't allowing you to place ressources everywhere. But it allows you to better specialize your towns.

3) it even allows the same with water based animals and plants (using the workboat for this)

4) it has included everything that is needed to add the 12 additional resources to be found in ViSa 3. Only thing needed is some easy uncommenting.

What it doesn't:

1) I didn't plot-balance the Boni yet. At the moment the "fertile land" boni just "compete" with the other boni for a plot. I need your feedback on how to solve this best.

2) I haven't found a way to hide the information what will grow where from the player and still give away what each bonus does in the worldbuilder. So for now players will be able to see, what code number each fertile plot has.

3) There is a known bug with the silk plantation. I have to assign the LSystem (if I'd know what this is ^^).

4) The farmer and farmboat unit share the same graphics with the worker and workboat. As much as I would like distinct graphics for them (a different shade would already be great), this is much beyond my skills.

Inside the zip is the ONLY my Add-On. First you have to download gordonthewhales SDK modcomp, add his agriculture mod on top, and finish the cake with my add-on.
I hope you have fun, and give me some feedback. ^^

------------------------------------------------------------------------

Imagine the following: all plant and animal resources on terran maps are removed. INSTEAD their places are changed to "fertile land". Only a very select few of each resource will be pre-planted at their historic places (wheat in the fertile crescent, corn in southern/eastern north-america...). So only the civs that settle those areas can directly use those resources. And once they build a farmer/rancher/planter unit, they'll be able to spread that one resource to the fertile lands in their cultural borders. Thus they'll gain access to several units of this resource, and can trade it to friendly neighbors.

This way resources will spread naturally. No corn in Europe until an european civ either makes friends with an american civ, or conquers/builds a colony that gives access to that resource. Same is true for wheat and horses the other way around. There will be no need for any python code to do this, just plain XML to use the SDK change.

Any help is appreciated, as my coding skills are rather limited.

EDIT: 0.81 repaired a small bug (corn, rice and wine could planted everywhere if they had fresh water).
 

Attachments

  • BBsplantermodv081.zip
    54.5 KB · Views: 128
Well, only two tests started, and I already run into problems.

Number one can be seen here:



What I did was trying to duplicate grassland as grassland_fertile. The result was a tile that looks and is named as a peak, and at the same time is supposed to be a freshwater lake. Huh? All I want is a grassland duplicate, that can be placed instead of grassland. ^^

Number two is bad graphic linking. I tried to duplicate the worker, name it as farmer, and give all the advanced resource buildings to it. Well, the later part succeeded, but the graphic linking didn't any hints?

If someone could help me find my errors in those attempts, the modcomp would be almost done (everything else is only copy 'n paste work) except for the climatic control.

So help please ^^.
 
Don't panic ! you must take a look at which art "grassland_fertile" refers and add a description in gametext xmls for the farmer. That dds applied on flat terrain is funny. You must put it in the funny screenshots thread.
 
Here's an idea that might make things easier: instead of creating 'fertile' areas on land and sea, you could change it to a 'resource converter'. Set the map so that there are only one or two of each plant and animal resource (i.e. only two instances of corn occurring naturally), but spread the map with two other resources: game (instead of deer) and grain (representing local, lower-grade cereals). Farmer units can replace "game" with any animal (cow, horse, pig, etc) and grain with food staples (wheat, corn, ), as long as they are on the proper terrain.

This would make sense historically as well since most areas that were naturally productive were co-opted by agriculturalists to raise better yeilding crops.
 
Thx, and actually I do something similar ^^.

What is done till now:

I created a farmer unit, that (theoretically) looks like the worker, is build like the worker, but is able to build the new improvements from gordonthewhales mod (and only those).

I created a bonus called fertile.

I changed the wheatfield improvement from gordonthewhales mod in such a way, that it can only be build on the bonus "fertile". It still requires the civ to have access to wheat in that town.

What needs to be done now?

I have to find a way to get the farmer his correct skin (till now its a nice pink).

Second I have to find a way to make the fertile bonus invisible or only decently visible on the graphics side. For now I use an obelisk to mark it. :D

I have to create more "fertile" boni, each for a group of standard animal and plant boni that have identical climatical and geographical requirements. For example a field that is good for wheat, will usualy be good for corn as well. So the bonus "fertile_cereal" will allow a farmer to plant all kinds of cereals his city owns. So the current standard fertile will become "fertile_wheat" or fertile_cereals".
Same is true for ocean based boni.
Worst case I have to make one bonus for each possible combination of: max_lattitude, hills, flatlands, no riverside, terrain and there plantable resources.

Then I have to restrict those boni to exactly that combination, so that map scripts wont plant the "fertile_cereals" bonus in the arctic. I can't help if mapmakers do so. ;)

After that I have to create a "seafarmer", and give him access to the searesources.

Away from the graphical questions its only organisation and "copy 'n paste" from now on. So it should be quickly done.
 
You might want to have more kinds of fertile.

Some kinds of resources are simply better than others. But having access to more kinds of animal increase your ability to produce food, because different animals are suited to different areas.

In effect, each type of fertile should be upgradeable to 1 or 2 options. Then by getting ahold of a new kind of plant or animal, you can spread it over your empire and fill in the areas that you couldn't get high-quality crops for before.

You will also have to tweak the AI: the AI will trade away important crops for far less than they are worth, while players will jealously horde them. Access to a particular crop is more like a technology, whose value goes up as time goes on. Python could pull that off -- in order to plant corn, you need the CornSeed technology. The CornSeed technology is recieved when you grow your own corn (python), or if you buy the CornSeed technology from an AI. Simply trading for the corn resource doesn't do it.
 
As it stands now I'll have 34 kinds of fertile for ViSa. ^^

Spoiler :
Fertile_C1 Clam Coral Fish Pearls
Fertile_C2 Clam Coral Crab Fish Pearls
Fertile_C3 Crab Fish
Fertile_Desert Barley Incense
Fertile_Fur Fur
Fertile_G1 Lemon Coffee
Fertile_G2 Silk Sugar Banana Barley Dye
Fertile_G3 Lemon Coffee Cotton Sheep
Fertile_G4 Cotton Sheep
Fertile_G5 Lemon Coffee Rubber
Fertile_G6 Lemon Coffee Rubber Cotton Sheep
Fertile_G7 Rubber Cotton Sheep
Fertile_G8 Silk Sugar Ivory Olives Spices Cannabis Banana Barley Dye Lemon Coffee Rice Cow Pig Corn
Fertile_G9 Silk Sugar Olives Spices Cannabis Banana Barley Dye Lemon Coffee Cow Pig Corn Horse
Fertile_G10 Silk Sugar Banana Barley Dye Corn Horse
Fertile_G11 Lemon Coffee Rubber
Fertile_G12 Silk Sugar Ivory Olives Spices Cannabis Banana Barley Dye Lemon Coffee
Fertile_G13 Silk Sugar Olives Spices Cannabis Banana Barley Dye Lemon Coffee
Fertile_Lemon Lemon
Fertile_O1 Coral Fish Varech
Fertile_O2 Fish Varech Whale
Fertile_P1 Sheep Cotton
Fertile_P2 Tobacco Barley Silk
Fertile_P3 Tobacco Barley Silk Horse Wheat Potato
Fertile_P4 Lemon Rubber
Fertile_P5 Lemon Tobacco Spices Olives Barley Silk Cannabis
Fertile_P6 Lemon Tobacco Spices Olives Barley Silk Cannabis Horse Wheat Potato
Fertile_P7 Lemon Wine
Fertile_P8 Lemon Rubber Wine
Fertile_P9 Lemon Tobacco Spices Olives Barley Silk Cannabis Wine
Fertile_P10 Lemon Tobacco Spices Olives Barley Silk Cannabis Horse Wheat Potato Wine
Fertile_P11 Lemon Wine Sheep Cotton
Fertile_Rubber Rubber
Fertile_Tundra Fur Cows


This amazingly small number was only possible by two inaccuracies:

I wont apply feature dependencies, and I also "shortened" down the lattitude to 3 "areas (0-30, 30-60, 60-90). While this won't produce perfect results, it will surely allow for accurate enough planting.

How did I design those groups? Well, frex Silk, Sugar, Ivory, Olives, Spices, Cannabis, Banana, Barley, Dye, Lemon, Coffee, Rice, Cow, Pig and Corn all can be found under the following conditions:

Lattitude 0-30, flatlands, river, grassland

So the bonus Fertile_G8 will require those conditions. And this bonus Fertile_G9 will allow for one of those 15 improvements.

Hope I'm not ignoring a much more simple possibility to solve this ^^.
 
OK, time for bed now. For those of you eager to test it, I packed my current work. Just add this Assets folder to the mod of gordonthewhale (don't forget his SDK first though). ;)

Till now I only added the 17 "boni" for the vanilla land resources AND only implemented 3 of those (Fertile_P2, Fertile_P3 and Fertile_P4) as requirements to build a wheatfield.

Let me tell you: it works as intended. ^^

Yes, there ain't any texts yet, and there still are those two ugly graphic problems. But the idea itself IS working. I haven't tested it yet with imported resources, but I don't see a reason why it shouldn't work.

Well have a good night (or day). I'll hopefully be able to finish this modcomp tomorrow, or latest this weekend.
 
Want a really simple one?

Fertile_Resource
is a tile that can be planted with that particular resource.

These are distributed using the same rules as the resource would usually, then a small area is created in which that resource is "native" and actually growing (maybe as little as 1 or 2 tiles to start).

Toss in a small chance that a potential tile will "spontaneously" grow the crop (sort of like mines) if you are in contact with a civilization who has that crop, and voila -- simpler.
 
Yeah Yakk, simpler. But also less flexibel ^^

OK, a short update what I did this morning:

after having a brilliant idea about organization tonight, I designed 66 new boni to replace the above mentioned one. 63 for land, 6 for the water. While several of them are quite useless (frex the 12 snow and 3 peak boni) they prepare the field for further development of other mods. Actually 41 (45 for ViSa) of those boni are "active" (the others I commented out).

I also decided for each of the 21 (33 for ViSa) resources on which "bonus" they can be planted.

Whale for example can only be "planted" on O6 (a polar ocean plot).

Naming Conventions:
Terrain Grass=G Plains=P Desert=D Tundra=T Snow=S Coast=C Ocean=O
Lattitude 0-30=0=Tropical 30-60=3=Temperate 60-90=9=Polar
Hills Flatlands=0 Hills=1
River NoRiverSide=0 NoRiverSide=1

So G001 would be a fertile tropical flat grassland with river access. On such a prime place you could plant one out of 10 (15 for ViSa) different resources.
On a T610, a fertile polar hilly dry tundra you could hold reindeer or have a fur farm.

Till now I only changed the improvements of gordonthewhale, thus only cow, horse, pig and sheep as well as wheat, corn and rice. The remaining 14(26) improvements I'll develop this afternoon, once I figured out how gordon implemented those improvements. ^^

I'm still having problems with the graphics though.
 
I hereby announce the release of v0.1 of BBs planter mod ^^.

Actually its an add-on to gordonthewhales mod.

What it does:

1) only the Farmer unit can now plant resources
2) it limits the place where you can plant resources. You see a little green obelisk? Well, there you can plant some resources. Not all of them though. Only those that could dwell there naturally.
3) Graphics are just fine ^^

What it doesn't:

1) it doesn't increase the amount of plantable resources (yet) above the 7: wheat, corn, rice, pig, cow, sheep and horse. But everything is prepared to go on from there once I figured out how to add a new Build_improvement_xyz mission
2) logically following from this, the farmboat isn't active yet.
3) I didn't plot-balance the Boni yet. At the moment the 13 "fertile" boni just "compete" with the other boni for a plot. When I manage to activate more improvements, this will be rather difficult (you don't wont less marble, don't you?).

Inside the zip is the Assets folder that can be used as add-on to gordonthewhales mod. Plus I also included an xls file showing which fertile plot bonus is good for which resources. Download from the thread start post. ^^
 
So, the problem with the "set list of types" is that some food resources are simply better than others.

Meanwhile, in the real world, there are areas that are best stuited to being used in certain ways. As an example, a bunch of the lands in Alberta are best used for cows.

This land isn't tundra.

In that entire list, there are no lands that can be used super-effectively for cows (outside of tundra?!) that can't be used super-effectively for pigs, lemons or half a dozen other crops.

Ideally, gaining access to a crop, even one that isn't as good of a bonus one you have, should give you a chance to plant it in areas where it is optimal. Ie: no crop should be dominated by another. Are you certain that is true with your current system?

Next, note that importing non-domesticated animals doesn't work that well: nobody has ever imported elephants for farming purposes. I would argue that anything requiring a "hunting camp" should not be plantable.

Hence the advantage of Fertile_X land that is particularly good for one kind of animal/crop. With a bit of fudging, you could even add non-tradeable techs called "access to X" that let you see the Fertile_X crops and are required to plant the X resource. So until you have access to corn, you can't see what land in your empire (or other people's empires) that would be good for corn. Once you do have access to corn, you can.
 
Well Yakk, my suggestion is:

try v0.7 of my modcomp ^^. Read the first post for more information.
 
Can this type of thing easily be modified to be used with the SMAC mod if we go that route? Obviously we'd have different terrain and resources.
 
I don't see a reason why not. I intentionally left my work as flexible as possible. I can't speak about gordons SDK changes, but after a superficial look into it (knowing no C++, mind you) I haven't seen anything that hardcoded terrains or resources.

I suppose you are thinking along the "grow fungus" lines? That would be easily doable I think. But remember: I use a bonus to make a plot "fertile". Thus you can't have another bonus on this plot anymore. Fungus should be a feature like forest anyway, so the only drawback would be that you'd somehow get around that bonus limitation.
 
Thanks B-B. I don't know our exact plans, but the ability to have terraformers plant resources (Earth-like anyhow) might need to be an option.
 
Little update:

it seems I run in an hardcoded limit. Somehow 6 of the 21 additional build missions are "forgotten" by Civ 4. I can't find an error on my side (which doesn't say that there isn't one) but I'll continue to try to incorporate those missions somehow. Weirdly there seems to be a connection to the number of units I split the missions onto. But its no simple "each unit can only do so many mission" cap.

Time for some serious experimenting.
 
OK, this IS definitely weird. ^^

I have 2-5 units that are "planting capable".

Worker
Farmer
Planter
Rancher
Workboat

I started with the idea to distribute the workload onto several units, due to fear of cluttering of the worker unit with to many symbols. And it didn't work out.

Here a few results from experiments.

Spoiler :
The first number is the number of additional missions, the second how many made it ingame.

Worker 0/0
Farmer 4/1
Planter 6/4
Rancher 7/7
Workboat 4/3
Sum 21/15

Worker 4/2
Planter 6/4
Rancher 7/7
Workboat 4/3
Sum 21/16

Worker 10/7
Rancher 7/7
Workboat 4/3
Sum 21/17

Worker 17/12
Workboat 4/3
Sum 21/15

Worker 0/0
Farmer 17/12
Workboat 4/3
Sum 21/15

Now next I tried to cut some missions (like whale-farm, and all 3 camps)

Farmer 14/11
Workboat 3/2
Sum 17/13


Now this results are extremely weird. For some crazy reason it chopped off more when it had less to do. My next attempt will be to give additional missions to the worker units (even such that don't make sense, like plant wheatfield for the workboat. ^^)
 
Well, I couldn't find out WHAT is causing this funny behaviour, but I found a workaround.

If someone has an idea why the game "eats" the last 5 build orders for the farmer unit and the last 2 build orders for the farmboat unit, please tell me.

Also any other bugs you find, will be valuable information for me.

PS: look at the thread starter post, v0.8 is out. ^^
 
Top Bottom