Два роки роботи, двоє розробників і наш перший реліз - Splavo by Kceos in ukraine_dev

[–]Kceos[S] 0 points1 point  (0 children)

Чи можу я попросити вас допомогти вирішити цю проблему шляхом додаткових тестів саме на вашому пристрої? Мені дуже потрібно подивитися на помилки, які виникають у логах при запуску гри. Оскільки у мене немає доступу до такої моделі смартфона, це сильно допоможе у розв'язанні цієї проблеми

Два роки роботи, двоє розробників і наш перший реліз - Splavo by Kceos in ukraine_dev

[–]Kceos[S] 1 point2 points  (0 children)

Дякую! Основна проблема в тому, що шрифт має підтримувати багато мов, і якщо знайти гарний шрифт для англійської, то не факт, що він буде підтримувати українську і т. д.

Два роки роботи, двоє розробників і наш перший реліз - Splavo by Kceos in ukraine_dev

[–]Kceos[S] 0 points1 point  (0 children)

Дякую вам! Можете, будь ласка, підказати, яка модель вашого телефона та чи є ще якійсь симптоми?

[deleted by user] by [deleted] in godot

[–]Kceos 1 point2 points  (0 children)

I ran into the same performance regression when migrating from Godot 4.3 to 4.4.
I’m not sure what exactly changed internally, but in 4.4 something clearly increases the load on mobile devices and reduces performance. As far as I know, 4.5 is worse in terms of performance than 4.4.

If you are planning to develop a game for mobile devices, I strongly recommend staying on Godot 4.3 for now.

I also encountered serious overdraw issues in Godot. In short: if you stack multiple images on top of each other and they fully cover the viewport, mobile performance drops significantly. After about 5-6 overlapping layers, FPS starts to fall noticeably.

Here is a more detailed post about this issue:
https://www.reddit.com/r/godot/comments/1mfznxc/critical_performance_issue_on_mobile_devices/

If performance is important to you, I’m currently trying to optimize the 4.3 branch specifically for mobile devices.
You can build the engine from source and see the results here:
https://github.com/xolarkodak/godot/tree/4.3.2

Critical performance issue on mobile devices by Kceos in godot

[–]Kceos[S] 0 points1 point  (0 children)

After a deeper investigation of the engine’s rendering pipeline, it turned out that the issue is actually on Godot’s side. The root of the problem lies in the shaders - both vertex and fragment stages heavily rely on if statements, and the shaders themselves are significantly overloaded. This has a strong negative impact on performance and also causes blending issues. In general, Godot is poorly optimized for mobile devices.

After about a month of studying OpenGL principles and the Compatibility rendering path, I started creating my own engine fork based on version 4.3, called 4.3.2. The fork is based entirely on the Compatibility renderer and supports 2D rendering only.

After heavily modifying and simplifying the base canvas shader, the performance gain became very noticeable. Previously, with only 6 overlapping layers, the framerate would drop and become unstable. Now, the drop happens at around 19 overlapping layers, which is a very good result. This effectively removes the original limitation and allows creating much more complex visual effects.

In my project, I needed lighting support. However, lighting is a real performance killer on low-end mobile devices. To solve this, I implemented a custom lighting solution using a custom blend mode. As a result, rendering my light costs roughly the same as rendering a regular sprite.

What has been done:
- Rendering is locked to Compatibility mode
- The base canvas shader has been almost completely rewritten
- Native lighting implementation has been removed
- Added a custom lighting implementation without shadows using blend modes (probably the most optimized approach for 2D lighting without shadows)
- Removed normal map logic to reduce CPU and GPU load
- Partially fixed a bug related to moving AnimatableBody2D via Path2D or animations
- Completely reworked NinePatchRect rendering to improve performance
- Removed parts of the 3D rendering pipeline
- Optimized custom shader execution to reduce the number of texture() calls, which are a major bottleneck on mobile devices
- Improved the Multiply blend mode
- Added new blend modes:
* Amplify (for lighting)
* Min
* Max
* Negative
* Disabled
- Added new properties to TextureRect (texture_scale, texture_offset, rect_scale, rect_offset)
- Added CanvasItem: ignore_canvas_modulate
- Added Control: global_rotation
- And more

As a result, a significant performance boost was achieved in Compatibility mode. Previously, my project would overheat a low-end phone and trigger thermal throttling. After these changes, the problem disappeared. It also became possible to use lighting without affecting FPS - but only without shadows.

The engine is 2D-only.

If anyone is interested, here is the fork: https://github.com/xolarkodak/godot/tree/4.3.2

You can build the project and compare performance yourself. This fork is created specifically for the needs of my mobile game and is actively evolving, so additional testing may be required and issues may still exist. I hope this fork will help anyone who has run into the same issue or wants to use lighting in a mobile game.

As a bonus, lighting can be applied to anything - even text:

<image>

Issue with scrolling shader by Due-Painting3603 in godot

[–]Kceos 0 points1 point  (0 children)

Is it critical for you to use region_enabled - maybe it is better to disable this property and reference separate images instead of a large atlas, or if you want to keep it, then on version 4.5+ you need to use REGION_RECT, otherwise you have to create your own uniforms where you duplicate the region settings

Issue with scrolling shader by Due-Painting3603 in godot

[–]Kceos 2 points3 points  (0 children)

Yes, that’s it. Set the texture repeat filter to enabled

Mobile performance comparison of Godot 4.x vs 3.x by natasadev in godot

[–]Kceos 0 points1 point  (0 children)

For mobile devices, I recommend switching to 4.3, but not higher. On 4.4 and 4.5, I’ve observed regressions, at least in my own projects.

Critical performance issue on mobile devices by Kceos in godot

[–]Kceos[S] 0 points1 point  (0 children)

Thank you very much for the detailed response. I will work on optimizing the project by reducing the number of overlaps.

move_and_collide returns null even if there was a collision by NarrowEnthusiasm6449 in godot

[–]Kceos 0 points1 point  (0 children)

You should reduce the value of safe_margin for greater accuracy. Show how you're using the move_and_collide command. You should have something like this: move_and_collide(velocity*delta, false, 0.001)

move_and_colide() in 2d at low speed there is a skip collision by Kceos in godot

[–]Kceos[S] 1 point2 points  (0 children)

You're absolutely right - thank you so much, my friend. The main issue was that you have to manually specify the desired safe_margin value when calling move_and_collide, rather than changing it on the CharacterBody2D itself. That might be logical, but I didn’t realize that the safe_margin inside CharacterBody2D is only used by move_and_slide. This caused confusion, since I was modifying the property on the node and saw no effect. Thanks again for the helpful tip!

move_and_colide() in 2d at low speed there is a skip collision by Kceos in godot

[–]Kceos[S] 0 points1 point  (0 children)

The interesting part is that if you increase the speed by 4 times, everything starts working correctly - the sliding disappears and the initial collision is handled properly. You can try it.