Hi, I have a very simple snippet which dynamically creates an entity as the player approaches and also dynamically removes it once the player has moved far enough from it. My problem now is that when I open up the Statistics Panel (F11) it shows an increasing amount of memory being consumed (ie: nex, mem, geo, shd, all increase and free memory decreases) as I move the player forward. Any idea why more memory is being consumed even though theoretically the amount of memory being used is the same? Albeit, the memory consumption rate is very slow.

Here are some important snippets:
Code:
action sector_life(){
	while(1){
		if(vec_dist(player.x,my.x) > 1000){
			ptr_remove(me);
			break;
		}
		wait(1);
	}

void level_init(){
	while(player==NULL)wait(1);
	var x_count = 512; // first sector is 512 units in length
	
	// create an empty entity in front of the player
	ENTITY* limit_ent = ent_create(NULL, vector(player.x+100, player.y, player.z), NULL);
	
	while(1){
		if(vec_dist(player.x,limit_ent.x) < 100){
			ent_create("sector1.wmb",vector(x_count,0,0),sector_life);
			x_count += 512;
			limit_ent.x += 512;
		}
		wait(1);
	}
}


Many Thanks,
David


Accelerated Game Creation Tutorial - Learn how to use 3D Gamestudio's WED with these exciting video tutorials!

Visit our website at http://www.accgames.com.