8 November 2023: Fog v2

Let me remind you that the first release of TrappedTogether will be for mobile devices. That's why performance is important. The first release is coming soon, and the first full testing showed that the performance is terrible!

There were two reasons for the decrease in FPS: trees and fog. The trees were optimized quite quickly. But I had to work hard with the fog.

I don’t know if the whole story and technical details are interesting to you. Anyway...
It took a lot of time to understand why the fog reduces FPS so much. Perhaps this is obvious to an experienced gamedev programmer. But I'm an embedded systems programmer, and I'm new to game development. Therefore, some things that are obvious for a gamedev programmer are not known to me.

Fog is a particle emitter: several times per second it emits a translucent texture that grows and changes transparency.
I changed different parameters of the particle emitter, but without success.

It turned out that the key parameter here is the number of particle emitters. They were in every cell of the landscape, and there really were a lot of them.

The obvious solution was to create only one fog source, and move it along with the player.
No, it didn't work. Yes, there was good fog, but the fog was moving with the player and it looked terrible.

I had to set the fog more rarely and tweak its parameters.

Meet fog version 2!
I like it much better than the previous fog: it moves, disappears, and appears again.
This cannot be shown in the picture, I hope there will be a first game video very soon.

How do you like it?

zombie apocalipsise player in fog

Add comment