Bug #01: Black line appears between tiles from certain camera positions
This one I believe I may have fixed already by hacking around. I haven't got a formal fix in place yet though as I'm still investigating, but here's what I think is the problem so far.
Code: Select all
VideoManager->GetPixelSize(x_pixel_length, y_pixel_length); rounded_x_offset = FloorToFloatMultiple(_camera->x_offset, x_pixel_length); rounded_y_offset = FloorToFloatMultiple(_camera->y_offset, x_pixel_length); // TODO: Change back camera_x = static_cast<float>(_camera->x_position) + rounded_x_offset; camera_y = static_cast<float>(_camera->y_position) + rounded_y_offset;
What I did for my hack to make this black line go away was to use the pixel x value of 0.025 for both x and y. I haven't been able to reproduce this since. So perhaps the cause of this problem is the GetPixelSize() function is buggy and returning inaccurate results.
Bug #02: Grey outlines appear around certain objects and tiles
This is an eyesore. See all those ugly grey outlines appearing around walls and other objects? This is not something that is wrong with map mode, but with the video engine. We've done some looking into this and believe it has something to do with the texture properties we set, either the scaling interpretation (GL_linear?) or something to do with mipmapping. We'll need someone to dive into OpenGL to figure this one out. This bug shows up in the editor too, by the way, since the editor uses the video engine to render the map.
Bug #03: Tile alignment issues
Simply put, tiles are not matching up correctly and I'm not sure why. Its painfully obvious where the "grid" of tiles lies because they don't stitch together nicely. Its almost like a line in the tiles is duplicated or missing or something. I'm not sure why this problem happens because the drawing code for tiles is pretty simple. It starts from the top left, then draws each tile across the screen to the end before going down and starting on the next line. We increment the same distance of the draw cursor for each tile we draw.
I was looking into this earlier and, as an experiment, tried adding a small additional distance between each horizontal tile that was drawn on the lower layer (middle and upper layer tiles were unaffected). The value I used was 0.02f (each tile is 2.0f across). Look at the screenshot below. There's a small black gap between most tiles, which is what I expected. But sometimes there's no gap at all! So if the draw position of each tile isn't persistent, its only natural that the type of problems I am describing would occur.
I'll do what I can to investigate here, but I think we're going to need some OpenGL expertise to really nail these suckers. I could look through the OpenGL docs if I really need to, but I'd rather not work on these problems alone...