bitECS
bitECS copied to clipboard
Bitecs resize data stores issue
Following code to reproduce
import { addEntity, createWorld } from 'bitecs';
const world = createWorld();
const entities: Set<number> = new Set();
const totalEntities = 90000;
function addEntityToGame(eid: number){
if(entities.has(eid)) throw "Cannot add eid that already exists! eid: " + eid;
entities.add(eid);
}
for(let i = 0; i < totalEntities; i++) addEntityToGame(addEntity(world));
Output: 👾 bitECS - resizing all data stores from 100000 to 150000 'Cannot add eid that already exists! eid: 0' (Error thrown from my own code)
Version "bitecs": "^0.3.38", "npm: " "8.3.1" "node": "v16.14.0"
thanks for the report! resizing has some known issues at the moment. i will be disabling resizing in the next release in favor of this proposal