- Home /
How to get minecraft-like game to generate blocks and still run OK and not slow afterward?
I'm currently working on a Minecraft-like game called MineScape, but I have a problem of whenever blocks generate and they are done generating, the game lags like crazy. This is especially true for when I use quads to build the cube, as the game becomes almost unresponsive and otherwise extremely slow. Otherwise, cubes just slow it down to an unpalatable speed.
I know I could potentially solve the problem with quads, and that I do in fact know that I can use code to build quads, but I don't know how to use the quads in a way that would prevent lagging the game out, and I can't exactly find the YouTube video I want for the problem itself. I don't want to take any more of the time required to figure it out on my own, and besides, I've decided that's what I'd rather do instead of other sources, and so therefore this is why I'm asking this right now. I know it's a bit of a dumb question, but still I could honestly use some help here.
In fact, here are some images show a little bit of that in action. Obviously, it doesn't show that the game is lagging, but it does at least show that the game lags either with these cubes or six-fold with six quads to make up cubes. The Scene View is what's particularly important there, so pay attention to that. But the Game View is also important in the second one, since both windows show both top and side sides of the cubes themselves, to prove that they are constructed out of quads.
Thanks for the help. Have a nice day.
Answer by unity_Q-dd0z1dejJSCg · Aug 06, 2019 at 01:23 AM
For starters disable the auto-generate lighting which is probably killing you on that amount of blocks. Also you can post your code here.
I'll try disabling auto-generate lighting - didn't think of that before. Heh-heh.
And it's not the code and generation that's the problem. In fact, the code literally ends right after the block terrain generation in the code, so literally nothing else happens. In fact, although I am aware of being able to post code here, that's the reason why I didn't post the code here, because the problem lies within the rendering itself after generation, not when the terrain is currently generating, and again in fact there's literally no more code after that process. But if you do insist on me sending the code, I'll certainly do that.
But again, I'll try disabling auto-generate lighting and see if that works. Thanks in advance. : )
Disabling auto-generate lighting did little at best and had no effect at worst. I've noticed that quads could potentially be used in a way that could un-render themselves if they were touching another one for example, allowing the game to run much faster and to reduce much of the lag greatly. I've heard of it from Hollistic3D's videos, but I don't know where the rest of the instructions are. To put it simply, solution did not work, further help is needed. Thanks.
However, I do know about how quads could potentially be used to "cut out" parts of the terrain that are unnecessary to show, speeding up the game wonders. However, I don't know how to work with these quads in order to make them work the way I want to in order to speed up the game, so I could honestly use some help in that area too, but any other help besides that is still very much welcome.
Other than that, I'm out of options, so thank you for any other advice y'all give me.