Feedback: Traits

Simple, just check the python codes :D

There are codes under onCityBuilt:
Code:
		if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_EXPANSIVE')):
			# Places extra food on city tile if founder is Expansive
			CyGame().setPlotExtraYield(iX, iY, YieldTypes.YIELD_FOOD, 1)

		if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_FINANCIAL')):
			# Places extra commerce on city tile if founder is Financial
			CyGame().setPlotExtraYield(iX, iY, YieldTypes.YIELD_COMMERCE, 1)

		if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_INDUSTRIOUS')):
			# Places extra production on city tile if founder is Industrious
			CyGame().setPlotExtraYield(iX, iY, YieldTypes.YIELD_PRODUCTION, 1)

But there are none onCityRazed.

Conclusion:
Razing the cities do not remove the boosted stuff.

Even if codes are added, there is still one loophole where it will still be screwed.
Building a city on turn 0 will add the boost to the tile correctly.
Regenerate the map, and the boost still remains on the plot with same X and Y...
Since the city was not razed, no codes will be activated even if codes are added to onCityRazed.
 
Industrious civs get +1 :hammers: in any tile that a city was built on, even if it is later razed and the ruins replaced with another improvement.

I'm not sure if the same happens with :food: for Expansive civs and/or :commerce: with Financial ones.

I think it happens with Financial ones, but I'm not sure.
I just know that I occasionally see tiles with ruins on them with more commerce than they ought to have.

Simple, just check the python codes :D

There are codes under onCityBuilt:

But there are none onCityRazed.

Conclusion:
Razing the cities do not remove the boosted stuff.

It used to, I suspect I may have inadvertently deleted the code. A while back I was experimenting with implementing this in a different way (yield attached to the city rather than the tile it's on), but it created more issues than it solved. I probably neglected to restore that section after that. Will fix.

Even if codes are added, there is still one loophole where it will still be screwed.
Building a city on turn 0 will add the boost to the tile correctly.
Regenerate the map, and the boost still remains on the plot with same X and Y...
Since the city was not razed, no codes will be activated even if codes are added to onCityRazed.

Yeah, map regeneration is a pain. Whole bunch of stuff doesn't get triggered that should.
 
I'm trying to replicate the problem with extra yield from traits not being removed when cities are razed, but I can't. There is code in onCityAcquired() that removes this extra yield when a city changes hands and in my testing I've confirmed that this is triggered even if a city is razed. The city still temporarily belongs to the conqueror, even a barbarian conqueror, before it is razed, even if it was a size 1 city.

That's why I didn't bother putting any code to handle this in onCityRazed(). If I do, it gets triggered twice - once when the city is acquired and again when the city is razed, resulting in a tile with lower than normal yield.

So I have no idea why you might be seeing razed cities with the extra yield still intact :/
 
Simple

Industrious leader A built City X.
Tile gets a boost
Industrious leader B conquers City X and razes City X.
onCityAcquired triggered, previous owner was Industrious, removed tile boost.
New owner is industrious, add tile boost.
City razed, nothing triggered, tile boost remained.

There you go.
 
Simple

Industrious leader A built City X.
Tile gets a boost
Industrious leader B conquers City X and razes City X.
onCityAcquired triggered, previous owner was Industrious, removed tile boost.
New owner is industrious, add tile boost.
City razed, nothing triggered, tile boost remained.

There you go.

Ah, of course. Thanks!
 
Platyping, do you have any good ideas how to replace getSelectedUnit() in my Colonist code? Looping through all units on the plot doesn't seem to work.
 
Afaik, there isn't a good solution for that.
You can try seeing whether AND or C2C managed to solve that, though I think those mods suffer from oos anyway.

My solution:
Scrap both colonist and pioneer units.
When city built, simply check for respective techs and add bonus.
Adjust settler cost via getunitcost callback to increase cost when they are "upgraded" via those techs.
Add new icons to tech bar to inform users settlers upgraded
 
onCityBuilt:

Code:
	### Colonists - Free Buildings
		if pCity.getOwner() == gc.getGame().getActivePlayer():
			if CyInterface().getHeadSelectedUnit().getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_COLONIST'):
				CyMessageControl().sendModNetMessage(700, pCity.getOwner(), pCity.getID(), -1, -1)


onModNetMessage:

Code:
	### Colonists (iData1 = MessageID, iData2 = PlayerID, iData3 = CityID)
		if iData1 == 700:
			pPlayer = gc.getPlayer(iData2)
			pCity = pPlayer.getCity(iData3)

			for iBuildingClass in HR.Unit.ColonistFreeBuildingClass:
				iBuilding = gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(iBuildingClass)
				if iBuilding > -1:
					pCity.setNumRealBuilding(iBuilding, 1)


What do you think of this as a solution for the Colonist? It seems to be working fine in single player but I've not got the setup to check it in multiplayer yet.
 
It will fail even in SP.
CyInterface().getHeadSelectedUnit()

When AI builds a city, it will fail
 
It will fail even in SP.
CyInterface().getHeadSelectedUnit()

When AI builds a city, it will fail

True. What I might do then is force the AI to upgrade its existing Settlers to Colonists as soon as they acquire the unlocking technology (Urban Planning) and then simply use a tech check for the AI, while players can use the code above.
 
So why will you want 2 separate codes to do the same stuff :D
That will just add unnecessary performance issue, and provided the above code works in MP anyway

P.S.
AI may not have the gold to upgrade also lol
 
So why will you want 2 separate codes to do the same stuff :D
That will just add unnecessary performance issue, and provided the above code works in MP anyway

Because I'd really like to keep the Colonist as a distinct unit (I'm giving them combat strength in 1.20 for example, and may give them more capabilities later) and I'd like to avoid the situation where the human player can stockpile Settlers in anticipation of having them all 'upgraded' for free.

Shouldn't be too bad performance-wise, the same code just with two different triggers.

P.S.
AI may not have the gold to upgrade also lol

I'll probably let them upgrade for free if they can't afford it. They're not likely to have too many Settlers active at once and it's not like the AI couldn't use a small boost from time to time.

EDIT: Actually, I can probably just let any already existing AI Settlers act like Colonists after Urban Planning is acquired. Much simpler solution, much the same result.
 
As mentioned earlier in this thread and the 1.20 beta thread, the Financial Trait's corporation spread refund wasn't working well and was causing OOS errors in multiplayer. Here's what I'm thinking for a replacement:

Financial
• +1 commerce per city
• Always Builds Wealth at rate of X%
• Double production speed of Market, Bank​

I just need some feedback on what X should be. 100% is the minimum, other players won't get this rate until Corporation. This does mean that this bonus has no affect after the Financial player discovers that tech, but that's not necessarily a bad thing nor out of line with other traits. 150% or 200% would be the alternatives but are potentially too strong, considering that this rate will kick in as early as Property. While it is possible to have different ranks just for Financial players I'd prefer to keep it simple. Thoughts?
 
Just add a level higher than the current max.
Then Financial players will always be 1 lvl higher than others.
Early game they will not be overpowered, yet still higher than others end game.
 
In this mod, hammers are much more easier to acquire than commerce, workshop and mine produce so much hammers while a town need a longtime to grow to provide only 4 commerce. I think even the 100% ratio is a bit too strong, maybe 66% after discovering corporation is a better choice(it is also too much to jump from 50% to 100%). For financial trait, maybe 50 to 75 to 100.
 
I don't think I'm short of hammers when playing this mod, but I am really lack of commerce to catch up with AI technology, and I have to build wealth a lot, the ratio just must not be raised too high for human players are definitely relying on it to make researching faster.
 
Just add a level higher than the current max.
Then Financial players will always be 1 lvl higher than others.
Early game they will not be overpowered, yet still higher than others end game.

The later game concerns me most actually. In the early and mid game when you build wealth (or another commerce) you are doing so instead of producing buildings, wonders, settlers, workers, etc. Though it's valuable while you're waiting for something to unlock or such, for the most part you have to weigh up whether it's the best use of production or not.

But in the later game you've already built most of the crucial infrastructure and you have a lot more cities with much greater production capabilities. You can churn out a hell of a lot of wealth even at 100%.

In this mod, hammers are much more easier to acquire than commerce, workshop and mine produce so much hammers while a town need a longtime to grow to provide only 4 commerce. I think even the 100% ratio is a bit too strong, maybe 66% after discovering corporation is a better choice(it is also too much to jump from 50% to 100%). For financial trait, maybe 50 to 75 to 100.

I don't think I'm short of hammers when playing this mod, but I am really lack of commerce to catch up with AI technology, and I have to build wealth a lot, the ratio just must not be raised too high for human players are definitely relying on it to make researching faster.

Yeah, production and commerce are a bit out of balance still.
 
Free promotion of commando making it really difficult task to defense against a aggresivem leader, players hate to lose their city, especially when railroads are constructed. would you consider redesigning this trait?
 
Free promotion of commando making it really difficult task to defense against a aggresivem leader, players hate to lose their city, especially when railroads are constructed. would you consider redesigning this trait?

No, traits in HR are meant to be a bit stronger and more interesting to play (and play against) than the traits in BTS. Aggressive is one of the better traits in HR in terms of this goal, in my opinion. Aggressive leaders should be feared.
 
After much deliberation I've decided I'm going to add 2 more traits to HR, bringing the total to 20 and the number of leader slots to 190 (with 143 filled so far). From my testing I'm pretty sure that leader art is loaded on demand rather than preloaded into memory, meaning that adding more leaders shouldn't increase the probability of MAFs (so long as they're not packed in an FPK). There's still a few civs I hope to add and, as discussed in another thread, there are a number of leaders worth adding to the existing civs.

I currently do not have any firm ideas for what these 2 traits could be or what their bonuses should be. I feel that at least one of them should be at least partially military themed, but other than that, I am open to suggestions. Let me know your ideas.
 
Back
Top Bottom