It’s not your business to judge some random person’s game, and the game will have places where you can exit (aka, go to level 1) so it will have some sort of goal in the end.
And @Razorboots, is there a way to make certain items more rare (like have a rare wall that spawns that takes you to the manilla room or something)
Alright, after some testing, the lag is coming from the script checking each tile to see if it is occupied. The process is not very efficient, so my idea is to make the process more efficient by having the script only check the furthest out.
I turned up the render distance to around 40 and there is 0 lag if checking is paused.
Yep! I just updated the place file to support any number of tile types.
You can find and add new ones in ReplicatedStorage and also block 118 of the module script.
You can change the chance for an exit to spawn in line 33 of the module script. You could also add a method to check if there are any other exits that are too close nearby, but that would require having to loop through the entire chunk list again.
The reason backrooms games work is because not only are you trying to find an exit, but you are also trying not to die, adding an aspect of realism (like camera bobbing or a running animation on a viewmodel) can immerse you in the experience and make it enjoyable even if you aren’t finding an exit.
Anyway back to the main point, I think the reason it might be lagging is because the remove function is checking the radial magnitude of the ending rooms while the add function seems to be in a double for loop (essentially searching the x and y distances separately). since the edges of the circle are being removed by the remove thing and added by the add thing every 0.2 seconds, that could be your issue.
(what i mean)
function gen.removeDistantChunks(x, z)
-- Delete all the chunks which are too far away.
for _, chunk in pairs(gen.chunkStorage) do
--right here check the x and y distances separately instead of grouping them together (i'm on a tablet so i can't format code lol)
if (Vector2.new(chunk.PrimaryPart.Position.X, chunk.PrimaryPart.Position.Z) - Vector2.new(x, z)).Magnitude > (gen.renderDistance*gen.gridScale) then
gen.removeChunk(chunk.PrimaryPart.Position.X, chunk.PrimaryPart.Position.Z)
end
end
end
edit: usually a simple distance check wouldn’t make any lag, accedentially deleting and cloning a bunch of instances would though, it also isn’t apparent in low render distances like 1-3 because the middle of the room isn’t being cut off by the edge of the circle radius
edit2: I’m really bad at explaining stuff by words so here’s a diagram
anything outside of the red circle is getting detected by remove checker and anything inside of the yellow square is being added, so all the blue area would be removed on the remove sweep and re-instanced on the rebuild sweep (causing a lot of a
lag)
that would be a lot more complicated as whenever the player leaves you would need to re-seed the plots. you can easily do it by some serverside unloading shenanigans