Error whose origin i can't trace when exporting my build as dedicated server

Godot Version

4.4.1

Question

ERROR: scene/3d/gpu_particles_3d.cpp:303 - Index p_pass = 1 is out of bounds (draw_passes.size() = 1).

I keep getting this error when i export my game build as dedicated server i can’t find what’s causing it. I do use gpu_particles in my scene tho but i can’t figure what’s wrong

A dedicated server is a headless server - which means it has no screen to output to. So it’s either going to process the visual code silently and waste cycles, or it’s going to choke on them because it has nowhere to output. This is likely your problem. I recommend you just insert a check to see if you’re running headless and if so, not turn on graphics.

Ultimately, I recommend you restructure your build so you can just export the dedicated server without any display code at all. Then you’d have say one Windows export configured for the server, and another for the clients. Same codebase, but different things coming out.

Oh i understand, is there a global setting to do such a thing?
I already set my process and physics process to false on the server since i only use it to authorize the inputs and send it over to others so it shouldn’t have to process much is my thinking

I honestly don’t know. There might be. But take a look at the Resources tab on the Export window. You can select files to include, or exclude, there. You can split up files if need be to make it possible to only include what you need for the server.

Thank you for pointing out the cause of the error. I will look into it and select the required to export files in the future.

Also, i don’t know if this changes something but the error happened in godot editor not in the running server itself

1 Like

Yes that changes things. Unfortunately, some of Godot’s errors are quite cryptic. Here’s what I would do: Disable each GPUParticles3D node in turn on your project and play it. When the error stops, you know that the problem is with the node that is currently disabled. Then you can figure out why, or just remake it from scratch.

After trying i realized that problem doesn’t always appear, some exports will show no error while other times with nothing changed at all will show the error

It could be that having the scene open and the GPU particle going it could be processing and changing state somehow randomly causing a problem. Best guess.

That looks to be the case. Thank you for the help :slight_smile:

1 Like

You’re welcome. If that was the solution, it’s helpful for people coming after to mark it as such.

1 Like