Harder Free Tech

Perkus

Prince
Joined
Oct 16, 2010
Messages
316
Location
Ontario, Canada
Foreword:
Most players would agree that the rapid free technology "beelines" possible in vanilla Civ 5 via Great Scientists and to a lesser extent certain technologies and wonders are overpowered. This mod attempts to reduce this problem without unduly punishing the player or requiring substantial interface changes.

Description:
Restricts free tech picks to techs with a median or lower unresearched cost when compared to the costs of all currently researchable techs. Those above the median are deemed "HARD", labeled as such in the interface, and can only be researched over time through science. Partial research of hard techs can bring their cost down below the median and make them eligible for free tech. If an even number of techs is researchable, the median used is the average of the two costs in the middle. Affects all free tech sources that leave the player a choice: Great Scientists, Wonders, and Policies. Does not affect the randomly chosen free tech given by ancient ruins. Doesn't affect research agreements in any way. Includes merge of TechTree.lua file from Unofficial Patch III (v 27). Does not affect saves. Supports tech tree research queueing. Has text localization.

Example:
You have 3 techs you are currently able to research. They require 1500, 2000, and 3000 science points. The median cost is 2000. Normally you could "free tech" the 3000 point one, gaining a substantial science advantage. With this mod enabled, that tech will show up labeled as "HARD", and you will not be able to choose it. You can however spend several turns researching that hard tech normally. Once its cost drops to 2000 or less, it will no longer be considered hard, and you can "free tech" it. Note that partial research progress into any available techs does not change the median cost, the full cost is always used!

Status:
Stable. Attached below. Available in Downloads @ http://forums.civfanatics.com/downloads.php?do=file&id=15959. Currently unable to upload to the mod browser due to an unknown ModBuddy error.

Known Issues:
  • Restricts human players only, AI can still "beeline" all it likes. Not fixable.

Assets Replaced:
TechTree.lua, TechPopup.lua

Known Mod Conflicts:
Combined Civilization's Mods and Tweaks (CCMAT)

Version History:
v. 2 - Nov 19, 2010 - Changed status to "Stable", updated readme & links, uploaded to Downloads section.
v. 1 - Nov 11, 2010 - Initial release

Author:
Perkus
 

Attachments

  • Harder Free Tech (v 2).civ5mod
    9.3 KB · Views: 218
This is a superb way to solve the crazy boost in power Great Scientists got in CiV.

  • Can lightbulb any tech in V (could not in IV).
  • Only great scientists can lightbulb.
  • No cap on :c5science: from lightbulbing.

These thing add up to a rather overpowered situation. There's several options out there to solve the problem of GSs and each has its advantages and disadvantages:

  • Fixed amount of :c5science:, otherwise unchanged - Solves the issue of late-game beelines up the top half of the tech tree (like the 200-turn space victory), but disproportionately affects different eras.
  • Random tech like Research Pacts - Works for every era, but removes the deterministic nature of lightbulbing.
  • Restrict lightbulbs to lower techs - Works for every era, but doesn't solve the issue of how lightbulbing scales better than other great person instant abilities in late game.

In addition, another problem is the first two options can't be done with the current tools... great thing about what Perkus found here is this solution actually with just the Lua tools we have available.

I don't think it's a big deal that AIs can still lightbulb any tech, since they don't exploit lightbulbing anyway. The AI governors run specialists of all kinds, and I notice them building Academies quite often.
 
For what it's worth, while working on this, I also discovered that there are API functions called SetResearchProgress and ChangeResearchProgress. I believe in may in fact be possible to use these to replace the existing "free tech" functionality with a specific amount of free science points. However, I have not done any testing whatsoever whether and how these would work.

There is also a function called GetOverflowResearch(), which I believe in combination with the above could potentially be used to create a mod that captures the overflow from completed research which is apparently being discarded. Ultra min-maxing players seems to be micro-managing this overflow loss in high difficulty games, so they'd probably appreciate such a mod.

All sheer speculation at this stage of course. I may dig into it myself later. And before everyone asks, I found those here in this Firaxis's API Help file at ...sdk/ModBuddy/Help/Civ5LuaAPI.html.
 
Wow this is an excellent solution.

I'm gonna start a new game with this mod (amongst others) :)
 
Thanks, let me know how it goes. While it's tested as best as I could manage, I've been so busy modding I actually haven't had a chance to play a game on this myself yet. I'm looking for at least some basic assurance that it doesn't horribly break anything! :) So I can put it online...
 
Another possible solution:
The amount of :c5science: you get is equal to the cost of your most advanced tech.

This way if you already got Astronomy, you can get Banking or Acoustics for free (same amount of :c5science:). Economics and Navigation (next tier techs), on the other hand, you'd only get about 2/3 done. Beelining would still be possible but you'd need to put some real research into it, too.

Just put the word "Partial" in there and change the color a bit instead of "Free" or something.
 
Another possible solution:
The amount of :c5science: you get is equal to the cost of your most advanced tech.

This way if you already got Astronomy, you can get Banking or Acoustics for free (same amount of :c5science:). Economics and Navigation (next tier techs), on the other hand, you'd only get about 2/3 done. Beelining would still be possible but you'd need to put some real research into it, too.

Just put the word "Partial" in there and change the color a bit instead of "Free" or something.

I don't think the helps at all since it still allows you to pursue ("abuse") deep beelines as you only need to research the difference between the desired tech and your most expensive before bulbing
 
Perkus,

If you haven't been following my updates on the Combined Strategy thread, it worked fine in my first game. I'm starting a second one today.
 
I dont know if this is a coincidence or not but in the game I was playing last night i got two free techs from ruins and both were the tech i was currently researching. I dont know if this is due to the formula you used and because in the beginning all the techs are equal cost that because i had already done research on one it chose that one because it was below the median....Like i said it could be coincidence but I've never been rewarded the tech i was almost done researching on my own and it happened both times. Not sure how you would get around this but it was kinda annoying, i was most of the way researched on both.

Just figured i would let you know cause i think this mod is very much needed
 
@rhammer640:
Free tech from ruins automatically picks what to give you, right? In that case, it's total coincidence and has nothing to do with this mod. My mod only intercepts the user interface clicks in the tech tree and the tech selection popup. Anything that bypasses that mechanism is not affected. I'll add a mention of ruins tech in the readme.

@Txurce:
Yes, I read your report, thanks for the long-term test. I feel comfortable enough now to put this on the mod browser soon. It sounded like you didn't think it made much difference to your choices. That is quite intentional, unless you're making an effort to beeline quickly to an expensive tech, you shouldn't feel too restricted. I know people don't like mods that make them feel weaker, even in the name of balance, so I chose the 'median' approach which is quite lenient. My first draft used average instead of median, which is much more draconian. If you had a choice of 4 techs that cost 1000, 1200, 1200, 1200, all the 1200s would be "hard" using average, forcing you to research the 1000 first.

@DeepQantas:
I'm well aware of that approach (specific amount of :c5science: / free tech). That is what everyone assumed the best solution would be until quite recently. The assumption was that it wasn't moddable that way with the current tools. This mod was an effort to accomplish the same thing but achievable now. However, as the TechOverflow mod exists, I imagine it is quite possible to make it work the other way also. I found there is a trick that lets you make a free tech pick go away without actually giving you a full tech. As long as you can add a certain amount of tech research to a given tech, which I believe TechOverflow does, you can make it work.
I could do as you ask, but it would basically be an alternate mod to achieve the exact same effect. If anyone prefers that solution, feel free to fork my code to make it happen, I'm curious if it can be made to work correctly.

@ifinnem:
Actually that is already possible in this mod. The only difference is that you have to pay the difference up front, to remove the the "hard" rating of an advanced tech. The net effect is identical to what DeepQantas proposed. I don't feel this is a problem at all. It does allow a certain degree of more controlled beelining, that IMHO is ok.
 
Perkus,

Yes, I liked the way it balanced in that game. In the game I'm playing now, I have yet to receive a GS (!) so I can't say. I'll have some interesting stuff to report on this one overall.
 
I attempted to upload this mod to the mod browser, however the upload is failing for some reason. The error is reported as "Failed with code - UnknownError". This is not very helpful! I reported this as a bug here: http://forums.civfanatics.com/showthread.php?p=9923401#post9923401. I'm mentioning it here in case any other modders have dealt with it before.

I will upload it to the Downloads section here, at least. Link: http://forums.civfanatics.com/downloads.php?do=file&id=15959. While this is version 2, there are no changes in functionality. I merely changed the status from beta to stable, and updated the readme & description.
 
I've frequently encountered 'unknown errors'. One was when I had ".html" as the last five characters of my mod description, an error that was INSANE to figure out. Could you attach a copy of the modbuddy solution folder? I'll look through it and see if I can identify any possible issues I've run into before.
 
Sure, here you go. I appreciate you having a look at it! I have no idea what it could be complaining about. Just went and tried it once more, still the same error.
 

Attachments

  • Harder Free Tech.rar
    41.4 KB · Views: 160
I believe the problem is most likely you're going over the character limit for the mod description. It's actually not 1024, more around ~1010, I suspect because some additional characters are added by modbuddy after the fact.

You're close to that so the easiest way to solve this is to remove all \r\n (enter key), which suck up 2 characters apiece without having any effect in the game's text display engine. What I typically do is write my mod descriptions normally, then do a find-replace "\r\n" → "" in notepad++ if I'm over 1000 chars. This will look the same ingame but should fix the issue, if not I'll look for other potential causes:


Restricts free tech picks to techs with a median or lower unresearched cost. Those above the median are deemed "HARD", labeled as such, and can only be researched over time through science. Partial research of hard techs can bring their cost down below the median and make them eligible for free tech. Affects these free tech sources: Great Scientists, Wonders, and Policies. Doesn't affect ruins tech & research agreements. Includes merge of TechTree.lua file from Unofficial Patch III (v 27). Support & feedback at http://forums.civfanatics.com/showthread.php?t=397918.[NEWLINE][COLOR_YELLOW]Known Issues:[ENDCOLOR][NEWLINE]- Restricts human players only, AI can still "beeline" all it likes[NEWLINE][COLOR_YELLOW]Assets Replaced:[ENDCOLOR][NEWLINE]- TechTree.lua, TechPopup.lua[NEWLINE][COLOR_YELLOW]Known Mod Conflicts:[ENDCOLOR][NEWLINE]Combined Civilization's Mods and Tweaks (CCMAT)[NEWLINE][COLOR_POSITIVE_TEXT]Version History:[ENDCOLOR][NEWLINE]Please see the enclosed Readme file.


To convert back for less eye-strain editing of the description just requires a "[NEWLINE]" → "[NEWLINE]\r\n" replace in notepad++.
 
Ok, good theory, I always cram my descriptions right up to the limit. Did exactly what you suggested. Description is now 996 chars. Upload still failed the same way. :(

Was about to give up, then figured I should try to shorten it even more. I replaced the CF link with a bit.ly link. This reduced the link to 963. Upload... success! :)

Needless to say, this is a pretty irritating problem, but at least I'm aware of it now. I'll go post this workaround in my bug report.

Domo arigato for the help!
 
Was it 996 visible characters or bytes (visible and invisible)? The limit is about ~1000 bytes, might be a little over or under. In notepad++ that byte total is the important number to look at, not the character count (which only counts "visibles").
 
Well I took out the carriage returns and line feeds to get it to 996. I don't think there was anything else invisible. I have it set to "Show All Characters" and don't see anything else suspicious. I got the number 996 from Notepad++.

It seems it's actually somewhat less than 996. Maybe it varies.
 
Whatever the exact threshold I'm glad we identified the problem. :)

This was tough to figure out when I first encountered the issue since ModBuddy states a wrong number. The fact the last five characters of the description can't be ".html" was even harder to deduce, that one's really puzzling, some bug in the upload or xml parser. Then there's the problem where my Thalassicus1 account crashes modbuddy.. :badcomp:
 
I had unwittingly cranked up the latest "Z-Eras in Hi-Res" modinfo description to a whopping 1064 characters yesterday. Little did i know that right here on CF, a genius had already figured it all out.

Just got a reply from someone at GameSpy stating they aren't aware of any U/L issues. Sure, i *DO* understand (now) why. It's the ModBuddy field created by Firaxis that doesn't actually block any edits greater than a maximum amount of precious details *WE* want to add while we're at it.

What a perfectly silly & (this ASCII is valid here, at least!) arbitrary restriction to design without warning us about THE damn limit.

One more thing to fix for them, i guess. Shouldn't we ask for another reasonable number such as - i dunno - something like 128-256-512-1024___2048... never enough? Or an all new re-programmed box where nobody will ever be able to type above any given length of text?

Thanks, Thal & Perkus.
 
Top Bottom