Hello, I’m making an infinite backrooms procgen game and I’m unsure of how to make a chunk loading system. So far I’ve made a small prototype of what the chunk would be, but I’m not sure how to apply it. Here is the module:
Tile generation at this moment generates until a defined quota, but I’d like to generate tiles when creating a chunk to allow infinite generation. Tiles generate off of outnodes located within other tiles, and RoomInstances use coordinates as well as the chunks. I’m also thinking of adding chunk coordinates. If anybody needs more context, I can send it.
(I should probably make a seperate post since I have explained this multiple times now)
Hi, I spent a long time making my own Infinite procedural generation:
What I did is calculating chunks on the server on sent the information to the client to render.
I used neighbours for this, so from each chunk tile it would go forward, rightward, downward and leftward.
You then store the chunkData in a table for overlap checking, etc.
And the neighbourdata in a seperate table for generating chunks.
Here is whaf the proces looks like:
No chunks at player position? Generate a starting chunk
Starting chunkdata is stored in a table and send to the client, the neighbours position and neigh ours data is stored in a table
When updated, it repeats step one and after that loops through each neighbour and checks if its close enough to the player and if it doesnt overlap any existing chunks. If all checks pass, you can generate a new chunk with the neighbour data and then sent to thr client again.
Example:
White dot: Current Chunk
Colored dots: Directions/ New Chunks
Alright, one thing thing though, the system I use for procedural generation relies on previously loaded tiles in other chunks. So if a loaded chunk were to border a new one, I’d need to detect what nodes lie on the boundary between them to perform such a task. How would I do such a thing?
Also, here’s a video example of my system so you can have an idea of how it operates. (Blue walls are connection nodes.)
Also, it would be great if you could send the file too, thank you.
I am a litte confused, but you mean check wich chunks are on the left and right side of your new chunk? Well then you could just offset the position using rightvector and get the data from that position right.
Ill give you the file later its like 02:43 lol.
sorry if my writing is a bit vague, although what I’m trying to say is not that I want to detect adjacent chunks, but to detect bordering connection nodes (as previously defined) from a newly created chunk. They are important to spawning new tiles in the procedural generation algorithm I made, basically every tile that can spawn one has at least one connection node.
I think I get it (hopefully).
So i guess you mean determine wich chunks should be placed next right?
I made a datamodule for this and just told each neighbour what to generate, and then used numbers. So you could label a connection node as 1 and then in your module tell that there should be a fully open chunk, or one with one wall or two walls.
If I am still wrong, sorry.
Or do you mean detecting when a neighbouring chunk is open and there shouldnt be a wall there? Then you could do a couple of things, but first tell me wich is correct, sorry for being stupid.
(you got blue app btw)
Ok so if you would go about detecting open spaces or generation nodes next to the new chunk, here is what I would do:
Get the chunkdata from the front, left and right neighbouring chunk. In each of these chunks get the the generation nodes and their directions. Then check if the directions are against eachother, so:
If you check the RIGHT neighbouring chunk and it has a generation Node pointing LEFT towards the new chunk, you dont want too generate a wall on the RIGHT side of the chunk and leave it empyy
Now how the hell are we going to get these directions from the neighbouring chunk?
Since chunks might be rotated and i dont know what this can be quite hard, I dont really know tbh.
Very interesting problem