0 votes

Hey guys,

we are currently working on a small boat game at our university with modular level setup and top view: enter image description here

The river consists of several tiles, which are randomly stacked to each other. For this, the nodes are instanced via var tile = sceneTileXY.instance()

All tiles are preloaded, but nevertheless a lag appears every time a tile is instanced for the first time. Seems to be comparable to this problem: Lag Spike When Instancing Node For the First Time - unfortunately the solution (presenting all used shaders at the beginning to pre-compile them) didn't work for us. The tiles are all low-poly, so the complexity of the meshes shouldn't be a problem.

Do you have any suggestions?

Thx, reiti

Godot version 3.2.3
in Engine by (17 points)

1 Answer

0 votes

This is more of a workaround than a solution, but you could move the lag to a moment where it is less problematic. Make yourself a loading screen, where you instantiate every one of the offending Nodes. That way, it will look perfectly normal, as loading screens naturally tend to have short freezes.

You could either make it look good, or try to hide them as much as possible. For instance, maybe rendering them in a Viewport that is not seen would be enough to "prime" the Node.

by (2,568 points)
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.