Update 86

These last two week the third level has been completed, now I am working on the big level 4. A lot of bugs have been fixed, some of the art has been completed too. I have modified some dialogs and some collisions.

Every time I make some progress there is always more to do, it looks like the game will never be finished. I think I need to add a lot more dialogs to have a game not too empty.

I need to buy the music but for the moment there are still too many bugs the game is not polished enough to be fully playable.

Steam greenlight will disappear soon and maybe I will not have money to put the game on steam, in this case, I will release the game on itch.io first.

Update 85

I post update less often because for maybe an entire week I have only fixed bugs. I can now sum up all the interesting bugs.

One interesting bug I have is:
OpenGL makes a border around sprites in a sprite sheet when the sprite is rescaled.

And the things is, this artifact is not a bug but depends on which filter algorithm is used by OpenGL. There are multiple but the two without mipmapping are GL_NEAREST and GL_LINEAR. Using nearest-neighbor interpolation produce an ugly result, so I need to use a linear interpolation for the filter.

The problem with linear interpolation is it compute the value of a point with the adjacents points, and sometimes with a certain size, position and ratio a border of one pixel appear around the sprite. This is when the linear interpolation algorithm needs to take the color of a transparent point. When I generate the sprite sheet with openCV the transparent color used is black (RGBA) : (0, 0, 0, 0). So the line around the sprite will be darker than the rest of the sprite.

The solution to this problem is simple once everything is explained, make a border of one pixel around the sprites with the good colors. I can do that easily by reducing the size of the sprite by 2 pixels.

Another classic bug with vector is the invalidated iterator after addition (when a reallocation is needed) or the deletion of an item.

In my case, the objects in the vector were stored on the stack, and I was using the address of the item as a pointer. Everything is fine if the vector is not modified, but I am inserting and deleting things while using pointer => pointer are invalidated => accessing invalid space in memory => game crash. The solution is simply to allocate thing on the heap to obtain a pointer that does not point on the vector and continue to be valid after modifying the vector.

There are a lot of others small bugs but when testing now I am using this to check for heap corruption (for visual studio only):