Skip to content

Initialize DAABBCC

selimanac edited this page Oct 8, 2024 · 11 revisions

All arrays are now pre-allocated, similar to how Defold handles them. Arrays will no longer grow dynamically, so it is your responsibility to set them up upfront. Initialization should only be done once.

Default allocations for arrays and hashtable(aka groups):

max_group_count = 3
max_gameobject_count = 128
max_query_result_count = 32
max_raycast_result_count = 32

There are two ways to initialize DAABBCC

1 - Initialize using game.project file

Open your game.project file using a text editor, copy and paste the settings below, and adjust them as needed.

[daabbcc]
max_group_count = 3
max_gameobject_count = 128
max_query_result_count = 32
max_raycast_result_count = 32

2 - Initialize using daabbcc.init() function

daabbcc.init(max_group_count, max_gameobject_count, max_query_count, max_raycast_count, [update_frequency])

Parameters

  • max_group_count (uint8) - Maximum number of Groups
  • max_gameobject_count (uint16) - Maximum number of Gameobjects to use with daabbcc.insert_gameobject()
  • max_query_count (uint16) - Maximum number of Query result for a single AABB
  • max_raycast_count (uint16) - Maximum number of Raycast result for a single raycast
  • update_frequency (int32)[optional] - Update frequency for Gameobject update. More info

Example

local max_group_count = 3
local max_gameobject_count = 128
local max_query_result_count = 32
local max_raycast_result_count = 32

daabbcc.init(max_group_count, max_gameobject_count, max_query_count, max_raycast_count) 
Clone this wiki locally