Problem with RDG number of GO

Guy i’m again with problem on beggining i was thinking i did something wrong but after some time i start to realise that there is a limit of GO to place with a table.

for x = 1, 16 do for y = 1, 16 do if level[x][y] == 3 then local p = factory.create("#floor", vmath.vector3(32*x,32*y , 0), nil, {},2) else local p = factory.create("#wall", vmath.vector3(32*x,32*y , 0), nil, {},2) end end end

I used that code to place blocks that should be walls or floors, and i get live 16 x 8 GO instead of the 16X16. I changed the code step by step increasing x & y from 4,8,12 and for my surprise when i get 12 problem get very clear … some kind of limit for place the blocks.

I would like to ask if someone know why is that limit and how i by pass this because i realy prefer work with GO then try tiles.

Ty for any help

Hello,

I believe you may be encountering a similar situation to the one I am - if your floor and wall tiles have scripts attached to them than you’re probably looking at the same thing as I talked about here: max_instances is effectively capped at 1025

Wait, I just noticed the “16x8”. If you open game.project and mess around with the config, you should find the max_count setting for the maximum number of sprites your scene can hold. I think the default is 128 which would definitely be a problem.

Ty … maybe this is the problem … ty for the help :smiley: i was trying to figure how to do with tiles and i discover that we still cant resize the tile map at runtime … something that should be implemented i must say.

But now i can go back to may old solution from love2d :smiley: i hope it works.

Ty alot tomorrow i will test because now im pretty tired. :smiley:

You can manipulate the map in runtime. See http://www.defold.com/ref/tilemap/

You can create a large enough map with blank tiles and set them as you go - probably to some sort of limit though.

I would aslo recommend the use of a tilemap instead of creating individual game objects with sprites and placing them in a grid as in your example.

I’m no specialist but if i can’t redefine the “borders” of the tile map at run time, will be mandatory for me to use a very very big tile map to make sure that my procedural level can be reused from lvl 1 to lvl 1000.
That could be a problem because of memory allocation for a tile map but i’m not sure because my skills of programming are kite low.

Regards to the manipulate i was telling, that was not telling about the tiles but tilemap size it self… i was not able to see any function like “tilemap.set_borders” or “tilemap.set_size” only thing i could see was the “get” functions.

Some one can explain me how a very big tile map full of empties tiles can slow my game… because if the impact is very low i 100% sure i change for tilemap.

Ty guys :smiley:

1 Like

Guy i managed to make it with tilemaps … i will continue to re-implement my love2d version of the script and i let everybody know if another issue comes.

Ty for the fast help

2 Likes