mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Reduce city stutter: lower spawn rate, resync interval, M2 render distance
- MAX_SPAWNS_PER_FRAME 8→3 (each spawn does sync M2 load, 5-50ms each) - Creature resync scan interval 1s→3s (O(N) entity iteration) - M2 render distance: add 1000+ instance tier at 500 units, reduce 2000+ tier from 350→300 units to cap draw call count in dense cities
This commit is contained in:
parent
9c25713b72
commit
956e2c8bb1
3 changed files with 6 additions and 4 deletions
|
|
@ -244,7 +244,7 @@ private:
|
||||||
float x, y, z, orientation;
|
float x, y, z, orientation;
|
||||||
};
|
};
|
||||||
std::vector<PendingCreatureSpawn> pendingCreatureSpawns_;
|
std::vector<PendingCreatureSpawn> pendingCreatureSpawns_;
|
||||||
static constexpr int MAX_SPAWNS_PER_FRAME = 8;
|
static constexpr int MAX_SPAWNS_PER_FRAME = 3;
|
||||||
static constexpr int MAX_NEW_CREATURE_MODELS_PER_FRAME = 1;
|
static constexpr int MAX_NEW_CREATURE_MODELS_PER_FRAME = 1;
|
||||||
static constexpr uint16_t MAX_CREATURE_SPAWN_RETRIES = 300;
|
static constexpr uint16_t MAX_CREATURE_SPAWN_RETRIES = 300;
|
||||||
std::unordered_set<uint64_t> pendingCreatureSpawnGuids_;
|
std::unordered_set<uint64_t> pendingCreatureSpawnGuids_;
|
||||||
|
|
|
||||||
|
|
@ -786,7 +786,7 @@ void Application::update(float deltaTime) {
|
||||||
if (gameHandler) {
|
if (gameHandler) {
|
||||||
static float creatureResyncTimer = 0.0f;
|
static float creatureResyncTimer = 0.0f;
|
||||||
creatureResyncTimer += deltaTime;
|
creatureResyncTimer += deltaTime;
|
||||||
if (creatureResyncTimer >= 1.0f) {
|
if (creatureResyncTimer >= 3.0f) {
|
||||||
creatureResyncTimer = 0.0f;
|
creatureResyncTimer = 0.0f;
|
||||||
|
|
||||||
glm::vec3 playerPos(0.0f);
|
glm::vec3 playerPos(0.0f);
|
||||||
|
|
|
||||||
|
|
@ -2081,8 +2081,10 @@ void M2Renderer::render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const
|
||||||
|
|
||||||
lastDrawCallCount = 0;
|
lastDrawCallCount = 0;
|
||||||
|
|
||||||
// Adaptive render distance: balanced for performance without excessive pop-in
|
// Adaptive render distance: tiered by instance density to cap draw calls
|
||||||
const float maxRenderDistance = (instances.size() > 2000) ? 350.0f : 1000.0f;
|
const float maxRenderDistance = (instances.size() > 2000) ? 300.0f
|
||||||
|
: (instances.size() > 1000) ? 500.0f
|
||||||
|
: 1000.0f;
|
||||||
const float maxRenderDistanceSq = maxRenderDistance * maxRenderDistance;
|
const float maxRenderDistanceSq = maxRenderDistance * maxRenderDistance;
|
||||||
const float fadeStartFraction = 0.75f;
|
const float fadeStartFraction = 0.75f;
|
||||||
const glm::vec3 camPos = camera.getPosition();
|
const glm::vec3 camPos = camera.getPosition();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue