0 votes

I don't using any physics in project - no Area2D or KinematicBody and want to delete all unneeded from export template. Especially any physics to make lighter native lib
libgodot_android.so .
I commenting unused modules, builtins and classes in
GODOTSRC/godot/scene/registerscene_types.cpp.
And so it works.

But when I try to commenting any unused servers: arvr, physics, physics_2d then get crash so something use it.

When I run profiler it shows Physics Frame Time is about 0.01666 and Physics_2d 1 call per any frame.

How to disable any physics in project and better way exclude it from template build?

asked Dec 6, 2019 in Engine by Nikas (36 points)
edited Dec 6, 2019 by Nikas

1 Answer

+1 vote
Best answer

If you go commenting out classes manually then there is no official guarantee your export will work. The way it's supposed to be done is, you disable modules in your SCons command (and of course have the export templates built yourself too). If the doc don't show how to turn off 2D physics you might need to do a request for it to be supported.

I don't think server APIs are supposed to be removed, what usually happens is, they get replaced with a dummy version that does nothing, because otherwise you would have to go through the tedious task of commenting out all calls to them through the codebase. That's quite bad if you want to sync up with upstream Godot afterwards. But again, if you want this officially, better go ask for the feature (or PR it, if you can get it to work).

Physics Frame Time is about 0.01666

That precise value really looks like a report of delta time, not the actual time physics takes to process. Physics should have zero impact on CPU if you don't use any.

answered Dec 6, 2019 by Zylann (26,786 points)
selected Dec 6, 2019 by Nikas
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.