Tilemap Culling (SOLVED)

Does Defold cull tiles or other graphics that are outside the camera view?

1 Like

No. Here’s an issue for it:

6 Likes

This would be a great help. I’m currently hitting the opengl memory cap for my game. I managed to get things stable for now, but I’m hoping to have at least 80x80 maps with 24x20 pixel tiles for the game. Another huge improvement which would help me is a tilemap.exists function. Currently my game puts out thousands of these errors in a normal run, but the only way I can think of to resolve is to create a “blank” tile to fill in the gaps in the map and then calculate the bounds by hand because get_bounds returns the wrong values in quite a few cases. I’d rather just check if the tile exists with a slight padding before using the data. I’m not sure, but I think printing out those errors could also be delaying level load time slightly as well. Or even better, just have get_tile return nil to indicate no tile and have no error output at all (let the developer interpret that as the tile not existing.)

1 Like

It does? Could please you provide more information about this?

2 Likes

I spent awhile to collect all the data / create a repro case for this, and finally I realized I had done something stupid: I was interpreting the w/h as the returned by get_bounds as the far right and top coordinates, not the number of columns past x/y :stuck_out_tongue: Since most of my maps start at x=1,y=1 those weren’t causing any issues but I had a few which were offset so they were losing tiles and I had to adjust the values after importing. Sorry for the false report! I’m glad I found/fixed this now though in my game so I won’t have to manually adjust the bounds after importing certain maps.

4 Likes