defold / defold/defold

Set the collection component count when setting a dynamic prototype for a collection factory

Open
#11,444 1 comment 0 reactions 0 assignees View on GitHub
engine feature request
Dominant language
C++
Stars
6.3k
Forks
455
Avg merge
1d 19h
Merged PRs (30d)
130

Description

Currently the default value is used. To optimize the memory it would be nice to have an option to set this count by code.

A good place would be an optional third argument to `set_prototype()`.

```
collectionfactory.set_prototype('#factory', '/main/levels/level1.collectionc', 1024)
```

To improve the usability of this feature it would be nice to have another function that would tell the component count of a collection at runtime. In cases where it is already known, nil otherwise.

```
collectionfactory.get_component_count()
collectionproxy.get_component_count()
```

And what about `collectionproxy.set_collection()`, does it have the same issue as `collectionfactory.set_prototype()`?

Contributor guide

Open the contributing guide

Research direction

Start at the collectionfactory.set_prototype() and collectionproxy.set_collection() entry points, then trace how collection component counts are currently obtained at runtime. Determine whether the optional count and get_component_count() behavior apply to both APIs, including the nil case, and verify the requested memory optimization and runtime results.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.