Jump to content

Comprehensive Stealth/Guerilla Warfare Mod


TeamDragonpunk

Recommended Posts

One thing that bugged me about the projectile system was the sound files are AkEvents *only*, which means if you want to make custom ones you'll need to get the wwise software. On the reddit thread a while ago asking about feature requests for the SDK I put in a request for the addition of SoundCues to the X2UnifiedProjectile class in addition to the AkEvents, as that'd make adding custom sounds much simpler. Or maybe you can figure out a way to get it to work as-is (if so please let me know!). Or, you can try using the wwise stuff. They apparently offer free limited licenses for free/small projects that you can request.

Link to comment
Share on other sites

One thing that bugged me about the projectile system was the sound files are AkEvents *only*, which means if you want to make custom ones you'll need to get the wwise software. On the reddit thread a while ago asking about feature requests for the SDK I put in a request for the addition of SoundCues to the X2UnifiedProjectile class in addition to the AkEvents, as that'd make adding custom sounds much simpler. Or maybe you can figure out a way to get it to work as-is (if so please let me know!). Or, you can try using the wwise stuff. They apparently offer free limited licenses for free/small projects that you can request.

 

You can actually add SoundCues through the AnimSet of the weapon in question. You'll have to make a new projectile archetype and blank out the AKEvent, and apply it to the XCOMWeapon Archetype.

 

EDIT: Not sure how you will do this since you are trying to override the weapon itself. My idea would be to swap out the archetype with the suppressed weapon archetype through unrealscript or something.

Edited by E3245
Link to comment
Share on other sites

Yeah, you can use the animset instead, which is probably sufficient for the "Fire" sounds which is probably all you need for this particular scenario. But you can't easily handle the projectile "Death" sounds cause you don't know when the projectile will actually die cause the animation can't react to different target distances.

Link to comment
Share on other sites

I don't think you understood me correctly, the problem isn't the actual sound the weapon makes (AFAIK the sound for the AI is just a sphere where the AI gets notified about the shooting event) what I am concerned about is how to change individual members that draw from the same template because how the weapon actually sounds is important but I am in charge of gameplay which isn't directly connected to this property. From what I understood when an ability fires there's code inside the xcomgamestate_unit class that checks for any AIs to send a sound alert to-its independent of the actual sound as far as I saw and that's why I think we either have to get a highlander mod to change XComGS_item and XCGS_unit or create new weapon templates Edited by Guest
Link to comment
Share on other sites

I don't think you understood me correctly, the problem isn't the actual sound the weapon makes (AFAIK the sound for the AI is just a sphere where the AI gets notified about the shooting event) what I am concerned about is how to change individual members that draw from the same template because how the weapon actually sounds is important but I am in charge of gameplay which isn't directly connected to this property. From what I understood when an ability fires there's code inside the xcomgamestate_unit class that checks for any AIs to send a sound alert to-its independent of the actual sound as far as I saw and that's why I think we either have to get a highlander mod to change XComGS_item and XCGS_unit or create new weapon templates

 

Ok, I apologize for misunderstanding, as I thought the projectile archetype system would satisfy the need to change the audio and detection radius. What "use case" are you referring to which would necessitate individual members drawing from the same template. The sound radius is set by the sound resource. My thoughts would be that anyone within the newly modified sound radius would be alerted, while anyone outside would not (or would not for X number of terms or however people decide to handle this).

 

So tonight, perhaps a "deep dive" into the alert system?

Link to comment
Share on other sites

One thing that bugged me about the projectile system was the sound files are AkEvents *only*, which means if you want to make custom ones you'll need to get the wwise software. On the reddit thread a while ago asking about feature requests for the SDK I put in a request for the addition of SoundCues to the X2UnifiedProjectile class in addition to the AkEvents, as that'd make adding custom sounds much simpler. Or maybe you can figure out a way to get it to work as-is (if so please let me know!). Or, you can try using the wwise stuff. They apparently offer free limited licenses for free/small projects that you can request.

 

Yeah, it's really annoying that it's $750 when other programs are far cheaper (not sure I see the value-add there). Our sound designer already has the program, so it's not a huge concern for us. I'm more worried about trying to override/balance the effects of the default projectile archetype. Sounds like it's feasible, but tricky.

Link to comment
Share on other sites

 

I don't think you understood me correctly, the problem isn't the actual sound the weapon makes (AFAIK the sound for the AI is just a sphere where the AI gets notified about the shooting event) what I am concerned about is how to change individual members that draw from the same template because how the weapon actually sounds is important but I am in charge of gameplay which isn't directly connected to this property. From what I understood when an ability fires there's code inside the xcomgamestate_unit class that checks for any AIs to send a sound alert to-its independent of the actual sound as far as I saw and that's why I think we either have to get a highlander mod to change XComGS_item and XCGS_unit or create new weapon templates

 

Ok, I apologize for misunderstanding, as I thought the projectile archetype system would satisfy the need to change the audio and detection radius. What "use case" are you referring to which would necessitate individual members drawing from the same template. The sound radius is set by the sound resource. My thoughts would be that anyone within the newly modified sound radius would be alerted, while anyone outside would not (or would not for X number of terms or however people decide to handle this).

 

So tonight, perhaps a "deep dive" into the alert system?

 

 

There's a difference in the projectile sound and the AI detecting sound from the weapons, those properties are set inside the templates of the individual weapons so if i change it for one weapon it will propagate to all weapons of the same template.

 

From XComGameState_Unic.uc :

 

 

function EventListenerReturn OnAbilityActivated(Object EventData, Object EventSource, XComGameState GameState, Name EventID)
{
	---- ability activation code ----

	if( ActivatedAbilityState.DoesAbilityCauseSound() )
	{
		if( ActivatedAbilityStateContext != None && ActivatedAbilityStateContext.InputContext.ItemObject.ObjectID > 0 )
		{
			SourceUnitState = XComGameState_Unit(History.GetGameStateForObjectID(ActivatedAbilityStateContext.InputContext.SourceObject.ObjectID));
			WeaponState = XComGameState_Item(GameState.GetGameStateForObjectID(ActivatedAbilityStateContext.InputContext.ItemObject.ObjectID));

			SoundRange = WeaponState.GetItemSoundRange();
			if( SoundRange > 0 )
			{
				if( WeaponState.SoundOriginatesFromOwnerLocation() && ActivatedAbilityStateContext.InputContext.TargetLocations.Length > 0 )
				{
					SoundLocation = ActivatedAbilityStateContext.InputContext.TargetLocations[0];
					SoundTileLocation = `XWORLD.GetTileCoordinatesFromPosition(SoundLocation);
				}
				else
				{
					GetKeystoneVisibilityLocation(SoundTileLocation);
				}

				GetEnemiesInRange(SoundTileLocation, SoundRange, Enemies);

				`LogAI("Weapon sound @ Tile("$SoundTileLocation.X$","@SoundTileLocation.Y$","@SoundTileLocation.Z$") - Found"@Enemies.Length@"enemies in range ("$SoundRange$" meters)");
				foreach Enemies(EnemyRef)
				{
					EnemyInSoundRangeUnitState = XComGameState_Unit(History.GetGameStateForObjectID(EnemyRef.ObjectID));

					// this was the targeted unit
					if( EnemyInSoundRangeUnitState.ObjectID == ActivatedAbilityStateContext.InputContext.PrimaryTarget.ObjectID )
					{
						UnitAGainsKnowledgeOfUnitB(EnemyInSoundRangeUnitState, SourceUnitState, GameState, eAC_TakingFire, false);
					}
					// this unit just overheard the sound
					else
					{
						UnitAGainsKnowledgeOfUnitB(EnemyInSoundRangeUnitState, SourceUnitState, GameState, eAC_DetectedSound, false);
					}
				}
			}
		}
	}

	return ELR_NoInterrupt;
}
 

 

 

from XComGameState_Item.uc - calling the iSoundRange var. as you can see it's independent of the unreal editor weapon archetype and only uses the weapon template

 

 

 

simulated function int GetItemSoundRange()
{
	local int iSoundRange;

	iSoundRange = class'X2WeaponTemplate'.default.iSoundRange;
	GetMyTemplate();
	
	if (m_ItemTemplate.IsA('X2WeaponTemplate'))
	{
		iSoundRange = X2WeaponTemplate(m_ItemTemplate).iSoundRange;
	}

	return iSoundRange;
} 

from

 

 

 

Link to comment
Share on other sites

 

 

I don't think you understood me correctly, the problem isn't the actual sound the weapon makes (AFAIK the sound for the AI is just a sphere where the AI gets notified about the shooting event) what I am concerned about is how to change individual members that draw from the same template because how the weapon actually sounds is important but I am in charge of gameplay which isn't directly connected to this property. From what I understood when an ability fires there's code inside the xcomgamestate_unit class that checks for any AIs to send a sound alert to-its independent of the actual sound as far as I saw and that's why I think we either have to get a highlander mod to change XComGS_item and XCGS_unit or create new weapon templates

 

Ok, I apologize for misunderstanding, as I thought the projectile archetype system would satisfy the need to change the audio and detection radius. What "use case" are you referring to which would necessitate individual members drawing from the same template. The sound radius is set by the sound resource. My thoughts would be that anyone within the newly modified sound radius would be alerted, while anyone outside would not (or would not for X number of terms or however people decide to handle this).

 

So tonight, perhaps a "deep dive" into the alert system?

 

 

There's a difference in the projectile sound and the AI detecting sound from the weapons, those properties are set inside the templates of the individual weapons so if i change it for one weapon it will propagate to all weapons of the same template.

 

From XComGameState_Unic.uc :

 

 

function EventListenerReturn OnAbilityActivated(Object EventData, Object EventSource, XComGameState GameState, Name EventID)
{
	---- ability activation code ----

	if( ActivatedAbilityState.DoesAbilityCauseSound() )
	{
		if( ActivatedAbilityStateContext != None && ActivatedAbilityStateContext.InputContext.ItemObject.ObjectID > 0 )
		{
			SourceUnitState = XComGameState_Unit(History.GetGameStateForObjectID(ActivatedAbilityStateContext.InputContext.SourceObject.ObjectID));
			WeaponState = XComGameState_Item(GameState.GetGameStateForObjectID(ActivatedAbilityStateContext.InputContext.ItemObject.ObjectID));

			SoundRange = WeaponState.GetItemSoundRange();
			if( SoundRange > 0 )
			{
				if( WeaponState.SoundOriginatesFromOwnerLocation() && ActivatedAbilityStateContext.InputContext.TargetLocations.Length > 0 )
				{
					SoundLocation = ActivatedAbilityStateContext.InputContext.TargetLocations[0];
					SoundTileLocation = `XWORLD.GetTileCoordinatesFromPosition(SoundLocation);
				}
				else
				{
					GetKeystoneVisibilityLocation(SoundTileLocation);
				}

				GetEnemiesInRange(SoundTileLocation, SoundRange, Enemies);

				`LogAI("Weapon sound @ Tile("$SoundTileLocation.X$","@SoundTileLocation.Y$","@SoundTileLocation.Z$") - Found"@Enemies.Length@"enemies in range ("$SoundRange$" meters)");
				foreach Enemies(EnemyRef)
				{
					EnemyInSoundRangeUnitState = XComGameState_Unit(History.GetGameStateForObjectID(EnemyRef.ObjectID));

					// this was the targeted unit
					if( EnemyInSoundRangeUnitState.ObjectID == ActivatedAbilityStateContext.InputContext.PrimaryTarget.ObjectID )
					{
						UnitAGainsKnowledgeOfUnitB(EnemyInSoundRangeUnitState, SourceUnitState, GameState, eAC_TakingFire, false);
					}
					// this unit just overheard the sound
					else
					{
						UnitAGainsKnowledgeOfUnitB(EnemyInSoundRangeUnitState, SourceUnitState, GameState, eAC_DetectedSound, false);
					}
				}
			}
		}
	}

	return ELR_NoInterrupt;
}
 

 

 

from XComGameState_Item.uc - calling the iSoundRange var. as you can see it's independent of the unreal editor weapon archetype and only uses the weapon template

 

 

 

simulated function int GetItemSoundRange()
{
	local int iSoundRange;

	iSoundRange = class'X2WeaponTemplate'.default.iSoundRange;
	GetMyTemplate();
	
	if (m_ItemTemplate.IsA('X2WeaponTemplate'))
	{
		iSoundRange = X2WeaponTemplate(m_ItemTemplate).iSoundRange;
	}

	return iSoundRange;
} 

from

 

 

 

 

 

Ok, I follow you now. Sorry for the confusion, as I wasn't expecting to work on this until July. These are the solid questions that need to be asked though, so thank you!

Link to comment
Share on other sites

It might be worth waiting a week to decide on stealth to see how the DLC implements it! While I think both eLaddy202 and I envision changes to the sound range for the suppressors, it looks like the Devs are implementing it in a different way. I think most of us have thought about doing this before, but haven't quite worked out how it might be applied to the whole squad.

 

"the Shadowfall ability that is guaranteed to hit and will place its user in concealment if the enemy is killed;" -From the latest DLC article out today on 2K

Link to comment
Share on other sites

It might be worth waiting a week to decide on stealth to see how the DLC implements it! While I think both eLaddy202 and I envision changes to the sound range for the suppressors, it looks like the Devs are implementing it in a different way. I think most of us have thought about doing this before, but haven't quite worked out how it might be applied to the whole squad.

 

"the Shadowfall ability that is guaranteed to hit and will place its user in concealment if the enemy is killed;" -From the latest DLC article out today on 2K

That's not the main issue (the comms delay ability already deals with that on a squad level) the issue i'm trying to solve is that sound is causing enemies to actively search for you and i want to reduce the range the AI get's notified at

Link to comment
Share on other sites

  • Recently Browsing   0 members

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