Development and optimizations


Hey all!

We continue to develop the game. Currently, more than 10 types of ships are available to the player from light fighters to cruisers, dreadnoughts and battlecruisers! Each with its own characteristics and weapons.

Available ships

With the increase in the size of the ships, we tried to convey the feeling of controlling something heavy and clumsy. And if it explodes, it pushes everything around! We decided to use the capabilities of the physics engine and added physics explosion 

Physics explosions and smooth ship movement

A spoon of tar

Creating content is good, but we also need to keep the performance high. During new tests we detected FPS drops. Which is very logical, because the total amount of polygons could reach 200k on the screen. And something had to be done about this. We decided to simplify the ship models so that simpler ones will be used in the game, and more detailed ones will be previewed in the store. Thus, we managed to reduce the number of polygons for each ship from 4k-8k to 1k-2k.

Mesh comparison

This is not an advertisement, but the Polygon Cruncher program was very helpful in simplifying the models. It has a trial version for 7 days, but if you do not close the program, you can extend this period 😃

In total, the overall amount of polygons was reduced from 200k to 60k on the screen! This is an excellent result!

We also did a little work to reduce the visual judder of the camera and player's ships.

The camera movement code was moved to the LateUpdate method, and the Interpolate property of the ships in the Rigidbody component was changed from None to Interpolate.

You can compare and see the difference with the previous video

Itch.io

We decided to try out a new platform and published a web version of the game. To do this, we had to redesign the interface a little and add keyboard support.

Of course, there were some bugs. After the release on itch.io, it turned out that all the player’s progress was lost after the publication of a new version of the game.

Dear indie developers! Don't use PlayerPrefs for WebGL. Under the hood, it is designed so that you have access to PlayerPrefs as long as you have a permanent link to the assembly. On Itch.io, when a new version is added, the assembly is placed in a new subfolder, which creates a new area for PlayerPrefs and it will no longer be possible to read the old values.

To fix the bug, we had to develop saving data to a file, with its own nuances. The file data and PlayerPrefs are stored in IndexedDB; after writing the file, you need to correctly save it to the database. These are the crutches 😔 I hope this helps to save someone time.

To “trigger” saving to the database, you need to explicitly call the Save method for PlayerPrefs

The main thing is that we managed to fix the bugs, even if it took several days.

That's all. I hope it was interesting to read! There is even more content ahead. Please,write comments & reviews - we welcome everyone!

And for those who read to the end - #complimentoftheday

Game development and material preparation take a lot of time. But at least it wasn't all for nothing, if you played the game - my most demanding player

Files

WebGL.zip Play in browser
Feb 16, 2024

Leave a comment

Log in with itch.io to leave a comment.