bitECS icon indicating copy to clipboard operation
bitECS copied to clipboard

Bitecs resize data stores issue

Open usrgnome opened this issue 3 years ago • 1 comments

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"

usrgnome avatar Aug 07 '22 10:08 usrgnome

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

NateTheGreatt avatar Sep 09 '22 18:09 NateTheGreatt