I have a system that uses Raycast to determine If there can be a bridge between two points. The issue here is that these points and the possible obstructions are in ServerStorage, so raycasting doesn’t work.
The reason these structures are in ServerStorage is that there are 1600 of them, and I plan to switch to using procedural generation soon instead of preloading a grid pattern and applying models.
If I were to do this outside of ServerStorage, it would be significantly less performant.
A current issue with bridges that check for the nearest candidate it can connect in a procedural generation system is that when generating it will sometimes not have enough candidates to search for and fail, which at that point many more issues arise.
The map is entirely made of floating islands over an abyss, which ends your game if you fall into it, so bridges here are important, but I don’t have a valid way to actually bridge between the islands in my head here.
Any help is appreciated.
Bumping post since it’s been a bit
Can you either create an invisible “test part” to raycast between or have preset data for the size and stuff of the islands and just use math to figure it out? I’m not exactly sure what you’re trying to do though.
The islands are detailed models so it wouldn’t work with just using invisible parts.
Here’s one of them named “Arbor Corruptionis”
As you can see it has a detailed base, making it tough to replicate with small amounts of parts.
To add to this, I still have issues with moving to generating islands as you go due to issues stated in the original post.
Just clone the part and loop trough the decandants of the model and make them trasparent
Transparency doesn’t “un-render” anything. When a large amount of objects are being rendered in a short period of time it begins to lag. That is the whole point of loading models in ServerStorage slots instead.
Oh yeah. You could try what Linesgamer12 just said, or just put it 100000 studs in the sky. Either way, nice build.
I think there is really no other solution to the problem
If you don’t use streaming already I have an idea
- enable streaming
- make the stream distance as low as posible
- set the streamoutmode to opertunistic
4.every model that should exist on the client needs the streaming mode persistant
- and every invisible model to default
I hope this works
I tested it sadly doesn’t work
Procedural generation is a solution to the problem, as I stated in the original post.
Generating models along a 2D theoretical grid should give way to easy generation, and I now have a function that searches for the nearest island in Workspace to bridge to.
I decided to default load around 100 islands total as a base and procedurally generate beyond that point.
Still of course there will be preset coordinates to spawn special islands, such as Arbor Corruptionis.
Simply check if the player is in range of spawning a new island on the grid, and if so spawn one.
Also, create a system that unloads chunks/islands when they exit the player’s range.
The function that searches for the nearest bridge can act on its own and automatically perform that action on any newly loaded chunks/islands because it checks if the island is in Workspace and therefore rays can be used to determine if the currently selected candidate is valid for bridging.
(Rays have barely any cost to performance, so don’t worry about that)
Theoretical grids can be created by simply using a format such as
This game uses FogEnd, meaning I can seamlessly unload and load chunks/islands without having any visual issues. Loading small amounts of islands at once should not cause lag as the client can handle it.
I am posting what is now extremely obvious to me here for anyone searching in the future.
Thank you for reading