Update 40

I am still fixing bugs in the web version and also learning to code “properly” in javascript with JSHint because most of the code is still a mess. I have also decided to have only one resolution for the web version: 1360×765. This resolution allows me to use tileset efficiently, a lot of maps can be stored in a 4096*4096 texture.

cell0

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.

Update 39

The web version is not completed yet, I had to change a lot of things in the code to make it work and Javascript makes it more difficult to debug  with untyped variable. Javascript is a lot different than C++ so I add to change the XML data of the level to make it valid because the parser needs the file to be valid to be parsed. It takes a lot of time to add this. for every method in the code. Another problem I had was understanding the scope of variables because pixi.js does not have events but only callbacks.

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 !

Update 38

I am working on the web demo of the game but since Emscripten have some problems and I need to change a lot of things in the game to make it work. I chose to port the game in javascript  with pixi.js, but this can take some time because it’s the first time I have to code in javascript. They are around 10.000 lines of C++ code to port so it should be fine I think.  The other alternative to Javascript is ActionScript but flash game become more and more obsolete with HTML5 and WebGL.

The other alternative to Javascript is ActionScript but flash game become more and more obsolete with HTML5 and WebGL. So I prefer to invest time into something new and multiplatform instead of something old. Flash is not a bad choice. For example, Amanita Design uses flash for all their demo (Samorost, Machinarium).

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.

Update 37

This week I have mostly done backgrounds for the last level and implemented the day/night transition.

stand-c

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.

Update 36

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:

sheetImg

So for twelve images I need 12/4 = 3 sheets of 1024*1024 or one sheet of 2048*2048:

sheetImg2

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.