Baffling, may need to have you guys take a look at my local villager hierarchy and see if anything could be setting if off in that case, you're right though that the villagers themselves aren't complex and neither is the landscape that I've made so I'm going to have to do some digging to see where I've potentially gone wrong.
[WIP] By the gods - God game
A bit random as well but part of why I switched this project over from Unity to Godot is it will be a great case study of how to do a fairly sizeable game in Godot so I'm of course trying to document everything and post up my progress as much as possible. This should also show people what Godot is capable of and we can really put the engine through it's paces rather than have people potentially ignorantly snubbing it because it's mostly only been used for small 2D games so far.
So polygon count is not really a problem anymore. You can easily draw millions or tens of millions of polys, even on budget hardware.
It's mostly down to shader complexity and material switching. If you are using the standard material, then the shader should not be an issue. But having too many materials, is a huge problem.
Because the objects have to be batched by material, to minimize the state changes, and that way multiple objects can be drawn in one draw call. So the material switches and draw calls are somewhat related.
I'm not sure how Godot handles it, especially if each character has multiple objects and/or materials inside. But I have to imagine they thought about this, and there is some way to optimize it.
I've just never got that far with animated meshes, most of my work has been with static scenes, so I am not 100% sure how to do it in Godot.
- Edited
We may need to poke around and ask people who may know more on that front in that case, it's really odd though because the materials in the scene aren't that many and they're incredibly simple and low res on purpose because I wanted to try making a fairly large sandbox god game which can run on lots of hardware.
cybereality I think for retro graphics like that you should be able to have a few hundred characters (or more on a higher end system).
Graphical fidelity/polycount isn't the bottleneck here. One would have to take a deep dive into godot servers to do a more data oriented design thing for mass npc/crowd sim in realtime.
Now that I think about it, in AAA games with lots of characters, they usually use imposters or instancing, not hundreds of unique independently animated people.
Still though, the scene looks fairly simple so I believe it should be possible with the right settings.
Here's how my hierarchy is looking right now for my male villager, there's likely a clue somewhere that I've missed if it's possible it's down to setup more than the issue of rendering hundreds of villagers, the top most parent has been highlighted.
- Edited
https://docs.godotengine.org/en/stable/getting_started/step_by_step/instancing.html
Hmmmm.....
I should point out actually, that I made the villager a local part of the scene while I figured everything out and got it working, I guess now is the time to start fiddling with having it as it's own instance among other things.
No way! LOL I think it was just because I hadn't made the villager into an instanced scene, hang on, I've got to do some more testing on this now.
Okay, it's chugging a bit at 400 villagers but that's a massive improvement already.
- Edited
I can get 30fps at 300 villagers but it just tanks after anymore than that, that's very interesting I bet it will run a lot better with multi-threading regardless if instancing does this much for performance.
Interesting. That is good news. I still think the model has too many pieces. You might want to find a way to combine the clothing and accessories so it is one mesh. I think that is the main issue.
- Edited
I'll look into it, that would be extremely tricky because the idea is the villagers have their own tools and everything that they use like woodcutting and so on and I need to be able to hide/show them pretty cleanly like in RPGs for weapon equipping, this will be something else for me to poke at.
Lethn I can get 30fps at 300 villagers but it just tanks after anymore than that, that's very interesting I bet it will run a lot better with multi-threading regardless if instancing does this much for performance.
Now what if you disable visibility of villagers at a certain distance from the camera or it's point of focus/view intersection with terrain?
Tools and weapons are fine, because they can be separate static objects (not part of the skin) and use a bone attachment.
In terms of the different outfits, you can do a lot with texture mapping, to have maybe only a few different meshes with a large variety of textures (as this does not cost performance).
But if each piece in the mesh is a sub mesh (with another material) this is going to cost a lot of performance.
Megalomaniak Well that would be frustrum culling wouldn't it? If I recall correctly that's even built into Godot and I just need to check out how the LOD settings work in Godot to see if tweaking those settings can help the performance there, I love how much more straightforward this stuff is to setup in Godot lol it's kind of unbelievable.
Lethn Well that would be frustrum culling wouldn't it?
Not exactly. Frustum culling takes the view bounds or 'cone' if you will into account. Which is also why I can't guarantee that it will improve performance further, but it might be worth trying.
https://docs.godotengine.org/en/stable/classes/class_occluder.html
Ahhhh, now we're getting somewhere, this is so much more interesting than dealing with vector3's and rotation maths lol.
- Edited
Just realised that I hadn't posted any updates on the Godot forum itself.
Various things I've been working on.
Tree growing mechanics - Completed
Pick Up and Throw mechanics - Completed, will post video on that
Currently getting really focused on building mechanics, once that's done I can then finish up miracle behaviour as that's tied in and then finish up even more with the villager breeding/day night cycle stuff I've got going, will be dropping quite a bit of content on here because I'm making a hell of a lot of progress which is great.