Notice soldiers say "contact east" instead of "contact, infantry, east, 300 meters"
Relevant code:
UMassSoundEntityQueueProcessor: Dequeues sounds from a queue and plays them, e.g. "contact, infantry, east, 300 meters" is 4 sounds in the queue. Also moves the audio component as the entity moves.
runs in Standalone and Client net modes
UMassSoundsSignalProcessor: runs when entity is signaled with an enum in EMassSoundsSignals. Adds sound to queue in FMassSoundsEntityFragment.
runs in Standalone and Client net modes
UMassEnemyTargetFinderProcessor: for all AI soldiers who need a target, if it finds one for them will send an RPC to client with EMassSoundsSignals::EntityContact.
runs in Standalone and Server net modes
TODO:
[ ] UMassSoundsSignalProcessor::HandleEntityDirectionSignal needs to take in FTargetEntityFragment list in addition to FTransformFragment list. Then to get the location of the target entity do something similar to UMassSoundsSignalProcessor::HandleEntityDescriptionSignal but from the EntityView call GetFragmentData<FTransformFragment>(). Then compute the rotator between FTransformFragment and the TargetEntity's FTransformFragment, and then pass it into UWorldDirectionsBlueprintLibrary::GetWorldDirectionDegreesForRotation.
[ ] Everywhere we use FMassRpcSendGenericEnumSignal, instead signal the entity immediately using UMassSignalSubsystem::SignalEntity. Don't delete FMassRpcSendGenericEnumSignal and AProjectM_PlayerController::ClientSendEntitySignalGenericEnum since it may be useful in future.
[ ] Change UMassSoundsSignalProcessor and UMassSoundEntityQueueProcessor to run on server and standalone net modes.
[ ] Change UMassSoundEntityQueueProcessor::PlaySoundFromQueue to call an RPC instead of UGameplayStatics::SpawnSoundAtLocation. The RPC should be similar to FMassRpcSendGenericEnumSignal but instead take in a sound asset to play. The Execute function should call a new unreliable RPC on AProjectM_PlayerController called ClientPlaySound.
[ ] In ClientPlaySound RPC, we should: MassSoundsEntityFragment.CurrentlyPlayingAudioComponent = UGameplayStatics::SpawnSoundAtLocation(...)
[ ] Create MassSoundDisplacementProcessor which runs on client and standalone net modes. In it, if an entity has FMassSoundsEntityFragment.CurrentlyPlayingAudioComponent set, run UMassSoundEntityQueueProcessor::HandleAudioComponentDisplacement (move that function into this new processor and delete call to it in UMassSoundEntityQueueProcessor).
In https://github.com/HaywireInteractive/OnAllFronts/pull/428 we made voice lines work on client net mode but certain voice lines require information that the client doesn't have, e.g. how to get the UMilitaryUnit of an entity, or the FTargetEntityFragment (to call out 3Ds: direction, distance, description. We should go with option 4 here: https://docs.google.com/document/d/1IHMPJNsLusZPapVFklM3MQDYjueA0_DYNSNvQzp6xZ8/edit#heading=h.x36zq4t6bwfi
To repro issue:
Relevant code:
TODO:
GetFragmentData<FTransformFragment>()
. Then compute the rotator between FTransformFragment and the TargetEntity's FTransformFragment, and then pass it into UWorldDirectionsBlueprintLibrary::GetWorldDirectionDegreesForRotation.MassSoundsEntityFragment.CurrentlyPlayingAudioComponent = UGameplayStatics::SpawnSoundAtLocation(...)