Devlog #4 Building System

I have a sensible idea for building system at last. My game should be fit according to the tileable system. I think to use a mask image when the building system will be activated. The first thing I do emphasize the tile areas and chunks as just views:isometric grid map

Okay, that's good-looking. However, there is a too important problem with the building system and mouse positions on the chunks. Normally, the mouse position is related to the just coordinates of the world, but it should be related to the chunks as relative in this program. So, I'm able to manipulate the layers of the map according to these relative positions. That seems easy but it's just a pseudo-to-sum solution to the problem. The other problem is the chunks overlapping each other. Actually, the reason for it, the map has an isometric view and it's totally normal. Therefore, I used weird way at least I think so, colors of the mask. I located this mask depending on the chunks. Of course, the mask won't be shown visually in the game. But I didn't use it just for the overlapping problem. I will use it to solve building something as tileable on the map. So the mask has the same size as every chunk and also there are tiles with different colors as look like tiles on the chunk. Every color represents a position on the chunk. In this way, we can manipulate the layers of the map data and I think it means, we can build something on the map. 

I've done most of these things. It can be seen in the video below:

And I added an info table for the prototype and I named it as a proof-of-concept version and it shows the position of tiles and chunks. So, the next goal is building something on the map. 

I rendered the map with two layers, that's okay, but there is a problem with FPS. I have never looked to fps until this time. The FPS of the prototype was very low. 😶 It was about 25 FPS. So, some after deactivation (some stuff of rendering), the FPS is increased to over 100, now. But I increased render operations for the second layer of the map necessarily. As a result, there is a decrease in FPS. It's a long-term issue.

I made some attempts to build a tree as a test. But, I guess, the image was positioned relative to the top-left like the below:
Build entity on the map
Also, there is another issue at the same time. The overflow of trees, but I can't get why it happens. The first issue, I suppose it is about the rendering of the tile. Because tiles are rendered based 64x32 and I realized the dimension of the tree image is bigger than the dimension of the base tile. Oh boy! I made a huge mistake! I have to render the isometric map relative to 64x64, (height size can be changeable).

As a solution, I cleaned the chunks and there is no overflow anymore. Also, the size of textures is changed easily and the result is like this:
building in tilemap
These solutions caused new issues and one of these issues can be seen via grid from the image above. 
I had trouble with the building system. One of these issues is a shift in the positioning of the tiles. I solved this problem by increasing the size of the tile's surface. (width:32px -> 64px) Also, the performance of the prototype is very low because of tile images. If I load them in different ways, fps can be increased.  But the first thing I did is giving effect to chosen tile area:
Improvement of the building system
Well, that looks nice. But the chosen tile is already filled by some building then the color of the edge shouldn't be green. It should be red.
building system

No comments:

Post a Comment