D
Dracodino300
Guest
My game has procedurally generated rooms, which build structures like walls using an auto tile object system. There is a significant slowdown, most of which seems to be due to the auto tiling.
The relevant auto-tiling code is as follows:
I can't see how to make this faster without getting rid of the autotile entirely.
The relevant auto-tiling code is as follows:
Code:
if(newlyCreated){
image_index = sprite_get_auto_index_16(objWall);
newlyCreated = false;
}
Code:
///sprite_get_auto_index_16(object)
var objType = argument[0];
var returnVal = 0;
if(position_meeting(x+32,y,objType)) returnVal+=1;
if(position_meeting(x,y-32,objType)) returnVal+=2;
if(position_meeting(x-32,y,objType)) returnVal+=4;
if(position_meeting(x,y+32,objType)) returnVal+=8;
return returnVal;
I can't see how to make this faster without getting rid of the autotile entirely.