Questions of a Newcomer

Kaiserowsky

Chieftain
Joined
Nov 6, 2020
Messages
2
Hi all, I'm Kaiserowsky, or, alternatively, Gluz (that's my Civ4 Discord nick by the way). I had been working for a month on my first mod that is... well, another Venice mod, named more creatively as "The Most Serene". The general idea is that Venice is very "tall" faction, with them for the most time of the game limited to a city-state, and then later on expanding with use of carefully placed Trading Ports (an improvement that works like cottage) that would grow to the whole Trade Factories (rather than represented in the same way as Feitorias, they would be an improvement.), which later on can be turned into normal cities. These Ports would be built by Venetian Merchants, unique unit for Venice, that would replace... Settlers, yes, that's the whole problem of Venice: while they start out with normal settler to establish their capital, their expansion choices are very limited and they get their UU later (I don't need to mention that UU would require a tech compared to Settlers).

You see, the two problem I want to solve is that I want to Venice start out with normal Settler, then get their hands on VMs later. Second, the dilemma of "Trade Cottage" mechanic (with also mentioned features of later on being able to turn into city, spending a merchant to settle) and how to implement that seamlessly so that it would be both not terribly broken and AI would be able to actually know what's going on and recognise that it can settle only on select tiles that have a Trade Factory on it (that it had been built earlier by AI player).

I must admit that I'm not knowledgeable in the more "technical" aspect of Civ4 modding, so any help would be appreciated
 
From what you’re describing you’ll want a unique settler for Venice (with a tech they can never research as it’s pre-requisite).

Your Venetian Merchants, as described are actually a Worker type who build specific improvements. Those improvements need to claim territory, so you’ll need to be using a mod component which allows forts and other improvements to claim territory. This may necessitate a second unique unit to be permanently based in Trading ports (to identify the owner).
The tough bit would be to teach the AI where to place these improvements.

To have the trading factories upgrade to cities, you’re looking at some python coding. You could try IMPROVEMENT_CITY as the improvement that a trading factory upgrades to after a certain number of turns but I’m not sure if that would work. I’d avoid having to build settlers and sending them to the plots of Trading Factories.

One option would be to limit the Venetian Settlers movement to 0 and have a (low) chance for a Venetian Settler to spawn in a Trading Port and a higher chance to spawn in the Trading Factory. If it cannot move, then there’s no choice but to found the city where it spawns. Simple python could force the AI to found a city at the start of a turn with any Venetian settler it has. One issue you might want to think about is what happens if another player founds a city close to the Trading port/factory. Does this prevent it from ever developing into a city or do you try to prevent that situation from arising in the first place?

—-
It may be if interest to you to look at the FFH implementation of Kuriotates.
Your Trading Port could be the equivalent of their Settlement.
The Trading Factory could be a building added within the Trading Port after some time/event to give certain benefits.
Python blocking/enabling could be used to define when Trading Ports with Trading Factories could upgrade to full cities.
 
I'm not going to say a lot because LPlate2 already said almost everything necessary but I could direct you to some useful things.
This is a modcomp that allows forts to have culture, you could easily change the definition of FORT to Trading Port or whatever you want.
To make an improvement turn into a city is pretty hard, I never tried it so I wouldn't know but I did have this idea that Towns could evolve to Cities so I might try to create a modcomp like this and you could change the Town to trading post.
To make a Venetian Merchant or Venetian settler spawn ever few turns is extremely easy to do, see the file I attached below.
Anyway I will try to make Towns evolve to cities and you can change the Town to Trading Port, I'll let you know if it works.
P.S. The unit will spawn in the players capital, I have no idea how to make it spawn on a improvement.
The part in the txt file has to be copied in the CvEventManager.py under
Code:
    def onEndPlayerTurn(self, argsList):
        'Called at the end of a players turn'
        iGameTurn, iPlayer = argsList
 

Attachments

  • Venetain Settler.txt
    579 bytes · Views: 50
Last edited:
Thank you very much !
From what you’re describing you’ll want a unique settler for Venice (with a tech they can never research as it’s pre-requisite).

Your Venetian Merchants, as described are actually a Worker type who build specific improvements. Those improvements need to claim territory, so you’ll need to be using a mod component which allows forts and other improvements to claim territory. This may necessitate a second unique unit to be permanently based in Trading ports (to identify the owner).
The tough bit would be to teach the AI where to place these improvements.

To have the trading factories upgrade to cities, you’re looking at some python coding. You could try IMPROVEMENT_CITY as the improvement that a trading factory upgrades to after a certain number of turns but I’m not sure if that would work. I’d avoid having to build settlers and sending them to the plots of Trading Factories.

One option would be to limit the Venetian Settlers movement to 0 and have a (low) chance for a Venetian Settler to spawn in a Trading Port and a higher chance to spawn in the Trading Factory. If it cannot move, then there’s no choice but to found the city where it spawns. Simple python could force the AI to found a city at the start of a turn with any Venetian settler it has. One issue you might want to think about is what happens if another player founds a city close to the Trading port/factory. Does this prevent it from ever developing into a city or do you try to prevent that situation from arising in the first place?

—-
It may be if interest to you to look at the FFH implementation of Kuriotates.
Your Trading Port could be the equivalent of their Settlement.
The Trading Factory could be a building added within the Trading Port after some time/event to give certain benefits.
Python blocking/enabling could be used to define when Trading Ports with Trading Factories could upgrade to full cities.

Idea was that Merchants would establish trading ports, consuming the unit, but Venice would start out with normal settler... yet, as Merchants would replace Settlers, I needed to do something with it, so gameplay would not be broken. To solve the problem, I had added two new units to circumvent this issue, namely Venetian Settler (or, in this case, "Emigrants") and new unit: special settler that Venice would start out with as free unit. "Special" settler is in fact just a normal settler, but added so Venice can even establish a starting city in the first place.
The plot rules would also apply to trade ports and factories.

I'm not going to say a lot because LPlate2 already said almost everything necessary but I could direct you to some useful things.
This is a modcomp that allows forts to have culture, you could easily change the definition of FORT to Trading Port or whatever you want.
To make an improvement turn into a city is pretty hard, I never tried it so I wouldn't know but I did have this idea that Towns could evolve to Cities so I might try to create a modcomp like this and you could change the Town to trading post.
To make a Venetian Merchant or Venetian settler spawn ever few turns is extremely easy to do, see the file I attached below.
Anyway I will try to make Towns evolve to cities and you can change the Town to Trading Port, I'll let you know if it works.
P.S. The unit will spawn in the players capital, I have no idea how to make it spawn on a improvement.
The part in the txt file has to be copied in the CvEventManager.py under
Code:
    def onEndPlayerTurn(self, argsList):
        'Called at the end of a players turn'
        iGameTurn, iPlayer = argsList

Yes, I am aware of SuperForts and I had integrated it into my mod. Also, thank you for solving few Python-related sheningans !

PS. Sorry for rather poor grammar, but I had wrote this post quickly.
 
Top Bottom