How to limit advances

Perico_Palotes

Chieftain
Joined
Mar 3, 2009
Messages
1
Hi, everybody! It's the first time I post and I hope that my problem will get a solution. I'll explain it:

I'd want to play a game entirely in the Ancient Age, so I thought the best way to get this was to restrict the advances that all civilizations can research (both AIs and humans), but when I modify or delete all non-ancient advances from rules.txt the game doesn't work.

I have no idea what I can do about it. If you have an useful tip for me I will be very happy :)
Thanks!
 
I don't make scenarios but one possibility might be to make plumbing a pre-req to invention. Since nothing can get plumbing that may stop the tech sequence cold. If invention would still be available via huts then you may have to go a little farther on the tech track.
 
I'd want to play a game entirely in the Ancient Age, so I thought the best way to get this was to restrict the advances that all civilizations can research (both AIs and humans), but when I modify or delete all non-ancient advances from rules.txt the game doesn't work.
You can't delete data from the @CIVILIZE table. Each line represents a hard-coded technology slot. To remove a technology from the tree you have to edit its properties, specifically the 4th and 5th data values. These codes represent prerequisite technologies. Change these values to 'no' (see below); the same as the unused slots at the end of the list. The technology will then become unavailable. Don't leave out any commas.
Code:
@CIVILIZE
Advanced Flight,    4,-2,  no, no, 3, 4    ; AFl
When you're done with that, make sure that everyone can research Future Technology (by changing its prerequisites to something researchable), otherwise the game will crash. The tech codes for the prerequisites must be exact - and they are case-sensitive. Rename Future Technology to something more appropriate if you like. You can run Mercator's Civ2Tech utility on the rules file to check for errors.
 
I have a question about limiting tech in ToT:

If I flag a tech that is necessary to continue through the tech tree to Future Tech as 'unresearchable,' will the game crash? (I know I could test this myself but I'm lazy.)

Macro.txt says this:

"Also note that for the game to function, every civilization must always have a possible research route to Future Technology (90). Therefore, the module that includes advance 90 and all of its
ancestor prerequisites must always have a value of 0 for all civilizations."

I'm reading that the answer is yes, the game will crash (because the tech will cut off the route to FT). Am I reading it correctly?

The reason I ask is because I wanted to try dividing the tech tree into Ages (a la Civ3) by preventing research in the next Age (i.e. Civ2=Era) until all of the previous Age's techs have been researched.
 
And I don't think Mercator's tech utility checks this problem (i.e. just checks @CIVILIZE section; restriction section is @CIVILIZE2).
 
I'm reading that the answer is yes, the game will crash (because the tech will cut off the route to FT). Am I reading it correctly?
Yes. When the AI can't research anything at all because the tech tree has been truncated, that's when it'll crash.
And I don't think Mercator's tech utility checks this problem (i.e. just checks @CIVILIZE section; restriction section is @CIVILIZE2).
Correct. The zero value mentioned in the quote is actually a reference to the @LEADERS2 table. The value for Future Technology in @CIVILIZE2 can be anything from 0 to 7; the values it cross-references in @LEADERS2 must be zero (see the attached example where I've given FT a value of 6 in @CIVILIZE2). Really Civ2Tech would also need to check any SCN/SAV file, as the @LEADERS2 table is written there once the game file has been created. When a scenario or saved game is loaded, the game ignores the table in the rules.txt file and reads the one from the SCN/SAV file instead. The EnableTechnology action rewrites @LEADERS2 data in memory; this is then saved in the SAV file when you save your game. Technology restrictions, as per @CIVILIZE2 and @LEADERS2, are buggy. Restricted (group 2) techs can be stolen by spies and diplomats (see this article).
 

Attachments

  • FutureTechToT.png
    FutureTechToT.png
    5.2 KB · Views: 85
Yes. When the AI can't research anything at all because the tech tree has been truncated, that's when it'll crash.

Ok so the game will crash if it runs out of techs to research, but it won't crash until the AI researches the last available tech (FT not being researchable). Meaning that one could still play with FT as non-researchable so long as there is always something to research.

So to keep with the example: as long as one enables the next Age's techs before the AI researches the last of the previous Age's techs, there's no problem.

See I was concerned that merely cutting off the path to FT, regardless of whether the AI had run out of techs to research was sufficient to cause a crash (i.e. that the AI would scan the tree, find no path to FT and crash the game immediately).

(I know I should have known the answer to that but I have to admit, I don't really experiment with techs that much--more of an implied, 'will test the tech stuff when I actually make a scenario.')

Correct. The zero value mentioned in the quote is actually a reference to the @LEADERS2 table. The value for Future Technology in @CIVILIZE2 can be anything from 0 to 7; the values it cross-references in @LEADERS2 must be zero (see the attached example where I've given FT a value of 6 in @CIVILIZE2). Really Civ2Tech would also need to check any SCN/SAV file, as the @LEADERS2 table is written there once the game file has been created. When a scenario or saved game is loaded, the game ignores the table in the rules.txt file and reads the one from the SCN/SAV file instead. The EnableTechnology action rewrites @LEADERS2 data in memory; this is then saved in the SAV file when you save your game. Technology restrictions, as per @CIVILIZE2 and @LEADERS2, are buggy. Restricted (group 2) techs can be stolen by spies and diplomats (see this article).

Yep thanks, copied that info from your site a while ago. ;)

The bug is a real bummer; you can get around it though (sort of): since 'no,no' techs can't be stolen, make the non-researchable tech 'no,no' and give it to player via events once x tech (the supposed prerequisite) is researched; only trigger the event if players meant to research it do so (i.e. if banned player researches the trigger tech, they aren't given the 'no,no' tech).

Example:

@IF
RECEIVEDTECHNOLOGY
receiver=Romans ['allowed' civ]
technology=3 ['prerequisite' tech]
@THEN
JUSTONCE
TEXT
No Broadcast
^
^^Your scientists discover (non-researchable tech).
^
ENDTEXT
GIVETECHNOLOGY
technology=4 [non-researchable tech]
receiver=TriggerReceiver
@ENDIF

Repeat this for each 'allowed' civ. I'm sure there's a more efficient way of doing this (i.e. where you could set the receiver as 'Anybody' and using flags) but I can't think of it at the moment.
 
Meaning that one could still play with FT as non-researchable so long as there is always something to research.
Yes.
So to keep with the example: as long as one enables the next Age's techs before the AI researches the last of the previous Age's techs, there's no problem.
Remember, the research rate for the AI will change at different difficulty levels. You'd want to test it on Deity. Is there any reason why you can't make FT available from the outset? It doesn't have to be positioned at the end of the tech tree.
The bug is a real bummer
You wonder how this kind of thing ever got past QA. Then again, years later I'd still never seen it mentioned in the the scenario design forums. It's not in this article, either. I discovered it the hard way (part way through designing a scenario) and was less than impressed. Thankfully, I found a workaround without having to revert to all that twice removed garbage.
I'm sure there's a more efficient way of doing this (i.e. where you could set the receiver as 'Anybody' and using flags) but I can't think of it at the moment.
Neither can I.
 
Remember, the research rate for the AI will change at different difficulty levels. You'd want to test it on Deity. Is there any reason why you can't make FT available from the outset? It doesn't have to be positioned at the end of the tech tree.

I suppose, but wouldn't that look kind of odd (i.e. having FT available for research in the Ancient Age)?

You wonder how this kind of thing ever got past QA. Then again, years later I'd still never seen it mentioned in the the scenario design forums. It's not in this article, either. I discovered it the hard way (part way through designing a scenario) and was less than impressed. Thankfully, I found a workaround without having to revert to all that twice removed garbage.

Yeah there are a number of little bugs like this that are odd considering what central functions they have in the game. Somebody didn't playtest. (It never ceases to amaze me how you sometimes get armies of playtesters on these games and they miraculously miss the most basic of bugs--just look at Civ3 and its succession of buggy patches.)
 
I suppose, but wouldn't that look kind of odd (i.e. having FT available for research in the Ancient Age)?
It's not ideal, but there are quite a few scenarios that do it, including my own WotR scenario. Rename it and make it clear that it's FT renamed.
Yeah there are a number of little bugs like this that are odd considering what central functions they have in the game. Somebody didn't playtest.
Anyone who's played any of the 4 official scenarios/mods would run across the bug soon enough. In this recent thread on the Sci-Fi game, the issue was raised in the opening post (7th point).
(It never ceases to amaze me how you sometimes get armies of playtesters on these games and they miraculously miss the most basic of bugs--just look at Civ3 and its succession of buggy patches.)
I've got wind of some of that. Sounds like another reason to keep avoiding Civ3.
 
It's not ideal, but there are quite a few scenarios that do it, including my own WotR scenario. Rename it and make it clear that it's FT renamed.

So the effect is that a player has something to research while they wait for the new batch of techs to become researchable? But then you're stuck researching the FT tech when once the non-researchable tech becomes researchable (in my case, that would be the following turn).

Unless.......ok what comes first, the 'allow research' event or the tech research options window (i.e. once you have researched the trigger tech that unlocks the next batch of techs)? Because if the former comes first, then there's no problem because the now-researchable tech is available for research by the time the player gets the research options window.

I assume that the same applies to the AI (i.e. the AI selects its research just like the player does--the sequence of functions is the same).

In case that wasn't clear, here's an example from the vanilla game:

Lets' say Feudalism is required for all Renaissance techs. Feudalism only becomes researchable once Construction, Philosophy, Monarchy and Trade have been researched.

So once the four prerequisites are researched (i.e. no techs left/event triggered), will I be able to research Feudalism when the research options window comes up or will the game crash?


I've got wind of some of that. Sounds like another reason to keep avoiding Civ3.

To be fair, they did deal with a lot of the bugs by the time the final patch came out (although it apparently introduced a new bug or two :rolleyes: ). The change over at Infograms is what apparently made the Conquests xp such an improvement--especially where modding was concerned. If it hadn't been for C3C, I don't think I would've even bothered trying to mod Civ3.
 
So the effect is that a player has something to research while they wait for the new batch of techs to become researchable? But then you're stuck researching the FT tech when once the non-researchable tech becomes researchable (in my case, that would be the following turn).
Well, assuming they've researched everything and there's nothing else available, yeah. The alternative would be that once they're done researching everything, there'd be a period where they'd have nothing to research. Even if that period lasted a single turn, you'd still have a problem if it affected an AI player. Then again, isn't the whole point of the procedure designed to keep the non-researchable, gifted tech out of the wrong hands? Why can't the trigger tech be the prerequisite for the next advance in the tech tree? Interrupting the tech tree in the manner you describe won't stop players from stealing any tech that can be researched by somebody - no matter where it's positioned in the tech tree. Otherwise, you'd merely be introducing a cumbersome method that produces the same net result (minus the trade and conquest restrictions) as the @CIVILIZE2/@LEADERS2 restrictions. In other words, you might as well use @CIVILIZE2/@LEADERS2 to block research.
Unless.......ok what comes first, the 'allow research' event or the tech research options window (i.e. once you have researched the trigger tech that unlocks the next batch of techs)? Because if the former comes first, then there's no problem because the now-researchable tech is available for research by the time the player gets the research options window.
The tech research options window comes first. The ReceivedTechnology trigger is checked at the very beginning of each turn, before the player turns. Therefore, when a player finishes researching the trigger tech in their turn, it won't be until the beginning of the following turn that the non-researchable tech is given.
Lets' say Feudalism is required for all Renaissance techs. Feudalism only becomes researchable once Construction, Philosophy, Monarchy and Trade have been researched.

So once the four prerequisites are researched (i.e. no techs left/event triggered), will I be able to research Feudalism when the research options window comes up or will the game crash?
If you use the ReceivedTechnology-GiveTechnology combo for one of its two prerequisite techs, Feudalism won't be available until the next turn, so no, it won't be available when the window pops up. The game will crash if this happens to an AI player. If it's a human player, the research progress will come up blank, but the research window will pop up as soon as a researchable tech becomes available. You'd only bother with all of this if the non-researchable tech (whatever that is in this example) had some function (eg, building railroads, certain city improvements or wonders) that you wanted to withhold from specific tribes. There'd be nothing to stop espionage units from the 'wrong' tribes stealing Feudalism and every researchable tech that follows once they'd been acquired by the 'right' tribes.
 
Then again, isn't the whole point of the procedure designed to keep the non-researchable, gifted tech out of the wrong hands? Why can't the trigger tech be the prerequisite for the next advance in the tech tree? Interrupting the tech tree in the manner you describe won't stop players from stealing any tech that can be researched by somebody - no matter where it's positioned in the tech tree.

It was really just to prevent any player from going straight for the next age without having completed all of the previous age's research. In the next age. But yeah, other players would still be able to steal the tech (thanks to the bug). The idea is that they would still need to steal all the previous Age's techs in order to do their own research in the next Age (or just keep stealing).

Obviously you could just interweave the tech so that the tree got reduced to two techs just before the next Age but it wouldn't work for an extremely simplified tech tree I had in mind and you'd still need the non-researchable limitation to prevent other players from researching next age techs they've stolen the prerequisites to.

I was actually thinking of 4 techs per age followed by an 'Age' tech in the next age (i.e. when you've researched the 4 techs, you can then research the 'Age' tech that is the prerequisite for the next 4 techs). (Mainly for reducing tech micromanagement.)

The tech research options window comes first./QUOTE]

Dang. I suppose that would've been too easy.

Nevertheless at least now I know what the process is. Thanks for that.
 
It was really just to prevent any player from going straight for the next age without having completed all of the previous age's research.
The reason I ask is because I wanted to try dividing the tech tree into Ages (a la Civ3) by preventing research in the next Age (i.e. Civ2=Era) until all of the previous Age's techs have been researched.
Obviously my Alzheimer's kicks in after about a week. :o
 
Top Bottom