NOT logic flag in tech prerequisites

ecawilson

Warlord
Joined
Oct 9, 2014
Messages
133
Location
Indiana, GMT-4
Is it possible to include in the tech requirements a NOT? Civ4 shipped with AND and OR, and some techs have used AND to require buildings, I don't know if NOT is an option.

For example... there is a theory that iron working in the fertile crescent only came about because of scarcity of metal. Or the opinion was recently suggested that mining was only possible to learn and practice when a certain religion was NOT the state religion. Or perhaps a nation can only learn and use nuclear fission when a certain diplomacy state is NOT in effect.
 
No horses = no Mining tech too ;)

Such civ could research series of punk techs in prehistoric and later eras to gain different things instead (what if someone more advanced than us was messing around?).
There could be autobuilding, that prevents other buildings from being built - those buildings could be requirement for tech.
Of course that autobuilding could be obsoleted or removed/replaced by unit.
I think @Thunderbrd would use a lot of this NOT prereq for techs.

Sadly AI would be too dumb to understand it.
Also you can always get horses eventually for now.

Currently if you introduce such tech that can't be researched, and if you use it as requirement for other techs, then clicking on other techs does nothing - it doesn't notify player, that earlier tech is unresearchable.
So UI side also would have to be improved.
 
Last edited:
I agree that a series of autobuildings could approximate the NOT logic, and that the UI of autobuildings would have to be modified considerably to handle that many new autobuildings. Modding such a tech tree would be laborious, but possible.

I am less concerned about AI handling such a case. My understanding of AI research behavior is that, based upon its 'personality' it chooses a tech based upon the relative weights given in the xml... but only between the ones it can research *now*. In other words, the AI has no idea what it might research in 100 turns, nor does it care... and not knowing is not an issue in quality of opponent. In the case of a diplomatic NOT, this behavior will closely match reality, as long as the weight of having this diplomatic restriction is sufficiently odious. When two techs are mutually exclusive, this behavior handles that as well. If it is a case of geographic restrictions (resource of metal or horse or distance between cities or whatever), this requires significant planning along the lines of wonders, that would naturally happen or not based upon chance, and the game handles that. I don't think AI concerns are significant in handling NOT logic in general, just specific (say if someone wanted a tech where you couldn't research modern tech X unless you skipped over prehistoric tech Y, no way AI would handle that properly).
 
Early mining in south africa certainly didn't require horses...
Yeah, that was more of an AND requirement anyway, so I let it go. I think we can all think of a bunch of cases, prehistoric or ancient or modern, where mining neither uses domesticated animals, nor are uses of domesticated animals the catalyst for needing the metals or stones.
 
Early mining in south africa certainly didn't require horses...
So Roads or other tech then.
Definitely some Prehistoric or Ancient era tech, that was critical for further development, but requirement for tech wasn't meet.
For example you can't have animal husbandry (at least on large scale) in jungles (parasites and stuff).

With those restrictions you could have Europe, Middle East, Asia civs go almost head to head in development while leaving those Native Americans, Sub-Saharan Africans and Aborigines behind, if you were playing on Earth map.
Essential Rhye's and Fall mod.

In Caveman2Cosmos only punks and religious techs are dead end (there are two requiring building too).
If you try not researching some tech for as long as possible, then you will have to research it 3 eras later at most.
 
Last edited:
All true, and good, and useful, and interesting, Raxo. But my question in this thread was whether NOT logic was possible. You are coming up with new and novel ways of using the AND logic.

Your example here, for example, is saying that grassland/plains is an AND requirement for animal husbandry. If you tried to make it into a NOT requirement, that would mean that, if anywhere in the cultural borders, a single jungle tile existed, no domestication of animals could take place and the animal husbandry tech could not be researched. I don't think that is your hope here, and wouldn't make sense with places like Cambodia (the Khmer Empire). I realize this is just an example, but I want to make clear the distinction between AND (which I already know exists) and NOT (which I don't know if it exists).
 
I meant that you can do NOT requirement indirectly, doing that directly just would need new tags.
 
There are some creative ways of setting up NOT conditions but as Raxo explained, to do it directly would require creating new tags. They would be very easy tags to create but like all tags would mean more memory storage per game object such tags were added to and each type of game object that could represent a NOT field would require its own unique tag. We have, for example, NOTonGameOption in a lot of types, and something similar would be quite possible to setup for NOTReligion on a unit or building or civic or tech.

The point I think I'm making here is it's not difficult to establish such a tag and you were 100% correct about how it would play into the AI - if they can take it they can evaluate it and if they can't, well... it would simply be isolated from being considered. That too is not hard to make sure happens in the code if it wouldn't do it naturally (in some cases if you didn't specify that then the AI could get stuck on an infinite loop trying to select the object when it can't if that's overly assumed to be automatic where it wouldn't be.) But yeah, all easy, just requiring that you set it up knowing why you are and how you'll apply it. Just adding the functionality would be a waste if it isn't applied. So the planned reason to specifically use such an effect is important to have established before you make the effect possible.
 
Top Bottom