Future Worlds

What does the 'Gengineered' promotion exactly do? Apparently it's supposed to enable some new promotion tree or something? I think I've seen a lot of related promotions in the code, but so far they don't work for me. The units get the Gengineered promotion just fine, but there's no change to selectable promotions upon levelup.
How did you get gengineered promotion? I was buying the biopod and buy the chimera and paratrooper. But none of them has this promotion.
 
On the subject of "possible tweaks/bugfixes", I've been wondering if I should adjust how the Node and Core work. Most importantly, currently the code for each uses "SetUnitXY" to check whether or not they're in range of a Node or Core, but that gets to be very time-intensive in the late game when there may be a lot of units running around. A more efficient variation would be to have it just check for units in range of a Node or Core at the start of the turn and provide them with the bonuses -- essentially, rather than continuously updating units in range, it would be a periodic battlefield update for affected units.

So any thoughts?

At the start of the turn? As our turn? Well, the unit wont get the promotion when move into the network area and fight the enemy.
I think the "SetUnitXY" is just fine.

Its better to add some filters, cause the worker get this promotion too.
Code:
function OnUnitSetXY(iPlayer, iUnit, iX, iY)
	if ....[B]its combat unit (non general/worker/great people/aviation/naval[/B]
end

Also, when the worker finished to build the node or core, you should add a function to check the nearby unit to give the promotion.

I think you have one, but its unfinished.
Code:
function CheckNode (iHexX, iHexY, iContinent1, iContinent2)
	local pPlot = Map.GetPlot(ToGridFromHex(iHexX, iHexY))
	local ImpID = pPlot:GetImprovementType()
	local Owner = pPlot:GetOwner()
	local pPlayer = Players[Owner];
	if (ImpID == iImprovementNode) then
		
	end
end
Events.SerialEventImprovementCreated.Add(CheckNode);
 
How did you get gengineered promotion? I was buying the biopod and buy the chimera and paratrooper. But none of them has this promotion.

Out of memory, I think I got it on my biotroopers. Don't remember whether it was on chimeras, but I'm pretty sure I got it somewhere.

Can't test it now though; updated my mod folder and cleaned the cache, now I can't open the old save without the game crashing.
 
At the start of the turn? As our turn? Well, the unit wont get the promotion when move into the network area and fight the enemy.
I think the "SetUnitXY" is just fine.

Also, when the worker finished to build the node or core, you should add a function to check the nearby unit to give the promotion.

I think you have one, but its unfinished.

I've already added the code so a completed Node adds the promotion to nearby units. :3

Mostly I'm concerned the Node/Core check will bog down AI turns. A unit with 5 moves ( such as a GDR currently checks 400 tiles each turn, which could result in long AI turns.

I've been considering repurposing the Core instead, which would also reduce the tile checks. Would this be a more preferable option?
 
Mostly I'm concerned the Node/Core check will bog down AI turns. A unit with 5 moves ( such as a GDR currently checks 400 tiles each turn, which could result in long AI turns.
If only there is index for each tile.
I've been considering repurposing the Core instead, which would also reduce the tile checks. Would this be a more preferable option?
Repurposing how?
 
I'd make it more like the Node in BE, where it would help heal nearby units.
Ofcourse, that would change everything. The iteration will just work when you click the next turn button.
Well, im still thinking how do the firaxis code the great general. Cause, the network core and node are working with the same way.
But then it occurred to me, there is no "promotion" from the general. The general is boosting the nearby unit WHEN the unit is about fighting the enemy ("Great General Near" promotion). Otherwise there is no promotion.
 
Ofcourse, that would change everything. The iteration will just work when you click the next turn button.
Well, im still thinking how do the firaxis code the great general. Cause, the network core and node are working with the same way.
But then it occurred to me, there is no "promotion" from the general. The general is boosting the nearby unit WHEN the unit is about fighting the enemy ("Great General Near" promotion). Otherwise there is no promotion.
No promotion is applied. The code is buried deep in the game's dll, and the extra combat effectiveness is added or taken away at that level of programming. All we can do is tell the game that a unit should be treated as if it were a great general (and boost nearby combat units).
 
Yeah, I have a suspicion that the Great General bonus only gets checked when a unit actually attacks, and the game code starts adding up all the bonuses or penalties it should have. That avoids a lot of the overhead I have to use by constantly checking to see if a unit should or shouldn't have a promotion based on its position.

The Core is currently rather too similar to the Node as it is, anyways, and I like the idea of each filling a different role in your empire -- the Node supporting offensive maneuvers while the new Core would help enhance defense.
 
All we can do is tell the game that a unit should be treated as if it were a great general (and boost nearby combat units).
Yeah, but we should be able to make double boosts. Which, no double boosts with two generals.
The units will get boosts from the core/node and the general.

The Core is currently rather too similar to the Node as it is, anyways, and I like the idea of each filling a different role in your empire -- the Node supporting offensive maneuvers while the new Core would help enhance defense.
I was suggesting that the node should be quicker to build. But i like the Core as offensive, cause it has larger coverage. Well, it should be tested on the "field" for better solution, haha...
Anyway, i was thinking that the node/core should be able to build outside our territory. But then, how do we determine the owner? Its not funny that the core/node gives the promotion to every sides. LOL

Out of memory, I think I got it on my biotroopers. Don't remember whether it was on chimeras, but I'm pretty sure I got it somewhere.
I dont know how you did that. But he forget the "TrainedFreePromotion" in Buildings.xml
I just knew that recently.
Code:
		<Row>
			<Type>BUILDING_FW_ECTOGENESIS_POD</Type>
			<BuildingClass>BUILDINGCLASS_FW_ECTOGENESIS_POD</BuildingClass>
			<Cost>900</Cost>
			<GoldMaintenance>5</GoldMaintenance>
			<PrereqTech>TECH_GENGINEERING</PrereqTech>
			<Help>TXT_KEY_BUILDING_FW_ECTOGENESIS_POD_HELP</Help>
			<Description>TXT_KEY_BUILDING_FW_ECTOGENESIS_POD_DESC</Description>
			<Civilopedia>TXT_KEY_BUILDING_FW_ECTOGENESIS_POD_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_FW_ECTOGENESIS_POD_STRATEGY</Strategy>
			<ArtDefineTag>ART_DEF_BUILDING_LABORATORY</ArtDefineTag>

<TrainedFreePromotion>PROMOTION_FW_GENGINEERED</TrainedFreePromotion>

			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>50</ConquestProb>
			<HurryCostModifier>0</HurryCostModifier>
			<IconAtlas>CIV_COLOR_ATLAS_FW_2</IconAtlas>
			<PortraitIndex>22</PortraitIndex>
		</Row>
 
It should -- as long as you have the starting promotion, the new "tree" should be available whenever you have the option of choosing new promotions.

I've added the extra line in to my current version (which I'm still working on), so it'll be in the next update.
 
Does that extra line of code make the promotion (line) work?
It does. But i didnt test the promotion effect in a battle yet.

It should -- as long as you have the starting promotion, the new "tree" should be available whenever you have the option of choosing new promotions.
But after the first promotion ADRENAL_GLANDS/ENHANCED_REFLEXES, we cant choose Medic I/Cover I promotion. As when you have drill I or shock I promotion, you can choose Medic I/Cover I for the next promotion.

And, i dont see any AI favor for the promotion. Or, there isnt such that thing for the promotion???
 
After having gotten interested, I decided to delve deeper into the code for promotions, see what's in there. While looking them up:

Code:
<Row Tag="TXT_KEY_PROMOTION_FW_PREDATOR_INSTINCT">
			<Text>Predatorial Instinct</Text>
		</Row>
		<Row Tag="TXT_KEY_PROMOTION_FW_PREDATOR_INSTINCT_HELP">
			<Text>+30% [ICON_STRENGTH] Combat Strength in Forest and Jungle terrain.</Text>
		</Row>
		<Row Tag="TXT_KEY_PEDIA_PROMOTION_FW_PREDATOR_INSTINCT">
			<Text>+30% [ICON_STRENGTH] Combat Strength in Forest and Jungle terrain.</Text>
		</Row>

This is supposed to be the explanation/text for the new promotion Predatorial Instinct. However...

Code:
<Row>
			<Type>PROMOTION_FW_PREDATOR_INSTINCT</Type>
			<Description>TXT_KEY_PROMOTION_FW_PREDATOR_INSTINCT</Description>
			<Help>TXT_KEY_PROMOTION_FW_PREDATOR_INSTINCT_HELP</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<PromotionPrereqOr1>PROMOTION_FW_ADRENAL_GLANDS</PromotionPrereqOr1>
			<PortraitIndex>43</PortraitIndex>
			<IconAtlas>PROMOTION_ATLAS</IconAtlas>
			<PediaType>PEDIA_ATTRIBUTES</PediaType>
			<PediaEntry>TXT_KEY_PROMOTION_FW_PREDATOR_INSTINCT</PediaEntry>
		</Row>

Data about what the promotion actually does is absent here, isn't it? Or am I reading it wrong?

Are the rest of the new promotions coded correctly?
 
After having gotten interested, I decided to delve deeper into the code for promotions, see what's in there. While looking them up:


This is supposed to be the explanation/text for the new promotion Predatorial Instinct. However...

Data about what the promotion actually does is absent here, isn't it? Or am I reading it wrong?

Are the rest of the new promotions coded correctly?
Combat effects for Features or Terrains are not implimented in table UnitPromotions. They are implimented via table UnitPromotions_Terrains and table UnitPromotions_Features
Code:
<UnitPromotions_Features>
	<Row>
		<PromotionType>PROMOTION_FW_PREDATOR_INSTINCT</PromotionType>
		<FeatureType>FEATURE_FOREST</FeatureType>
		<Defense>30</Defense>
		<Attack>30</Attack>
	</Row>
	<Row>
		<PromotionType>PROMOTION_FW_PREDATOR_INSTINCT</PromotionType>
		<FeatureType>FEATURE_JUNGLE</FeatureType>
		<Defense>30</Defense>
		<Attack>30</Attack>
	</Row>
</UnitPromotions_Features>
 
Combat effects for Features or Terrains are not implimented in table UnitPromotions. They are implimented via table UnitPromotions_Terrains and table UnitPromotions_Features
Good explanation. I thought he was talking about the PEDIA. There is only Game info about the promotion in civilopedia.
 
Well, I should have most of these bugs fixed at this point, as well as some of the other tweaks I wanted to make completed, so should be able to get an update posted this weekend, once I've been able to test and make sure it's running stably.
 
Any chance of an early beta, even if buggy? There is a new CPP/CBP beta today..... so its time to start a new game!
 
This'll probably have to be something for the next version, but I may as well bring it up now.

When playing RER with the CP, I noticed that the AI was beelining Gunpowder, and completely ignoring Machinery. I believe this is because Gunpowder contained a better unit than Machinery (in theory), but it didn't require machinery. Therefore, the AI rushed it, got the techs that it led do, and ended up with armies of Muskets, 2Handers and Comp bows :/

To avoid a similar situation here, could I recommend making sure that unit trees all require each other; that the Power Armour Infantry tech requires Mechanization, and so on.

Of course, it isn't a major need because I'm pretty sure it will only affect improved AIs that choose techs properly, but it might be worth looking at for v4.
 
Any chance of an early beta, even if buggy? There is a new CPP/CBP beta today..... so its time to start a new game!

I made a build of the current version of the mod, and uploaded it to dropbox here! The compressed version of the mod now exceeds 20mb, so I may not be able to upload it to the civfanatics site anymore...

Also, the current version of the mod is now v4, as I've added a couple of additional buildings and wonders, as well as revising the tech tree slightly. The "hyperstructure" wonders have also been revised, so hopefully they're more impressive now. I've also hopefully fixed most of the bugs in how several buildings worked, and I've modified the Node and Core so they function somewhat differently -- the Node now has a base range of 3, which Skynet doubles to 6. The Core no longer gives a combat bonus, however, but instead heals adjacent units for 10 HP each turn. It's also been moved to the Artificial Intelligence tech.

Still haven't finished the Orbital Elevator, though... u__u

I also haven't been able to fully test the mod yet, but preliminary tests show the tech tree is working normally, and there's no errors showing up in the Lua code, so it -should- be working properly for the most part. Although I may still have missed things like before... XD

May do a little more tweaking with this update, and then once it goes live I'm going to start looking towards v5, which will involve re-examining the unit trees. I've also got ideas for at least 3 more units that'll hopefully be interesting~
 
Top Bottom