This week I have mostly done backgrounds for the last level and implemented the day/night transition.
I have added more objects for the level 4, this enabled more choices with characters. A good balance between object and dialog is important, I think most players for adventure game do not like to have walls of texts each they speak to one character.
I have also modified the structure of the data folder to reduce the loading time of the images. I have searched a way to store more maps in memory because if the user has a graphics card with 128 MB of VRAM, one sprite sheet with size 2048*2048 takes 2048*2048*32 = 16mb so at most 128/16 = 8 sprite sheets can be stored in memory.
One solution is texture compression with DXT algorithm the problem is this takes more place on the hard drive than PNG or JPEG and more time to implement because stb_image do not support the loading of the DDS file format. The gain is not constant and can vary greatly between images. This solution only works for computers, iPads use PVRTC algorithm.
Loading textures on the fly allow me to keep a small memory footprint.
For example one map :
menu and icons : two 2048*2048 sprite sheets
map and animations : two 2048*2048 sprite sheets
map shadow : one 2048*2048 sprite sheet
objects : one 2048*2048 sprites sheet
= 6* 16 = 96 MB which is correct for most computer with OpenGL 2 I think.