8 Commits

Author SHA1 Message Date
432741af52 feat(combat): cues de hit react + som punch + camera shake (cliente UE)
3 GameplayCueNotify_Burst BPs (taxonomia Lyra GameplayCue.Zeus.Combat.Hit.*):
  GC_Combat_Hit_React   -> PlayAnimMontage AM_HitReact_Light no alvo
  GC_Combat_Hit_Impact  -> SpawnSoundAtLocation SW_Punch_Cartoon na pos do alvo
  GC_Combat_Hit_Self    -> ClientStartCameraShake CS_HitReact no PC do alvo

Assets novos:
  AS_HitReact (+ AM_HitReact_Light/Medium/Heavy) -- montages de reacao
  SW_Punch_Cartoon -- SFX de impacto (0.3s)
  CS_HitReact -- LegacyCameraShake (osc 0.35s, pitch/roll/locZ)

DT_Abilities recriado (RowStruct ZeusAbilityDataRow): rows Dash+Kick com
AbilityClass + ActivateCueTag GameplayCue.Zeus.*. GC_Kick/GC_Dash com tags
renomeadas pro prefixo GameplayCue.* (filter do Asset Picker).

ZeusServerTags.ini: regenerado via ZeusTool tags sync (106 tags canonicas).

Source/Combat/ZeusAnimNotifyState_BodyHitWindow: AnimNotifyState que abre a
janela de hit detection (FootR capsule) durante o swing do Kick.

GC_Kick_Target removido (substituido por Combat.Hit.React reutilizavel).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 21:37:40 -03:00
84f552b4fa feat(gas): Kick V0 end-to-end -- IA_Kick + BP_GA_Kick + GC_Kick + rename Pawn + limpeza ThirdPerson
Cliente UE Kick V0 funcionando end-to-end (testado com 2 PIEs: ativador chuta
+ proxies dos peers veem montage via GameplayCue replicado).

ASSETS NOVOS:
- IA_Kick.uasset: Enhanced Input Action (Boolean) -- tecla F.
- IMC_Default: mapping F -> IA_Kick (trigger Pressed).
- BP_ZeusPlayerCharacter.uasset (em /Game/ZMMO/Core/Player/): renomeado a
  partir do BP_ThirdPersonCharacter; agora possui handler IA_Kick que chama
  RequestActivateAbilityByTag("Zeus.Ability.Melee.Kick") no UZeusGASComponent
  do PlayerState. ZeusGameMode aponta pra ele via FClassFinder.
- GC_Kick.uasset (em /Game/ZMMO/GAS/Cues/): GameplayCueNotify_Burst BP, parent
  AZeusGameplayCueNotify_Burst, tag Zeus.Cue.Melee.Kick. Override do hook
  OnZeusCueExecute (Lyra-style) -> Cast To Character (MyTarget) -> Play Anim
  Montage (AM_Kick_Montage). Quando server emite S_ABILITY_CUE, cliente
  spawna esse GC e roda a animacao no Mesh do proxy.

ASSETS MODIFICADOS:
- GA_Kick: conexoes PlayMontageAndWait -> EndAbility ajustadas. Antes TODAS
  as 5 saidas (OnCompleted/OnBlendedIn/OnBlendOut/OnInterrupted/OnCancelled)
  ligavam no EndAbility -- OnBlendedIn dispara ~100ms apos inicio (fim do
  blend in) -> EndAbility -> bStopWhenAbilityEnds=true -> montage para
  prematuro. Fix: so OnCompleted/OnInterrupted/OnCancelled. Hook BP novo
  OnZeusAbilityConfirmedByServer -> Print "Kick CONFIRMED by server".
- DT_Abilities: row Kick adicionada (Tag=Zeus.Ability.Melee.Kick, AbilityClass
  =GA_Kick_C, ActivationMontage=AM_Kick_Montage, ActivateCueTag=Zeus.Cue.Melee.Kick,
  Category=Melee, KeybindHint=F).
- BP_PlayerState: salvo apos GameMode apontar pra ele (mark dirty).
- ABP_Unarmed: deletado 1 Slot DefaultSlot duplicado (warning AnimBlueprintLog
  "node ja existe" + PlayMontage interno falhava em escolher slot).

LIMPEZA Content/ThirdPerson/:
- BP_ThirdPersonCharacter.uasset DELETED (renomeado pra BP_ZeusPlayerCharacter).
- BP_ThirdPersonGameMode.uasset DELETED (sem refs externas).
- BP_ThirdPersonPlayerController.uasset DELETED (so usado por BP_ThirdPersonGameMode).
- Menu.umap DELETED (sample UE template, sem refs).
- MI_ThirdPersonColWay.uasset mantido (90 refs em L_Test_UI -- mover pra
  /Game/ZMMO/Materials/ fica pra batch futuro).

Content/_DevOnly/ NAO incluido.

Tested in PIE 2 players: PIE0 aperta F -> chuta visualmente; proxy do PIE0
no PIE1 tambem chuta (montage replicado via GC). Cooldown 1.5s ativo.
Stamina cai 100 -> 95 a cada kick.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 03:56:28 -03:00
1308338953 feat(gas): GameMode aponta pra BPs (Pawn/PlayerState) + cleanup ZeusCharacter
ZeusGameMode.cpp:
- DefaultPawnClass: usa FClassFinder pra /Game/ZMMO/Core/Player/BP_ZeusPlayerCharacter
  (fallback AZeusCharacter). Sem isso, engine instancia C++ direto e perde
  toda customizacao BP (EnhancedInputAction events, AnimBP wire, componentes
  BP-added).
- PlayerStateClass: usa FClassFinder pra /Game/ZMMO/Core/Player/BP_PlayerState
  (fallback AZeusPlayerState). Mesmo motivo -- BP filho tem componentes (ex:
  UZeusGASComponent via ComponentClasses no DefaultGame.ini) e overrides do
  designer que classes C++ puras nao tem.
- TODO: renomear BP_PlayerState -> BP_ZeusPlayerState (alinhar com convencao
  BP_ZeusPlayerCharacter); path do FClassFinder ja preparado pra renomear.

ZeusCharacter.cpp/h cleanup:
- Removida gambiarra anterior (PossessedBy + OnRep_PlayerState overrides +
  RefreshGASAvatar com FTimerHandle retry). Substituida pelo pattern
  event-driven em UZeusGASComponent::HandlePawnSet (commit server anterior).
- Includes desnecessarios (AbilitySystemComponent.h + ZeusAbilitySystemComponent.h)
  removidos.

ZMMO.uproject:
- GameplayAbilities adicionado em Plugins (UE 5.7 exige que modulo do jogo
  declare explicitamente plugins que ele consome -- antes vinha transitivamente
  do plugin ZeusGAS, gerava warning de build).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 03:56:00 -03:00
21d42d9846 chore(gas): sync GameplayTags do server (Stamina/Kick/Spell/Buff) + flags de debug GAS
ZeusServerTags.ini -- merge gerado por sync_tags.ps1 (14 tags novas vindo do
ZeusServer dump JSON via ZeusTool tags sync):
- Stamina:           Zeus.Attribute.Stamina + MaxStamina
- Kick:              Zeus.Ability.Melee + Zeus.Ability.Melee.Kick
                     Zeus.Effect.Cooldown.Kick + Zeus.Cooldown.Kick
                     Zeus.Cue.Melee + Zeus.Cue.Melee.Kick
- FireballRain rename: Zeus.Ability.Spell.* + Zeus.Effect.Cooldown.FireballRain
                       Zeus.Cooldown.FireballRain
- Buff reorg:        Zeus.Effect.Buff + Zeus.Effect.Buff.StrUp

Tag orfa removida manualmente: Zeus.Ability.Combat.Kick (Kick mudou
de Combat.* pra Melee.*; merge preservou a antiga, limpo aqui).

DefaultGame.ini: flags de debug do GAS pra Kick development:
- bUseDebugTargetFromHud=true   (showdebug abilitysystem aponta pra mira)
- AbilitySystem.LogAbilityTriggers=1
- AbilitySystem.DebugAbilityTags=1

Lembrete: GameplayTags.ini so' eh lido no boot do editor -- reiniciar UE
pra registrar as tags novas (BP_GA_Kick depende de Zeus.Ability.Melee.Kick).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 01:37:45 -03:00
2895889e2b feat(gas): rename BP_GA_* -> GA_* + DT_Abilities seed + wire no ThirdPersonCharacter
Convencao de nome: abilities passam de "BP_GA_<Nome>" pra "GA_<Nome>"
(remove o "BP_" redundante -- ja sabemos que GA_ e' Blueprint).

- BP_GA_Dash.uasset -> GA_Dash.uasset
- BP_GA_Kick.uasset -> GA_Kick.uasset (pasta Kick/ mantida)
- DT_Abilities: linha do Kick atualizada pra apontar pra GA_Kick
- BP_ThirdPersonCharacter: ability Kick ligada (input/grant)

Doc HOWTO ja' reflete a nova convencao (ver server commit).
Content/_DevOnly/ NAO incluido.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 00:50:09 -03:00
1114ddbb11 feat(gas): seed inicial do GASCombatSystem -- ABP_Unarmed + Kick ability
- ABP_Unarmed.uasset: AnimBP unarmed (modificado) - base de animacao p/ combate sem arma
- BP_GA_Kick.uasset: GameplayAbility blueprint do Kick
- AS_Kick.uasset: animation sequence do golpe
- AM_Kick_Montage.uasset: montage que a ability dispara

Primeiro asset GAS authored cliente-side -- pre-requisito pra Fase 2 (M9 cues + M10 AbilityTask cliente).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 00:29:10 -03:00
9a430dabc3 feat(aoi): UZeusAOIComponent ganha visibility tracking + delegates BP (1.4 do roteiro PvP)
Estende o componente (que ja existia como debug overlay) com:
- TSet<int64> VisibleEntityIds_ espelhando ENT_SPAWN/ENT_DESPAWN do V1
- Delegates BlueprintAssignable: OnEntityEnteredAOI(EntityId) + OnEntityExitedAOI(EntityId, Reason)
- BlueprintPure: GetVisibleEntityCount, GetVisibleEntityIds, IsEntityVisible, GetSelfEntityId
- Bind/unbind dos delegates DYNAMIC do UZeusNetworkingClientSubsystem (AddDynamic/RemoveDynamic)
  no BeginPlay/EndPlay
- Self-entity filtrada via OnSelfEntityAssigned -- proprio char nao trackeia

Sem histerese client-side (server ja filtra com margem ~2048cm; se aparecer
flapping visual, adicionar depois). Memoria: project_aoi_client_component.

NAO testado in-game.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 00:23:51 -03:00
a3f2fa9c06 feat(client): overlay de fronteira -- ajustes + materiais e external actor
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-17 22:44:11 -03:00
53 changed files with 346 additions and 15 deletions

View File

@@ -91,3 +91,12 @@ bShouldAcquireMissingChunksOnLoad=False
bShouldWarnAboutInvalidAssets=True
MetaDataTagsForAssetRegistry=()
[/Script/GameplayAbilities.AbilitySystemGlobals]
bUseDebugTargetFromHud=true
[ConsoleVariables]
; mostra cooldowns, ativações, falhas
AbilitySystem.LogAbilityTriggers=1
; mostra effects aplicados/removidos com magnitude
AbilitySystem.DebugAbilityTags=1

View File

@@ -1,13 +1,29 @@
; Gerado por ZeusTool tags sync -- tags do ZeusServer p/ o cliente UE.
; NAO editar a mao: regenere com `ZeusTool tags sync <json> <ini>`.
[/Script/GameplayTags.GameplayTagsList]
GameplayTagList=(Tag="GameplayCue",DevComment="")
GameplayTagList=(Tag="GameplayCue.Zeus",DevComment="")
GameplayTagList=(Tag="GameplayCue.Zeus.Melee",DevComment="")
GameplayTagList=(Tag="GameplayCue.Zeus.Melee.Kick",DevComment="")
GameplayTagList=(Tag="GameplayCue.Zeus.Combat",DevComment="Categoria root de cues compartilhados por TODO melee (reutilizaveis)")
GameplayTagList=(Tag="GameplayCue.Zeus.Combat.Hit",DevComment="Familia de cues do impacto de hit")
GameplayTagList=(Tag="GameplayCue.Zeus.Combat.Hit.Impact",DevComment="Broadcast AOI - SFX impact + VFX sparks na location (todos ouvem)")
GameplayTagList=(Tag="GameplayCue.Zeus.Combat.Hit.React",DevComment="Broadcast AOI - AnimMontage de hit react no target (todos veem)")
GameplayTagList=(Tag="GameplayCue.Zeus.Combat.Hit.Self",DevComment="Unicast - feedback privado do alvo (camera shake, hit flash, rumble)")
GameplayTagList=(Tag="GameplayCue.Zeus.Melee.Kick.Target",DevComment="")
GameplayTagList=(Tag="GameplayCue.Zeus.Movement",DevComment="")
GameplayTagList=(Tag="GameplayCue.Zeus.Movement.Dash",DevComment="")
GameplayTagList=(Tag="Zeus",DevComment="")
GameplayTagList=(Tag="Zeus.Ability",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Casting",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Channeling",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Melee",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Melee.Kick",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Movement",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Movement.Dash",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Recovery",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Spell",DevComment="")
GameplayTagList=(Tag="Zeus.Ability.Spell.FireballRain",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Agi",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Aspd",DevComment="")
@@ -20,6 +36,7 @@ GameplayTagList=(Tag="Zeus.Attribute.Dex",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Flee",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Hit",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Hp",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.HpRegenRate",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Int",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.JobExp",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.JobLevel",DevComment="")
@@ -32,6 +49,9 @@ GameplayTagList=(Tag="Zeus.Attribute.MaxSp",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Mdef",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.SkillPoint",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Sp",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.SpRegenRate",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Stamina",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.StaminaRegenRate",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.StatusPoint",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Str",DevComment="")
GameplayTagList=(Tag="Zeus.Attribute.Vit",DevComment="")
@@ -46,9 +66,7 @@ GameplayTagList=(Tag="Zeus.Combo.Slot2",DevComment="")
GameplayTagList=(Tag="Zeus.Combo.Slot3",DevComment="")
GameplayTagList=(Tag="Zeus.Combo.Window",DevComment="")
GameplayTagList=(Tag="Zeus.Cooldown",DevComment="")
GameplayTagList=(Tag="Zeus.Cue",DevComment="")
GameplayTagList=(Tag="Zeus.Cue.Movement",DevComment="")
GameplayTagList=(Tag="Zeus.Cue.Movement.Dash",DevComment="")
GameplayTagList=(Tag="Zeus.Cooldown.FireballRain",DevComment="")
GameplayTagList=(Tag="Zeus.Damage",DevComment="")
GameplayTagList=(Tag="Zeus.Damage.Earth",DevComment="")
GameplayTagList=(Tag="Zeus.Damage.Fire",DevComment="")
@@ -60,10 +78,23 @@ GameplayTagList=(Tag="Zeus.Damage.Shadow",DevComment="")
GameplayTagList=(Tag="Zeus.Damage.Water",DevComment="")
GameplayTagList=(Tag="Zeus.Damage.Wind",DevComment="")
GameplayTagList=(Tag="Zeus.Effect",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Buff",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Buff.StrUp",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cooldown",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cooldown.Dash",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cooldown.FireballRain",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cooldown.Kick",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cost",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cost.Sp_10",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cost.Sp_50",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Cost.Stamina_5",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Damage",DevComment="")
GameplayTagList=(Tag="Zeus.Effect.Damage.Kick",DevComment="")
GameplayTagList=(Tag="Zeus.State",DevComment="")
GameplayTagList=(Tag="Zeus.State.NoHpRegen",DevComment="")
GameplayTagList=(Tag="Zeus.State.NoRegen",DevComment="")
GameplayTagList=(Tag="Zeus.State.NoSpRegen",DevComment="")
GameplayTagList=(Tag="Zeus.State.NoStaminaRegen",DevComment="")
GameplayTagList=(Tag="Zeus.Status",DevComment="")
GameplayTagList=(Tag="Zeus.Status.Buff",DevComment="")
GameplayTagList=(Tag="Zeus.Status.CC",DevComment="")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,46 @@
// Copyright Zeus Server Engine. All rights reserved.
#include "ZeusAnimNotifyState_BodyHitWindow.h"
#include "Components/SkeletalMeshComponent.h"
#include "GameFramework/Actor.h"
#include "Game/Entity/ZeusCharacter.h"
void UZeusAnimNotifyState_BodyHitWindow::NotifyBegin(USkeletalMeshComponent* MeshComp,
UAnimSequenceBase* /*Animation*/, float /*TotalDuration*/,
const FAnimNotifyEventReference& /*EventReference*/)
{
if (!MeshComp) { return; }
if (AZeusCharacter* Char = Cast<AZeusCharacter>(MeshComp->GetOwner()))
{
Char->SetHitColliderEnabled(Source, /*bEnabled*/ true);
}
}
void UZeusAnimNotifyState_BodyHitWindow::NotifyEnd(USkeletalMeshComponent* MeshComp,
UAnimSequenceBase* /*Animation*/, const FAnimNotifyEventReference& /*EventReference*/)
{
if (!MeshComp) { return; }
if (AZeusCharacter* Char = Cast<AZeusCharacter>(MeshComp->GetOwner()))
{
Char->SetHitColliderEnabled(Source, /*bEnabled*/ false);
}
}
#if WITH_EDITOR
FString UZeusAnimNotifyState_BodyHitWindow::GetNotifyName_Implementation() const
{
const TCHAR* SourceLabel;
switch (Source)
{
case EZeusHitSource::FootR: SourceLabel = TEXT("FootR"); break;
case EZeusHitSource::FootL: SourceLabel = TEXT("FootL"); break;
case EZeusHitSource::HandR: SourceLabel = TEXT("HandR"); break;
case EZeusHitSource::HandL: SourceLabel = TEXT("HandL"); break;
case EZeusHitSource::WeaponR: SourceLabel = TEXT("WeaponR"); break;
case EZeusHitSource::WeaponL: SourceLabel = TEXT("WeaponL"); break;
default: SourceLabel = TEXT("?"); break;
}
return FString::Printf(TEXT("Zeus Body Hit (%s)"), SourceLabel);
}
#endif

View File

@@ -0,0 +1,74 @@
// Copyright Zeus Server Engine. All rights reserved.
#pragma once
#include "CoreMinimal.h"
#include "Animation/AnimNotifies/AnimNotifyState.h"
#include "Game/Entity/ZeusCharacter.h" // EZeusHitSource
#include "ZeusAnimNotifyState_BodyHitWindow.generated.h"
class USkeletalMeshComponent;
class UAnimSequenceBase;
/**
* AnimNotifyState que liga o HitCollider de uma parte do corpo durante a sua
* janela no montage. NotifyBegin liga + NotifyEnd desliga -- define o HIT
* WINDOW do golpe melee/arma branca.
*
* Generaliza para qualquer parte do corpo via EZeusHitSource:
* - FootR / FootL -> chute (capsule attachado em foot_*_Socket)
* - HandR / HandL -> soco (capsule em HandGrip_*)
* - WeaponR / WeaponL -> arma branca (capsule em weapon_*)
*
* === Como usar ===
*
* No editor de um AnimMontage (ex: AM_Kick_Montage):
* 1. Encontrar o frame onde o membro comeca o movimento de impacto.
* 2. Right-click na track de notifies -> Add Notify State -> Zeus Body Hit Window.
* 3. Definir Source = FootR (ou HandR pra soco, WeaponR pra arma, etc).
* 4. Arrastar o range pra cobrir o arco completo do golpe (ex: frame 8 a 18
* em 30fps = ~330ms de janela).
*
* Pq AnimNotifyState e nao AnimNotify pontual:
* - AnimNotify dispara em UM frame -> nao da' pra detectar entradas no
* capsule durante a janela.
* - AnimNotifyState tem NotifyBegin/NotifyTick/NotifyEnd. Pra "ligar
* collider de frame X ate Y", e' o pattern correto.
*
* === Replicacao ===
*
* Roda LOCAL em cada cliente. Cliente do ATIVADOR liga capsule local + reporta
* overlap via opcode MELEE_HIT_REPORT pro server. Server valida e aplica dano +
* dispatcha cue Kick.Target pra todos no AOI do alvo.
*
* Proxies de outros clientes tocam o montage via GameplayCue replicado (visual)
* mas o capsule deles roda no PROXY que e' Pawn local de outra coisa -- nao
* importa, o reportador autoritativo eh quem ativou a ability.
*/
UCLASS(meta = (DisplayName = "Zeus Body Hit Window"))
class ZMMO_API UZeusAnimNotifyState_BodyHitWindow : public UAnimNotifyState
{
GENERATED_BODY()
public:
/// Qual parte do corpo (capsule) tem o hit ligado durante a janela.
/// Default = FootR (chute direito e' o golpe mais comum em montages
/// melee unarmed). Trocar pra HandR pra soco, WeaponR pra arma, etc.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Zeus|Combat")
EZeusHitSource Source = EZeusHitSource::FootR;
// === AnimNotifyState overrides ===
virtual void NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
float TotalDuration, const FAnimNotifyEventReference& EventReference) override;
virtual void NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation,
const FAnimNotifyEventReference& EventReference) override;
#if WITH_EDITOR
/// Mostra "Zeus Body Hit (FootR/HandL/WeaponR/...)" no editor de montage em
/// vez do nome generico da classe -- ajuda a identificar qual parte sem
/// abrir details.
virtual FString GetNotifyName_Implementation() const override;
#endif
};

View File

@@ -173,6 +173,12 @@ void AZeusCharacter::Tick(const float DeltaSeconds)
void AZeusCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
// IMPORTANTE: chamar Super:: pra que BPs filhos consigam auto-bindar
// nodes EnhancedInputAction no Event Graph (ex: GA_Kick / IA_Kick no
// BP_ThirdPersonCharacter). Sem isso, bindings em BP ficam orfaos --
// so' bindings C++ (Move/Look/Jump/Dash abaixo) recebem input.
Super::SetupPlayerInputComponent(PlayerInputComponent);
if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent))
{
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &AZeusCharacter::OnJumpPressed);

View File

@@ -5,10 +5,47 @@
#include "ZeusPlayerController.h"
#include "ZeusPlayerState.h"
#include "UObject/ConstructorHelpers.h"
AZeusGameMode::AZeusGameMode()
{
DefaultPawnClass = AZeusCharacter::StaticClass();
// DefaultPawnClass: usar o BP filho (BP_ThirdPersonCharacter) em vez do
// C++ puro. BPs filhos so' sao instanciados se o pawn possessed for da
// classe BP -- caso contrario o engine cria a classe C++ direta e perde
// TUDO que o designer fez no BP (EnhancedInputAction events, AnimBP wire,
// hooks de ability, componentes adicionados via editor).
//
// Fallback pra AZeusCharacter pura se o asset BP nao existir (asset
// renomeado/deletado por engano -- nao deve acontecer em prod).
static ConstructorHelpers::FClassFinder<APawn> DefaultPawnBP(
TEXT("/Game/ZMMO/Core/Player/BP_ZeusPlayerCharacter"));
if (DefaultPawnBP.Succeeded())
{
DefaultPawnClass = DefaultPawnBP.Class;
}
else
{
DefaultPawnClass = AZeusCharacter::StaticClass();
}
PlayerControllerClass = AZeusPlayerController::StaticClass();
PlayerStateClass = AZeusPlayerState::StaticClass();
// PlayerStateClass: usar BP filho pelo mesmo motivo do DefaultPawnClass --
// componentes BP-added (ex: UZeusGASComponent listado em DefaultGame.ini
// ComponentClasses), eventos no Event Graph e overrides do designer so'
// existem na classe BP. C++ direto (AZeusPlayerState) perde tudo isso.
// TODO: renomear o asset pra BP_ZeusPlayerState pra alinhar com a convencao
// (BP_ZeusPlayerCharacter) -- quando renomear, atualizar o path aqui.
static ConstructorHelpers::FClassFinder<APlayerState> PlayerStateBP(
TEXT("/Game/ZMMO/Core/Player/BP_PlayerState"));
if (PlayerStateBP.Succeeded())
{
PlayerStateClass = PlayerStateBP.Class;
}
else
{
PlayerStateClass = AZeusPlayerState::StaticClass();
}
HUDClass = AZeusHUD::StaticClass();
}

View File

@@ -66,6 +66,13 @@ void UZeusAOIComponent::BeginPlay()
{
AoiConfigHandle_ = NetC->OnDebugAoiInfo.AddUObject(this, &UZeusAOIComponent::HandleAoiConfig);
FrontierConfigHandle_ = NetC->OnDebugFrontierInfo.AddUObject(this, &UZeusAOIComponent::HandleFrontierConfig);
// 1.4 -- visibility tracking. Delegates DYNAMIC do subsystem V1
// precisam AddDynamic + UFUNCTION nas handlers (assim como no
// ZeusWorldSubsystem que ja faz spawn/despawn de proxies).
NetC->OnEntitySpawned.AddDynamic(this, &UZeusAOIComponent::HandleEntitySpawnedV1);
NetC->OnEntityDespawned.AddDynamic(this, &UZeusAOIComponent::HandleEntityDespawnedV1);
NetC->OnSelfEntityAssigned.AddDynamic(this, &UZeusAOIComponent::HandleSelfEntityAssignedV1);
}
}
}
@@ -87,12 +94,17 @@ void UZeusAOIComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
if (AoiConfigHandle_.IsValid()) { NetC->OnDebugAoiInfo.Remove(AoiConfigHandle_); }
if (FrontierConfigHandle_.IsValid()) { NetC->OnDebugFrontierInfo.Remove(FrontierConfigHandle_); }
// 1.4 -- unbind dos delegates DYNAMIC de tracking.
NetC->OnEntitySpawned.RemoveDynamic(this, &UZeusAOIComponent::HandleEntitySpawnedV1);
NetC->OnEntityDespawned.RemoveDynamic(this, &UZeusAOIComponent::HandleEntityDespawnedV1);
NetC->OnSelfEntityAssigned.RemoveDynamic(this, &UZeusAOIComponent::HandleSelfEntityAssignedV1);
}
}
}
AoiConfigHandle_.Reset();
FrontierConfigHandle_.Reset();
}
VisibleEntityIds_.Empty();
if (FrontierActor_)
{
FrontierActor_->Destroy();
@@ -344,3 +356,64 @@ int32 UZeusAOIComponent::GetEnabledOverlayCount() const
+ (bShowProxyLabels ? 1 : 0) + (bShowHandoffLine ? 1 : 0) + (bShowAuthDrift ? 1 : 0)
+ (bShowFrontier ? 1 : 0);
}
// ===========================================================================
// Gameplay AOI: visibility tracking (1.4 do roteiro PvP)
// ===========================================================================
//
// Espelha ENT_SPAWN/ENT_DESPAWN do subsystem V1 num TSet local. Fires os
// delegates BlueprintAssignable pra game systems escutarem. Self-entity
// filtrada (o proprio char nao entra no tracking nem fires).
void UZeusAOIComponent::HandleSelfEntityAssignedV1(int64 EntityId)
{
SelfEntityId_ = EntityId;
// Se ja' havia "spawnado" antes do SELF chegar (race possivel), remove agora.
if (EntityId != 0 && VisibleEntityIds_.Contains(EntityId))
{
VisibleEntityIds_.Remove(EntityId);
OnEntityExitedAOI.Broadcast(EntityId, /*Reason=*/0);
}
}
void UZeusAOIComponent::HandleEntitySpawnedV1(int64 EntityId, int32 /*Kind*/,
FVector /*PosCm*/, float /*YawDeg*/,
FVector /*VelCmS*/, bool /*bGrounded*/,
int64 /*ServerTimeMs*/)
{
if (EntityId == 0) { return; }
if (EntityId == SelfEntityId_) { return; } // nunca trackear self
bool bAdded = false;
VisibleEntityIds_.Add(EntityId, &bAdded);
if (bAdded)
{
OnEntityEnteredAOI.Broadcast(EntityId);
}
// Re-spawn (entity ja' visivel) = no-op silencioso. Pode acontecer em
// keyframe pos-handoff cross-server.
}
void UZeusAOIComponent::HandleEntityDespawnedV1(int64 EntityId, int32 Reason)
{
if (EntityId == 0) { return; }
if (VisibleEntityIds_.Remove(EntityId) > 0)
{
OnEntityExitedAOI.Broadcast(EntityId, Reason);
}
}
int32 UZeusAOIComponent::GetVisibleEntityCount() const
{
return VisibleEntityIds_.Num();
}
TArray<int64> UZeusAOIComponent::GetVisibleEntityIds() const
{
return VisibleEntityIds_.Array();
}
bool UZeusAOIComponent::IsEntityVisible(int64 EntityId) const
{
return VisibleEntityIds_.Contains(EntityId);
}

View File

@@ -10,6 +10,15 @@
class AZeusFrontierOverlayActor;
// Delegates BlueprintAssignable pra game systems reagirem a entrada/saida de
// outras entidades na AOI do player local. Disparados quando ENT_SPAWN /
// ENT_DESPAWN chega do servidor (V1 canonico). Self-entity filtrada -- o
// proprio char NAO fires aqui.
// - Entered: 1 param (EntityId)
// - Exited: 2 params (EntityId, Reason). Reason vem do payload ENT_DESPAWN.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FZeusAOIEntityEnter, int64, EntityId);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FZeusAOIEntityExit, int64, EntityId, int32, Reason);
/**
* UZeusAOIComponent (cliente / jogo)
*
@@ -70,6 +79,22 @@ public:
UFUNCTION(BlueprintPure, Category = "Zeus|AOI Debug")
int32 GetEnabledOverlayCount() const;
// === Gameplay AOI: visibility tracking (1.4 do roteiro PvP) ============
//
// Espelha quem o servidor mandou ENT_SPAWN/ENT_DESPAWN pro player local.
// Cliente NAO faz histérese própria -- server já filtra com
// margem de ~2048cm ([[project_aoi_crossserver_hysteresis]]). Game systems
// (HUD, audio, ability target filtering) escutam estes delegates pra
// reagir a entrada/saída. Self-entity filtrada (o próprio char
// não fires nem entra no tracking).
UPROPERTY(BlueprintAssignable, Category = "Zeus|AOI") FZeusAOIEntityEnter OnEntityEnteredAOI;
UPROPERTY(BlueprintAssignable, Category = "Zeus|AOI") FZeusAOIEntityExit OnEntityExitedAOI;
UFUNCTION(BlueprintPure, Category = "Zeus|AOI") int32 GetVisibleEntityCount() const;
UFUNCTION(BlueprintPure, Category = "Zeus|AOI") TArray<int64> GetVisibleEntityIds() const;
UFUNCTION(BlueprintPure, Category = "Zeus|AOI") bool IsEntityVisible(int64 EntityId) const;
UFUNCTION(BlueprintPure, Category = "Zeus|AOI") int64 GetSelfEntityId() const { return SelfEntityId_; }
private:
void DrawOverlays();
bool ResolveOverlay(EZeusAOIOverlay Overlay) const;
@@ -108,4 +133,17 @@ private:
float FrontierRepollAccumSec_ = 0.0f;
/** Ator que desenha as paredes + labels (spawn lazy ao ligar o overlay). */
UPROPERTY() TObjectPtr<AZeusFrontierOverlayActor> FrontierActor_ = nullptr;
// === Visibility tracking (1.4) ==========================================
UFUNCTION() void HandleEntitySpawnedV1(int64 EntityId, int32 Kind, FVector PosCm,
float YawDeg, FVector VelCmS, bool bGrounded,
int64 ServerTimeMs);
UFUNCTION() void HandleEntityDespawnedV1(int64 EntityId, int32 Reason);
UFUNCTION() void HandleSelfEntityAssignedV1(int64 EntityId);
/** EntityIds atualmente visíveis (espelho do server). TSet pra O(1) check.
* Não inclui self. Limpo no EndPlay. */
TSet<int64> VisibleEntityIds_;
/** EntityId do próprio char (recebido via ENT_SELF). 0 = ainda não atribuído. */
int64 SelfEntityId_ = 0;
};

View File

@@ -18,20 +18,33 @@ namespace
const FColor kLabelAlive(93, 213, 255); // ciano -- server online
const FColor kLabelDead(255, 90, 90); // vermelho -- server offline / cell vazia
// Offset do cellId de filha de split (espelha CHILD_CELLID_OFFSET do server).
constexpr uint32 kChildCellIdOffset = 1000000u;
// Decodifica o cellId int na notacao de quadtree: raiz -> "0".."3"; filha ->
// "<pai>,<quadrante>" (ex "0,2"); neto -> "0,2,1" (recursivo). Espelha
// childCellId = offset + pai*4 + quadrante do SplitCoordinator.
// Decodifica o cellId na notacao "raiz fora, splits no array" da k-d tree
// binaria: raiz pura -> "0"; derivada -> "0,[0,1]". Espelha o layout
// bit-packed de Server/ZeusServices/Shared/types/src/cell-id.ts:
// bit 30 = flag (1 = cell derivada de split)
// bits 29..26 = depth (profundidade de split)
// bits 25..15 = rootId (cell raiz do baseGrid)
// bits 14..0 = path (1 bit por nivel, MSB-first)
FString DecodeCellPath(uint32 CellId)
{
if (CellId < kChildCellIdOffset)
constexpr uint32 kFlagBit = 1u << 30;
if ((CellId & kFlagBit) == 0u)
{
return FString::Printf(TEXT("%u"), CellId);
return FString::Printf(TEXT("%u"), CellId); // raiz pura
}
const uint32 Rel = CellId - kChildCellIdOffset;
return DecodeCellPath(Rel / 4u) + FString::Printf(TEXT(",%u"), Rel % 4u);
const uint32 Depth = (CellId >> 26) & 0xFu;
const uint32 Root = (CellId >> 15) & 0x7FFu;
const uint32 Packed = CellId & 0x7FFFu;
FString Path;
for (uint32 i = 0; i < Depth; ++i)
{
if (i > 0)
{
Path += TEXT(",");
}
Path += ((Packed >> (14u - i)) & 1u) ? TEXT("1") : TEXT("0");
}
return FString::Printf(TEXT("%u,[%s]"), Root, *Path);
}
// Aresta compartilhada entre dois retangulos axis-aligned (no plano XY).

View File

@@ -76,6 +76,10 @@
{
"Name": "CommonUI",
"Enabled": true
},
{
"Name": "GameplayAbilities",
"Enabled": true
}
],
"AdditionalPluginDirectories": [