There are "phantoms" of enemies on the client shuffled with the actual ones

No, all enemies are visible at the beginning of the game.

They are placed on the global map at design time.

In that menu, I have only “Placed in World” label.

Then try to spawn option. Perhaps once hidden the ai might unposses the character. Then when it “awakens” it may not be possessed again. Also could intersection with the terrain cause them to get stuck?
If the phantoms repeat at the same places try raising them slightly above the terrain and see if that helps

also try do debug the AI with the " key
See if the phantom AI is possessed and if it is running any types of behaviors

Edit: pressing the " key in front of an AI will set it the the current debugged character.

What means “spawn options”? Setting that parameter to “Placed in World or Spawned”, as on your screenshot?

It seems exactly the opposite, hiding the enemies (when they are killed) also hides the phantoms, and further their showing does not show the phantoms.

Yes

That is strange behavior. Like they are de-synchronizing from the server state.

So killing a phantom on the server would in this case make the frozen phantom on the client disappear? Is this the behavior you are seeing during runtime?

Could you show a screenshot of the details panel of the enemy with the filter “replicat”

Perhaps you have Only relevant to owner checked?

That didn’t help.

It has the following sign:
2024-04-02_19-36-27
And here is the info, but sorry for the colorization:

There are no phantoms on the server. Maybe you meant “killing an enemy on the server”?

Sorry for the disinformation, but I have just checked - at least killing an enemy in the debugger, with manipulating the “HideTime”, doed not make the phantom disappear. But one time I had watched the disappeared on my eyes phantom, probably by manual killing exactly the necessary enemy, but I am not sure.

I noticed the ai is on a streamed landscape. It may be a navmesh problem

I would also try repossesing the character with the ai controller after showing it

I don’t have a navmesh in my game, player is controlled from the keyboard.
Also I have checked that killing all enemies at the same time, but using the damage, also does not hide the phantoms. And I have just thought that maybe phantoms appear when several enemies are shown at the same location point. Every time the enemy is shown it is in the random of the default locations. If all enemies show at the same time, some of them can get into the same location. Can this be the problem?

They shouldnt overlap if they can collide with each other. You should have a navmesh for ai otherwise it wont work with ai move to (you would have to program the whole motion)

Why I should have it? I did not have it for more than 3 years and all the enemies moved correctly. (Assuming they are not phantoms.)

Navmesh is needed for enemy ai pathfinding. Otherwise enemies can get stuck before getting to their target.

In my game the enemies do not use pathfinding. They just walk in the zone and, when the player nears them, attack.

The topic is actual again.

Do the actors move based on physics? Perhaps they are put to sleep with time by the engine and need to be reawakened?

The actors moving is based on the following:

I’m guessing movement is set to replicate in the character. Are all client players always spawned from the player class?

All replication settings of the enemy are screenshoted here.

Do you mean client players or enemies? Players are spawned from the subclasses of the “Player” class because the “Player” class itself is abstract. Enemies are placed in the world at design time.

The topic is actual again.

What movement component are you using? Floating pawn? is the enemy based on a character? Is it a custom component?

The enemy is a subclass of the Character.

Repl.zip (24.9 MB)

Check the project. I think I got it to replicate your enemy movement with respawns after time.

WASD to move, left mouse to click => damage enemies in front with box trace.

1 Like