Amineri Posted July 24, 2013 Share Posted July 24, 2013 My next big project is as is described in the topic title.It's really kind of two big changes rolled into one reasonably complete package -- at least, that's my current vision. Both multiple chances (but at least one) to attack alien bases, as well as the chance to re-take lost countries. The reason I'm putting them together in the same topic is that my current plan involves intertwining the two together. The core idea is that instead of a single alien base being spawned as part of the plot (but not really having much to do with game-play), alien bases will be spawned whenever a country is lost. Defeating the alien base within the alien-occupied country will result in the country rejoining the XCOM project. I've done some initial testing to confirm that I can spawn multiple alien bases. Here is a screenshot : This isn't expected to be typical. What I did here was spawn 1 alien base per Funding country, located at a random city within the country. I did this at the start of the game, just to make it easy to check. This resulted in 16 alien base missions being spawned and visible after the first mission was complete. As is usual, alien base missions cannot be accepted until the skeleton key has been manufactured, so these would just be cluttering up the display in an actual game. In order to prevent clutter (and to tie in another game mechanic), I plan to add another condition for assaulting an alien base : XCOM must orbit a satellite above the occupied country in order to detect the alien base. The usual player MO that I envision is (1) orbit a satellite, (2) detect alien base, (3) launch assault on alien base. I've come up with a clear set of required functional changes :Alien bases created in occupied countries When country is occupied existing satellite is destroyed Alien base revealed when Base Shard research complete and satellite coverage over occupied country Alien base mission can be accepted after completion of Skeleton Key item (unchanged from vanilla) Launching satellite over occupied country clears storm and updates base reveal status Satellite destroyed over occupied country enables storm and updates base reveal status Completing alien base mission causes associated country to rejoin XCom with 4 panic Objectives shows requirement to orbit satellite over occupied country The plotline would proceed similarly to before, except that an additional subobjective for assaulting an alien base is required. In addition to completing the base shard research project and manufacturing the skeleton key, a satellite must be orbited above an occupied country. (any occupied country will suffice) In order to guarantee such an occupied country, the aliens will have to start already in possession of at least 1 Funding country. Some mods may want to have the alien initially possess more than 1 on harder difficulties. If the aliens do not control a country then it would be impossible to assault an alien base, advance the plotline and win the game. After the first alien base is successfully assaulted the plot will advance as usual. The skeleton key will still be present. Launching a further satellite over an occupied country will reveal the alien base there, which can then be assaulted, returning the country to the XCOM project. Balance-wise some adjustments would have to be made to compensate for the possibility of regaining countries -- probably making panic increases a bit easier for the aliens. I think I've mostly identified the key functions that need to change (11 so far), and have written target code for each as an exercise to double-check that the concept is technically feasible. Am posting up the concept so that I can get further feedback / ideas to help evolve / refine the concept as I move forward. Thanks for any feedback! Link to comment Share on other sites More sharing options...
theoldone22 Posted July 24, 2013 Share Posted July 24, 2013 Love the idea. If there is any way I could help I be happy to try. Link to comment Share on other sites More sharing options...
Amineri Posted July 24, 2013 Author Share Posted July 24, 2013 Love the idea. If there is any way I could help I be happy to try. I think I can handle the programming -- I'm primarily looking for ideas as to how people might be interested in using it so I can incorporate them into the design (if it's possible / practical). The only thing I'm not quite sure of is how the geoscape will display if a satellite is put into orbit over a country that's defected. The vanilla game's behavior is to color the area with a green country outline which doesn't seem quite appropriate for scanning a conquered country. I've tweaked the vanilla "Launch Base Assault" UI to display the country name instead of the continent name. Everything else in the following screenshot is vanilla. You can see what I mean about the green outline, although in this case the country hasn't left XCOM. This is a different start than the previous screenshot. Here the U.S. base in in Houston or Dallas, and the previous screenshot it was in Boston. My ideal display for the occupied countries with a satellite would be to have the same outline, just colored red instead of green. Oh, I also poked around at trying to add more cities, but the cities are pretty much hard coded (in terms of number of cities) instead of drawing from a config file, so adding more cities will be a bit of a pain. Link to comment Share on other sites More sharing options...
theoldone22 Posted July 24, 2013 Share Posted July 24, 2013 Could it be set to shoot down your sat quickly after you put it up over an occupied country with a chanch of finding the base before then? Link to comment Share on other sites More sharing options...
Amineri Posted July 24, 2013 Author Share Posted July 24, 2013 Could it be set to shoot down your sat quickly after you put it up over an occupied country with a chanch of finding the base before then? Currently my thinking is to preserve the vanilla functionality that automatically shoots down the satellite over a country when the country leaves XCOM. In part I'm wanting to do this to make sure that all of the country / continent bonuses get removed properly. That said, I think it would be interesting if the aliens could be assumed to be able to detect sats over occupied countries and keep sending "Hunt mission" UFOs after the satellite. Shooting down these UFOs (narratively : since they are in occupied countries) shouldn't generate a crashed UFO mission (gameplay : otherwise it would be pretty easy to exploit this to get lots of UFO missions and lots of UFO loot). So yes, I think ideally launched satellites wouldn't stay up for very long over an occupied country. In general this means that freeing an occupied country means having/building spare satellite capacity, building a satellite and launching it, and then winning the detected alien base mission. Of course, this will only become possible once the outsider shard research project is completed (to detect bases) and the skeleton key built (to enter them). Link to comment Share on other sites More sharing options...
Tycus Posted July 24, 2013 Share Posted July 24, 2013 (edited) This is awesome! Finally we got the possible tie-in of storyline and actual gameplay (because I know of several cases on Ironman Impossible playthroughs, when player does NOT assault the base, until nothing is left to research, then does base assault mission, unlocks few techs and psi, rushes them (because is nothing left to do), shoots down Overseer and so on, basically it becomes race to final credits :rolleyes:). End result that flow of storyline is kind of broken, certain tech is made useless (Hyperwave Relay, because player gets it at the point, when it does not matter anymore), and player probably has to level up new soldiers, if he wants psionics and all. Also panic decrease as result of base assault is kind of wasted as well. This happens, because there is no real reason (besides plot advancement) to research outsider shard and do base assault mission. And you are proposing solution to this kind of behavior, so player actually would be motivated to get relevant research and assault alien base mid-game. I am pretty sure, that by tinkering with panic values it is possible to ensure that at least one country leaves XCOM on first/second month (could be several countries as well).And we even can limit, how much Alien Base Assaults player can do at once (by requiring several outsider shards to make skeleton key). Only possible setback I foresee in lack of said outsiders, as game replaces command squad on UFOs after said Alien Base Assault mission (that can be easily solved by changing supporting aliens in Sectoid Commander pod to Outsider; this way they indeed become "linked" :wink:). That leads to some interesting balancing possibilities (and now I need to run numbers on this). Also, regaining lost countries :thumbsup:. I will be looking forward to see progress on this. Edited July 24, 2013 by Tycus Link to comment Share on other sites More sharing options...
Amineri Posted July 24, 2013 Author Share Posted July 24, 2013 (edited) So here's the mechanic I'm proposing for ensuring that at least 1 country will have left XCOM, thus allowing the Alien Base Assault mission to take place. There is an existing (but unused) alien objective call "Infiltrate". What this does is spawn, in succession, 2 UFOs of the "Ethereal" type (basically what the Overseer ship is). The first performs a long scout in the targeted country. If that is successful the second does a direct flight to the country. If both missions are successful then the objective is completed, resulting in : case 7: SignPact(kLastUFO, kObj.m_iCountryTarget); The country straight-up leaves XCOM. Narratively, I imagine that the Ethereals fly around brain-scanning for the country's leaders. After they find them the fly in and mind-enslave them, taking over the country. Currently the template objective for 'Infiltrate' is created, but a current mission is never created (it would be a bit unbalanced in vanilla). Since countries will now be able to be won back, I'm proposing adding the infiltrate mission back in. It feels a bit like railroading the player, as there is nothing that the player can do to prevent the countries from leaving, but at least now there will be the tools in place for the player to take them back. Re-taking countries, however, will require the plot to be advanced to the point of the skeleton key. -------------- My initial prototype would be to add the following code to XGStrategyAI.AIAddNewObjectives() : if(iMonth <= Game().GetDifficulty()) { J0x0300: iContinent = WORLD().GetRandomContinent(); if(iContinent == HQ().GetContinent()) { goto J0x0300; } iCountry = Continent(iContinent).GetRandomCouncilCountry(); // returns int AIAddNewObjective(7, 5, Country(iCountry).GetCoords(), iCountry,, ) // somewhere around the start of the month launch an infiltrate mission to the specified country } The start day for the first infiltrate mission is the 5th of the month. Countries on the same continent as XCOM HQ cannot be infiltrated. A random continent (not the HQ Continent) is selected, and then a random Council Country on that continent. This function already skips countries that have already left XCOM. The above ties the number of months such missions take place to the game difficulty. Easy has only the March infiltration. Each step up in difficulty adds another month of infiltration mission, with Impossible having 4 months of such missions, resulting in 4 lost countries. After that, from a narrative perpsective, it can be assumed that the ethereals get more cautious and so start flying around in their stealth mode. XCOM is putting up satellites and shooting down UFOs, so they stop attempting such missions. Edited July 24, 2013 by Amineri Link to comment Share on other sites More sharing options...
johnnylump Posted July 24, 2013 Share Posted July 24, 2013 Sounds great. Would the overseers on this mission be visible without the Hyperwave? If the player somehow manages to shoot down an overseer before the base mission, that could do some interesting things with the plot, in that they might get an ethereal device before they get the Hyperwave. If they rush Firestorm tech, etc -- going to be difficult to pull off in Long War, but it may not be out of the question in other mods. There are a bunch of extra functions that are specifically about the overseer, although it may be the overseer flybu mission, and not the craft itself. Either way, I'd love to put more Overseers on the map after the base mission, just for variety's sake, but that's a separate matter. I'd be in favor of such missions occurring randomly in the late game, too. Might suggest a supply barge and/or battleship at some point, marking the base being constructed, a la OG. Link to comment Share on other sites More sharing options...
Amineri Posted July 24, 2013 Author Share Posted July 24, 2013 (edited) It looks like the game-code is set up to not allow detection of ethereal UFOs until the hyperwave is constructed. In XGGeoscape.DetectUFO : if(kUFO.GetType() == 9) // 9 = eShip_UFOEthereal { if((HQ().GetNumFacilities(18) == 0) || STORAGE().EverHadItem(189)) // 18 = eFacility_HyperwaveRadar, 189 = eItem_PsiLink { return -1; } } This disallows detection of ethereal UFOs unless the player has the hyperwave or the psilink (I guess the latter in case the hyperwave facility is destroyed after the overseer mission?) The game code currently is set up to spawn the overseer ship only in areas where the player has satellite coverage. That is set up as objective 3, eObjective_Flyby. The suggestion above could be modified to spawn more infiltrate missions after a certain point in time. I suppose narratively the aliens only initially need a small number (game-play wise based on difficulty) of bases with which to conduct their experiments on humanity. After XCOM destroys the first base, however, they might decide to get more aggressive and launch more infiltration attacks in order to crush resistance. This would then require the hyperwave to counter. Until the hyperwave is built, the ethereals could conduct infiltration missions even in countries with satellite coverage, causing the country to be lost, along with the satellite. Definitely would be a heating up of the conflict. Edited July 24, 2013 by Amineri Link to comment Share on other sites More sharing options...
Amineri Posted July 24, 2013 Author Share Posted July 24, 2013 I've got new hex for infiltration objectives/missions, and have verified that it is working : In this case the second mission for the objective finished up on March 12. I'd started a new game, finished the first mission, then just skipped past a couple of UFOs and an Abduction mission in Russia. Prior to leaving China was at 1 bar of panic, then suddenly "BOOM" it's gone from the council. I re-used the XGStrategyAI.RevealBase function (actual base reveal is handled differently -- this function is never called) into a helper function to create infiltration missions. I've tried to build this generally enough that with a few more tweaks more infiltration missions could be added. Country selection and timing would need to be changed, though. Currently the function simply selects a random Council Country (however it cannot select a country that has already left XCOM). function #AddInfTgt() { local XGMission kBase; kCountry = World().GetRandomCouncilCountry(); AIAddNewObjective(7, 5, kCountry.GetCoords(), kCountry.GetID()); //return; } hex code for this : XGStrategyAI.RevealBase // #AddInfTgt original hex: header: F3 42 00 00 AB 1F 00 00 00 00 00 00 F2 42 00 00 00 00 00 00 00 00 00 00 F3 42 00 00 00 00 00 00 F1 03 00 00 0A 72 00 00 AC 00 00 00 7C 00 00 00 body: 58 19 1B 69 0E 00 00 00 00 00 00 16 92 00 94 2F 00 00 00 01 94 2F 00 00 00 F3 42 00 00 00 4A A8 00 07 A7 00 9A 19 00 F3 42 00 00 09 00 35 37 00 00 00 01 35 37 00 00 2C 06 16 0F 19 00 F3 42 00 00 09 00 30 37 00 00 00 01 30 37 00 00 25 19 1B 69 0E 00 00 00 00 00 00 16 1C 00 00 00 00 00 00 1B EF 1F 00 00 00 00 00 00 2E 75 37 00 00 00 F3 42 00 00 16 30 04 0B 31 30 04 0B 53 new hex: (virtual 0x94) header: F3 42 00 00 AB 1F 00 00 00 00 00 00 F2 42 00 00 00 00 00 00 00 00 00 00 F3 42 00 00 00 00 00 00 F1 03 00 00 0A 72 00 00 94 00 00 00 7C 00 00 00 body: 0F 00 DD 42 00 00 19 1B 9C 2C 00 00 00 00 00 00 16 0A 00 0B 47 00 00 00 1B 0B 10 00 00 00 00 00 00 16 1B E4 00 00 00 00 00 00 00 24 07 2C 05 19 00 DD 42 00 00 0A 00 74 24 00 00 00 1B C9 0E 00 00 00 00 00 00 16 19 00 DD 42 00 00 0A 00 5E 24 00 00 00 1B 58 0F 00 00 00 00 00 00 16 4A 4A 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53 The function was a bit small, so I allowed the HQ country as a potential target. Would make that game a bit rough, I think :wink: To add the objective/mission I added the following lines to XGStrategyAI.AIAddNewObjectives : if(iMonth <= Game().GetDifficulty()) { #AddInfTgt(); } This function was already modded in Long War 1.9 (which I'm using as a base), so there were already free 0B bytes available. This means that the hex replacement isn't generally applicable to be installed into a vanilla game. Here is the hex for the two lines, for those interested : if(iMonth <= Game().GetDifficulty()) 07 A4 01 98 00 45 42 00 00 19 1B 4C 0E 00 00 00 00 00 00 16 0A 00 43 41 00 00 00 1B F6 0E 00 00 00 00 00 00 16 16 RevealBase(); // renamed #AddInfTgt(); 1B F7 22 00 00 00 00 00 00 16 And finally, here is the hex I used to change the function name : Function name change original: RevealBase 0B 00 00 00 52 65 76 65 61 6C 42 61 73 65 #AddInfTgt 0B 00 00 00 23 41 64 64 49 6E 66 54 67 74 Link to comment Share on other sites More sharing options...
Recommended Posts