Trouble making a Grid Rendering System

Hello Everyone,

I am working on a game with a friend, which uses a dungeon generation system.

Currently, I am trying to make a rendering system. A Grid of 16 500x500 Parts groups the rooms, and if a section of the Grid is far enough from the player, it will be “unrendered”.

I’m having trouble grouping the rooms, though. You see, each room is parented to a folder, which is numbered when the map is generated. And the idea is to parent that folder to the grid section it’s children are touching, like :GetTouchingParts() or :GetPartsInParts.

How do I find the folder to begin with? Finding the folder through part touching brings you back to square one. Unless I create a table of all possible names somehow.
image
As you can see, the names of the folders are pretty complex.

Overall, I’m wondering if this is actually a viable solution to the lag issue. This or having to check the distance between the player and the 200+ rooms.
image
Grid is organized like this. BoundingBoxes don’t seem useful in this scenario, so I’m using parts. Plus, I don’t know how I would create a grid with them.

Thank you.

2 Likes