Jump to content

Squad Concealment Reveal, should it be apllied to aliens?


UhuruNUru

Recommended Posts

Dumb idea, is your first thought, right, mine as well. Here me out, before you decide it's stupid.

 

Basically, under the current system only your squad members can activate other pods, when what should activate them is the battle.

If they see another pod fighting unknown enemies, they behave as though it's not even happening, this isn't realistic enough for me, they should be alerted an moving towards the battle.

 

The incident that made this apparent to me, and got me thinking about the the situation, was where two pods are in the same area, which often occurs, when passing through each others position on patrol routes, at the same time.

Yet only one of them can activate, just because you're 18 tiles away from the nearest pod member of the other one, even though some of the activated pod are more than 18 tiles away.

It makes no sense to me, that you can activate one pod, yet not not the other, when they are practically the same pod, at that moment.

 

What do they say?

"Sorry not helping you, union rules, my pod is 18 tiles away. In fact, you're really out of luck, my path walks me away from the fight, not towards it. So not going to be helping, by activating next turn. Nice knowing you, I'll send a wreath to the funeral".

Watching the second patrol walk away, while the active pod died, just wasn't fun. I actually felt bad for the ones I killed, and deliberately activated the second pod, but it wasn't the same as a double activation.

 

Squad concealment is dropped when a single soldier triggers line of site in the red tile area, but that's for our squad, I'm not talking about applying actual concealment, like we get, to the aliens.

When concealment is dropped, suddenly your squad goes live, and if another pod is within 17 tiles of any unconcealed squad member, that pod activates.

This is the part of squad concealment that, should apply to the alien pod as well. this sudden reveal mechanic should apply to all activated pod members as well as the revealed squad members.

 

Resulting in the fire fight activating nearby pods, if any revealed participant in the engagement, is within 17 tiles of an inactive pod, it alerts the pod.

Not sure whether a chain reaction would work best, that should be easier to code, or restricting this to the first pod may be better, and more like the battle alerting pods, but having both options would always work best, leaving choices to user is always the best way.

 

This sudden reveal part of squad concealment, should have the same effects, whether the squad is actually concealed or not, because it's now applied to the pods on their activation, and they become revealed simply by being in a battle.

I've not checked out the code, don't know this would have the desired effect, but can't think of an obvious reason why not.

 

This post is more about asking, is it dumb, and I've missed something obvious, or should I carry on looking into making it, knowing nothing of the code.

I don't think a mod already does this, I normally find them if they do, but let me know if one does exist, because I want the battle to activate pods, not just my side of it.

Link to comment
Share on other sites

i dont like the pod activation, too. like u said, it just feels so unrealistic.
I didnt try the activate all pods mod, cause i fear activating all pods at the same time, but ur idea of activating only the surrounding pods could be really cool. maybe (but thats advanced modding i think ^^) have the "volume" (how many granedes rockets you use/how often u fire) of the fight play a part in the radius in which additional pods get activated.

 

Long Story Short:
Would love to see a mod like this :)

So if you can figure out how to do that pleas do :D

Link to comment
Share on other sites

Neither am I, but we work with what's available, if this pans out I envisage two versions to start with, even started My mod, not that that's hard. Mod Buddies doing, no more than a ReadMe at the moment.

 

Combat Aware Patrols - Combat Alert

see your guys fighting an unseen enemy, you go to help

 

Combat Aware Patrols - Alarm Spreads

The chain reaction, LoS of the alerted is enough and spreads through sight and sound of the alarm bring spread. The Call to Arms doesn't end, it keeps spreading, the entire map is alerted over time. Though the battle may have ended, and squad gone before any help arrives, taking too long is more dangerous.

Trying to add the sense of urgency, Firaxis and the game need, even without timers, this is starting to be my favourite option, but I want both available, and can already see variants for this, depending on how the Alert is spread (instant or turn based to begin with).

Still not tried any coding yet, but writing the ideas down, has helped me focus on what might achieve my aims.

I know the mechanic I want to use, and what I need it to do, time to go code hunting, now I know what I'm looking for.

Next step go looking for mods that deal with activation and concealment, all I have is True Concealment, but that's the mission timer it changes, it uses first activation though so has a pointer for me in that.

 

Though I've never made public mods, I make my own patches, I find reading this source comes easy, its well documented if not detailed. When I first learned to code, Assembly Language was the tool, these modern codes read like plain English, in comparison too that.

Not that I know C based ones specifically, mote a self taught browser, I know a little of everything, but nothing in depth, but it's all machine code in the end, (compared to XCOM's actual, machine code, not PatchUPK code), this code is very easy to understand).

 

Code examples hidden

 

 

XCOM machine code

[MODDED_HEX]
07 C3 01 9B 38 3A 00 EC B9 00 00 38 3A 24 00 16
0F 35 82 0F 00 00 84 0F 00 00 00 00 35 8E 0F 00
00 99 0F 00 00 00 01 00 E7 B9 00 00 38 3A 00 EC
B9 00 00 06 02 02 0F 35 82 0F 00 00 84 0F 00 00
00 00 35 8E 0F 00 00 99 0F 00 00 00 01 00 E7 B9
00 00 45 9A A7 2C 02 16 25 16 02 00 2C 02

The XCOM 2 source is a little easier too figure out. than XCOM was without PatcherGUI. even then it wasn't easy and here's the Mod that created that Machine code output, (which is actually the mods uninstall code to put vanilla back)

MOD_NAME=Soldier Gender Probability
AUTHOR=wghost81 aka Wasteland Ghost
DESCRIPTION=Set soldier gender probability

Version: 2.0

Compatible with XCOM Enemy Within versions:
 - all

UPK_FILE=XComGame.upk
OBJECT=XGCharacterGenerator.CreateTSoldier

// Female probability: change 25 to whatever value you like between 0 and 100
// Do not touch anything except number! Do not add spaces between number and other symbols!
// You can enter only integer values between 0 and 100, no floating-point values are allowed!
// Value 0 will result in all males, value 100 - in all females.
ALIAS=FemaleProb:<%b100>

// modded code
REL_OFFSET=0x121
[MODDED_CODE]
//kSoldier.kAppearance.iGender = ( (eForceGender != 0) ? eForceGender : ( (Rand(100) < 25) ? 2 : 1 ) );
0F 35 <XGTacticalGameCoreNativeBase.TAppearance.iGender> <XGTacticalGameCoreNativeBase.TAppearance> 00 00 35 <XGTacticalGameCoreNativeBase.TSoldier.kAppearance> <XGTacticalGameCoreNativeBase.TSoldier> 00 01 00 <.kSoldier>
45
9B
    38 3A 00 64
    25
16
0B 00 // skip
38 3A 00 <.eForceGender>
10 00 // skip
45
96
    A7 2C <%b100> 16
    2C <!FemaleProb>
16
02 00 // skip
2C 02
01 00 // skip
26
// fill
00 <.eForceGender>
00 <.eForceGender>
00 <.eForceGender>
00 <.eForceGender>
00 <.eForceGender>
0B 0B 0B 0B 0B 0B

{ end of mod file }

I know which I prefer, great though PatcherGUI is for XCOM.

When put against the source for True Concealment's "check for activation" class, and my first pointer for what I want too achieve.

//-----------------------------------------------------------
//Returns whether or not XCOM has been revealed yet this mission
//By: FZeroRacer
//-----------------------------------------------------------
class SeqCond_HasBeenRevealed extends SequenceCondition;

event Activated()
{
    local XComGameState_Player PlayerState;
    local XComGameStateHistory History;
    History = `XCOMHISTORY;
    
    foreach History.IterateByClassType(class'XComGameState_Player', PlayerState)
    {
        if( PlayerState.GetTeam() == eTeam_XCom )
        {
            break;
        }
    }

    if (!PlayerState.bSquadIsConcealed)
    {
        OutputLinks[0].bHasImpulse = true;
    }
    else
    {
        OutputLinks[1].bHasImpulse = true;
    }
}

defaultproperties
{
    ObjName="Squad Concealed"
    ObjCategory="Check"

    bAutoActivateOutputLinks=false
    bCanBeUsedForGameplaySequence=true
    bConvertedForReplaySystem=true

    InputLinks(0)=(LinkDesc="In")
    OutputLinks(0)=(LinkDesc="No")
    OutputLinks(1)=(LinkDesc="Yes")
}

 

 

Now too see if I can get some more pointers, it's more about knowing where too look in the base game than copying what the mod does, but reading mod code is one of the best ways to learn, to code your own.

Link to comment
Share on other sites

i dont like the pod activation, too. like u said, it just feels so unrealistic.

I didnt try the activate all pods mod, cause i fear activating all pods at the same time, but ur idea of activating only the surrounding pods could be really cool. maybe (but thats advanced modding i think ^^) have the "volume" (how many granedes rockets you use/how often u fire) of the fight play a part in the radius in which additional pods get activated.

 

Long Story Short:

Would love to see a mod like this :smile:

So if you can figure out how to do that pleas do :D

Actually I hope to avoid that sort of complexity by using the existing reveal mechanic, ultimately an advanced mod would replace the entire system with a better one.

I'm hoping I can tweak the crude system, by applying reveal mechanic to pods, of course the devils in the coding, it could be a single bit that I just toggle or thousands of lines of code.

 

Anyway signing off and hunting for mods that use activation triggers for pointers now. Like I said though this is nothing but an idea yet, but no ones said it already exists, or my logic is flawed.

Time to start doing something more than talk, talk is cheap.

Link to comment
Share on other sites

Right , I've decided to use this thread, to outline the typical process of a Noob Mod Author, succeed or fail. maybe it will help others realise it's not that hard, and failure is OK.

First rule is don't promise what you can't deliver, I know what I want, a realistic activation system, better than the current pod based one.

 

So this isn't about teaching you how to code, so much as the overview, if I was a dev team, instead of one man, this would be a project leads, blog, rather than coding tutorial.

More of an overview than all the little details.

 

So first Impressions after looking at code, and a clear example of how ideas can evolve and change as I learn.

Mow the Title is likely misleading, but I wont change it.

 

First and the most important lesson I've learned so far, though using other peoples mods as pointers and even "stealing" code is perfectly OK (if credited etc), it wont always help.

First I would provide links to these video guides, which are mostly useless and not (yet) aimed at this type of mods.

I learned one thing, but don't think they are bad guides, if that's all you learn, it's worth watching all of them to learn it.

The thing I learned was make a Default Mod for reference, as it contains all the Vanilla source. you can use mod Buddies powerful search system to find the classes you want.

 

I got that nugget from

XCOM 2 Modding Tutorial Series

Also found these, I haven't watched yet, but I will

XCOM 2 Mods

 

The only downside was, you can't have 2 projects running, so it's default or your mod.

I found another way to search using a tool from the UDK site (Full UDK and UE4 are both free).

UDK | UnCodeX

 

You tell it where the SDK source is and all will be searchable, I found doing it this way, with my Project in Mod Buddy, much easier

Source path you need

..\Steam\SteamApps\Common\XCOM 2 SDK\Development\SrcOrig

 

So searching for the terms Conceal and Reveal gives me

X2Effect_StayConcealed.uc

X2Effect_BreakUnitConcealment.uc

X2Action_ConcealmentLost.uc

SeqAct_ModifyConcealment.uc

SeqAct_RefreshConcealment.uc

SeqCond_HasBeenRevealed.uc

This one I'll give as an example, the first code line (//blah is comment not code, but probably the best clues to guide you, so comment your code, your future self will worship you, or curse you is you don't comment) tells you what class this extends, which you may need to check as well

class SeqCond_HasBeenRevealed extends SequenceCondition;

So we get related classes following these headers

 

SequenceCondition.uc

 

Now the file SeqCond_HasBeenRevealed.uc turned my plans on their heads (caveat, I don't know everything, this is subject to change, as I learn more.

 

SeqCond_HasBeenRevealed.uc

 

 

//-----------------------------------------------------------
//Returns whether or not XCOM has been revealed yet this mission
//By: FZeroRacer
//-----------------------------------------------------------
class SeqCond_HasBeenRevealed extends SequenceCondition;

event Activated()
{
    local XComGameState_Player PlayerState;
    local XComGameStateHistory History;
    History = `XCOMHISTORY;
    
    foreach History.IterateByClassType(class'XComGameState_Player', PlayerState)
    {
        if( PlayerState.GetTeam() == eTeam_XCom )
        {
            break;
        }
    }

    if (!PlayerState.bSquadIsConcealed)
    {
        OutputLinks[0].bHasImpulse = true;
    }
    else
    {
        OutputLinks[1].bHasImpulse = true;
    }
}

defaultproperties
{
    ObjName="Squad Concealed"
    ObjCategory="Check"

    bAutoActivateOutputLinks=false
    bCanBeUsedForGameplaySequence=true
    bConvertedForReplaySystem=true

    InputLinks(0)=(LinkDesc="In")
    OutputLinks(0)=(LinkDesc="No")
    OutputLinks(1)=(LinkDesc="Yes")
}

 

 

Now I'm not giving details just highlights here.

You can clearly see the comment is very useful even vital to modders, who may not know exactly what the code does, without this.

One other point is this is based on the C++ code Windows is based off, so knowledge of how C++ works helps.

I never learned any high level languages in my youth, Assembly and C=64 Basic, is what I cut my teeth on.

One thing I do know is all languages are designed for humans to understand, not computers, they only understand machine code,

A single hex number 0 to F is a byte or 8 bits 00000000 to 11111111.

So even machine code is converted for humans to read. Machine code as on and off.

 

I've added comments with my thoughts, as I read The yellow text

 

Basic was an high Level language designed for beginners, long before C started (never Mind C++), but two key facts make all high level languages very similar.

Humans are meant to understand the code, it's all basic mathematics in the end, if you understand maths, you can read code without learning that languages spelling or punctuation.

Don't get me wrong writing code is precise, knowing the spelling and punctuation is required to write good code, but not to read, or cut and paste, The best modders learn C++, but you will need it to get your feet wet and doggie paddle, that's cross channel swimming, not how to start

Many modders never need to learn the code, with good source to copy, they can get by on with modding and learn as they go.

//-----------------------------------------------------------
//Returns whether or not XCOM has been revealed yet this mission Clearly a big help use comments if you code
//By: FZeroRacer
//-----------------------------------------------------------
class SeqCond_HasBeenRevealed extends SequenceCondition; //Class extended as mentioned above

event Activated() // Function?? (not sure if "event" is a function which is generally a section of code that returns a result a sub-routine GOSUB was the Basic name for a function call, 35 years ago)
{
    local XComGameState_Player PlayerState; // Variables called from somewhere outside this class (*.uc file)
    local XComGameStateHistory History;
    History = `XCOMHISTORY;
    
    foreach History.IterateByClassType(class'XComGameState_Player', PlayerState)// For Each a loop to check multiple items for the same thing
    {
        if( PlayerState.GetTeam() == eTeam_XCom )// EUREKA!!!!! this tells me that this can be used on Aliens or no need to say it's XCON
        {
            break;
        }
    }

    if (!PlayerState.bSquadIsConcealed) // if > then > else is pure basic a conditional decision sequence means Concealed (Guess is 1) or revealed (0)
    {
        OutputLinks[0].bHasImpulse = true;
    }
    else
    {
        OutputLinks[1].bHasImpulse = true;
    }
}

defaultproperties // This is vital, I'm sure of that, but need to learn more the b... values are often seen in ini's so that's a possibilty
    ObjName="Squad Concealed"
    ObjCategory="Check"

    bAutoActivateOutputLinks=false
    bCanBeUsedForGameplaySequence=true
    bConvertedForReplaySystem=true

    InputLinks(0)=(LinkDesc="In")
    OutputLinks(0)=(LinkDesc="No")
    OutputLinks(1)=(LinkDesc="Yes")
}

Right now that changes a lot of things, I have just finished commenting that and it's helped me a lot, i deliberately did it here, and it's my first proper read through, since I saw the significance of EUREKA!!!! straight away, if you do now , but only with my comments added, you will see how vital they are.

Oh and that Default Mod is never altered, that's Vanilla code, make another one "Defaul+Commentst" (I must Check if + is ok in nanes first) or any Name you choose, the name is picked, so you know what it means.

 

Conclusions

Squad Concealment isn't actually checked for the squad, it's per soldier.

theory derived (needs checking)

0=playerstate revealed (note player is each unit, squad or pod member, not "You the Gamer")

1=concealed

Possible extension of variable state

2=Concealed+squad concealed

 

Conjecture needing validation (subtract 1 is all that's used at reveal) so a concealed Ranger losing squad concealment becomes 1 and stays concealed while the normal squad concealment drops to zero.

It's simple but works so thats my current theory.

 

So though the title of this thread is less relevent, progress has been made, writng this helps me get things straight, hoe it's useful.

The major lesson I'm trying to convey, is you start making mods knowing nothing, you learn what you need to, when you need to, but you never learn everything.

So if someone sees something, I got wrong or missed, feel free to teach me.

 

I always say this to people, lacking knowledge isn't stupidity, stupidity is lacking knowledge and never trying to learn it, there are no stupid questions, just stupid people, the ones who never ask those stupid questions.

Link to comment
Share on other sites

Right , I've decided to use this thread, to outline the typical process of a Noob Mod Author, succeed or fail. maybe it will help others realise it's not that hard, and failure is OK.
First rule is don't promise what you can't deliver, I know what I want, a realistic activation system, better than the current pod based one.

So this isn't about teaching you how to code, so much as the overview, if I was a dev team, instead of one man, this would be a project leads, blog, rather than coding tutorial.
More of an overview than all the little details.

So first Impressions after looking at code, and a clear example of how ideas can evolve and change as I learn.
Now the Title is likely misleading, but I wont change it.

First and the most important lesson I've learned so far, though using other peoples mods as pointers and even "stealing" code is perfectly OK (if credited etc), it wont always help.
First I would provide links to these video guides, which are mostly useless and not (yet) aimed at this type of mods.
I learned one thing, but don't think they are bad guides, if that's all you learn, it's worth watching all of them to learn it.
The thing I learned was make a Default Mod for reference, as it contains all the Vanilla source. you can use mod Buddies powerful search system to find the classes you want.

I got that nugget from

XCOM 2 Modding Tutorial Series
Also found these, I haven't watched yet, but I will

XCOM 2 Mods

The only downside was, you can't have 2 projects running, so it's default or your mod.
I found another way to search using a tool from the UDK site (Full UDK and UE4 are both free).
UDK | UnCodeX

You tell it where the SDK source is and all will be searchable, I found doing it this way, with my Project in Mod Buddy, much easier
Source path you need
..\Steam\SteamApps\Common\XCOM 2 SDK\Development\SrcOrig

So searching for the terms Conceal and Reveal gives me
X2Effect_StayConcealed.uc
X2Effect_BreakUnitConcealment.uc
X2Action_ConcealmentLost.uc
SeqAct_ModifyConcealment.uc
SeqAct_RefreshConcealment.uc
SeqCond_HasBeenRevealed.uc
This one I'll give as an example, the first code line (//blah is comment not code, but probably the best clues to guide you, so comment your code, your future self will worship you, or curse you is you don't comment) tells you what class this extends, which you may need to check as well

class SeqCond_HasBeenRevealed extends SequenceCondition;
So we get related classes following these headers

SequenceCondition.uc

Now the file SeqCond_HasBeenRevealed.uc turned my plans on their heads (caveat, I don't know everything, this is subject to change, as I learn more.

SeqCond_HasBeenRevealed.uc

//-----------------------------------------------------------
//Returns whether or not XCOM has been revealed yet this mission
//By: FZeroRacer
//-----------------------------------------------------------

class SeqCond_HasBeenRevealed extends SequenceCondition;

event Activated()
{
local XComGameState_Player PlayerState;
local XComGameStateHistory History;
History = `XCOMHISTORY;

foreach History.IterateByClassType(class'XComGameState_Player', PlayerState)
{
if( PlayerState.GetTeam() == eTeam_XCom )
{
break;
}
}

if (!PlayerState.bSquadIsConcealed)
{
OutputLinks[0].bHasImpulse = true;
}
else
{
OutputLinks[1].bHasImpulse = true;
}
}

defaultproperties
{
ObjName="Squad Concealed"
ObjCategory="Check"

bAutoActivateOutputLinks=false
bCanBeUsedForGameplaySequence=true
bConvertedForReplaySystem=true

InputLinks(0)=(LinkDesc="In")
OutputLinks(0)=(LinkDesc="No")
OutputLinks(1)=(LinkDesc="Yes")
}


Now I'm not giving details just highlights here.
You can clearly see the comment is very useful even vital to modders, who may not know exactly what the code does, without this.
One other point is this is based on the C++ code Windows is based off, so knowledge of how C++ works helps.
I never learned any high level languages in my youth, Assembly and C=64 Basic, is what I cut my teeth on.
One thing I do know is all languages are designed for humans to understand, not computers, they only understand machine code,
A single hex number 0 to F is a byte or 8 bits 00000000 to 11111111.
So even machine code is converted for humans to read. Machine code as on and off.

I've added comments with my thoughts, as I read The yellow text

Basic was an high Level language designed for beginners, long before C started (never Mind C++), but two key facts make all high level languages very similar.
Humans are meant to understand the code, it's all basic mathematics in the end, if you understand maths, you can read code without learning that languages spelling or punctuation.
Don't get me wrong writing code is precise, knowing the spelling and punctuation is required to write good code, but not to read, or cut and paste, The best modders learn C++, but you don't need it to get your feet wet and doggie paddle, that's cross channel swimming, not how to start
Many modders never need to learn the code, with good source to copy, they can get by with cut and paste modding and learn as they go.

//-----------------------------------------------------------
//Returns whether or not XCOM has been revealed yet this mission
Clearly a big help use comments if you code
//By: FZeroRacer
//-----------------------------------------------------------

class SeqCond_HasBeenRevealed extends SequenceCondition; //Class extended as mentioned above

event Activated() // Function?? (not sure if "event" is a function which is generally a section of code that returns a result a sub-routine GOSUB was the Basic name for a function call, 35 years ago)
{
local XComGameState_Player PlayerState; // Variables called from somewhere outside this class (*.uc file)
local XComGameStateHistory History;
History = `XCOMHISTORY;

foreach History.IterateByClassType(class'XComGameState_Player', PlayerState)// For Each a loop to check multiple items for the same thing
{
if( PlayerState.GetTeam() == eTeam_XCom )// EUREKA!!!!! this tells me that this can be used on Aliens or no need to say it's XCON
{
break;
}
}

if (!PlayerState.bSquadIsConcealed) // if > then > else is pure basic a conditional decision sequence means Concealed (Guess is 1) or revealed (0)
{
OutputLinks[0].bHasImpulse = true;
}
else
{
OutputLinks[1].bHasImpulse = true;
}
}

defaultproperties // This is vital, I'm sure of that, but need to learn more the b... values are often seen in ini's so that's a possibilty
ObjName="Squad Concealed"
ObjCategory="Check"

bAutoActivateOutputLinks=false
bCanBeUsedForGameplaySequence=true
bConvertedForReplaySystem=true

InputLinks(0)=(LinkDesc="In")
OutputLinks(0)=(LinkDesc="No")
OutputLinks(1)=(LinkDesc="Yes")
}


Right now that changes a lot of things, I have just finished commenting that and it's helped me a lot, i deliberately did it here, and it's my first proper read through, since I saw the significance of EUREKA!!!! straight away, if you do now , but only with my comments added, you will see how vital they are.
Oh and that Default Mod is never altered, that's Vanilla code, make another one "Default+Comments" (I must Check if + is OK in names first) or any Name you choose, the name is picked, so you know what it means.

Conclusions
Squad Concealment isn't actually checked for the squad, it's per soldier.
theory derived (needs checking)
0=playerstate revealed (note player is each unit, squad or pod member, not "You the Gamer")
1=concealed
Possible extension of variable state
2=Concealed+squad concealed

Conjecture needing validation (subtract 1 is all that's used at reveal) so a concealed Ranger losing squad concealment becomes 1 and stays concealed while the normal squad concealment drops to zero.
It's simple but works so that's my current theory.

So though the title of this thread is less relevant, progress has been made, writing this helps me get things straight, hope it's useful.
The major lesson I'm trying to convey, is you start making mods knowing nothing, you learn what you need to, when you need to, but you never learn everything.
So if someone sees something, I got wrong or missed, feel free to teach me.

I always say this to people, lacking knowledge isn't stupidity, stupidity is lacking knowledge and never trying to learn it, there are no stupid questions, just stupid people, the ones who never ask those stupid questions.

Link to comment
Share on other sites

I think you're looking at the wrong piece of code.

 

SeqCond_HasBeenRevealed seems to be only relevant to (breaking) concealment, as opposed to pod activation / being seen.

What you probably need to do is recode the pod activation so it'll also trigger when the new pod sees already engaged aliens.

Edited by Solariz
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...