GreyFox's TechnoMod

xienwolf

Deity
Joined
Oct 4, 2007
Messages
10,589
Location
Location! Location!
As winner of the Somnium Tournament, Greyfox was allowed to request that I code a mod for him. Here is the result. Till he sets some values for the specific numbers in the XML which he would like, this is mostly just a "proof of concept" post and a handy method of getting the mid-point result to him.

GreyFox's request was that the research cost of a technology could be affected by the other technologies you know, then he also mentioned in providing an example having Bronze making BronzeWorking cheaper. Of course, that isn't a tech, so I lumped in Bonuses with Techs to discout/enhance tech costs.


This is written with the sourcecode for Patch K, and the TechInfos for patch L (I don't recall if that patch included changes to TechInfos). It will be mostly compatible with all future patches without needing updated as long as TechInfos doesn't change and you install this AFTER the FfH patch. Doing so will make you lose any new DLL changes from the latest patch. But it won't take long for an update to get posted, so long as sourcecode is offered from FfH.


New Fields are all in TechInfos (end of each entry, optional):

Code:
			<BonusCostShifts>
				<BonusCostShift>
					<BonusType>BONUS_CORN</BonusType>
					<iCostShift>30</iCostShift>
				</BonusCostShift>
			</BonusCostShifts>
			<TechCostShifts>
				<TechCostShift>
					<TechType>TECH_NECROMANCY</TechType>
					<iCostShift>-500</iCostShift>
				</TechCostShift>
			</TechCostShifts>
			<BonusCostMods>
				<BonusCostMod>
					<BonusType>BONUS_CRAB</BonusType>
					<iCostMod>20</iCostMod>
				</BonusCostMod>
			</BonusCostMods>
			<TechCostMods>
				<TechCostMod>
					<TechType>TECH_HORSEBACK_RIDING</TechType>
					<iCostMod>500</iCostMod>
				</TechCostMod>
			</TechCostMods>

Any tech or bonus can be listed in the fields, and any modifier/shift can be used. Shift means the number indicated is added, Mod means it is multiplied by the number entered. Using a 0 or negative for a Mod means that the tech will wind up costing 1 :science:, unless of course you have two of them, then the negatives will cancel out :)


I believe the main idea is to make some of the basic starter techs get cheaper when you have assorted higher-end techs to make the catch-up game a bit quicker, and to do things like making Way of the Wise and Way of the Wicked cause each other to cost 10x as much, thus discouraging someone from researching both of them. Or of course having each of the religioon-required techs tie into a large assortment of other techs for cost mod.

Anyway, where to use it is up to anyone who downloads this, and Greyfox if he provides a TechInfos.xml with what he had in mind for me to include with the main download.


(Right now Agriculture has some samples of the fields being used which are all quite silly, except for Gold I do not think that any of them are even possible before Agriculture, well, not easily)


LAST UPDATED FOR PATCH M OF FFH2
 

Attachments

sounds great... You could even say that, if you have corn or rice etc in you cultural zone that you get a discount on researching agriculture. This can be applied to many other things.
Like if you are attacked by animals hunting becomes cheaper, since you have had an incite to these things...

But I guess that is harder to code???
 
Checking for any resource, even if not connected/improved (but only if visible) would be possible, and wouldn't take too much, but would need some extra functions written to handle it. Fairly simple to code that bit. Going so far as to make nifty conditionals like killing animals making hunting cheaper becomes more tricky, as for some of them you can have quite outrageous requirements.

Would be up to GF if he wants to have it based off resources merely being in your territory, or still needing them to be connected. I imagine the primary use of that field will be to make Iron Working cheaper for the guy with Mines of Gal'dur, and to make Necromancy/Alteration/Divination/Elementalism cheaper based on already having (palace/features) the mana which it provides.
 
Very nice.

Could I convince you to extend this though so that your Civilization, State Religion, and Alignment (possibly both base and broader alignment) can also change the costs of techs?

I would love to make it so that instead of forcing the AI to research the appropriate techs (especially religion specific ones) we would just make those civs be able to research the techs much more cheaply. I also think that Righteousness and Malevolent Designs should be strongly tied to alignment, and that FoL should make recon techs faster while RoK makes techs like Engineering and Iron Working cheaper.
 
Bonuses required Readpass 3 work to be possible (which is the hardest possible loading case), so really with the code here as an example, you could easily make ANYTHING be a valid prereq to adjust the costs.

But as far as THIS little modlet goes, I don't intend to develop it any further than the initial request :) Plenty of other things to work on ;)
 
Aaah, feels nice being just the designer and not the programmer for once. ;)
Thanks xienwolf, I know I won a tournament and this was my award, but still, thanks!

Gonna take some time to get a nice redesign of the tech costs worked out though. And I'm going home today and I don't know when I will get my mobile connection. Other mod-modders will probably find this useful, and hopefully it will find it's way into the main mod some way. :)

Not only will I be able to redesign the early tech tree (some techs could possibly be more expensive now, but cheaper with the right prerequisites), but things like the 4 different requirements for Sorcery will be able to lower the cost of the Sorcery tech. That's just one extreme example since it is one of the techs (the only?) that has 4 different prereqs.
 
Sounds super awesome. What a simple great idea.
 
Q: who says it must be complex to be awesome?
A: I don't know, but this proves them wrong
 
seconded. in the Splintered Court scenario, playing as Arendel, I have to keep my perm allies from researching Way of the Wicked, which they sem to like very much :D
 
Any chance that this will find it's way into Fall Further? I had some ideas of my own, like making Sorcery cost less for each of the arcane branches you had.
That way I wouldn't feel so bad about rushing Alteration instead of Sorcery with a Great Sage, since getting Alteration would help me research Sorcery anyway.
 
Yeah that's one of my ideas too. I will try to release an updated version of this with all my changes soon.
 
Hmm......I would love to FINALLY have AI civs always getting AV, especially the Elohim...with a bit of knowledge of the coding.....I can make all the best civs be weighted towards the overlords.......Cthulhu will be pleased :)
 
Uhm, seems this already existed in BtS? I had no idea and I haven't tested it myself.

Techs get cheaper the number of prerequisites you have. Some of these bonus is mandatory, but when there are optional routes you can enjoy them as well.

For example, you get a 20% bonus for researching Masonry with Mining, and a 20% bonus for researching Masonry with Mysticism. You have a 40% bonus for researching Masonry with both.

I learned this from reading a Deity game thread. I've never noticed this behaviour in BtS and definitely not in FfH. Seems this mod is kinda redundant if this is the case...
 
Not redundant, better. You can increase costs with this, and vary costs from non-prereq fields, and by non-symmetric quantities. You COULD choose values for this such that it mimics the already existing mechanic

Anyway, just to be complete with compilation of where mods can come from:

You gain a bonus for all other teams who already have the tech (if you are the last to research it you get the full bonus listed in Global Defines as TECH_COST_TOTAL_KNOWN_TEAM_MODIFIER, otherwise you gain a fraction of it equal to the fraction of other teams with the tech)

You gain a bonus equal to TECH_COST_KNOWN_PREREQ_MODIFIER for each PrereqOrTech you know.


Looks like those 2 and this one are about it. Though this one applies itself to the tech cost, and those 2 apply themselves to your research output.
 
does this only work on techs, or could wonders and rituals be adjusted as well? One prime example that pops in my head is the prophecy of ragnarok being suggested as next-to-build in every single one of my build cues, just because a teammate researched the tech.
 
Back
Top Bottom