Hi guys! Finally the time has come to issue a next alpha of my mega game Shepard of the Night. I think you are very tired of waiting and would welcome this version gladly. So here it is!
As usual a great amount of amendments and improvements has been done during the last month. Here I put just the main of them:
1) Creating of Map editor. It is an absolutely new feature – now you can create your own map and save it as a separate JS file. All units now are not engraved somewhere in the depths of the code but put in a simple JS file which is loaded every time the game starts and any time can be changed to another one. Creating new map is very simple. Just press the E button on the keyboard and enter Map Editor Mode. Now you can add/delete any unit on the map. Editor helps you to create awesome new maps and fully uncover your creative potential.
2) Selecting frame code has been completely changed. Earlier I used canvas to draw green selecting rectangle, and it was fine, but later it appears that enlargement of the map greatly influences the performance of the canvas and not in a good way. Selection froze the computer and made it very difficult to play. Several methods have been considered to improve performance. One of them was dynamically change the size of the canvas, but it was unsuccessful. Finally I decided to use SVG technique for drawing. SVG provides vector-based technology to draw lines which are much more efficient and less resources consuming than raster-based canvas.
SVG showed a great performance improvement cracking any map disregarding its size. Additionally now we do not create a new rectangle every time we want to make a selection. Instead we always have a little rectangle hidden in the top left corner of the screen and just change its size and coordinates every time we want to select something. After selection, we shrink it again to 1x1 px and hide it in the 0, 0 coordinates. It is a part of our new global strategy which is to have all objects uploaded to the DOM and just change their size and visibility if we want to animate them.
Ball of Morane works on the same principle. It is always on the screen hidden in the top left corner and every time Morane strikes it drugs to her, appears and then flies to the target for eventually going back in his confinement in 0, 0.
3) The next great improvement is removing visibility from the objects which lay beyond the current viewport. It means turning off objects which you do not actually see. Large amount of objects on the screen, especially trees, makes old computers freeze. I found out that just making trees invisible helps completely eliminate this problem. I wrote a special code which always keeps truck of objects and check which of them are in the point of view. And if they are not –just hide them. Now my game runs much smoother and moreover I am not restricted by the map size and number of objects anymore. Any computer can deal with it.
4) And of course hundreds of bugs had been removed.
So push the button and enjoy the game! Good luck!