Hi,
I have a question about entity management, at the moment a game I am working on uses an entity management system using an ArrayList with instances of every entity. Every game loop update (the thread sleeps for 50ns or ms (cant remember what it is)) it goes through the ArrayList and for each entity it moves the entity if it is a moving entity and if it is within the players view, it renders it… So, as i have a big map (4000000 x 4000000 tiles) and will end up having maybe close to a million separate entities it will need to be quick… With my current system, having say 100 trees or so works fine… but when i spawn 10000 instances of an object (say a tree) the game almost stops and updates at roughly 1 frame every 2-3 seconds…
As I’m sure there is a way to do this, I would like your suggestions…
Thank you,
Lucas Fraser ;D