I want to create a game but I have some questions regarding performance.
Game idea
Voxel 3D Tower Defense / RTS in which the player can control units to build structures and defend the base. (Inspired by this game)
Analysis
The voxel part seems pretty easy to manage. I saw that there is an existing voxel library made for godot, and that I could also implement it myself by just following a tutorial. One thing that I didn’t find a lot of information on is how I can either add slopes when the terrain is changing height, or how to tell the pathfinding algorithm that it can move up or down 1 block.
For the units, I read that a big issue with RTS games is the performance when trying to manage collisions and pathfinding. I think I can avoid that by limiting the amount of units the player can have, let’s say 15. So, by doing that, there should be no problem creating the units as CharacterBody3D
, right? There would also be waves of enemies with the same node type, so during the combat/defense phase, there could be around 50 CharacterBody3D
. Is that going to be an issue?
I saw online people ignoring collisions and having a simple 2D pathfinding algorithm to simplify things, but I don’t think that would work in my case since it’s not a pure RTS, it also has a base-building/physic aspect to it.
The next issue I’m concerned about is the building part. In the game I get my inspiration from, the units can place down blocks and create castles and fortresses. Ideally, each individual block would be a specific entity with physics applied so that a wall would be able to collapse if an enemy hits the bottom block and destroys it. I read that the RigidBody3D
can have a heavy impact on performance because of its physics calculations. So I asked GPT and it said that the game could create the different blocks as StaticBody3D
initially, and replace them with RigidBody3D
when needed, but that sounded a little weird and I was wondering if there was a better solution. I know I can use a physics engine called Jolt that I hear is more optimized for those kinds of physics calculations.
Continuing with the building aspect, I would need to rebake the mesh every time a block is placed down. I saw that we can now bake meshes with the AABB feature, so instead of having multiple meshes to prevent rebaking all of it, I can simply rebake a small section.
This is all purely theoretical so far, I haven’t tested any of this. I just wanted to ask around and see if people had better ideas