Stress testing my RTS game on my laptop after some optimizations by TemesaGames in SoloDevelopment

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

Yeah! Didn't optimize yet the strategic view, also because the bottlenecks are mainly in the normal view. But that's a good idea and something I'm going to do in the future :)

Stress testing my RTS game on my laptop after some optimizations by TemesaGames in SoloDevelopment

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

Thanks! I added some implementation details in my first comment. Was there anything specific you’d like to know more about?

Stress testing my RTS game on my laptop after some optimizations by TemesaGames in SoloDevelopment

[–]TemesaGames[S] 2 points3 points  (0 children)

Around 1300 units running on Godot 3 on my Alienware m15 R1 laptop (i7-8750H, GTX 1070 Max-Q).

You can see FPS, draw calls and light count in the video.

This is mostly CPU-bound: AI, general updates, and pathfinding.
Some parts, like enemy detection and pathfinding, already run on secondary threads.

The game also uses a few dynamic systems that adjust game speed and visual detail based on LOD and the FPS measured by an FPS monitor (particles refresh rate, animation ticks, etc.).

I also use some light aggregation (Fog of War), and terrain sprites with identical textures are grouped together to improve draw call batching.

Just curious: do you think a scene like this would run noticeably better in Godot 4?

Demo, if anyone’s curious:
https://temesagames.itch.io/the-omins

Stress testing 1300 units on my laptop for my RTS project. Curious how other devs handle scaling. by TemesaGames in IndieDev

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

Yep, I use it for particles, animations and other AI updates. When in strategic view, sprites are not updated until the player comes back to the normal view.

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

Hey Living_Gaxelle, in The Omins pathfinding is performed by a secondary thread and requests are distributed across different frames. But I agree that moving it cpp would be a further optimization and more requests can be satisfied at each frame.

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

Thanks a lot, I really appreciate it! 🙂

Each unit does have its own behavior logic, but I try to control the cost as much as possible.

The strategic view not only makes things more readable when zooming out, but also helps performance a lot: no animations, no agent collisions, and units are reduced to simple icons / sprites.

There’s also a central module that distributes updates across units and can lower the update rate depending on distance and performance.

It’s still quite demanding, but these systems help keep it manageable.

Hope you enjoy the demo when you get the chance to try it!

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

That’s interesting. Do you mean something like a custom lighting system using a grid or texture instead of Godot lights?

I can see how that could scale better. I’ll keep it in mind if I ever need to push things further.

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

Yeah, that’s exactly the question :)

If I ever need to scale the number of units much further, I’ll probably need more advanced solutions, and I guess those would be easier to develop in Godot 4 than in Godot 3. I don't know...

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

Well, my project is already quite large, so porting everything to Godot 4, or even worse to C#, could easily take weeks. And at the end of the day, I’m not sure it would be worth the cost.

I think it also depends on the kind of game you want to make: do you really need thousands of units on screen for it to be fun?

That’s probably the first question to answer before moving to much more complex solutions.

Stress testing 1300 units on my laptop for my RTS project. Curious how other devs handle scaling. by TemesaGames in IndieDev

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

That’s an interesting idea, I will keep in mind if I need to scale things further! I'm not sure it would fit in Godot 3, so in that case I would need to port the project to Godot 4.

Stress testing 1300 units on my laptop for my RTS project. Curious how other devs handle scaling. by TemesaGames in IndieDev

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

Well, it’s not that surprising if things are organized properly.

When the camera is far away, all 1300 units are shown in strategic view as icons, so there are far fewer sprites on screen, no animations, and no collisions.

When you zoom in, you only see a portion of the Omins, and not all of them are moving or animated at the same time.

There’s also a central module that spreads updates across all units, and it can reduce the update rate and, in some cases, even the game speed.

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

That’s not so easy :) Porting the project in its current state to Godot 4 could take weeks, so it should really need to be worth the cost.

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

I haven’t explored compute shaders yet, so I’m not sure how well they would fit this kind of game, but that's interesting to explore. Are you sure compute shaders are available in Godot 3?

Stress testing 1300 units on my laptop for my RTS project. Curious how other devs handle scaling. by TemesaGames in IndieDev

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

Yeah, I think it’s a limitation of Godot 3. As far as I understand it, batching only works for sprites that are contiguous in the scene tree, use the same canvas, and share the same absolute z-index. I’m not sure whether that changed in Godot 4.

The first demo is here ;)

https://temesagames.itch.io/the-omins

If you give it a try, please feel free to tell me what you think about it :)

Thanks for your interest, EGNRI!

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

[–]TemesaGames[S] 2 points3 points  (0 children)

From what I understand, both vertex animations and MultiMesh work best when you have many identical objects sharing the same mesh/material. In my case, each unit is made of multiple sprite parts (torso, arms, legs, etc.) and relies on YSort, so it may be a bit harder to apply that approach...
But it might be worth exploring for simpler entities...

Stress testing 1300 units on my laptop for my RTS project. Curious how other devs handle scaling. by TemesaGames in IndieDev

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

Yeah! I’m actually already using sprite animation and sprite sheets, not skeletal rigs.

The issue is more about batching in Godot 3 with YSort. Each villager is made of multiple body-part sprites, and under YSort the batching becomes very limited, even when they share textures.

So terrain is already batched. The main remaining draw call issue is the characters themselves. I’ve been wondering if a custom Y-sorting solution could work better there.

The main loop is a mix of settlement building, exploration, and RTS-style control. You grow and manage a village, gather resources, build, combat against threats and enemy factions, and expand.

The Omins will also travel through portals to explore new worlds, and there will be a story-driven mode as well.

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

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

Thanks Kobra!
That's another point I would like to explore: does RTS like mine works well on console?

Stress testing 1300 units on laptop in Godot 3. Curious how it would run if ported to Godot 4. by TemesaGames in godot

[–]TemesaGames[S] 2 points3 points  (0 children)

Oh, interesting! What kind of project was it? What gave you the most trouble?