godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.68k stars 21.11k forks source link

Tilemap framerate drops significantly above a certain threshold of tiles #91456

Open JSonaV opened 6 months ago

JSonaV commented 6 months ago

Tested versions

Tested in 4.3dev6 and 4.2.stable (reproducible in both)

System information

Godot v4.3.dev6 - Windows 10.0.22631 - Vulkan (Forward+) - integrated AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 31.0.21912.14) - AMD Ryzen 5 5500U with Radeon Graphics (12 Threads)

Issue description

Tilemaplayer (and Tilemap in 4.2) seems to drop your frame rate after reaching a specific tile threshold. Specifically, frame rate stays at a consistent 1000fps with 145 tiles (120 tiles in 4.2) in a scene. 2 tiles above that, the frame rate begins to drop between 60-70fps occasionally, and after 1 more, the frame rate stays at 60-70fps

https://github.com/godotengine/godot/assets/42086815/c961b951-697a-4187-adfe-4171e9cf47c3

Steps to reproduce

Create a tilemaplayer and draw 145 tiles (120 tiles in 4.2) to achieve the unaffected frame rate draw 1 or 2 more tiles to achieve the occasional frame drops (consistent with both versions) draw another tile to achieve the fully affected fps which has been dropped significantly

Minimal reproduction project (MRP)

Tilemap_bug.zip

QAQ-HYSJ commented 4 months ago

I have the same problem as you. And after testing, I found that if switch the rendering mode to compatibility mode, the frame rate will return to normal.

System information

Godot 4.2.1stable - Windows 10.0.22631 - AMD Ryzen 7 4800U with Radeon Graphics

Calinou commented 4 months ago

I can't reproduce this on 4.3.beta 25ff1306d (Linux).

Benchmark

All tests done at the default window size. Using an optimized editor build for testing (optimize=speed lto=full).

PC specifications - **CPU:** Intel Core i9-13900K - **GPU:** NVIDIA GeForce RTX 4090 - **RAM:** 64 GB (2×32 GB DDR5-5800 C30) - **SSD:** Solidigm P44 Pro 2 TB - **OS:** Linux (Fedora 39)

Forward+

NVIDIA
145 tiles 146 tiles 147 tiles 187 tiles
11957 FPS 11594 FPS 11503 FPS 11400 FPS

lavapipe (software rendering)

145 tiles 146 tiles 147 tiles 187 tiles
595 FPS 595 FPS 594 FPS 594 FPS

Compatibility

NVIDIA
145 tiles 146 tiles 147 tiles 187 tiles
13019 FPS 12909 FPS 13136 FPS 13442 FPS
MewPurPur commented 4 months ago

@QAQ-HYSJ Can you reproduce this in versions like 4.3-beta2? The OP stopped being able to reproduce the issue himself, which likely means it's very setup-specific.

QAQ-HYSJ commented 4 months ago

@QAQ-HYSJ Can you reproduce this in versions like 4.3-beta2? The OP stopped being able to reproduce the issue himself, which likely means it's very setup-specific.

I'm still having issues with Godot 4.3beta2. And I'm fairly sure that this is the case only with AMD graphics cards, and probably only with integrated graphics cards. And although the frame rate is low, the system resource usage is not high. furthermore, I started dropping frames at 191 tiles not 187.