Files
AyeZeeBB ea3f081367 World: big maps no longer run out of spatial cull IDs while loading
A spatial transaction queue gives every object it tracks a cull ID from a
free list made once, when the queue is, at the game's
InitialCullIdListSize (40,000 in its config), and never grown. A custom
map with more objects (Cardiff) emptied it while loading and the next
insert read entry 0xffffffff of the list (crash at 0x489cfe9).

- spatial_cull_ids: as each queue makes its list, its size setting is
  raised to 262,144, one ID for every entity slot the entity pages hold;
  a larger configured value is kept. 12 bytes an ID per queue.
- The contract checks the list maker and how it reads the setting; it is
  installed at startup with the other world pools.
2026-10-15 20:01:48 -05:00

16 lines
608 B
C++

#pragma once
#include <cstdint>
#include <string>
namespace dingosdk {
// Cull IDs per spatial transaction queue: one for every entity slot the entity pages hold
// (entity_pages.h), as each object a queue tracks is an entity. 12 bytes an ID per queue.
inline constexpr std::uint32_t spatial_cull_id_target = 262'144;
// Install after Detours hook service init, before any level loads. Raises the game's
// InitialCullIdListSize to the target as each queue makes its list; a larger configured
// value is kept.
bool start_spatial_cull_ids(std::uintptr_t base, std::string& error);
} // namespace dingosdk