Very large number of NPC?
Asked Answered
I

4

0

How did you achieve optimization of such a large number of autonomous agents, over 500 units?

I am trying to create a large number of rival cars, but the FPS drops already occur at 60 units. This is due to the complex mathematics in the rival car script. I have tried running each rival in a separate thread, but it didn't help much.

What solutions do you see? Should I rewrite all the complex calculations in the rival car from GD to C++?

Issacissachar answered 12/7, 2023 at 16:19 Comment(0)
T
0

Issacissachar Simulate only nearby cars, fake the rest.

Threap answered 12/7, 2023 at 16:23 Comment(0)
S
0

Issacissachar What solutions do you see?

Depends on what you're trying to accomplish. Visual effect or real simulation. If you only need a crowd, then Franzen advice is absolutely valid. But if you want a real calculation of each car, then

Should I rewrite all the complex calculations in the rival car from GD to C++?

Yep.

Godot не рассчитан на реальную физическую обработку большого количества объектов.

Senescent answered 12/7, 2023 at 17:2 Comment(0)
T
0

Yeah it really depends what actually needs to happen with those cars. But in my experience people, especially beginners, tend to simulate way too much. A lot can be faked/simplified without anyone noticing the difference. There is a bit of artistry to knowing what and when to fake though.

Threap answered 12/7, 2023 at 17:5 Comment(0)
D
0

You should try one of the ecs plugins in asset library, alot of units with shared component logics could benefit from ecs framework, especially performance wish.

Though I am not sure if you really need 499 rivals simultaneously...

Discharge answered 13/7, 2023 at 15:4 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.