The downside to that is the size of png file : > 10mb uncompressed, so I will try to reduce that size. I hope the demo will be done at the end of this week, every day I am fixing multiples bugs, you could say it’s done when I am running out of bug to fix :). But I need to change some small things and maybe add this shader for some parts of the demo. I want to return to the C++ version but I am more efficient when I am focused on one thing, switching often between environments and languages waste some time.
I put on week in the port of the demo and I see more progress and fewer problems than the emscripten version of the game. For example, the loading times are much better with pixijs than emscripten simply because come things are loaded asynchronously and when needed. Emscripten needs to download all the resource beforehand and when you have around 80 MB of data it takes a lot of time.
Here is the list of libraries I will use for the demo (all on github) :
– pixi.js for the graphics
– mousetrap for handling keyboard
– howler.js for sounds/musics
After the demo I will test and refine the whole game !
Why am I doing a web demo ? When I put the game on GameJolt I think a lot of users just want to try the game and downloading 50 MB can be annoying, and they are so many games on itch.io or GameJolt games including Ludum Dare games or other things. To have an online version of the game can make a big difference in term of the number of players.
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.
I have remarked the level 4 lack of content, so I have found out a solution to fix this: add day/night mode. This allows me to add more characters on the same map. I don’t know yet the story for each character added to the maps.
Now the game can be divided like that:
Level 1 : 10%
Level 2 : 5%
Level 3 : 30%
Level 4 : 45%
Level 5 : 10%
I have focused on the last level: level 5 where I have a very precise idea of what I want to do with it. I have done a lot of content for this level but I will not show it because most of it contains spoilers of the ending :). The base of the game is coming along when the level 4 has been figured it out I can start the testing of the game.
I have focused on the last level: level 5 where I have a very precise idea of what I want to do with it. I have done a lot of content for this level but I will not show it because most of it contains spoilers of the ending :). The base of the game is coming along when the level 4 has been figured it out and when every level is feature complete I can start the testing of the game.
I think the animations will be added during the testing, and I will need to choose which one to do because even for a simple animation of one second I need like 12 images. The problem is not really to create twelve images for the animation but for example, I have a character with a size of 300*600 pixels. I can store only four images in one sheet of 1024*1024:
So for twelve images I need 12/4 = 3 sheets of 1024*1024 or one sheet of 2048*2048:
There is already one sheet of 2048*2048 for the map and one for the shadow, the question to ask is what is the maximum number of sheets a computer can load in a reasonable time. Each map is loaded on the fly added to a pool and the first one added is free when the pool is full. To test that I need to do a benchmark on a computer with low spec.