0 votes

hi there,

after a year of abstinence i went back to an old project of me.
The reason why is stopped developing stands in the title.

But now iam interessted about whats going on.

Description of the project:
I have a little bit more complex Godot project to test different things. One bigger part of that is a terrain generator (i call it "Surfafe", it sounds like "surface" spoken from a german when eating a hot potato :D :D).

You can find this part of my project here (100% gdscript):
https://gitlab.com/heroldini/surfafe
(Its a node, but im not sure if its cleanly standalone :D )

This is roughly how it works:

  • I split the world in "sections". one section per default is 16x16x16 blocks tall.
    Each block is defined by its corners and is generated with marching cubes tables.

  • A simpel noise generator generates data for a procedural landscape (very basic)

  • Up to now it generates a predefined number of sections, when the game starts. No generation while playing atm.

  • It has a LOD-system included (disabled per default) which generates each section for lower resolution (but there are still missing the transitions)

The Problem:
Generation works well for me. But when you generate a bigger terrain you get a very low frame rate. But i do not really understand why.
For example i added a 3D-model with about 250,000 vertices made with blender. It runs very smoothly. I can add 10 of them with no problem.

But when i generate a terrain with my generator it has very low performance when it has about 300,000 vertices and i look in its direction.
If i look in another direction (empty space) the fps raise to normal.

Here some screenshots:
low frame rate
looking in another direction (empty space)
Monitore while running
Profiler while running

Tested in Godot 3.1.1 (then) and now in 3.2.3
Hardware: amd ryzen 7; geforce 1080

I would be happy if someone could explain to me what I am doing wrong :D

thx :)

in Engine by (79 points)
recategorized by

1 Answer

0 votes

Your script is spending 77 milliseconds in _process() on every frame. This means you're running heavy processing in your script, likely because you're doing something every frame when you didn't intend to.

by (12,893 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.