With occlusion culling I highly doubt OP needs to invent their own rendering system
using the system that you gave me, it runs great! even with around 100 rows, but how would i go about making it generate around the player?
occlusion culling is a studio exclusive currently as its in beta
You can send info to generate cells to each client and detect inside which cell the player is by using math for instance get relative position of player to grid and do:
local relativeX = math.floor(playerRelativeX/Grid) * Spacing
having the player only generate the room when their only in the sam area would break the illusuion of an infinite room, wouldnt it? or am i miss understanding?
note i changed the script to something along the lines of this:
local Rows = 100 -- how many rows we want in each axis
local GridSize = 25
local Rooms = {}
local function RandomSection()
local Sections = script.Sections:GetChildren()
return Sections[math.random(1, #Sections)]
end
for i = 1, Rows ^ 2 do
local index = (i - 1) -- we don't loop from 0 to Grid ^ 2 - 1 due to table being easier to use
local x = index % Rows*GridSize
local z = math.floor(index / Rows)*GridSize
local displayPart = Instance.new("Part",workspace)
displayPart.Anchored = true
displayPart.Position = Vector3.new(x,5,z)
displayPart.Size = Vector3.new(1,1,1)
local Room = RandomSection()
Rooms[i] = {
x = x,
z = z,
index = index,
id = Room.Name
} -- we storing room inside table
end
The catch is we don’t generate rooms on server, we only store few bytes of data, we use this data to create rooms on client, soo every player will see their rooms, no matter where they are
yes i understand that, but similarly to how my original system worked, i need the rooms to infinitley generate around the player in the grid, rather then just render rooms in a set grid as, as far as im aware of, theres no way to make the grid infinite
but then again im not expereince in using grids/chunks, so i may be missing something