anUser Posted April 23, 2013 Author Share Posted April 23, 2013 At last I could implement it all... it requires a bunch of hex edits to lots of functions, but I hope the result is worth the effort. I'll post here some of the edits I've made, in case anyone is interested in trying this same setup or any other you may come up with. ---------- Techs ----------Techs requirements are set in BuildTechs function and HasPrereqs, both in XGTechTree. In BuildTechs function (the function that "creates" techs) we can specify an item requirement and/or a tech requirement, and for those techs requiring a special treatment it has a boolean "Custom prereqs" param. If that one is true then to check if the tech is available for research it runs a hard-coded check inside HasPrereqs function, ignoring the tech and item requirements as set in BuildTechs. The game originaly made great use of this custom prereqs, so that's great because there's planty of space in HasPrereqs function to suit our needs, but there was few space in BuildTechs to change many 4A NoParam tokens with 2 bytes integers (in order to use less custom requirements and more "regular" requirements, ie having researched certain tech). In order to save that space I replaced all those calls to TechCost for single-byte 1 (0x26), that is later overwritten by DGC.ini values. Fortunately in BuildTechs there's no virtual size or jump to worry about. The fun comes with HasPrereqs, I had to re-write it entirely, correcting jumps and alike, but it's pretty straightforward to edit, I just needed a cheatsheet with the four functions that are used all the time and the rest is having patience with the switch case statement. If someone's to modify this, my advice in order to save a few bytes, is using HasTechPrequisites(iTech) instead of LABS().IsResearched(xx) and using HasItemPrequisites(iTech) over STORAGE().EverHadItem(xx), at least for the first item or tech requirement. The final decompiled code looks like this: function bool HasPrereqs(int iTech) { local TTech kTech; kTech = TECH(iTech); // End:0x6E if(!kTech.bCustomReqs) { return (HasItemPrequisites(iTech)) && HasTechPrequisites(iTech); } // End:0x5B8 else { switch(iTech) { // End:0xC4 case 18: return (HasTechPrequisites(iTech)) && ENGINEERING().IsFoundryTechResearched(11); // End:0x5B6 break; // End:0x155 case 5: return (((HasTechPrequisites(iTech)) && LABS().IsResearched(32)) && ENGINEERING().IsFoundryTechResearched(5)) && ENGINEERING().IsFoundryTechResearched(11); // End:0x5B6 break; // End:0x1FB case 22: return (HasTechPrequisites(iTech)) && (((HasItemPrequisites(iTech)) || STORAGE().EverHadItem(14)) || STORAGE().EverHadItem(15)) || ); // End:0x5B6 break; // End:0x28C case 23: return ENGINEERING().IsFoundryTechResearched(7) && ((HasItemPrequisites(iTech)) || STORAGE().EverHadItem(15)) || STORAGE().EverHadItem(17); // End:0x5B6 break; // End:0x335 case 24: return ((HasTechPrequisites(iTech)) && LABS().IsResearched(36) || LABS().IsResearched(41)) && (HasItemPrequisites(iTech)) || STORAGE().EverHadItem(17); // End:0x5B6 break; // End:0x390 case 25: return ((HasTechPrequisites(iTech)) && HasItemPrequisites(iTech)) && LABS().IsResearched(41); // End:0x5B6 break; // End:0x421 case 33: return (((HasTechPrequisites(iTech)) && ENGINEERING().IsFoundryTechResearched(4)) && ENGINEERING().IsFoundryTechResearched(8)) && ENGINEERING().IsFoundryTechResearched(9); // End:0x5B6 break; // End:0x426 case 20: // End:0x50E case 21: return ENGINEERING().IsFoundryTechResearched(6); // End:0x5B6 break; // End:0x561 case 3: return LABS().HasInterrogatedCaptive() && STORAGE().GetNumItemsAvailable(191) > 0; // End:0x5B6 break; // End:0x5B3 case 13: return LABS().IsResearched(4) && LABS().IsResearched(8); // End:0x5B6 break; // End:0xFFFF default: return false; } } //return ReturnValue; } ---------- Foundry ----------Foundry projects follow a similar pattern. They are defined in BuildFoundryTechs, and just like labs techs we can set here a required tech and a required item, but no custom requirement. Instead the game performs an extra check in HasFoundryPrereqs function, which is in addition to standard requirements. In this case I've been tremendously lucky because there's room for only 2 checks (or maybe 3 using some sort of code optimization), and in my draft only 2 projects had custom requirements, so I've just replaced this piece of code:// End:0x32 if(iFoundryTech == 16) { return ENGINEERING().IsFoundryTechResearched(1); } // End:0x6B if(iFoundryTech == 2) { // End:0x6B if(!STORAGE().EverHadItem(88)) { return false; } } for this one: // End:0x33 if(iFoundryTech == 14) { return ENGINEERING().IsFoundryTechResearched(13); } // End:0x6B if(iFoundryTech == 15) { return ENGINEERING().IsFoundryTechResearched(14); } so now pistol upgrades become a "research path", each upgrade after another. ---------- Unlock Items ----------But then in order to make certain lab techs and foundry projects unlock pertinent items we've got to edit the items themselves in XGItemTree.BuildItems. There we can save bytes replacing those -1 values with 1, and so we can add more items (like grapple, smoke grenade) and give items more default requirements, that can be a tech, a foundry project and/or an item. In particular I've changed here alien grenades to make them buildable but so they require the alien grenades foundry project (so you can start manufacturing them once the project is completed. Notice also the foundry project requires light plasma rifle tech and an alien grenade item, which can only be obtained from a captive alien, so it's a long path now). Also I've disabled the infinite alien grenades upon completing the project editing XGFacility_Engineering.OnFoundryProjectCompleted, changin this check: // End:0x49D if(m_arrFoundryProjects[iProject].eTech == 2) { STORAGE().m_arrInfiniteItems.AddItem(88); BARRACKS().UpdateGrenades(88); } for eTech == 19, which will never validate.I've also made so new equippable items such as grapple, battlescanner and (yet inoperative) flashbang grenades require Experimental Warfare, and also changed Plasma Pistol to require SHIV Plasma project (plasma weapon prototyping), and all 3 ufo boost consumibles. And finally, XGFacility_Engineering.GetItemProjectCost sets extra item requirements to build certain items (firestorm, ufo boosts, chiting plating, mind shield). The way the game apply this is as follows: first it checks in this getItemPorjectCost function if there's some custom requirement and in case it doesn't it then requires the item set in BuildItems (pretty stupid the case of MindShield item, that had hard-coded it requires an ethereal corpse, and already had that defined as "regular" requisite). In any case, I've set most of items requirements in BuildItems so I've just skipped most of the checks in GetItemProjectCost by comparing (eItem == 195), except for firestorm that still requires an ufo power src and 2 nav compt, and psi-armor that took the place of chiting plating and now requires 8 chryssalid corpses. ---------- Facilities ----------I wanted to unlock the foundry from the beginning but I haven't found yet where does the game stores that info. My thought was XGFacility_Labs.OnResearchCompleted, but the only reference to tech 11 (exp.warf) is this: if((ISCONTROLLED()) && m_eLastResearched == 11) { HANGAR().SetDisabled(false); }I'm not sure what it does, but it doesn't seem to unlock the foundry. I'd appreciate if someone could give a hint to know at least where to look at, otherwise I think I'll try if I can sneak a call to that same sentence somewhere else in case that hangar m_bDisabled variable were indeed used as a flag to check if foundry is available. Link to comment Share on other sites More sharing options...
Amineri Posted April 23, 2013 Share Posted April 23, 2013 Unlocking the Foundry is a piece of cake. I had an old forum post about how to do this: http://forums.nexusmods.com/index.php?/topic/937083-shivs-for-early-game-unlocking-the-foundry/&do=findComment&comment=7537817 It was in some earlier beta versions of Long War, so I know it works. Link to comment Share on other sites More sharing options...
anUser Posted April 23, 2013 Author Share Posted April 23, 2013 missed that... thanks! Link to comment Share on other sites More sharing options...
Amineri Posted April 24, 2013 Share Posted April 24, 2013 That set of changes looks pretty awesome! Sorry I haven't posted up much about it yet. I was trying to convince JL to make Smoke Grenades, Battlescanners and Medikits "free" infinite items at the beginning of the game. If XCOM can afford free assault rifles, Kevlar body armor, frag grenades and rocket launchers, it seems a bit stingy to not include these other basics. However, Battlescanners give a serious boost to Squadsight snipers, so I've been shoulder-deep wading through hex code to put in the squadsight aim penalties. That modlet actually might be popular enough on its own to warrant distributing it. BUT IT IS DONE NOW! ------------------------------------------ Anyhow! It looks good. How does it play? The scope of it so large its a little hard to wrap my head around. I recall that most of the foundry projects required only tech or an item, and of course that the foundry be built. It was sort of an implicit requirement that Experimental Warfare be completed for any of the foundry projects. Unlocking the foundry of course eliminated that, so I had hard coded in that all of the foundry projects (except the shiv project) required experimental warfare. It might be possible to hard-coded in a few other special requirements like that if you find that you need it. With all of the changes, it might be nice to have a graphic picture to get an idea of what is changing. There is a really nice picture that someone developed for the vanilla game. http://www.xdude.com/images/xcom-enemy-unknown-2012-tech-tree-research-chart.pdf Color coded, and with lots of little arrows. ------------------------------------------------------ Ok ... here goes ! I guess one thing that comes to mind is this: can the tech tree be made into an emergent gameplay feature? I don't mean that the arrows are randomized or anything like that. I mean, Civ IV had a fixed tech tree, but different dynamic events and playing as different cultures could impact your traversal of it, leading to different experiences on different playthroughs. I wonder if there is any way to bring something like that to the XCOM tech tree, so that it's not just the same optimal path through the tech tree every time. The general rule for developing emergent behavior is having a large number of simple entities, but with a large number of possible interactions between them. How to apply that to the tech tree .... *ponder* It's too bad that the scientists can't be more individualized. That would be one route to emergent behavior -- if each scientist and engineer had randomized "affinities" for different types of projects. Unfortunately, it would require a complete new UI and data structures, both of which are beyond us. Also, it could easily lead to a ton of micromanagement that wouldn't really be very fun. It is rather interesting how in a game that is so hard-core about randomized to-hit rolls, randomized crit rolls, randomized damage, randomized recovery times, the "That's XCOM, baby!" mantra -- with all of that, research progress is 100% deterministic and is perfectly linear. Double your scientists and you double your rate of science progress. And you know with perfect certitude exactly how long each project will take. Another strategy game I like, Crusader Kings II, has a completely different spin on research. There are 24 technologies that give you bonuses as they improve. Each county in the game world has its own technology level, for each of the 24 technologies. Each game year, each county has a small (often 1%) chance to improve each technology by 0.1 (The tech levels range from 0.0 to 5.0). However, the chances can be influenced by the player in a variety of ways. 1) If your ruler and his advisor have a high learning skill, then tech progress in the entire realm is improved.2) Three "focus" areas can be defined, which double the chance of increase in all counties that your ruler rules.3) Each county in your immediately controlled demesne with a higher tech level grants the others a bonus4) You can send your advisors to improve the chance to increase in one particular county (usually your capitol)5) A county with a neighbor with a higher tech level gets a bonus to improve Since there are 100's of counties in the game, each following simple rules, emergent behavior arises. It is not possible to predict exactly how technology research will progress. It IS possible to influence it probabilistically, and it IS possible to take advantage of how the research develops. Clearly the exact same ideas wouldn't apply here. However, it is possible to make research probabilistic instead of deterministic. Perhaps every research project that -could- be researched has a small chance of advancing every hour. The research project that you choose has a much greater chance. The chances of improving are greatly affected by the number of scientists (or engineers). In the real world no one knows how long research will take. And engineering projects ALWAYS take longer than scheduled ^_^. Besides, these are world class scientists we must be talking about working on this advanced stuff. They probably have a bit of ego, and so may not work on exactly what you tell them to. Plus, maybe they have some brainstorm on a project besides the one you directed them to work on. Since you've placed the projects into rough categories, those could also be taken advantage of. Each of the FC nations could have randomized affinites toward each of the project categories. Instead of contributing scientists/engineers per se, when a satellite is put up it allows real-time high-bandwidth teleconferencing with the scientists in that country, so the probabilistic progress of the possible projects in each category is improved based upon that nation's affinities. If the player wants to go for a particular category, she can go for particular countries that are "good" at that research category. Of course, that might mean passing up some of the continent bonuses, or having to spend more on interceptors in order to protect the satellites. One feature of this I like is that then the satellite effectively contribute research (similar to scientists), but this contribution is vulnerable to the aliens shooting down the satellite. Currently you get scientists and engineers monthly -- once you have them, they are "safe" and you can never lose them. (this is an example of another "interaction" possibility) Of course, you'd still be able to collect scientists and engineers in other ways -- just not as a monthly reward for having a satellite up. As a bonus, as soon as the satellite reached orbit, the research influence would begin, which could encourage players to not launch satellites only at the end of the month. A nice feature of the "hour granularity" that the strategy game calculates in is that large numbers of probabilitistic events tend to be relatively predictable, but not 100% so. They lead to the phenom of the "random walk" (http://en.wikipedia.org/wiki/Random_walk). Specifically, suppose you could advance research by "one point" every hour, with a 50% chance (given priority, number of scientists, labs, project difficulty, and FC nations linked in). Over the course of 15 days, that represents 15 * 24 = 360 random checks. On average you'd expect to have 180 successes, or 180 research points accumulated toward that project. However, this follows a binomial distribution (http://en.wikipedia.org/wiki/Binomial_distribution) which has certain well-defined properties. In particular, the sample variance (the amount that you expect to deviate from the average) is Sqrt(180 / 4) = 6.7. That is, 67% of the time you'll have between 173 and 187 points, and 95% of the time you'd have between 167 and 193 research points. It is actually very unlikely to get EXACTLY 180. This would make it possible to calculate (and give to the player) the approximate time of completion, but the exact time would not be predictable. Rather like real-life research projects.So, I see the following ways to generate non-determinstic behavior from research projects:1) Progress points toward each project that has all requirements met are gained probabilitically every hour2) The priority research project the player selects has a large boost in chance per hour3) The chance per hour is influenced by: a) Number of scientists or engineers (depending on project type) b) Number of labs or workshops (depending on project type) c) Number and affinity of FC nations with satellite connections d) Number of prerequisite projects completed (in the case of a Project A OR Project B requirement) This last idea would play out like so -- you COULD always try and research plasma weapons having researched only one of <weapon fragments>, <elerium>, <alien materials>, but it is much harder to do so, and will likely take longer. If you've researched two of them it will go faster, and even faster with all three. Some requirements are "hard requirements", of course. You can't research UFO Power Sources if you don't have any. (of course, maybe you could try and figure them out based on a damaged UFO power source, but that would be a lot harder!) This concept leads to the idea of "the more of an item you have, the faster you can research it". If you have 80 scientists, it would be difficult for all 80 to effectively study one UFO power source. There should be some improvement for having two, or three. Of course, you may have to dismantly some items, leading to the chance of item destruction from storage as a side-effect of research. Clearly there are diminishing returns at play here -- having 10 scientists and 60 sectoid corpses isn't going to help much more than having 30 sectoid corpses. This adds another category -- e) Number of required items collected. This means that the results of the tactical game more directly feed back into research rate. Particularly if the "explosions destroy corpses" mod is enabled. Skillful tactical play balancing need-to-win, need-to-preserve-soldiers, and need-to-collect-artifacts will be required. Push too much on winning and preserving your troops and you might find your research taking too long due to lack of artifacts. -------------------- Anyhow, sorry for the long and somewhat rambling post. Guess I got inspiration from somewhere :D Link to comment Share on other sites More sharing options...
anUser Posted April 24, 2013 Author Share Posted April 24, 2013 lol that's a long post... but hey, there are tons of interesting ideas there As for playtesting my setup, I couldn't playtest it yet, I've found an issue regarding tech research times, they seem to ignore the time I set in the ini, maybe that's related to num of scientist available and required, or "optimal" (I think the game doesn't really require certain num of scientists, only engineers, but then certain techs get their time reduced once you get certain number of scientists), though I may got it wrong, I actually have to go through the code and see how it's done. A small (current) technical limitation is regarding foundry projects requirements. Labs Techs can be customized as you like, some of them have alternative requirements (so you need one or the other) and actually you can script whatever requirements you want for them since there's plenty of space in HasPrereqs(), but foundry projects have little space in HasFoundryPrereqs(), and I'd say those stack on the required tech for that foundry project, so to further customize foundry projects requirements we'd need to find a function to call from within HasFoundryPrereqs. I like some of the ideas you've mentioned- Cross-path researches (or dynamic multiple tech interactions): from a technical point of view it's totally possible, the script that set techs as available checks if certain condition is met for each tech and if so that research becomes available, and that check could be as crazy as having the base located in certain continent, OR having all satellites on that continent, OR whatever you want. I see two main implementations on this, one this "national" technology that countries or continents may guard so proudly that they'd only share it if you treat them well, and another one is creating cross-path researches, ie making certain tech available after different paths. That is how I ended up coding the archangel armor, since I couldn't make it so the advance flight project had *alternative* requirements as intended (floater interrogation OR heavy floater autopsy), what I've made is that Floater Interrogation allows developing the adv.flight proj., which allows developing archangel armor, and Heavy Floater autopsy allows direct access to researching archangel armor (without the need of the foundry project), so in this case the player has the choice to wait until s/he meets heavy floaters on the ground or s/he can push the research of archangel armor interrogating a regular floater and at the cost of an extra investigation (foundry adv.flight proj) but the archangel armor would become available sooner that way. This is a small and probably irrelevant example, but the concept can be scalated, the pity there aren't many many techs. - Non-deterministic research times: I love the idea, there are many possible setups for this, a random check (based on some parameters) to determine wether an investigation progresses or it doesn't sounds good. - Research time bonus: I haven't messed with the code responsible for this yet, I know the game has those "research credits" that grant an X% research time bonus to certain techs, and there's also a function that sets which credit applies to which tech, so this can be coded. My thought on this was just 1) make certain "research credits" are granted after regular research, not only with interrogations (in my setup researching elerium grants laser weap techs), and 2) then see if those research credits can be stacked, so following previous example where there was a long path and a short path to reach the same point, choosing the long one could grant research credits to make following investigations in that field come faster. The problem again is that there are few research credits, but they all could be used for 2 research-intensive investigation paths (like ufo/firestorm tech and plasma weaponry). By the time you get the "All Weapons" or "All techs" res.cred. you've already developed relevant techs. Anyway there aren't many "alternative" techs to make this much relevant, in the case of plasma weapons, each tech requires having developed the previous less poweful version, so let's say we make them all available once certain previous requirements are met (ie, researching elerium, whatever) ... unless you really want plasma pistols or light plasma rifles, nobody would research them just to reduce plasma rifle research time... but if the alternative were researching them all in order (pistol, light rifle, rifle) and getting pretty accurate research times, or rather risking investigating plasma rifle and just getting small progress each random amount of time (however it's coded that'd be the result) then I think the alternatives are pretty cool. Both previous ones could be combined so research credits would cut down the "expected" research time (and that is visible), while meeting other criteria (like already having developed related techs) would increase the chances of making progress every day in that field of research. In this direction, each tech could be given a different weight when counting towards the success chance... just an example, maybe alien grenades benefit from plasma research but nothing learnt from them can be in turn applied to plasma weapons research. Anyway there should be a clear way for the player to know an approximate chance of success, ... or leave that covered with few hints and let the player experiences the joy and frustration of researching the unkown I tried to make two differenciate big branches of research, human techs vs alien techs. First include upgrades to ballistic weapons, laser weapons, SHIVs and arc-thrower, including EMP cannon (to give a high-tech choice for interceptors in this "brach"), and alien techs involved everything else, plasma weaponry,ufo tech and alien alloys (including armor). By giving alien techs a high research time I intend to make them sort of require labs (cause I play with few staff), and since I play with few staff the player has to focus on getting more scientists to build more labs, so in the end if you want to research that in reasonable times you've got to focus on getting scientists,while on the other hand, if you want to go for "human" techs you'll need lots of engineers to meet the foundry projects requirements, so you'll end up needing to build some workshop or just picking engies whenever you can. The problem is that using the foundry leaves the lab available, and viceversa, so my concern now was timming paths so the player can't use those gaps to advance in technologies s/he's not actually researching without disrupting his/her main research. For example, the foundry plasma project (weapon prototiping) will take as many days as researching alien materials and elerium (cause that grants the laser weap res. credit), but if the player chooses to research alien armor while waiting 'till the prototype is done s/he'll have to wait a few more days for the armor to finish until s/he can resume the laser investigation. And the idea is to make the same for all the techs, at least to make 3 or 4 "optimal" paths to begin with, ballistic, laser or plasma rush and ufo techs maybe... and as I've said, I love the idea of creating a random chance of progress in tech research, but I think any implementation should consider strategic decisions and avoid punnishing the player whenever it isn't necessary, so in this case, if a player follows certain research path from the begining, taking every step necessary, the random factor should be small imo, while punishing for picking a high tech from an unresearched brach. I'll give it some more thought, this seems very promising. Link to comment Share on other sites More sharing options...
anUser Posted April 25, 2013 Author Share Posted April 25, 2013 (edited) I've been digging some more into the code, investigating whatever I was finding related to how techs work, and I've made a few discoveries: Function XGTechTree.GetTech, instead of just returning m_arrTechs[iTechType] it also sets the expected duration, it applies south america bonus to interrogations and autopsies (unfortunately they used 1-byte 0, I wanted to make it so that bonus just halved autopsies time, instead of =0, /=2 but for just one byte I'll have to re-work it somehow). And it also calls GetCreditAdjustedTechHours which runs once for each research credit, so multiple bonus stack together! I've also looked for the possibility of implementing that "techs conditional/random progress" feature that's been discussed here, and my veredict is that it is entirely possible! :smile: ...although it may be difficult to find the right place to code it out.... I don't know if Amineri was aware of the way the game tracks techs progress but the thing is that indeed there's a GetResearchPerHour() function that returns "how much" the player researches per hour, and it turns out that players research (Num.Scientists * Labs Bonus * Labs adjc bonus) each hour, which clearly gives us a hint of the magnitude of those three elements and their weight in the calculation. Honestly I expected to find the number of scientists contribute in a non-linear way, but that's the exact formula, so it just renewed my convincement that the number of staff you get per month had to be cut down. The relevant code that makes use of that call to GetResearchPerHour is in XGFacility_Labs as well, function Update(): iHoursCompleted = GetResearchPerHour(); m_kProject.iActualHoursLeft -= iHoursCompleted; m_arrProgress[m_kProject.iTech] += iHoursCompleted; m_arrTimeSpent[m_kProject.iTech] += 1;If I'm not wrong last line array m_arrTimeSpent it's only used for stats, which may in turn grant an achievement or something like this, so unless removing it affects the game in some other manner, I think it's the perfect place to call a function to check if that hour has been fruitful or it hasn't. So it could end up like this: iHoursCompleted = GetResearchPerHour() * CUSTOM_FUCTION(); m_kProject.iActualHoursLeft -= iHoursCompleted; m_arrProgress[m_kProject.iTech] += iHoursCompleted;the only requirements for this custom function would be: either a) be a class function in XGFacility_Labs or XG_Facility that takes as only mandatory argument an integer, or b) a function somewhere else that takes as the only mandatory argument a TResearchProject struct, and in both cases it should return either an integer or a boolean to perform the multiplication. In any case, the sentence that could be removed frees up 25 bytes, whatever can be done with this is welcome. And in order to code the multiple bonus for each tech we'd need a pretty long function. As a side note, I'll try to give another go to tech research credits and see if some of the sort of what's been talked lately can be done only with this research credits, separating with care those techs that *really need* some other tech to be researched and those that *could beneffit* from already having researched another tech. I'm thinking of an example that will be easy to implement: all 4 "basic" armor techs (2 light, 2 heavy, level 1 & 2 of each type) available from the beginning. Alien alloys tech (weap frag) grants Armor research credits 1, and developing an armor of level 1 (carapace or skeleton) grants additional armor research credit. In this case the purely theorical research (Alien Alloys) would grant the biggest time discount, since it doesn't grant anything else per se. Idealy each tech would be a research credit on it's own, so every armor researched would slow down the time required to research any other armor, but unfortunately we've only got 9 of them. Edited April 25, 2013 by anUser Link to comment Share on other sites More sharing options...
morro123 Posted April 27, 2013 Share Posted April 27, 2013 Sorry guys, I just read you and felt the urge to post that any effort spent in making research less deterministic simply sounds like heaven! Thanks for trying this! Link to comment Share on other sites More sharing options...
anUser Posted April 28, 2013 Author Share Posted April 28, 2013 hey morro welcome to the forum and thanks for the support! I've been thinking a way to put together a "plan" or a draft on possible tech trees to make the most techs available from the beginning but also making that those more advanced could greatly beneffit from previous researches on the same field. I've based this approach considering current technical limitations, so in theory it would require to change only those functions originally involved in this process, no new or cannibalized functions - yet. This plan would require changing the research credits, though, and change their name in some localization file I guess, besides changing the icon and % in BuildResearchCredits. This is still a draft, I'm not implementing this any sooner yet, first I want to keep testing current version for a while more, and also I'd like to polish it "on paper" before implementing it on hex. There's also a couple of new concepts I wanted to try in this approach:- Certain interrogations unlock certain autopsies: I'm really increasing the need of interrogations here, this one may be a way to delay a bit more the research of cool stuff, see map below. Now also some key interrogations require 2 alive subjects, like thin man, sectoid commander and muton elite.- Item repair: The game already had certain items that required some other item to build them. Using this mechanism I've made that interrogating an Ethereal lets you repair damaged UFO power sources and navigation computers (ie it unlocks them for manufacturing, and the items require a damaged item to build them).- Item improvement: Plasma technology is far beyond current scientific knowledge so the best we can do is to adapt recovered alien weapons and improve them a little bit, but we lack the knowledge to build them from scratch. So using that same trick, in order to build any plasma weapon it will require a plasma weapon exactly one level inferior (light rifle requires pistol // rifle requires light rifle // heavy, sniper & alloy require rifle // Plasma cannon require heavy), so each weapon (in number) can only be obtained through stunning an enemy, and to build a plasma light rifle you'll need 1) the technology to do so and 1 plasma pistol. Also interrogating a two muton elite grants the knowledge to build plasma pistols from scrratch (using some weapon fragments and elerium, but anything else), so those can later be upgraded to other plasma weapons. And a couple of changes from previous version:- Now ballistic weapons don't get any upgrade, they're the default option you get if you don't do research. Now laser wepons get the foundry pistol upgrades. By default I mean to make laser weapon even a bit weaker than ballistic, so the beneffits only are shown really if besides researching in the lab the player also gets the foundry upgrades. So that would the the "big tech branch" that would make intensive use of the foundry and perhaps workshops, since the number of required engis can be high, while laser techs would require focusing on labs, because of extremely high research times.- I've incorporated Amineri's idea of creating a set of ballistic weapons using alien materials. Those are available after researching experimental warfare (I think the name even suits the purpouse), and those would be just regular weapons but improved, buildable and presumably quite expensive. This feature hasn't been implemented yet that I know, but it can be done. - Tech research (research time) [requirements] %credit granted% {benefits from credits} * Foundry project # Item manufacturing $ Facility building --- RESEARCH CREDITS ------------------------------------------ Alien Materials: Armor 1 15% Basic knowledge of alien metal alloy carap, skel, arch: Armor 2 25% titan & ghost Armor 3 20% Weapon fragment Weapons 1 10% Basic knowledge of alien materials used in weapon manufacturing Plasma pistol weapons 2 15% plasma light rifle weapons 3 15% plasma rifle weapons 4 15% Elerium: Power 1 10% Power source Power 2 15% --------------------------------------------------------------- $ Labs $ Workshop $ Foundry - Laser Weapons {pw1, weap1} * SHIV Laser # Laser Pistol # Laser Rifle * Pistol 1 (Laser 1, inc crit. hit) - Precision Lasers {pw1, weap1} # Laser Sniper Rifle # Laser Shotgun * Pistol 2 (Laser 2, inc. accuracy) - Heavy Lasers {pw1, weap1} # Laser Machinegun # SHIV Machinegun * Pistol 3 (increased damage) - Laser Cannon {pw1, weap1} # Laser Cannon - Alien Materials [5 alien alloy] %Armor1% {armor1, armor2, armor3, weap1} - Carapace Armor [5 alloys] %Armor 2% {armor1, armor2, armor3} - Skeleton Armor [5 alloys] %Armor 2% {armor1, armor2, armor3} - Titan Armor [20 alloys] %Armor 3% {armor1, armor2, armor3} - Ghost Armor [20 alloys] %Armor 3% {armor1, armor2, armor3} - UFO Power Source [2 ufo power src] %Power 2% {pwr1, pwr2} - Alien Navigation Computer [2 alien nav. compt.] {pwr1, pwr2} - Elerium [5 elerium] %Power 1% {power 1, power 2} - Firestorm [5 elerium, 5 alloy, 5 weap.frag, 2 ufo pwr src, 2 ufo nav compt] {weap1-4, armor1-3, pwr1, pwr2} - Weapon Fragments [5 weapon fragments] %Weapons1% {weap1-4, armor1} - Experimental Warfare [5 weap.frag, 5 alloy] {armor1, weap1} # Alloy ballistic weapons - Plasma Pistol [1 plasma pistol OR plasma light rifle] %Weapons2% {weap1, weap2, weap3, weap4, power1, power2} (can use plasma pistols, cannot manufacture them!) - Plasma Light Rifle [1 plasma light rifle OR plasma rifle tech] %Weapons3% {weap1, weap2, weap3, weap4, power1, power2} # Plasma Light Rifle [1 plasma pistol] - Plasma Rifle [1 plasma rifle OR heavy plasma tech] %Weapons4% {weap1, weap2, weap3, weap4, power1, power2} # Plasma Rifle [1 plasma light rifle] - Plasma Sniper [no cost] {weap1-4, pwr1,2} # Plasma Sniper [1 plasma rifle] - Alloy Cannon {weap1-4, pwr1,2} # Alloy Cannon [1 plasma rifle] - Heavy Plasma [1 heavy plasma] %Weapons4% {weap1, weap2, weap3, weap4, power1, power2} # Heavy Plasma [1 plasma rifle] # SHIV Plasma Cannon [1 plasma rifle] - Plasma Cannon {weap1-4, pwr1,2} * SHIV Plasma [1 heavy plasma] {weap1-4, pwr1,2} # Plasma Cannon [1 heavy plasma] * Alien Grenade [2 alien grenade] {weap1-4, pwr1,2} - Xeno-Biology [5 corpses] - Autopsy Sectoid [2 sectoid corpse] * SCOPE upgrade - Interrogate Sectoid [1 sectoid captive] * Improved Arc Thrower - Autopsy Thin Man [2 thin man corpses] * Improved medikit - Interrogate Thin Man [2 captives!!!] * Stealth Satellites - Autopsy Floater [2 corpses] * Advanced Flight - Archangel Armor [15 elerium, 15 alloys] %Armor 2% {Armor1-3, pwr1} # Archangel Armor # Ufo speed boost [1 ufo pwr src item, ufo pwr src tech] - Interrogate Floater [1 captive] # Ufo Dodge [1 alien nav.compt, alien nav compt tech] # ufo Aim [alien nav compt tech] - Autopsy Muton [2 corpses] * Ammo Conservation - Interrogate Muton [1 captive] - Autopsy Sectoid Commander [1 corpse] (to allow investigation after assaulting the base) - Interrogate Sectoid Commander [2 captives!!!] - Psi Labs/Psi Link? - Autopsy Heavy Floater - Archangel Armor [15 elerium, 15 alloys] %Armor 2% {Armor1-3, pwr1} # Archangel Armor - Interrogate Heavy Floater - Autopsy Cyberdisk [2 cyberdisk corpses] * SHIV Heal - Autopsy Drone [4 drone corpses] * Drone Capture - Autopsy Sectopod [2 sectopod corpses] - EMP Cannon [shiv heal, drone capture, imp.arc thrower] # EMP Cannon [2 sectopod corpses] - Autopsy Berserker [2 corpses] # Combat Stims - Interrogate Berserker [1 captive] - Autopsy Chryssalid [2 corpses] - Psi-armor (chryssalid armor) [6 chryssalid corpses] # Psi-armor (chryssalid armor) [8 chryssalid corpses] - Autopsy Muton Elite [2 corpses] # Chiting plating [2 muton elite corpses] - Interrogate Muton Elite [2 captives!!!] # Plasma Pistol [weap.frag, elerium] - Autopsy Ethereal [2 corpses] - Interrogate Ethereal [2 captives!!!] # Ufo power src [1 damaged ufo power src + elerium] ("Repair" item) # Ufo Nav. computer [1 damaged ufo nav.compt.] ("repair" item)With this setup it's still required capturing an alien with the arc thrower to recover a plasma weapon, but any weapon could be researched as soon as the player gets a sample. And also researching a superior tech would unlock the one immediately before. Still it is now necessary to capture a muton elite to get a heavy plasma (or do heavy floters carry one of those too?). Notice there are some techs (armor techs) that now require alien alloys, so they won't be available until the first ufo, ~ day 8? This plan would also require to balance techs time with great care, and adjust to variations (research credit discount, labs bonus, num.staff) since there are techs affected by many research credits the initial research time must be really big so with it's due research it becomes reasonable. As an example, Firestorm takes advantadge of all the 9 research credits, so maybe as soon as the player has gathered the few items required to research (2 ufo splashed if lucky with the remains) maybe the initial research time should be around ~4 months or even more so in the long run it goes down to less than a month. Any suggestion or comment to improve this "Bunch of techs / Research credits" system or on any other aspect of techs & research is more than welcome. Link to comment Share on other sites More sharing options...
Amineri Posted April 28, 2013 Share Posted April 28, 2013 I have a thought regarding the autopsies, interrogations and the research credits. The primary issue I'm thinking of addressing is that corpses and captives are RESOURCES that can be collected, just like Weapon Fragments, Alloys, Elerium, UFO Power Sources, etc. Now, there are many lines of research that require using these resources, but once you research "Weapon Fragments" you don't lose the need to keep collecting more. I think by treating autopsies and interrogations as a researchable tech just like any other, there is an opportunity lost. The first option is a project I have going on (in planning stages now) to alter the FC Request mechanism to replace the Abduction Rewards. The Abduction Rewards present a moral hazard : in order to keep collecting the rewards you have to keep allowing abductions.This results in strategies such as:1) Keeping a continent uncovered in order to continue abductions (in Vanilla)2) If Abduction Mission UFOs are made visible, not shooting down the abductions UFO My plan for the FC Rewards is to remove all buildable items, and add all the corpses and some captives as "items requested". This would allow the player to spend collected artifacts in order to obtain the traditional abduction rewards. FC nations can also ask for alloys, elerium and weapon fragments. ---------- The second option is to change the mechanic of the autopsies and interrogations. It should be possible to make autopsies and interrogations repeatable research. The array of researched techs is an array of integers, just like the perks. This means it could be utilized as a counter instead of as a boolean, counting the number of times that an autopsy and/or interrogation has occurred. Interrogations in particular seem like a very promising avenue in this regard. Not every alien would know every research secret, so it makes sense to interrogate every alien you capture. It is a war ... <.< Having repeatable autopsies/interrogations could work in variety of ways.Two that I see are:1) Each one completed gives a chance to unlock a certain item construction, or a new technology to research. For example, performing a Thin Man autopsy might grant a 5% chance (per autopsy conducted, cumulative) to unlock the Improved Medikit Foundry Project. (There would be a 5% chance after the first autopsy, 10% after the second, 15% after the 3rd, etc). The same could be done for Chryssalids and chitin plating (to make the item), etc.2) Each one completed grants a temporary boost in some manner. Instead of permanent research credits with a fixed % boost, each interrogation provides a research credit that only lasts for a limited duration (maybe 10 days, or a month). However, the research credit could be stackable, meaning multiple interrogations would provide increased (and continuing) boost to research. Interrogations would have to be continually performed in order to maintain a research boost. Granting boosts to Foundry research times would be nice as well, although that would be an entirely new mechanism. This would clearly require adjusting the interrogation/autopsy research times, and potentially the South America continent bonus. One alternative would be that the first autopsy/interrogation on each corpse/captive takes much longer (since much less is known about the subject), but subsequent repeats go much faster. he idea here is to make corpses and captives into another limited and consumable resource that the player must make decisions about. Combining repeatable autopsies / interrogations, FC Requests, and having more items built from corpses would make for a lot more tough decisions. Often times on my playthroughs I end up with far too many corpses and end up just tossing them out through the gray market for some more cash. It seems like an opportunity lost. ----------------------------------------- Regarding increasing the number of "things researched". Since the m_arrResearched is an array of integers, this opens up many many possibilities. It has 32 bits of goodness, of which only 1 bit is currently used. My suggestion would be to utilize the lower 16 bits (two bytes) as a counter of the number of times a repeatable project has been researched. This allows the top 16 bits to be used as bit-flags indicating that a particular benefit relating to that research topic has been unlocked. A simple example:1) I plan to add a "Basic Medikit" that is available at the beginning of the game, and grants ability to heal and stabilize, but does not grant poison immunity. 2) The (existing) Medikit would become an "Advanced Medikit" that would become unlocked via performing Thin Man autopsies. 3) The "Advanced Medikit" would be buildable if bit 16 of m_arrResearched[eTech_AutopsyThinMan] is set. (this could be set after a number of autopsies performed, or with random chance, etc) (further, the "Advanced Medikit" would also require and consume a Thin Man corpse) 4) However, ANOTHER result can also be unlocked via eTech_AutopsyThinMan, which is the Foundry project to improve the amount healed by all medikits (eFoundry_MedikitII). 5) This Foundry project would be available if bit 17 of m_arrResearched[eTech_AutopsyThinMan] is set. This allows multiple results to be stored from the same research project. As mentioned before, each result could have a random chance of occuring with each research repetition, or could be set after a certain number have been accomplished. How to display this extra "stuff" to the user via the UI I haven't quite worked out yet ... >.>' Link to comment Share on other sites More sharing options...
morro123 Posted July 30, 2013 Share Posted July 30, 2013 (edited) Amineri:Sorry to resurrect this thread...but while you are out there improving the gaming experience rescuing defeated nations and making multiple alien bases raiding possible, I thought I could give you some feedback on this one.a) on interrogations: I highly favor the repeteable interrogation option. I'm not sure about the reward though. I guess the prisioners may have a random chance to reveal:1. Nothing.2. Alien plans.3. Alien tech.4. Alien physiology info.5. Alien psi info.6. XCOM weaknesses.About the game mechanics you describe, the cummulative knowledge option seems more reallistic to me than the temporary boost. I like more the first one than the latter. Ohter options you may consider as well:3) Revealing alien plans may trigger special missions4) Revealing alien plans may lower panic levels5) Revealing alien plans may reveal alien base (new!)5b) Revealing alien plans may stop alien infiltration6) Revealing alien tech gives a small permanent bonus to research (stackable?)7) Revealing alien tech may reduce research times on next tech8 )Revealing alien tech may give new tech or foundry proyect9) Revealing alien physiology info may give bonus (?) against that alien species in combat10) Revealing alien physiology may improve further interrogation techniches by reducing interrogation times.11) Revealing alien psi info may give bonus (?) against that alien species in combat12) Revealing alien psi info may improve further interrogation techniches by reducing interrogation times.13) Revealing alien psi info may improve soldier's statics (Will/Psi resist)14) Revealing XCOM weaknesses may improve SHIVs statistics (?)...b) on corpses/autopsies: I'd love to ponder carefully before selling corpses instead of just selling them madly for money. The rewards of continued research on corpses could be:1. Nothing.2. Alien physiology info.3. Reduced autopsy time.4. Bioenhancements for your soldiers (eg: berseker-chryssalid/claw; thin man/poisonresist, etc) (consumable).Combine all these goodies with managing scientists to research more than one tech at a time and spend a good amount of testing in balancing issues, and I guarantee you'll get a big replayability boost... Edited July 30, 2013 by morro123 Link to comment Share on other sites More sharing options...
Recommended Posts