Current state and plans for ECS integration?

Sorry, been quite busy lately so I had no time to follow up on this. It’s quite amazing what you could achieve so far. I’m just playing around with your repo.

I’m not entirely sure however what causes the big performance impact of the baked followerentity scene. I get heave frame drops before reaching even 1000 agents - something that I’m pretty sure, I did in some other project with the unbaked followerEntities without problems.

EDIT:
In a build and setting the movement plane source to graph instead of raycast, I could run around 2000 agents at 60fps.

1 Like

For me, in either scenario (the scene that uses FollowerEntity and the scene that uses AStarPath.StartPath() + custom movement script), I max out at about 1,200 entities on my 3 year old gaming laptop. That’s good to know that graph is faster than raycast - good catch!

If you want to use the FollowerEntity method in your project I think all you need is FollowerAgentAuthoring.cs and FollowerAgentInitSystem.cs. But as you said… it won’t use ECS Physics.

The other method can sorta work with ECS physics if you add a collider+shape to the agents and modify PathMovementSystem.cs to push the agent with velocity forces instead of setting the local transform directly (which basically teleports each frame). I tried it before, and it mostly worked, though the agents got stuck sometimes if the hills were steep and occasionally they randomly started spinning or floating.

1 Like

I see there is now an official 5.0 release. Congrats, it’s really awesome how much dedication you give to this project Aron.
Is there a chance, we can get an “official” Baker for the FollowerEntity at some point? It’s ok, if we keep using a custom one, but it would be nicer to have an officially maintained one to avoid version conflicts etc.
The approach with the FollowerAgentInitSystem, that Ph0t0n outlined, to overcome the problems with the pointers in the ManagedState works pretty well. Could be part of the official implementation.

2 Likes

Sorry, don’t want to be annoying, but could we maybe get a quick statement on the option for an inbuilt authoring script? Is this actually something on the roadmap?

Hi

I have plans to make an authoring script. But I don’t think I’ll have time in the near future, I’m afraid. Too many other commitments.

Fair enough, it’s also not super urgent, would just be a big quality of life improvement :wink:

1 Like

I updated mine to Entities 1.2 a few days ago if you want to use it.

https://gitlab.com/lclemens/AStarPfpBenchmark/-/blob/master/Assets/Scripts/FollowerAgentAuthoring.cs?ref_type=heads

https://gitlab.com/lclemens/AStarPfpBenchmark/-/blob/master/Assets/Scripts/FollowerAgentInitSystem.cs?ref_type=heads

1 Like

That’s very kind, I adjusted my authoring script also a few weeks back to work with entities 1.2 and pathfinding 5.1, so all good at the moment. But thanks anyways.

Do you by any chance also get a lot of errors like:

Caught in a potentially infinite loop. The navmesh probably contains degenerate geometry.

I tried also your authoring scripts, but the same thing happens. I’m not sure when this error started to show up frequently, maybe around upgrade 5.09?

No I have never seen that error before. I’m using 5.1.0 with the Recast Graph.
Maybe try messing with some of the parameters in your navmesh and rebaking it?

Thanks. I think it must have something to do with the entities spawning, because I only get it the moment spawning them. The error is triggered by the Pathtracer which is called by the JobRepairPath. Maybe it’s because of an invalid path or starting position or alike.
Anyways, this is probably of topic…

If anyone wonders: Looks like this error came from setting an actual initial destination point in the authoring script instead of setting it to PositiveInfinity. At least now the error is gone.

1 Like