NicoFIDI
Member
Halla everyone,
today i need an advise over optimizing something that runs every frame.
i'm obsessed with make a procedural generated world game,
i have at least 2 world builders working and building a randomized world.
now... in both cases i have the same issue. drawing a dinamic minimap it's way too slow.
i dont know where i'm failing or even if i'm failing
The basic logic is this:
today i need an advise over optimizing something that runs every frame.
i'm obsessed with make a procedural generated world game,
i have at least 2 world builders working and building a randomized world.
now... in both cases i have the same issue. drawing a dinamic minimap it's way too slow.
i dont know where i'm failing or even if i'm failing
The basic logic is this:
Code:
for (var xx = minimap_left; xx < minimap_left + (minimap_width div zoom); xx++) {
for (var yy = minimap_top; yy < minimap_top + (minimap_height div zoom); yy++) {
var relX = view_xview + minimap_offset_x + xx*zoom;
var relY = view_yview + minimap_offset_y + yy*zoom;
var color = c_black;
switch(obj_config_map.actualMap[# xx,yy]) {
case cell_type.water: color = c_aqua; break;
case cell_type.grass: color = c_green; break;
case cell_type.mountain: color = c_brown; break;
}
draw_sprite_ext(spr_whitePixel, 0,relX,relY,zoom,zoom,0,color,.5);
}
}