Game crashes a few seconds after joining, desperately trying to optimize

I’ve been making a map for the past few months, and recently it’s been crashing when loading and unplayable, no matter how much i’ve tried to optimize it. The game is entirely scriptless (apart from BoatBomber’s WindShake script) and takes little time to load, but in the Roblox client it takes a really long time to load, just for it to lag and to then crash a few seconds after. Most assets are original and made out of parts, although roads and certain buildings are currently models made by Roblox as placeholders which are mostly made out of meshes. The map uses significant amounts of terrain only for 2 islands and for oceans.

Here’s the part, terrain voxel & instance count:
image
The map is roughly double and a half the size of a game like Jailbreak (slightly bigger than GTA 3!), and uses lots of vegetation although I’ve been reducing the amount of vegetation enough to the point that at certain angles the map in Studio runs at around 60 fps.

Here is the game, if you want to see stats or something.
https://www.roblox.com/games/6916286523/kaoc

Any advice? I’ve been trying to minimize the amount of terrain, parts and all.

EDIT: I’m optimizing more and more, and water seems to be a major part in the amount of terrain voxels. I’ve also been making holes under mountains to reduce the amount of voxels. Roblox’s engine is very optimized and very good for large scale games, especially with terrain! /s
image
Also, the vegetation uses LODs., along with some meshes.

1 Like

That is a lot of memory you are using, 3GB. Have you tried reusing meshes over and over?

Most of the game uses meshes over and over. I’m extremely confused on why it would take so much memory.

It could be all of those meshes, parts and models in the game they could be crashing the game

Definitely a lot of stuff going on.
Are you sure there are no scripts in any of the models you’ve used? If they are from Roblox you should be fine, but if they aren’t there may be something in there.
Lots of Terrain will slow a game down, as well as lots of Parts since the game has to try to render each and every one.
If you make sure all the Parts that aren’t moving are Anchored, and make sure that all Parts, Unions and MeshParts that a player won’t be touching to run a script have the CanTouch property set to false (unchecked) it might help.

1 Like

There’s only the Windshake script, I’ve checked. I’ve been minimized the amount of terrain and parts as much as possible (and anchored it all) while not making the ingame map drastically different gameplay-wise, and am continuing to do so.
Disabling CanTouch might help, but what does CanTouch do? Does it make scripts able to detect parts?

Possible, but the game had nearly the exact same map with different vegetation and ran fine, until some point that I can’t exactly pinpoint.

Is there a reason you’re not using Streaming Enabled? This massive open world would really benefit, especially if there are no scripts.

Click that on and I almost guarantee you’ll be able to load in fine. Because currently, the game is just too big.

2 Likes

StreamingEnabled ruins visual quality, responds extremely slowly and can’t even unload objects. I’m thinking of having a simpler system where small residential buildings (there are a LOT of those) get unloaded on all islands except the one the player is on, and having flat lowres images of those buildings appearing in place. Only issue is, I don’t know how to script at all, so I’m attempting to optimize it as much as possible without scripting currently. At the very least, I’m doing quite alot of progress to the point that the vegetated island runs at nearly 60fps when seen from top down with other islands out of view, but I don’t know if that’ll translate ingame.

The best way to fix the game is deleting parts. 484k is a lot and it can be reduced to maybe say 300k if you increase the size of each part to where it considers as two parts. There might be some builds like that and also remember to check for meshes aswell, you can group them into one and increase the size of the mesh which is another way of reducing clutter. Download a virus checker just in case if there is something else slowing down the game. Add a loading screen to fix the unnecessary lag spike at the beginning and you are done!

EDIT: I forgot to mention about fixing the lighting to make it compatible, oh yeah and also reduce terrain with parts. Water is a big issue :slight_smile:

1 Like

I’m currently doing this to sidewalks and roads, it seems to reduce the amount of parts a bit, and is pretty useful. Most of the vegetation is made of meshes too, and I’m reducing it quite alot.

Also currently doing this by making water less thick (the game will not have anything underwater) and making huge holes in terrain under roads, structures and mountains.

You are doing great and it might take time but it’s always a necessary step.

1 Like

You want to render everything at once, but also want performance optimization? You can pick one or the other, and Streaming Enabled is a loading system without having to do any of the scripting yourself. If you still want things to force render a bit further, and can play with the MinRadius and other settings. This way you can have graphics fidelity close to your player and still let the player actually play your game :slight_smile:

It does unload objects if your graphics settings and PC requires it. You can see for yourself in this Streaming Enabled proof of concept I made a couple years ago:
https://www.roblox.com/games/4825729399/Get-Lost-In-A-Forest

2 Likes

I actually just tried StreamingEnabled and it’s much better than I remember (and unloads objects, it didn’t do that last time i tried it weirdly), strangely. It also makes forests look denser from a distance. I’ll make some skyscrapers have streaming disabled on them since they don’t appear at all. The game still crashes shortly after fully loading in though, and some things still look extremely low quality from a distance.

EDIT: Part-made skyscrapers still don’t appear at a distance, even with LODs disabled on them. The game still crashes, although sometimes it doesn’t but shows a crash message that closes the game when you press “OK” (specifically when you quickly move the camera around).

haha funny wiimote, this makes me want to disable streaming on specific objects even more!
image

Have you tried saving your place to a file then while in Studio go to Terrain and delete it.
Upload it to Roblox and play it again on the site to see if the Terrain is the main cause of your issue. It’s likely a combination of Terrain and Parts as @Aotrou mentioned.
When you want your Terrain back just go into Studio again and load your place back from your file and upload it to Roblox.

400k parts ain’t healthy for a game

I have no scripts other than BoatBomber’s WindShake, I’ve mentioned this in the initial post.