Need Help With Optimisation

Hey, I’m new to coding and took a rather large idea as my first project, an open world horror game. The problem is not the game but rather optimising. Any tips or tricks? Yes it may not run badly on your machines but I’m on a rather low end laptop and the frames are not great, any help is appreciated!

Link: PlayCanvas | HTML5 Game Engine

Hi @Nuke and welcome!

After looking at your project, it seems to have minimal requirements at this stage.

A possible improvement is to remove the cube map, since it can be quite resource-heavy on low-end devices. Also, using spotlights with shadows can affect performance, but usually a single spotlight isn’t a problem (especially since you’ve already disabled shadows).

Thanks

Why does every object have a light component

Good catch! I didn’t notice that.

I have no clue, think I miss clicked and then just copy pasted the assets

Looking through your project I noticed many weird decisions:

The parent entity you named “average tree” is just a lump on the tree, why is that the parent entity? It should either be the trunk, or an otherwise componentless entity.

image

For whatever reason this entity has a y value of 1.025, meaning every child of the entity is slightly stretched by 2.5%, why was this choice made? Also the collision does not properly match either number. It should be half.

image

Many entities have disabled light components, why? Also, the top of the tree has collision despite the player being much lower than it and is unable to interact with it. Why does this entity have collision? And a light?

The player has a purple capsule attached to it, despite the fact that this has no purpose and will never be seen by the player. Also, the ground is a box with a y value of 0.5, and since the player is a regular sized capsule the floor pushes into the player. Why did you do this? The floor is also massive at 3.5 kilometers square. In my experience that usually causes collision bouncing, either make it to avoid thismuch smaller or split the floor into several entities.

The camera is for whatever reason translated -0.129 z, meaning the camera is offset from the center of the player. What was the reason you did this? It also has a missing script assigned to it.

All of this before even launching the project.

Launching your project I find that the timer does nothing, but for whatever reason the game is very laggy. I have no idea why this is the case. Also, if this is supposed to be some horror game, or a game where the player walks around in the dark with a flashlight, then why is it bright daytime?

The reason your project is so laggy is because you have an usused camera in the scene. This means that you are rendering the scene twice per frame. If you remove the second camera, the triangle and draw call count gets cut in half and the framerate nearly doubles.

I removed the skybox, and the camera got slightly moved by accident at some point, I recently changed jump height because they could jump onto the tree at some point so it had collision, I didn’t know about the capsule or the stretching. I removed the lights after seeing an email about this reply on my phone. I also didn’t know about the parent entity thing but thanks for the advice

Thank you

Does anyone here know any YouTube channels or places with tutorials, I still need to learn JS and don’t know where to start, I start with the modeling side then thought of a game. My expectations of the work it needed was a lot lower

I have a few tutorials I have made

First person shooting (unfinished and has some broken scripts but mostly works):
ALUCARDS LETHAL MUNITIONS EXPO | Editor

SVG to texture:
SVG TO TEXTURE | Editor

Roblox style tycoon:
Shape Tycoon | Editor

I am also thinking of making a simple horror game tutorial in the future. Could probably crank it out in a single day if I wanted to.