Forts

Ok, lets run through some ideas on how to get the Bonus resources collected by forts gathered and into your cities...

1. The simplest way: It is automated and that each turn the amount collected is automaticly added to the city. You can mouse over a Good in the city management screen and if a Fort is supplying the city with a good it will be listed here.

Pros: Its Automated :)

Cons: The City that the fort delivers to would have to be assigned somehow if multiple cities are connected to the same fort. If not then the player has no control over where his goods go.

2. A Wagon train must be assigned to the fort. Once the Resource is being gathered it is added to the list of possible Trade Routes. Then a Wagon Train must be set to Fully Automate or set to Run that Trade Route. Or maybe a new Command called "Collect from Forts".

Pros: Allows more interaction with the game and more uses for Wagon Trains.

Cons: Goods not collected are lost.

3. A Goods Unit is created in the Fort. Wagon trains can be sent over to collect the Bonus. This can be all there is to it or it could be as number 2 above as well.

Pros: Allows more interaction with the game and even more uses for Wagon Trains. Goods not collected are added to the Unit to the max the unit can hold. Goods stored over the Max would just create a new unit so that no goods are lost.

Cons: The most complicated to code.
 
Ok, lets run through some ideas on how to get the Bonus resources collected by forts gathered and into your cities...

1. The simplest way: It is automated and that each turn the amount collected is automaticly added to the city. You can mouse over a Good in the city management screen and if a Fort is supplying the city with a good it will be listed here.

Pros: Its Automated :)

Cons: The City that the fort delivers to would have to be assigned somehow if multiple cities are connected to the same fort. If not then the player has no control over where his goods go.

2. A Wagon train must be assigned to the fort. Once the Resource is being gathered it is added to the list of possible Trade Routes. Then a Wagon Train must be set to Fully Automate or set to Run that Trade Route. Or maybe a new Command called "Collect from Forts".

Pros: Allows more interaction with the game and more uses for Wagon Trains.

Cons: Goods not collected are lost.

3. A Goods Unit is created in the Fort. Wagon trains can be sent over to collect the Bonus. This can be all there is to it or it could be as number 2 above as well.

Pros: Allows more interaction with the game and even more uses for Wagon Trains. Goods not collected are added to the Unit to the max the unit can hold. Goods stored over the Max would just create a new unit so that no goods are lost.

Cons: The most complicated to code.

I like 2 the best, as it allows a more "organic" transportation system than 1. 1 seems to be too abstracted to me, and doesn't take into account transportation times and capacity. 3 is good too, but it doesn't have an auto-route feature, and is harder to code.
 
I like 2 as well.

One thing, though- if you do set the Wagon Trains (and Locomotives?) up using the Automated Trade Routes system, you'll need some way to distinguish Forts from each other. Like a name for each fort.

The easiest way would be to use Fort Commanders and give them UniqueNames and then maybe add a landmark to the plot with that name (so the unique names would be names of Forts).

Alternatively, you could give improvements a new UniqueNames array and then do the same thing with those names.
 
I like 2 as well.

One thing, though- if you do set the Wagon Trains (and Locomotives?) up using the Automated Trade Routes system, you'll need some way to distinguish Forts from each other. Like a name for each fort.

The easiest way would be to use Fort Commanders and give them UniqueNames and then maybe add a landmark to the plot with that name (so the unique names would be names of Forts).

Alternatively, you could give improvements a new UniqueNames array and then do the same thing with those names.

Right, I thought about all of that. It would be neat to have fort names but that would take a lot more coding but mostly time trying to figure out how to do that.

Prolly the easiest way at the moment would just be to add a new command for wagon trains and doing suggestion 3. Where level 1 forts can hold up to 100 of each Good and it is created on the map and level 2 forts can hold up to 200 goods. That would give more insentive to upgrade as well.

Then say a new command for wagon trains:

Commisson for Fort Duty: Assigns the wagon train to work the fort transporting goods to selected City. Hold shift for multiple forts.

I am working on this idea atm but have encountered a problem. Units like tobcacco are set to delayed death if they are not placed in a transport when created and so the very next turn they get deleted. I have yet to discover exactly why. In the UnitInfos I figured out thats its the Units class that causes this. Only if you change a Tobaccos class to Colonist or something will it no be deleted and if you change a Colonist class to Tobacco it will get deleted, even if you change the default unit for Tobacco to Colonist.

So somewhere in the code there is a check for unitclass and deletes Cargo classed units if not in a transport. Maybe in Python? I could solve this with the Fort Commanders by giving them the ablity to transport cargo. But something I noticed when testing things if you create a Cargo unit under a ship in the water it will auto load that ship... if you create a Cargo unit under a Wagon Train it will not auto load the wagon train. So it prolly want auto load in a fort commander either... so I am stuck at the moment trying to figure this out.

Edit: Well the Fort Commanders will fix this problem actually.. I just have to set them as the Transport of the Good. So I am going to add them right now to the game for that reason instead of trying to figure out what is killing my units cause I am at a loss. Maybe it python it cycles through all a units classes and deletes units with no transport that are classed as Tobacco, Ore, and such?
 
I have a question: would an unit to work on the fort plot for the commodities?

Thats an interesting thought. In the Cities units are required to gather commodities so it would seem that they should be required to work out in the field as well. For now lets just assume that the Fort Commanders are coordinating the gathering of the goods. But requireing a unit to be working the plot could be added later.

I am looking into requireing forts to be supported by cities in that 2 food is consumed in the city to support the fort. So that would help to compensate for no units working the field.
 
Ok, in keeping track of my ideas and concepts on this forum here is my latest thoughts:

This is how the Forts and Wagons will or could work...

1. A soldier Unit builds a Fort thus converting to a Fort Commander or a Pioneer builds a Fort and a Soldier unit uses a new command called "Command Fort", then converting to a Fort COmmander. Four borders N,S,E,W of the fort will be controlled.

2. Fort Commanders are required to control the borders surrounding fort and they must be supplied by a city. Fort Commanders will have a new command called "Select supporting City" in which you can select what city supports the fort. If the fort is connected by roads to the supporting city it will start controlling the borders around it. They will also have an "Abandon Fort" command to destroy the fort and convert back to a soldier.

3. To gather resources a the Fort must be supported by a City and connected by roads as well. The plot on which the Bonus resource must be connected by roads and have the appropriate Improvement built. Then the City will spend two food per turn to help gather resources and support the fort.

4. Each turn a resource is gathered it appears at the fort as being transported by the fort commander. The Fort commander can only hold 1 bonus good. Once it reaches 100no more will be gathered.

5. Wagon trains will have a new command called "Commision for Fort Duty". This command allows you to select which cities the wagon will gather from Forts for. If the selected city has a Fort assigned to it by a Fort Commander it will gather the goods from that fort and return them to the selected city.

6. Wagon trains can upgrade a fort to a level 2 fort with 100 lumber and 100 guns. The Fort Commander will get an increase in cargo space and all borders around the fort will be controlled.

7. Fort Commanders are the last to defend the fort. If the Fort Commander dies the fort is either destroyed or can be taken over.
 
Ok, in keeping track of my ideas and concepts on this forum here is my latest thoughts:

This is how the Forts and Wagons will or could work...

1. A soldier Unit builds a Fort thus converting to a Fort Commander or a Pioneer builds a Fort and a Soldier unit uses a new command called "Command Fort", then converting to a Fort COmmander. Four borders N,S,E,W of the fort will be controlled.

2. Fort Commanders are required to control the borders surrounding fort and they must be supplied by a city. Fort Commanders will have a new command called "Select supporting City" in which you can select what city supports the fort. If the fort is connected by roads to the supporting city it will start controlling the borders around it. They will also have an "Abandon Fort" command to destroy the fort and convert back to a soldier.

3. To gather resources a the Fort must be supported by a City and connected by roads as well. The plot on which the Bonus resource must be connected by roads and have the appropriate Improvement built. Then the City will spend two food per turn to help gather resources and support the fort.

4. Each turn a resource is gathered it appears at the fort as being transported by the fort commander. The Fort commander can only hold 1 bonus good. Once it reaches 100no more will be gathered.

5. Wagon trains will have a new command called "Commision for Fort Duty". This command allows you to select which cities the wagon will gather from Forts for. If the selected city has a Fort assigned to it by a Fort Commander it will gather the goods from that fort and return them to the selected city.

6. Wagon trains can upgrade a fort to a level 2 fort with 100 lumber and 100 guns. The Fort Commander will get an increase in cargo space and all borders around the fort will be controlled.

7. Fort Commanders are the last to defend the fort. If the Fort Commander dies the fort is either destroyed or can be taken over.

Sounds good! Although, perhaps "Assign to Fort Duty" would be a better name?

Did you stop the cargo units from being deleted at the end of each turn?
 
Sounds good! Although, perhaps "Assign to Fort Duty" would be a better name?

Did you stop the cargo units from being deleted at the end of each turn?

Yeah, when I added Fort Commanders to carry them as cargo it stopped it but I haven't figured out yet what causes the goods to be deleted that way yet.
 
Still making progress. This is actually a big mod for me as I want to add enough to it to make Forts a unique and fun experience.

Right now I have it so that the Soldier Profession can only build Forts sense Fort are military installations for the most part. I am trying to decide if Forts should be instantly built like founding cities or it takes several turns. The Unit is consumed in building the fort, but not really as it is converted to a Fort Commander Unit. I have it right now so it takes a few turns to build the fort and even made it so the Unit turns into a military worker while building as shown in the picture.

fortworker.jpg

Forts can not be built within one tile of another fort or city and cities can not be built within one tile of a Fort. I am thinking of allowing Cities to be built on or next to a Fort but the Fort gets consumed and the Unit is added to the City.

I am making this all Modder friendly and adding as my xml tags as possible.

Any thoughts on these ideas?
 
I am trying to decide if Forts should be instantly built like founding cities or it takes several turns.
No! Please don't do so, that the fort appears instantly. Construction of the fort should require a quite long time and of course some materials (wood, stone, maybe muskets or tools).

Forts can not be built within one tile of another fort or city and cities can not be built within one tile of a Fort. I am thinking of allowing Cities to be built on or next to a Fort but the Fort gets consumed and the Unit is added to the City.
I guess these distances between the Fort and the City could be possible to adjust for bigger city radius, too.

I am making this all Modder friendly and adding as my xml tags as possible.
This is a very useful feature of your mods. :)
 
Sounds good Kailric.

No! Please don't do so, that the fort appears instantly. Construction of the fort should require a quite long time and of course some materials (wood, stone, maybe muskets or tools).

I agree, it appearing instantly would not only make it too easy to make them, but also takes away the strategy of having to plan for the future. By the way KJ, how did you make the full length icon for the Fort Commander?
 
Another idea- perhaps Fort Commanders should be able to "Abandon Fort"? Which would give you a Veteran but you would loose control over the Fort. (Even if they weren't created by a Veteran, by serving as a Fort Commander you would think the military unit would become a Veteran).

I am trying to decide if Forts should be instantly built like founding cities or it takes several turns.

I agree it should take several turns- perhaps 4-6 turns. I'm not so sure about it requiring other materials as KJ Jansson suggested.

Because then in addition to the military unit you'd need to have a Wagon Train on the plot with the required materials, and that seems like a little too much micromanagement to construct a Fort, especially since you already need a Wagon Train on the plot with required materials to update the Fort.
 
Another idea- perhaps Fort Commanders should be able to "Abandon Fort"? Which would give you a Veteran but you would loose control over the Fort. (Even if they weren't created by a Veteran, by serving as a Fort Commander you would think the military unit would become a Veteran).

I agree it should take several turns- perhaps 4-6 turns. I'm not so sure about it requiring other materials as KJ Jansson suggested.

Ok, I'll make the Forts take turns. And about the "Abandon Fort", yeah, if you delete a Fort Commander it will convert back to a normal Unit and remove the Fort.

One idea I have about Fort Commanders and Veterans is this.

Veterans become Fort Commanders, and regular Soldiers become Fort Sergents where Commanders have a few added benefits. We can add promotions that allow a unit to become a Commander of a Fort though.
 
By the way KJ, how did you make the full length icon for the Fort Commander?

There are at least two simplest techniques.

1. Copy screen from Civilopedia.



Then crop from the image and edit in GIMP.

Here there are two negative effects:
- colored background -> difficult to remove
- size of cropped image is too large and therefore you have to change it significantly to get the final resolution (64x128); as result - big distortions of the final image.

2. From the game. You open WorldBuilder, insert a required unit (here Great General) in the game on any empty tile, then "PrintScreen" => paste in any graphic editor => crop as in the previous case. Time required for all operations is about 10-20 sec.



Here there are two positive moments:
- black + uniform(!!!) background => very easy remove such background in GIMP
- smaller size after crop operation => smaller distortions of final image.

Last time I use only the second technique. There are other methods, but they are more complicated and time consuming.

I'm not so sure about it requiring other materials as KJ Jansson suggested.

KJ Jansson's stonecutter already prepared a lot of stones for Kailric's Fort. And winemaker is ready to open a bottle of good old wine. :)

One of Guilds of my city is ready to propose some goods (Ammo, Gunpowder and Provision) for your Fort.

Icon_Ammo.jpgIcon_Gunpowder.jpgIcon_Provision.jpg
 

Attachments

KJ Jansson's stonecutter already prepared a lot of stones for Kailric's Fort. And winemaker is ready to open a bottle of good old wine. :)

One of Guilds of my city is ready to propose some goods (Ammo, Gunpowder and Provision) for your Fort.

Soon as I get the chance KJ I'll check out your mod. I just noticed it the other day. After I get this version of Forts complete maybe I'll get the chance to work with you for a Forts version for your mod.


I have one technique I use in making buttons and full length icons and such.

Open world builder and go to any spot with a lot of land then start adding Ocean terrain over a large area... you will soon see the effect that I have in the screen shot below... the area starts to turn black. Then just plop your unit down there in the middle of all the black then exit World Builder. Then if you install a mod that gives you full control of the camera you can zoom in and out and even make a unit pose like fortify and such.
Spoiler :

attachment.php


attachment.php
 

Attachments

  • Screenshot1.jpg
    Screenshot1.jpg
    111.9 KB · Views: 270
  • screenshot2.jpg
    screenshot2.jpg
    12.7 KB · Views: 283
KJ Jansson got me to thinking sense I we now have the ability to determine if a plot is connected by roads to a city with PlotGroups it would be a simple thing really to add in requirements for things such as:

Example: To build a railroad you must have access by road to a City that has 20 Ore and 20 tools and they get consumed with each railroad built.

The below code is what checks for distance between the plots and wether there is enough extra food in the city to support a Fort. As you can see its pretty simple and any action in the game can have such a requirement added with little effort in coding sense the hard part is done already.

Code:
bool CvPlot::isRouteGroupConnectedToCity(PlayerTypes ePlayer, int MaxDistance, CvCity* pHomeCity) const
{
    //int iPathTurns;
	int iValue;
	//int iBestValue = MAX_INT;
	CvPlotGroup* pCityRouteGroup;
	CvUnit* pFortCommander = getFortCommander();
	//CvCity* pHomeCity;
	if (pFortCommander != NULL && pHomeCity == NULL)
	{
	    pHomeCity = pFortCommander->getHomeCity();
	}

    if (getPlotGroup(ePlayer) != NULL && pHomeCity != NULL)
    {
        pCityRouteGroup = pHomeCity->plot()->getPlotGroup(ePlayer);

        if (pCityRouteGroup == getPlotGroup(ePlayer))
        {
            iValue = plotDistance(getX_INLINE(), getY_INLINE(), pHomeCity->getX_INLINE(), pHomeCity->getY_INLINE());
            if (iValue <= MaxDistance)
            {
                if (pHomeCity->foodDifference() >= GC.getDefineINT("TK_FOOD_CONSUMED_FORTS"))
                {
                    return true;
                }
            }

        }

    }
    return false;
}

In the picture you can see the results of above code:
attachment.php
 

Attachments

  • consumed.jpg
    consumed.jpg
    19 KB · Views: 311
There are at least two simplest techniques.

1. Copy screen from Civilopedia.



Then crop from the image and edit in GIMP.

Here there are two negative effects:
- colored background -> difficult to remove
- size of cropped image is too large and therefore you have to change it significantly to get the final resolution (64x128); as result - big distortions of the final image.

2. From the game. You open WorldBuilder, insert a required unit (here Great General) in the game on any empty tile, then "PrintScreen" => paste in any graphic editor => crop as in the previous case. Time required for all operations is about 10-20 sec.



Here there are two positive moments:
- black + uniform(!!!) background => very easy remove such background in GIMP
- smaller size after crop operation => smaller distortions of final image.

Last time I use only the second technique. There are other methods, but they are more complicated and time consuming.



KJ Jansson's stonecutter already prepared a lot of stones for Kailric's Fort. And winemaker is ready to open a bottle of good old wine. :)

One of Guilds of my city is ready to propose some goods (Ammo, Gunpowder and Provision) for your Fort.

View attachment 245205View attachment 245206View attachment 245207

Thanks :)

One question: how do I eliminate the black background in GIMP?
 
Back
Top Bottom