wghost81 Posted December 13, 2013 Share Posted December 13, 2013 (edited) With new move and expand function features :smile: it is finally possible to easily change alien squad composition by altering GetPossibleAliens, GetSupportingAlien and BuildPod functions. My initial idea was to add psionic aliens (Sectoid Commanders and Etherials) as soldiers to make psionics more useful. But when I started to analyze the data, I decided to do a major rework of the whole squad composition system. I attached three diagrams to this post: soldiers distribution, terrorists distribution and summary distribution of aliens throughout the game. I also attached alien "weights" table. Now I know why I don't get many Cyberdiscs. :smile: Clearly, Berserker and Heavy Floater weights are brokenly large: Cyberdiscs don't have a chance with those values. Of course, those are pod types weights and Berserkers have Mutons as supporting aliens, but anyway, 100->50 is too much, compared to 50->25 for Cyberdiscs. Furthermore, in EW Alternative Mechtoids (Mechtoids with Sectoid Commanders) do not replace regular Mechtoids, but instead are added to the list with the same 100 weight. This results in more Mechtoids and even less Cyberdiscs. So, first thing I want is to change pod types weights to make it more balanced. Second thing is I want to add commanders as regular soldiers. GetSupportAlien function has optional bool bAlt parameter, which is currently used to allow three EXALT types in Elite Exalt pods. This can be used to distinguish commanders from soldiers and even to alter other pods composition. As for EXALT, they're coded pretty straightforward (all types have equal weights, elite units replace regular units) and I want to change this too. Working with GetPossibleAliens as it is now will be a pain: recalculating offsets for all those jumps is a modders nightmare. So I want to change it to something like weight = Clamp(some_expression_to_calculate_weight_progress, 0, 100 * (iMonth >= startingMonth))Suggestions on how to adjust weights and compose alien squads are welcomed. :smile: Edited December 13, 2013 by wghost81 Link to comment Share on other sites More sharing options...
johnnylump Posted December 13, 2013 Share Posted December 13, 2013 EW changed how supporting aliens work from EU, but here's how Long War 2.12 (EU) handles pod composition GetPossibleAliens works alien chances cumulatively, which saved a bunch of space at the cost of a little granularity month-to-month. function TPossibleAlienSquad GetPossibleAliens() { local int iMonth; local TPossibleAlienSquad kSquad; STAT_SetStat(1, Max(Game().GetDays(), Game().GetDays() + (STAT_GetStat(2)))); iMonth = (STAT_GetStat(1)) / 30; // End:0x90 if(m_bFirstMission) { iMonth += 1; } AddPossible(GetCommanderType(), 100, kSquad.arrPossibleCommanders); AddPossible(11, 255, kSquad.arrPossibleRoaming); // End:0x1A7 if(iMonth >= 0) { AddPossible(4, ((iMonth <= 2) ? 80 : 35), kSquad.arrPossibleSoldiers); AddPossible(17, ((iMonth <= 4) ? 25 : 10), kSquad.arrPossibleSoldiers); AddPossible(13, 150, kSquad.arrPossibleSecondaries); } // End:0x2B1 if(iMonth >= 1) { AddPossible(5, ((iMonth <= 5) ? 100 : 35), kSquad.arrPossibleSoldiers); AddPossible(5, ((iMonth <= 6) ? 50 : 10), kSquad.arrPossibleSecondaries); AddPossible(6, (((iMonth >= 2) && iMonth <= 8) ? 65 : 50), kSquad.arrPossibleSoldiers); AddPossible(6, 25, kSquad.arrPossibleSecondaries); } // End:0x2EC if(iMonth == 2) { AddPossible(7, 35, kSquad.arrPossibleSoldiers); } // End:0x378 if(iMonth >= 3) { AddPossible(7, (((iMonth >= 4) && iMonth <= 6) ? 100 : 65), kSquad.arrPossibleSoldiers); AddPossible(7, 25, kSquad.arrPossibleSecondaries); } // End:0x3B3 if(iMonth == 3) { AddPossible(8, 15, kSquad.arrPossibleSecondaries); } // End:0x42D if(iMonth >= 4) { AddPossible(8, ((iMonth <= 7) ? 35 : 50), kSquad.arrPossibleSoldiers); AddPossible(8, 50, kSquad.arrPossibleSecondaries); } // End:0x468 if(iMonth == 5) { AddPossible(15, 15, kSquad.arrPossibleSecondaries); } // End:0x4E2 if(iMonth >= 6) { AddPossible(15, ((iMonth <= 8) ? 100 : 50), kSquad.arrPossibleSoldiers); AddPossible(15, 50, kSquad.arrPossibleSecondaries); } // End:0x55C if(iMonth >= 7) { AddPossible(9, ((iMonth <= 9) ? 25 : 45), kSquad.arrPossibleSoldiers); AddPossible(9, 25, kSquad.arrPossibleSecondaries); } // End:0x5D6 if(iMonth >= 8) { AddPossible(10, ((iMonth <= 9) ? 100 : 75), kSquad.arrPossibleSoldiers); AddPossible(10, 50, kSquad.arrPossibleSecondaries); } // End:0x650 if(iMonth >= 9) { AddPossible(11, ((iMonth <= 11) ? 50 : 85), kSquad.arrPossibleSoldiers); AddPossible(11, 25, kSquad.arrPossibleSecondaries); } // End:0x6CA if(iMonth >= 10) { AddPossible(16, ((iMonth <= 11) ? 35 : 50), kSquad.arrPossibleSecondaries); AddPossible(12, 25, kSquad.arrPossibleSecondaries); } // End:0x705 if(iMonth >= 11) { AddPossible(12, 25, kSquad.arrPossibleSoldiers); } // End:0x740 if(iMonth >= 12) { AddPossible(16, 25, kSquad.arrPossibleSoldiers); } NormalizeValues(kSquad.arrPossibleCommanders); NormalizeValues(kSquad.arrPossibleSoldiers); NormalizeValues(kSquad.arrPossibleSecondaries); NormalizeValues(kSquad.arrPossibleRoaming); return kSquad; //return ReturnValue; } function XComGame.XGGameData.ECharacter GetSupportingAlien(XComGame.XGGameData.ECharacter eMainAlien) { switch(eMainAlien) { // End:0x18 case 8: // End:0x20 case 16: return 17; // End:0x25 case 12: // End:0x2D case 19: return 11; // End:0x35 case 15: return 7; // End:0x47 case 9: return (Rand(2) * 14) + 4; // End:0x4C case 6: // End:0x51 case 7: // End:0x56 case 10: // End:0x8F case 11: return #GetMoreSupportng(eMainAlien); // End:0xFFFF default: return eMainAlien; } function int #GetMoreSupportng(XComGame.XGGameData.ECharacter eAlien) { iMonth = GetMonth(); // End:0x48 if(eAlien == 7) { return ((Rand(3) <= ((iMonth <= 6) ? 0 : 1)) ? 7 : 5); } // End:0x7C if(eAlien == 10) { return ((Rand(3) <= ((iMonth <= 10) ? 0 : 1)) ? 10 : 5); } // End:0xA7 if(eAlien == 11) { return ((Rand(4) <= 1) ? 11 : (Rand(2) * 8) + 7); } // End:0xC8 if(eAlien == 6) { return ((Rand(3) <= 0) ? 4 : 6); } return 4; } #GetMoreSupporting was a repurposed XGStrategyAI function involved in reducing the art asset load for consoles. EW has annoyingly moved the supportingalien stuff to an XComGame.upk function. Link to comment Share on other sites More sharing options...
wghost81 Posted December 13, 2013 Author Share Posted December 13, 2013 I don't know why they decided to move GetSupportingAlien, but seems it somehow related to EXALT. Haven't figured it out yet as EXALT changes work correctly in EW Larger Pods and I don't see how GenerateAliens function (which uses new GetSupportAlien function) affects EXALT (or any other) mission. Link to comment Share on other sites More sharing options...
Amineri Posted December 13, 2013 Share Posted December 13, 2013 What I would really like to add is some actual Strategy AI that would composite squads based on a "point system" akin to Multiplayer. As in Multiplayer each alien type would cost a certain number of points to include. The list of possible aliens that can be added to a particular mission would be constrained based on time (so no March Muton Elites, for example). The general system would be that the alien points for a particular mission would in general be based on time passed so that the alien squads get tougher as they go along. The available points could also be randomized slightly or varied based on mission type. For example landed UFOs, terror missions, alien bases, might get more points. "Easy" abduction missions would get fewer points and "Very difficult" abduction missions would get more points. The AI selecting sectoids for a late game mission means that there are more points to spend on other, tougher aliens. The larger alien pods and (still to be updated for EW) alien leaders mods would add to the points system (so various ranks of alien leaders would add additional point cost). This has always kind of been my dream system, and with the ability to resize functions up I'm thinking that it is definitely going to be doable now :) Link to comment Share on other sites More sharing options...
wghost81 Posted December 14, 2013 Author Share Posted December 14, 2013 The AI selecting sectoids for a late game mission means that there are more points to spend on other, tougher aliens.Yes, but late game Sectoids are too weak anyway and having a pod of them will decrease mission difficulty, especially on smaller maps with only 4 spawn points. That's why tougher aliens replace early game aliens as time passes. Another solution will be to boost their characteristics and add some new abilities. As in the leader mod, but for all pod members. Link to comment Share on other sites More sharing options...
Bertilsson Posted December 14, 2013 Share Posted December 14, 2013 This reminds me of an idea I had a long time ago.How about always populating each pod with both static & patrolling groups of aliens? That way you would have at least 8 groups of aliens on each map, where at least 4 are patrolling. With increased number of patrols it wouldn't be much issue if a few of them were weak ones. Link to comment Share on other sites More sharing options...
Amineri Posted December 14, 2013 Share Posted December 14, 2013 Yes, but late game Sectoids are too weak anyway and having a pod of them will decrease mission difficulty, especially on smaller maps with only 4 spawn points. That's why tougher aliens replace early game aliens as time passes. Another solution will be to boost their characteristics and add some new abilities. As in the leader mod, but for all pod members. Ah, but of course I think of this in the context a few other mods I made : (1) the ability to increase the maximum pod size, (2) the ability to gradually increase the stats of all aliens over time, and (3) the ability to create upgraded members of a squad (aka leaders), (4) the ability to create pods with different kinds of aliens. Following Bertilsson's idea, I think it might be possible to (5) alter the pod placement mechanics to allow for more than 1 pod to be placed at a given spawn point. Possible each point could generate 1 patrol pod and 1 guard pod.. One of the reasons I went for larger pods over more pods was because more pods tend to result in a definite inability for the player to ever maneuver. Sectoids in particular need more love. In Long War we were giving them all Low Profile after a certain point, but what I'd really like to do is give them more psionic abilities, like Mindfray or Psi Panic. Maybe even a defensive one like telekinetic field. My thinking is to make these abilities available only to a Sectoid receiving a mindmerge. Link to comment Share on other sites More sharing options...
wghost81 Posted December 14, 2013 Author Share Posted December 14, 2013 XCOM maps are too small. One thing I didn't liked about LW is too many units (XCOM and alien) on too small maps. And I totally agree that larger pods are better than more pods. But personally, I don't have much love for Sectoids. :smile: May be because I played first I/I mission like 50 times before I finally understood I/I rules. :smile: But EW chain of upgrades like Sectoids+Sectoids -> Sectoids+Mechtoids -> Sectoid Commanders/Sectoid Commanders+Mechtoids seems good enough for me. Just need to make this progress time dependent rather than game act dependent. And replace Mechtoids with Mecthtoid_Alt, not add them together. Same with Floaters/Mutons. Their Heavy/Elite replacements are as good as upgrades. So I'm not complaining about early game aliens have almost zero probability late game. One thing for certain: I want more Cyberdiscs and this will be my priority task. :smile: Link to comment Share on other sites More sharing options...
wghost81 Posted December 15, 2013 Author Share Posted December 15, 2013 (edited) First tweaker: http://www.nexusmods.com/xcom/mods/460 Allows for more Cyberdiscs! :smile: I've expanded original function and added all possible types (including commanders as soldiers) for each month to allow easy modifications without a need to recalculate jump offsets. PS It was too late when I realized byte constants are unsigned (?). At least UE Explorer threads 24 FF as 255. Originally I wanted to make "limit" equal to -1 (as in vanilla), but ended up setting it to 255. :smile: My mistake, but works anyway, since 255 is more than enough. :smile: Edited December 15, 2013 by wghost81 Link to comment Share on other sites More sharing options...
FlyingHigh10000000 Posted December 17, 2013 Share Posted December 17, 2013 (edited) Disregard this, I'm an idiot. Didn't notice which program you have to use to install the mods. Edited December 17, 2013 by FlyingHigh10000000 Link to comment Share on other sites More sharing options...
Recommended Posts